The content of the invention
To solve the mark continuity problem under multiple spot distribution environments, the embodiment of the present invention provides a kind of mark resource allocation
Method and system, technical solution are as follows:
The embodiment of the present invention provides a kind of mark resource allocation methods, unified applied to the mark resource between multiple subsystems
Distribution, this method include:
Management module is identified in advance with fixed fragment size, mark resource space is segmented, to it is each be segmented into
Row serial number, then according to the modulo operation of number value as a result, it is modulus that each segmentation, which is incorporated into as N number of burst, wherein N,;
When some subsystem needs to apply mark resource, currently available lowest number point in all N number of bursts of poll
Section;Mark management module gives the lowest number segment assignments in this N number of segmentation to the subsystem.It is a kind of specific according to the present invention
Embodiment, the mark management module, including 2 ~ N number of identify manage submodule, and each mark management submodule is for managing
At least one burst.
A kind of embodiment according to the present invention, described 2 ~ N number of identify manage submodule, are distributed in different geography
Position or different logical places.
A kind of embodiment according to the present invention, currently available lowest number in all N number of bursts of poll
Segmentation, is implemented as:
The subsystem sends inquiry request to each mark management submodule respectively, knows that each submodule is currently available
The lowest number of segmentation.
A kind of embodiment according to the present invention, the management module that identifies is by the lowest number in this N number of segmentation
Segment assignments give the subsystem, are implemented as:
The subsystem identifies resource accordingly to the mark management submodule application with minimum segmentation label.
A kind of embodiment according to the present invention,
If the subsystem fails to some mark management submodule inquiry, the query result of the submodule is abandoned.
A kind of embodiment according to the present invention, this method further include:
After the lowest number for determining the currently available segmentation of each burst, which is labeled as temporarily unavailable, and set
Put mark effective time.
The embodiment of the present invention also provides a kind of mark resource allocation system, applied to the mark resource system between multiple subsystems
One distribution, the system include:Identify management module and the mark application module of subsystems;
Management module is identified in advance with fixed fragment size, mark resource space is segmented, to it is each be segmented into
Row serial number, then according to the modulo operation of number value as a result, it is modulus that each segmentation, which is incorporated into as N number of burst, wherein N,;
When the mark application module of some subsystem needs to apply mark resource, currently may be used in all N number of bursts of poll
Lowest number is segmented, and mark management module further gives the lowest number segment assignments in N number of segmentation to the subsystem.
A kind of embodiment according to the present invention, the mark management module, including 2 ~ N number of identify manage submodule
Block, each mark management submodule are used to manage at least one burst.
A kind of embodiment according to the present invention, described 2 ~ N number of identify manage submodule, are distributed in different geography
Position or different logical places.
A kind of embodiment according to the present invention, the mark application module of the subsystem are specifically used for:
Inquiry request is sent to each mark management submodule respectively, knows the minimum of the currently available segmentation of each submodule
Numbering.
A kind of embodiment according to the present invention, the mark application module of the subsystem are additionally operable to:
Resource is identified accordingly to the mark management submodule application with minimum segmentation label.
A kind of embodiment according to the present invention,
If the mark application module of the subsystem abandons the submodule to some mark management submodule inquiry failure
The query result of block.
A kind of embodiment according to the present invention, the mark management module are additionally operable to:
After the lowest number for determining the currently available segmentation of each burst, which is labeled as temporarily unavailable, and set
Put mark effective time.
The technical solution that the embodiment of the present invention is provided, based on the actual demand of multiple spot allocation identification, will identify resource space
Between divided from two dimensions, using " segmentation " as smallest allocation unit, using " burst " as basic management unit, work as difference
Subsystem when having demand, to mark management module application identified segments, since the segmentation applied is in each burst
The lowest number value segmentation being polled to, therefore can macroscopically ensure the continuity of identifier number distribution, so that preferably full
Various demands in terms of sufficient information management and practical application.
Embodiment
It is more IDC shown in Fig. 1(Internet Data Center, Internet data center)One kind of web site architecture is shown
It is intended to, including a main IDC and multiple mirror image IDC, each IDC can include a server, and more common situation is
In the form of server zone, it is made of the server of multiple and different functions, including application server, count information server,
Product information server etc..
Each IDC forms a website subsystem, and the content stored in each mirror image IDC in main ICD with being deposited
The content of storage is substantially uniform.Wherein, mirror image IDC can be divided according to geographic area, for example, Beijing IDC, Shanghai IDC,
Hong Kong IDC etc., can also be divided according to cellular logic, such as telecommunications IDC, unicom IDC etc., it is of course also possible to tie
Close both the above dividing mode, such as Beijing Telecom IDC, Beijing unicom IDC etc..User, can be with browsing website contents
Real network access situation according to residing for terminal, IDC of the selection with preferable quality of connection, website is obtained from corresponding IDC
Content.
A kind of implementation according to prior art, different IDC(Including main IDC and mirror image IDC)Between use multiple spot
The mode of ID is distributed, i.e., first whole ID resource spaces are divided using the mode of modulus, the subspace marked off is distributed
To each IDC, the shortcomings that this method of salary distribution, is, the distribution of overall ID spaces is not continuous, when different IDC applications
When differing greatly, the ID value differences that different IDC are distributed can be caused different huge, be both unfavorable for being managed information, may be used also sometimes
It can lead to not the specific requirements for meeting some upper layer applications.
For example, in forum applies, may according to the morning and evening of the ID value magnitude estimation user's registration times of user, according to
The above-mentioned multiple spot method of salary distribution, ID values size and user's registration time are simultaneously uncorrelated, if the ID quantitative differences of difference IDC distribution
Very big, then estimation result also can substantial deviation actual conditions.Again for example in some storage applications(Such as picture storage, audio are deposited
Storage etc.)In, the corresponding memory space of distribution can be estimated according to currently allocated maximum resource ID values, if IDC points of difference
The ID quantitative differences matched somebody with somebody are very big, and it will cause the invalid distribution of a large amount of memory spaces.In short, ID numberings discontinuously may result in very
More problems, although some problems can be solved from other angles, but, if it is possible to fundamentally solve under multiple spot distribution environments
ID numbering continuity assignment problems, can necessarily make it that much application and the problem of management aspect become simple.
Based on the demand, the present invention provides a kind of allocative decision for identifying resource, to solve under multiple spot distribution environments
ID numbering continuity assignment problems.
Division processing is carried out to mark resource space first:Assuming that it can be numbered with ID since 0, according to 1,2,3 ...
Order natural increasing, presets a fragment size section_size first, then according to the value size, whole ID is numbered empty
Between be divided into some segmentations, to it is all segmentation carry out serial numbers.
Then according to the numbering size of segmentation, all segmentations are further incorporated into N number of set, each collection is collectively referred to as
One burst, specific practice are:Modulo-N arithmetic is carried out to number-of-fragments value, the identical segmentation of result is incorporated into identity set,
Wherein N is preset value, and N can be 1, or the natural number more than 1.
Shown in Fig. 2, be according to such scheme divide ID numbering spaces a kind of schematic diagram, wherein section_size=
100, N=16.As it can be seen that whole ID numbering spaces be divided into segmentation S0, S1 that several sizes are 100, S2 ...;Then basis
The modular arithmetics of all number-of-fragments as a result, by all segmentations incorporate into respectively to burst 0, burst 1 ... burst 15.
It can be seen that in the technical solution of the embodiment of the present invention, the division of two kinds of dimensions is carried out to mark resource space, wherein
Using " segmentation " as smallest allocation unit, using " burst " as basic management unit, with reference to specific system, to the present invention
Mark allocative decision be described further.
Shown in Fig. 3, the mark resource allocation system schematic diagram that is provided by the embodiment of the present invention, the system includes a mark
Management module 100 is known, for multiple subsystems to be identified with the unified distribution of resource.Different subsystems can correspond to not
With IDC, be each configured with each subsystem mark application module 201/202/203 ... for mark management module
100 application mark resources.The function of several modules and cooperation relation will be described in detail below:
It is advance as the method previously described to identify management module 100, whole mark resource space is divided.Wherein, no
With burst can be managed collectively, can also separate management, for example, configured in management module 100 identify it is multiple mark manage
Submodule, each submodule can be responsible for one or more bursts, that is to say, that for N number of burst, can configure at least 2
It is a, at most N number of submodule, this have the advantage that the fault-tolerance of enhancing whole system, if some submodule is done for,
Other submodules still are able to provide burst resource, do not interfere with continuously running for whole system.
Identifying the basic demand of management module 100 is:It can communicate with all subsystems, so as to all sons
Systematic unity is identified resource allocation.A kind of typical embodiment is:Mark management module 100 is configured in main IDC,
Certainly, this embodiment and it should not be construed the limitation to the present invention program.
If being configured with multiple mark management submodules, this multiple submodule can be co-located, can also position
In diverse location, such as different geographical locations or different logical places are distributed in, a kind of typical embodiment is:Will not
Same mark management submodule is arranged respectively in different IDC, and multiple mark management submodules can be configured in each IDC,
Here main IDC and mirror image IDC is needed not distinguish between, as long as ensureing that each subsystem can be led to all mark management submodules
Letter.
When mark applies for module(Below exemplified by 201)When needing to apply ID resources, Shen is sent to mark management module 100
Please, wherein the condition for sending application can be apply first, can also find that the ID resources itself held will exhaust.
After mark management module 100 receives this application, it is polled in all bursts, finds each burst and be currently able to what is provided
Lowest number is segmented, that is to say, that can be found N number of lowest number segmentation, then be further determined that the minimum in this N number of segmentation
Numbering segmentation, mark application module 201 is distributed to by the ID of this segmentation.
In the above-described embodiment, polling operation can be sought unity of action by mark management module 100, can also be by identifying
Apply for module 201 to perform.Especially, if manage submodule by multiple marks manages different burst resources respectively, then
The mode that mark application module 201 performs polling operation is proposed with, specific embodiment is as follows:
Mark application module 201 sends inquiry request, each mark management submodule to each mark management submodule respectively
The minimum number-of-fragments that block can be provided itself return to mark application module 201, and mark application module 201 is further from more
It is a return the result in determine minimum value, and to possess ID section of the lowest number mark manage submodule send ID sections of applications, this
After mark management submodule receives application, corresponding ID resource allocations are given to mark application module 201.
If it is worth noting that, a mark management submodule has managed multiple ID bursts at the same time, then mark management
Submodule first can directly select a lowest number segmentation from the multiple bursts itself held, and in this case, return
Mark application module 201 the result is that less than N's.
In addition, under some abnormal conditions, mark application module 201 possibly can not identify management submodule from one or more
Block normally interacts, such as communication failure, management submodule faults itself etc., and in this case, mark application module 201 can be with
Abandon the query result of respective identification management submodule, the result that the submodule that only considering other can normally interact is returned.
In more IDC environment, different IDC may apply for ID resources, a kind of basic processing at the same time in the same period
Scheme is:For multiple IDC of application at the same time, ID resources are sequentially allocated by the way of " queuing ".However, according to reality above
The mode of applying, which can be seen that from mark application module 201, applies for that being issued to ID resource allocations finishes, the certain delay of intermediate demand,
Particularly when mark application module 201 and distant mark management submodule, when polling procedure may consume more
Between.If considering further that " queuing " factor, may be delayed will be longer, to solve such case, in a kind of embodiment party of the present invention
In formula, for multiple IDC of application at the same time, still parallel form is taken to handle, specific embodiment is as follows:
After mark management module 100 determines the lowest number of the currently available segmentation of each burst, to this lowest number point
Section is labeled, and shows that the segmentation is in " temporarily unavailable " state, and set an effective time T to the mark.Generally
For, T can be slightly larger than carries out the duration needed for a poll in all bursts.That is, for any one segmentation, marking
During note, other IDC are not allowed to apply again;Finally, which may be allocated away, if it is not allocated, then marking
After time-out, which recovers upstate again.
If manage submodules by multiple marks manages different burst resources respectively, then above-mentioned labeling operation can be by
Each mark management submodule is respectively completed.If a mark management submodule has managed multiple ID bursts at the same time, then mark
Knowing management submodule only can be labeled the lowest number segmentation selected in multiple bursts.
The above method, applies for the ID that different IDC are sent, can be with parallel processing, it is not necessary to waits once application to handle
After the completion of reprocess it is next, even now may to a certain extent on influence the continuitys of ID numberings, but grand
Still ensure that ID distribution is continuous in sight, be not in large-scale interruption.
For convenience of description, it is divided into various modules during description apparatus above with function to describe respectively.Certainly, this is being implemented
The function of each module can be realized in same or multiple softwares and/or hardware during invention.Device described above and
System embodiment is only schematical, wherein the unit illustrated as separating component may or may not be thing
It is separated in reason, it may or may not be physical location as the component that unit is shown, you can with positioned at a place,
Or it can also be distributed in multiple network unit.Some or all of module therein can be selected according to the actual needs
Realize the purpose of this embodiment scheme.Those of ordinary skill in the art are without creative efforts, you can with reason
Solve and implement.
Based on above-mentioned upload data handling system, the embodiment of the present invention also provides a kind of upload data processing method, should
Method includes:
Management module is identified in advance with fixed fragment size, mark resource space is segmented, to it is each be segmented into
Row serial number, then according to the modulo operation of number value as a result, it is modulus that each segmentation, which is incorporated into as N number of burst, wherein N,;
When some subsystem needs to apply mark resource, currently available lowest number point in all N number of bursts of poll
Section;Mark management module gives the lowest number segment assignments in this N number of segmentation to the subsystem.
Wherein, the mark management module, can use, which includes 2 ~ N number of identify, manages submodule, each mark management submodule
For managing at least one burst.Described 2 ~ N number of identify manages submodule, can be distributed in different geographical location or different
Logical place.
In one embodiment of the invention, subsystem can send inquiry to each mark management submodule respectively and ask
Ask, know the lowest number of the currently available segmentation of each submodule.Then further it is segmented to the subsystem to minimum
The mark management submodule application of label identifies resource accordingly.
In another embodiment of the invention, if subsystem fails to some mark management submodule inquiry,
Abandon the query result of the submodule.
In another embodiment of the invention, after the lowest number for determining the currently available segmentation of each burst, may be used also
It is temporarily unavailable the segmentation to be labeled as, and mark effective time is set.
Below with the example of a reality, the mark Resource Allocation Formula of the present invention is illustrated:
As shown in figure 4, ID resources are divided first, wherein section_size=100, N=4.3 marks are configured altogether
Know management submodule, its Neutron module 1 management burst 0 and burst 1, submodule 2 manages burst 2, and submodule 3 manages burst 3.Respectively
The currently available lowest number of a burst is segmented:
Burst 0:S4;
Burst 1:S5;
Burst 2:S10;
Burst 3:S7;
At the T0 moment, mark application module 201 sends inquiry request to each mark management submodule, and each submodule returns
Return mark and apply for that the result of module 201 is respectively:
Submodule 1:S4;
Submodule 2:S10;
Submodule 3:S7;
Since burst 0 and burst 1 are managed jointly by submodule 1, submodule 1 is returned only to a result.Each submodule
Block is further to respectively carrying out S4, S10, S7 " temporarily unavailable " mark, and set mark effective time, it is assumed that is 10s.
After mark application module 201 receives the result that each submodule returns, further determine that out that the numbering of S4 is minimum, because
This sends to submodule 1 applies, S4 is distributed to mark application module 201 by submodule 1.
On the other hand, it is assumed that one other identification application module 202 was sent to each mark management submodule at the T0+5s moment
Inquiry request.Due to communication failure, mark application module 202 can not obtain query result from submodule 3.And application is identified at this time
" temporarily unavailable " mark during the last inquiry of module 201 not yet fails, therefore each submodule returns to mark application mould
The result of block 202 is respectively:
Submodule 1:S5;
Submodule 2:S14;
Submodule 3:(Null value);
Each submodule is further to mark " temporarily unavailable " to S5, S14 respectively.
After mark application module 202 receives the result that each submodule returns, further determine that out that the numbering of S5 is minimum, because
This sends to submodule 1 applies, S5 is distributed to mark application module 201 by submodule 1.
Be assigned twice and mark respectively failure after, each available lowest number section of burst be respectively S7, S8,
S9, S10, it is seen that either in the case of communication mistake or concurrent request, using the solution of the present invention, can ensure institute
ID is distributed in continuity macroscopically, is not in large-scale interruption.
As seen through the above description of the embodiments, those skilled in the art can be understood that the present invention can
Realized by the mode of software plus required general hardware platform.Based on such understanding, technical scheme essence
On the part that contributes in other words to the prior art can be embodied in the form of software product, the computer software product
It can be stored in storage medium, such as ROM/RAM, magnetic disc, CD, including some instructions are used so that a computer equipment
(Can be personal computer, server, or network equipment etc.)Perform some of each embodiment or embodiment of the invention
Method described in part.
Each embodiment in this specification is described by the way of progressive, identical similar portion between each embodiment
Divide mutually referring to what each embodiment stressed is the difference with other embodiment.It is real especially for method
For applying example, since it is substantially similar to system embodiment, so describing fairly simple, related part is referring to system embodiment
Part explanation.
The present invention can be used in numerous general or special purpose computing system environments or configuration.Such as:Personal computer, service
Device computer, handheld device or portable set, laptop device, multicomputer system, the system based on microprocessor, top set
Box, programmable consumer-elcetronics devices, network PC, minicom, mainframe computer including any of the above system or equipment
Distributed computing environment etc..
The above is only the embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications also should
It is considered as protection scope of the present invention.