CN109388626A - Method and apparatus for being numbered to traffic assignments - Google Patents
Method and apparatus for being numbered to traffic assignments Download PDFInfo
- Publication number
- CN109388626A CN109388626A CN201710665501.5A CN201710665501A CN109388626A CN 109388626 A CN109388626 A CN 109388626A CN 201710665501 A CN201710665501 A CN 201710665501A CN 109388626 A CN109388626 A CN 109388626A
- Authority
- CN
- China
- Prior art keywords
- business
- buffer queue
- database
- type
- prefix
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
Abstract
Embodiment of the disclosure discloses a kind of method for numbering to traffic assignments, comprising: monitoring includes the quantity numbered for the residue into the buffer queue that traffic assignments are numbered;And it when quantity is less than predetermined threshold, is numbered to database request number section.
Description
Technical field
This disclosure relates to data processing field, more particularly, to a kind of method and dress for being numbered to traffic assignments
It sets.
Background technique
In the distributed system application deployment of current mainstream, unique number can be usually distributed to business datum (than as usual
O/No., goods number, attribute number, template number etc.) it is stored, and different business scenarios may need not
Same number initial value and number number section carries out traffic differentiation in order to system.
In existing technical solution, various systems all utilize MYSQL database to create number generation table.For example, each
The newly-built number of system generates table, and each application server inquires the value of present type of service number first, by with type of service
Value with current number is that it is current will to continue inquiry if number section obtains failure for the condition number section that current number is certain from increasing
The value and type of service of number are to obtain number section, safeguard if number section obtains successfully, in buffer queue in the server current
The value and number section of number.When obtaining number for business, lock control will be synchronized, that is, each server guarantees current
There is a thread to obtain next number in buffer queue and current number is revised as to the number obtained, if in buffer queue
Number taken, then will continue database and other servers carry out resource contention to obtain specified number section and by its
It stores in buffer queue.
During realizing present inventive concept, at least there are the following problems in the prior art: flexibility for inventor's discovery
It is poor, for example, the generation of the respective maintenance service type number of each operation system, cannot quickly generate needed for the business newly accessed
Number;Scalability is poor, for example, when the number needed for generating the business newly accessed, it may be necessary to pass through data script
The number initial value for adding present type of service in table for new business is generated in number;Maintenance cost is high, for example, each business system
System will safeguard that the number of oneself generates and coding rule, for the business newly accessed, need secondary development and online;And property
Can be poor, for example, each application server requires to synchronize lock control when obtaining number from memory, and calculate in real time
The number to be obtained finally is assembled according still further to business rule and is numbered, will be with other clothes if the number in buffer queue has been used up
Business device carries out resource contention, and the server for taking row lock just has the right to obtain specified number number section and is stored to buffer queue
In safeguarded, and do not take row lock server by Infinite Cyclic until taking.
In order to realize centralized, the efficient and flexible management to number in the case where supporting the scene of cross-system and different business
And promote the development efficiency of operation system, it is desirable to be able to high with certain rule in the case where supporting the scene of cross-system and different business
Effect ground generates the method and system of number.
Summary of the invention
In view of this, present disclose provides a kind of method and apparatus for numbering to traffic assignments.
An aspect of this disclosure provides a kind of method for numbering to traffic assignments, comprising: monitors to be included in and use
The quantity of remaining number in the buffer queue numbered to the traffic assignments;And when the quantity is less than predetermined threshold
When, it is numbered to database request number section.
In accordance with an embodiment of the present disclosure, the method also includes: from database obtain for the buffer queue row lock;
When successfully getting the row lock for the buffer queue, obtain from the database from current Base Serial Number to be allocated
The number section of the predetermined length of beginning;All numbers are determined using the prefix of the number section and the type for identifying the business;And
Identified all numbers are written in the buffer queue as requested number section number.
In accordance with an embodiment of the present disclosure, the method also includes: when failing obtain for the buffer queue
When row lock, the obtaining step is repeated, until successfully getting the row lock for the buffer queue.
In accordance with an embodiment of the present disclosure, the method also includes: receive request for numbering to traffic assignments, it is described to ask
It include the type of the business in asking;It determines when according to the type of the business in the presence of buffer queue corresponding with the business
When, the number in buffer queue described in Xiang Suoshu traffic assignments.
In accordance with an embodiment of the present disclosure, delay when according to the type of the business is determining there is no corresponding with the business
When depositing queue, determine that the business has new type of service, to digital number initial value corresponding with the business, prefix
Legitimate verification is carried out with the number section length obtained from database, and when the legitimate verification passes through, by the number
The type of number initial value, the prefix and the number section length and the business is stored in association in the database.
In accordance with an embodiment of the present disclosure, it is stored by the digital number initial value, the prefix and the number section length
After in the database, the method also includes: the database is scanned at every predetermined time, when scanning is arrived
When the new type of service, determined according to the digital number initial value, the prefix and the number section length for described
The number of business creates buffer queue corresponding with the business, and the number is initialised to created caching
In queue.
Another aspect of the present disclosure provides a kind of device for numbering to traffic assignments, comprising: monitors module, is matched
It is set to the quantity of the remaining number in the buffer queue monitored include for numbering to the traffic assignments;And ask modulus
Block is configured as numbering when the quantity is less than predetermined threshold to database request number section.
In accordance with an embodiment of the present disclosure, described device further include: first obtains module, is configured as obtaining needle from database
To the row lock of the buffer queue;Second obtains module, is configured as successfully getting the row for the buffer queue
When lock, the number section of the predetermined length since current Base Serial Number to be allocated is obtained from the database;Determining module is matched
It is set to and determines all numbers using the prefix of the number section and the type for identifying the business;And writing module, it is configured as
Identified all numbers are written in the buffer queue as requested number section number.
In accordance with an embodiment of the present disclosure, the second acquisition module is further configured to: when failing obtaining needle
When locking to the row of the buffer queue, the obtaining step is repeated, until successfully getting for the buffer queue
Row lock until.
In accordance with an embodiment of the present disclosure, described device further include: receiving module is configured as receiving for traffic assignments
The request of number includes the type of the business in the request;And distribution module, it is configured as when according to the business
Number when type is determined in the presence of buffer queue corresponding with the business, in buffer queue described in Xiang Suoshu traffic assignments.
In accordance with an embodiment of the present disclosure, described device further include: first processing module is configured as: when according to the industry
When buffer queue corresponding with the business is not present in the type determination of business, determine that the business has new type of service,
Legitimacy is carried out to digital number initial value corresponding with the business, prefix and the number section length obtained from database to test
Card, and when the legitimate verification passes through, by the digital number initial value, the prefix and the number section length and institute
The type for stating business is stored in association in the database.
In accordance with an embodiment of the present disclosure, described device further include: Second processing module is configured as compiling by the number
After number initial value, the prefix and number section length storage in the database, at every predetermined time to the number
It is scanned according to library, when scanning is to the new type of service, according to the digital number initial value, the prefix and described
Number section length determines the number for being directed to the business, creates corresponding with business buffer queue, and by the number
It is initialised in created buffer queue.
Another aspect of the present disclosure provides a kind of computer readable storage medium, is stored thereon with executable instruction, should
Instruction makes processor execute method as described above when being executed by processor.
Another aspect of the present disclosure provides a kind of server for numbering to traffic assignments, comprising: one or more
Processor;Storage device, for storing one or more programs, wherein when one or more of programs by one or
Multiple processors execute, so that one or more of processors realize method as described above.
In accordance with an embodiment of the present disclosure, the service access that can be realized fast and flexible configuration, to reduce each business system
It unites and oneself safeguards bring development cost;By utilizing row lock, it can be ensured that one and only one line in the case where multithreading
Journey is updated successfully;In addition, whenever from when successfully getting number section in database just in database it is current it is to be allocated
The number that begins is updated, it can be ensured that the number that each buffer queue is got will not repeat;Finally, by service access
Sufficiently assessment obtains the frequency of digital number to control the threshold value for numbering to database request number section, can protect well
Card requesting party directly obtains unduplicated number from the buffer queue in server, to greatly promote performance.
Detailed description of the invention
By referring to the drawings to the description of the embodiment of the present disclosure, the above-mentioned and other purposes of the disclosure, feature and
Advantage will be apparent from, in the accompanying drawings:
Fig. 1 is shown can be using the exemplary of the method and apparatus for numbering to traffic assignments of the embodiment of the present disclosure
System architecture 100;And
Fig. 2 diagrammatically illustrates the flow chart of the method 200 for numbering to traffic assignments according to the embodiment of the present disclosure;
Fig. 3 diagrammatically illustrates the flow chart of the method 300 for creating buffer queue according to the embodiment of the present disclosure;
Fig. 4 schematically shows the block diagrams according to the device 400 for numbering to traffic assignments of the embodiment of the present disclosure;
And
Fig. 5 shows the structural representation for being suitable for the computer system 500 for the terminal device for being used to realize the embodiment of the present disclosure
Figure.
Specific embodiment
Hereinafter, will be described with reference to the accompanying drawings embodiment of the disclosure.However, it should be understood that these descriptions are only exemplary
, and it is not intended to limit the scope of the present disclosure.In addition, in the following description, descriptions of well-known structures and technologies are omitted, with
Avoid unnecessarily obscuring the concept of the disclosure.
Term as used herein is not intended to limit the disclosure just for the sake of description specific embodiment.Used here as
Word " one ", " one (kind) " and "the" etc. also should include " multiple ", " a variety of " the meaning, unless in addition context clearly refers to
Out.In addition, the terms "include", "comprise" as used herein etc. show the presence of the feature, step, operation and/or component,
But it is not excluded that in the presence of or add other one or more features, step, operation or component.
There are all terms (including technical and scientific term) as used herein those skilled in the art to be generally understood
Meaning, unless otherwise defined.It should be noted that term used herein should be interpreted that with consistent with the context of this specification
Meaning, without that should be explained with idealization or excessively mechanical mode.
Fig. 1 is shown can be using the exemplary of the method and apparatus for numbering to traffic assignments of the embodiment of the present disclosure
System architecture 100.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105.
Network 104 between terminal device 101,102,103 and server 105 to provide the medium of communication link.Network 104 can be with
Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 101,102,103 and be interacted by network 104 with server 105, to receive or send out
Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 101,102,103
(merely illustrative) such as the application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform softwares.
Terminal device 101,102,103 can be the various electronic equipments with display screen and supported web page browsing, packet
Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 105 can be to provide the server of various services, such as utilize terminal device 101,102,103 to user
The shopping class website browsed provides the back-stage management server (merely illustrative) supported.Back-stage management server can be to reception
To the data such as information query request analyze etc. processing, and by processing result (such as target push information, product letter
Breath -- merely illustrative) feed back to terminal device.
It should be noted that the method provided by the embodiment of the present application for numbering to traffic assignments is generally by server
105 execute, correspondingly, for being generally positioned in server 105 to the device that traffic assignments are numbered.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need
It wants, can have any number of terminal device, network and server.
Fig. 2 diagrammatically illustrates the method at server for numbering to traffic assignments according to the embodiment of the present disclosure
100 flow chart.
As shown in Fig. 2, this method is included in operation S201, receive for business (for example, JAVA web applied business)
The request of number is distributed, includes the type of business in request.The request can be by operation system via based on remote process tune
It is initiated with agreement (PRC) to server.
Then, in operation S202, buffer queue corresponding with business is determined whether there is according to the type of business.
When being determined according to the type of business in the presence of buffer queue corresponding with business, in operation S203, to business point
With the number in buffer queue, for example, the first number in buffer queue.It then, can be by the number of distribution in operation S204
Return to operation system.
In addition, when determining that method 200 enters stream there is no when buffer queue corresponding with business according to the type of business
Journey A, to execute the following method for creating buffer queue as shown in Figure 3.
In operation S205, monitoring includes the quantity numbered for the residue into the buffer queue that traffic assignments are numbered.
It should be noted that the sequence of operation S203 and operation S205 are not limited to sequence of the present invention, in other words,
Operation S205 can be executed before operation S203 and operation S204.
In operation S206, whether quantification is less than predetermined threshold.
In operation S207, when quantity is less than predetermined threshold, to database (for example, MYSQL database, ORACLE data
Library etc.) request number section number.The predetermined threshold can be by assessing the number for probably needing to number per minute in service access
To control.
When quantity is not less than predetermined threshold, process terminates.
Next, obtaining the row lock for buffer queue from database in operation S208.
In step S209, judge whether to get the row lock for buffer queue from database.
In operation S210, when successfully getting the row lock for buffer queue, obtain from database from currently wait divide
The number section for the predetermined length that the Base Serial Number matched starts, and current Base Serial Number to be allocated is updated to acquired number section
In the last one number next number.For example, may currently exist in multiple buffer queues while competition data library
Number section, therefore when a buffer queue in multiple buffer queues competes the number section into database, it is assigned in the number section
After buffer queue, need to remove the number section from the database, and the current starting to be allocated in database is compiled
Number it is updated to come next number after the last one number in the number section in database, that is, the residue in database
Lowest number in number, will not duplicate allocation number when to compete next time.
When failing getting the row lock for buffer queue, the obtaining step step is repeated, until
Until successfully getting the row lock for buffer queue.
In operation S211, all numbers are determined using the prefix of the type of the number section and identification service of acquisition.
In operation S212, by identified all numbers as in requested number section number write-in buffer queue.
In accordance with an embodiment of the present disclosure, the service access that can be realized fast and flexible configuration, to reduce each business system
It unites and oneself safeguards bring development cost;By utilizing row lock, it can be ensured that one and only one line in the case where multithreading
Journey is updated successfully;In addition, whenever from when successfully getting number section in database just in database it is current it is to be allocated
The number that begins is updated, it can be ensured that the number that each buffer queue is got will not repeat;Finally, by service access
Sufficiently assessment obtains the frequency of digital number to control the threshold value for numbering to database request number section, can protect well
Card requesting party directly obtains unduplicated number from the buffer queue in server, to greatly promote performance.
Fig. 3 diagrammatically illustrates according to an embodiment of the present disclosure for creating the flow chart of the method 300 of buffer queue.
Method 300 is since process A, when according to the determination of the type of business, there is no corresponding with business in operation S202
Buffer queue when, operation S301, determine business have new type of service, for example, by parametric solution parser pair and business phase
It (includes: judgement number that corresponding digital number initial value, prefix and the number section length obtained from database, which carry out legitimate verification,
Number initial value, prefix and number section length whether be it is empty, whether the verifying such as the record of existing identical services type), and work as
When legitimate verification passes through, the type of digital number initial value, prefix and number section length and business is stored in association with number
It according in library, such as stores in number table in the database, so as to persistence.In operation S301, when legitimate verification does not lead to
It is out-of-date, return to creation failed message.Digital number initial value corresponding with business, prefix and number section length can be unified
It is configured by administrator according to business demand in the configuration page.
Then, in operation S302, database is scanned at every predetermined time, when the new service class is arrived in scanning
When type, the number for the business of being directed to is determined according to digital number initial value, prefix and number section length, is created corresponding with business slow
Queue is deposited, and number is initialised in created buffer queue.In operation S302, scan operation can be by periodically sweeping
Device is retouched to complete, for example, the timing scan device based on spring quartz.Timing scan device can come every such as 10 minutes
Number table in database is scanned.
After creating buffer queue, the operation S203 in method 200 can be continued to execute as traffic assignments number.
Fig. 4 diagrammatically illustrates the block diagram of the device 400 according to an embodiment of the present disclosure for numbering to traffic assignments.
As shown in figure 4, device 400 may include monitoring module 410 and request module 420.
Monitoring module 410 and can be configured as monitoring includes for the residue into the buffer queue that traffic assignments are numbered
The quantity of number.
Request module 420 can be configured as when quantity is less than predetermined threshold, number to database request number section.
Device 400 can also include the first acquisition module, be configured as obtaining the row lock for buffer queue from database;
Second obtain module, be configured as when successfully get for buffer queue row lock when, from database obtain from currently to
The number section for the predetermined length that the Base Serial Number of distribution starts;Determining module is configured as the type using number section and identification service
Prefix determine all numbers;And writing module, it is configured as compiling identified all numbers as requested number section
Number write-in buffer queue in.Second acquisition module can be further configured to: when failing be obtained for buffer queue
Row lock when, repeat the obtaining step, until successfully get for buffer queue row lock until.
Device 400 can also include: receiving module and distribution module.Receiving module can be configured as reception for industry
Business distributes the request of number, includes the type of the business in request.Distribution module can be configured as when the class according to business
When type is determined in the presence of buffer queue corresponding with business, the number into traffic assignments buffer queue.
Device 400 can also include: first processing module, be configured as: when according to the type of business determine there is no with
When the corresponding buffer queue of business, the business that determines has new type of service, initial to digital number corresponding with business
Value, prefix and number section length carry out legitimate verification, and when legitimate verification passes through, by digital number initial value, prefix
It is stored in association in database with the type of number section length and business.
Device 400 can also include: Second processing module, be configured as by digital number initial value, prefix and number section
After length storage in the database, database is scanned at every predetermined time, when new type of service is arrived in scanning,
The number for the business of being directed to is determined according to digital number initial value, prefix and number section length, creates caching corresponding with business team
Column, and number is initialised in created buffer queue.
The apparatus and method 100 are corresponding.The specific descriptions to method 100 and explanation are equally applicable to the device above,
Details are not described herein.
In accordance with an embodiment of the present disclosure, the service access that can be realized fast and flexible configuration, to reduce each business system
It unites and oneself safeguards bring development cost;By utilizing row lock, it can be ensured that one and only one line in the case where multithreading
Journey is updated successfully;In addition, whenever from when successfully getting number section in database just in database it is current it is to be allocated
The number that begins is updated, it can be ensured that the number that each buffer queue is got will not repeat;Finally, by service access
Sufficiently assessment obtains the frequency of digital number to control the threshold value for numbering to database request number section, can protect well
Card requesting party directly obtains unduplicated number from the buffer queue in server, to greatly promote performance.
Below with reference to Fig. 5, it illustrates the computer systems 500 for the terminal device for being suitable for being used to realize the embodiment of the present disclosure
Structural schematic diagram.Computer system shown in Fig. 5 is only an example, should not function and use to the embodiment of the present disclosure
Range band carrys out any restrictions.
As shown in figure 5, computer system 500 includes central processing unit (CPU) 501, it can be read-only according to being stored in
Program in memory (ROM) 502 or be loaded into the program in random access storage device (RAM) 503 from storage section 508 and
Execute various movements appropriate and processing.In RAM 503, also it is stored with system 500 and operates required various programs and data.
CPU 501, ROM 502 and RAM 503 are connected with each other by bus 504.Input/output (I/O) interface 505 is also connected to always
Line 504.
I/O interface 505 is connected to lower component: the importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode
The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 508 including hard disk etc.;
And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because
The network of spy's net executes communication process.Driver 510 is also connected to I/O interface 505 as needed.Detachable media 511, such as
Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 510, in order to read from thereon
Computer program be mounted into storage section 508 as needed.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description
Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium
On computer program, which includes the program code for method shown in execution flow chart.In such reality
It applies in example, which can be downloaded and installed from network by communications portion 509, and/or from detachable media
511 are mounted.When the computer program is executed by central processing unit (CPU) 501, executes and limited in the system of the disclosure
Above-mentioned function.
It should be noted that computer-readable medium described herein can be computer-readable signal media or meter
Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not
Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter
The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires
Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In this application, computer readable storage medium can be it is any include or storage journey
The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this
In application, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal,
Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited
In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can
Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for
By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium
Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned
Any appropriate combination.
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be
Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating
Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes
Equipment execution is obtained according to the method for numbering to traffic assignments of this embodiment of the present disclosure.
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the application, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more
Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box
The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical
On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants
It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule
The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction
It closes to realize.
Claims (14)
1. a kind of method for being numbered to traffic assignments, comprising:
Monitoring includes the quantity of the remaining number in the buffer queue for numbering to the traffic assignments;And
When the quantity is less than predetermined threshold, numbered to database request number section.
2. according to the method described in claim 1, further include:
The row lock for the buffer queue is obtained from the database;
When successfully getting the row lock for the buffer queue, obtain from the database from current starting to be allocated
Number the number section of the predetermined length started;
All numbers are determined using the prefix of the number section and the type for identifying the business;And
Identified all numbers are written in the buffer queue as requested number section number.
3. according to the method described in claim 2, further include:
When failing obtaining the row lock for the buffer queue, the obtaining step is repeated, until successfully
Until getting the row lock for the buffer queue.
4. according to the method described in claim 1, further include:
The request for numbering to traffic assignments is received, includes the type of the business in the request;
When being determined according to the type of the business in the presence of buffer queue corresponding with the business, Xiang Suoshu traffic assignments institute
State the number in buffer queue.
5. according to the method described in claim 4, wherein, being not present and the business phase when being determined according to the type of the business
When corresponding buffer queue, determine that the business has new type of service, at the beginning of digital number corresponding with the business
Initial value, prefix and the number section length obtained from database carry out legitimate verification, and when the legitimate verification passes through, will
The type of the digital number initial value, the prefix and the number section length and the business is stored in association with the number
According in library.
6. according to the method described in claim 5, wherein, by the digital number initial value, the prefix and the number section
After length storage in the database, the method also includes:
The database is scanned at every predetermined time, when scanning is to the new type of service, according to the number
Word number initial value, the prefix and the number section length determine the number for being directed to the business, create opposite with the business
The buffer queue answered, and the number is initialised in created buffer queue.
7. a kind of device for being numbered to traffic assignments, comprising:
Module is monitored, is configured to listen for including the remaining number in the buffer queue for numbering to the traffic assignments
Quantity;And
Request module is configured as numbering when the quantity is less than predetermined threshold to database request number section.
8. device according to claim 7, further includes:
First obtains module, is configured as obtaining the row lock for the buffer queue from the database;
Second obtains module, is configured as when successfully getting the row lock for the buffer queue, from the database
Obtain the number section of the predetermined length since current Base Serial Number to be allocated;
Determining module is configured as determining all numbers using the prefix of the number section and the type for identifying the business;And
Writing module is configured as the identified all numbers buffer queue is written as requested number section number
In.
9. device according to claim 8, wherein the second acquisition module is further configured to: when failing
When ground obtains the row lock for the buffer queue, the obtaining step is repeated, until successfully getting for described
Until the row lock of buffer queue.
10. device according to claim 7, further includes:
Receiving module is configured as receiving the request for numbering to traffic assignments, includes the class of the business in the request
Type;
Distribution module is configured as determining when according to the type of the business in the presence of buffer queue corresponding with the business
When, the number in buffer queue described in Xiang Suoshu traffic assignments.
11. device according to claim 10, further includes: first processing module is configured as: when according to the business
When type is determined there is no buffer queue corresponding with the business, determine that the business has new type of service, to
The corresponding digital number initial value of the business, prefix and the number section length obtained from database carry out legitimate verification, and
And when the legitimate verification passes through, by the digital number initial value, the prefix and the number section length and the industry
The type of business is stored in association in the database.
12. device according to claim 11, further includes: Second processing module is configured as by the digital number
After initial value, the prefix and number section length storage in the database, at every predetermined time to the data
Library is scanned, when scanning is to the new type of service, according to the digital number initial value, the prefix and described number
Segment length determines the number for being directed to the business, creates buffer queue corresponding with the business, and will be at the beginning of the number
Beginningization is into the buffer queue created.
13. a kind of computer readable storage medium, is stored thereon with executable instruction, which makes to handle when being executed by processor
Device executes method according to any one of claim 1 to 6.
14. a kind of server for being numbered to traffic assignments, comprising:
One or more processors;
Storage device, for storing one or more programs,
Wherein, when one or more of programs are executed by one or more of processors, so that one or more of places
It manages device and realizes method according to any one of claim 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710665501.5A CN109388626B (en) | 2017-08-04 | 2017-08-04 | Method and apparatus for assigning numbers to services |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710665501.5A CN109388626B (en) | 2017-08-04 | 2017-08-04 | Method and apparatus for assigning numbers to services |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109388626A true CN109388626A (en) | 2019-02-26 |
CN109388626B CN109388626B (en) | 2023-01-31 |
Family
ID=65413816
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710665501.5A Active CN109388626B (en) | 2017-08-04 | 2017-08-04 | Method and apparatus for assigning numbers to services |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109388626B (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111741081A (en) * | 2020-06-05 | 2020-10-02 | 安徽三实信息技术服务有限公司 | Distributed server management system |
CN111913956A (en) * | 2020-06-28 | 2020-11-10 | 中国船舶重工集团公司第七一六研究所 | Unified service coding method and device |
CN111950232A (en) * | 2019-05-16 | 2020-11-17 | 北京京东尚科信息技术有限公司 | Method and device for automatically switching number segments |
CN112632117A (en) * | 2020-12-30 | 2021-04-09 | 广州华多网络科技有限公司 | Method and device for processing serial number data, electronic equipment and storage medium |
CN112732760A (en) * | 2021-01-07 | 2021-04-30 | 泰康保险集团股份有限公司 | Distribution method, server and storage medium for report number under distributed environment |
CN113377548A (en) * | 2020-03-10 | 2021-09-10 | 上海淘票儿信息科技有限公司 | Identification generation method and device, computer equipment and storage medium |
CN113743786A (en) * | 2021-09-06 | 2021-12-03 | 携程科技(上海)有限公司 | Order number distribution method, system, equipment and storage medium for multi-class service line |
CN113806407A (en) * | 2021-09-27 | 2021-12-17 | 武汉众邦银行股份有限公司 | Method, device and storage medium for obtaining order numbers in batch based on cache |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104317749A (en) * | 2014-10-31 | 2015-01-28 | 小米科技有限责任公司 | Information writing method and device |
CN105183794A (en) * | 2015-08-24 | 2015-12-23 | 用友网络科技股份有限公司 | Business serial number generation apparatus and method |
US20160381164A1 (en) * | 2013-05-14 | 2016-12-29 | International Business Machines Corporation | Optimizing storage in a publish / subscribe environment |
CN106911780A (en) * | 2017-02-28 | 2017-06-30 | 北京三快在线科技有限公司 | Traffic ID generation method, apparatus and system |
-
2017
- 2017-08-04 CN CN201710665501.5A patent/CN109388626B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160381164A1 (en) * | 2013-05-14 | 2016-12-29 | International Business Machines Corporation | Optimizing storage in a publish / subscribe environment |
CN104317749A (en) * | 2014-10-31 | 2015-01-28 | 小米科技有限责任公司 | Information writing method and device |
CN105183794A (en) * | 2015-08-24 | 2015-12-23 | 用友网络科技股份有限公司 | Business serial number generation apparatus and method |
CN106911780A (en) * | 2017-02-28 | 2017-06-30 | 北京三快在线科技有限公司 | Traffic ID generation method, apparatus and system |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111950232A (en) * | 2019-05-16 | 2020-11-17 | 北京京东尚科信息技术有限公司 | Method and device for automatically switching number segments |
CN111950232B (en) * | 2019-05-16 | 2023-09-05 | 北京京东振世信息技术有限公司 | Method and device for automatically switching number segments |
CN113377548A (en) * | 2020-03-10 | 2021-09-10 | 上海淘票儿信息科技有限公司 | Identification generation method and device, computer equipment and storage medium |
CN111741081A (en) * | 2020-06-05 | 2020-10-02 | 安徽三实信息技术服务有限公司 | Distributed server management system |
CN111913956A (en) * | 2020-06-28 | 2020-11-10 | 中国船舶重工集团公司第七一六研究所 | Unified service coding method and device |
CN112632117A (en) * | 2020-12-30 | 2021-04-09 | 广州华多网络科技有限公司 | Method and device for processing serial number data, electronic equipment and storage medium |
CN112732760A (en) * | 2021-01-07 | 2021-04-30 | 泰康保险集团股份有限公司 | Distribution method, server and storage medium for report number under distributed environment |
CN113743786A (en) * | 2021-09-06 | 2021-12-03 | 携程科技(上海)有限公司 | Order number distribution method, system, equipment and storage medium for multi-class service line |
CN113806407A (en) * | 2021-09-27 | 2021-12-17 | 武汉众邦银行股份有限公司 | Method, device and storage medium for obtaining order numbers in batch based on cache |
Also Published As
Publication number | Publication date |
---|---|
CN109388626B (en) | 2023-01-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109388626A (en) | Method and apparatus for being numbered to traffic assignments | |
CN110096344A (en) | Task management method, system, server cluster and computer-readable medium | |
CN109981750A (en) | Business process system, business data processing method and device | |
CN110019211A (en) | The methods, devices and systems of association index | |
CN108846753B (en) | Method and apparatus for processing data | |
CN109657174A (en) | Method and apparatus for more new data | |
CN110019080A (en) | Data access method and device | |
CN110083627B (en) | Data processing method, system, computer device and storage medium | |
CN109032796B (en) | Data processing method and device | |
CN110046178A (en) | The method and apparatus of distributed data inquiry | |
CN110928912A (en) | Method and device for generating unique identifier | |
CN110377416A (en) | Distributed subregion method for scheduling task and device | |
CN110321738A (en) | Information processing method and device | |
CN109992406A (en) | The method and client that picture requesting method, response picture are requested | |
CN109918191A (en) | A kind of method and apparatus of the anti-frequency of service request | |
CN108764866B (en) | Method and equipment for allocating resources and drawing resources | |
CN108399046A (en) | File operation requests treating method and apparatus | |
CN110928594A (en) | Service development method and platform | |
CN109471713A (en) | Method and apparatus for query information | |
CN113779004A (en) | Data verification method and device | |
CN110113176A (en) | Information synchronization method and device for configuration server | |
CN113111626A (en) | Sequence generation method and device, electronic equipment and storage medium | |
CN111382953A (en) | Dynamic process generation method and device | |
CN111161072A (en) | Block chain-based random number generation method, equipment and storage medium | |
CN108933802B (en) | Method and apparatus for monitoring operation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |