Embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, technical scheme of the present invention is elaborated below in conjunction with the accompanying drawing embodiment that develops simultaneously.
Referring to Fig. 1, Fig. 1 is the schematic flow sheet of embodiment of the invention inter-domain resource method for pushing, may further comprise the steps:
Step 101, select the resource supplying request message in the highest subordinate territory of priority.
When the subordinate territory first when register in the higher level territory, or when resource updates takes place, all can send the resource supplying request message to the higher level territory.Can carry the resource information number that this need push in the said resource supplying request message, if this subordinate territory is to push resource to this territory first, then this resource information number that need push is total to this territory resources shared for this subordinate territory; If this subordinate territory is not to push resource to this territory first, then the accumulative total number of the resource of renewal for taking place in this resource information number that need push behind the resource supplying from last time.
Here; The priority in each subordinate territory is provided with in advance; Can set the priority in each subordinate territory through multiple strategy; For example; Can come to be provided with in advance the priority in each territory according to each importance of subordinate territory in practical application; Can also priority be set according to the usage frequency of shared resource in each subordinate territory, be the higher priority that is provided with in the higher subordinate territory of the usage frequency of shared resource.
If the higher level territory receives the resource supplying request message in a plurality of subordinates territory simultaneously; Then can be according to the priority in the subordinate territory of sending the resource supplying request message; The resource supplying request message in the subordinate territory that priority treatment priority is the highest; And then select the resource supplying request message in the highest subordinate territory of next priority, up to all resource supplying request messages are disposed.
Step 102, judge whether the corresponding resource updates mark in the resource updates mark that carries in the resource supplying request message in the subordinate territory that this priority of selecting is the highest and this subordinate territory is identical, if, then go to step 104 and carry out, otherwise, execution in step 103;
In the present embodiment; Source synchronous for the ease of subordinate territory and higher level territory; The source synchronous situation of using the resource updates mark to come mark subordinate territory and higher level territory; For example; Can use the nearest resource updates time as the resource updates mark; Send in the resource updates request message to the higher level territory when the subordinate territory, the nearest resource updates time is carried in the resource updates request message; When the higher level territory receives the resource updates request message in this subordinate territory; Can compare the nearest resource updates time of carrying in the resource updates request message in the nearest resource updates time in this subordinate territory of writing down in this territory and this subordinate territory that receives; If it is consistent; Illustrate that then this subordinate territory is after last resource supplying; Resource updates does not take place; Do not need to push again resource to this higher level territory; If it is inconsistent; Illustrate that then this subordinate territory is after last resource supplying; Resource updates has taken place again, has needed to push resource to the higher level territory.
In addition, the subordinate territory begins after the higher level territory pushes resource, behind the resource supplying message in every reception in higher level territory and processing subordinate territory, needs to upgrade the corresponding resource updates mark in this subordinate territory, and returns the resource supplying confirmation message; The subordinate territory receives after the resource supplying confirmation message in higher level territory, confirms that the resource that the higher level territory will push before this successfully upgrades, and writes down in view of the above the nearest resource updates time of the resource that successfully is pushed to the higher level territory.Like this; If in the process of resource supplying; Break down in higher level territory or subordinate territory; Then when fault recovery; The subordinate territory can be pushed to the nearest resource updates time of the resource in higher level territory according to the success of record; Only will not pushing successful more new resources is pushed to the higher level territory again, and does not need again all more new resources to be pushed to the higher level territory again.Here; If subordinate's territory shared resource is to a plurality of higher levels territory; Then need be directed against the nearest resource updates time that the resource that successfully is pushed to this higher level territory is write down in each higher level territory; In order to this higher level territory propelling movement resource the time, the resource supplying that only takes place after the time that will write down to upgrade arrives this higher level territory.
Step 103, calculate the resource supplying zero-time in this subordinate territory, and notify this subordinate territory to begin to push resource from said resource supplying zero-time, execution in step 104 according to this resource supplying request message.
Here; Handle the resource supplying request message in the highest subordinate territory of the priority of selection in the higher level territory; After calculating the resource supplying zero-time in this subordinate territory, the resource supplying zero-time is carried at returns to this subordinate territory in the resource supplying request confirmation message; And after this subordinate territory receives the resource supplying request confirmation message in higher level territory; According to the resource supplying zero-time of wherein carrying; Begin to push resource from this resource supplying zero-time to the higher level territory; Thereby can avoid occurring simultaneously the situation of a large amount of resource supplying messages; Therefore; Can alleviate the burden that the resource supplying message is handled in the higher level territory, improve the inter-domain resource sharing efficiency.
Step 104, the highest resource supplying request message of the next priority of selection, and judge whether to select successfully, if, then go to step 102 and carry out, otherwise, execution in step 105.
Here, after handling a resource supplying request message, need to continue to select the highest resource supplying request message of next priority to handle, dispose up to all resource supplying request messages.
Step 105, the processing of resource supplying request message finish.
Here, select the highest resource supplying request message failure of next priority, illustrate there is not untreated resource supplying request message that therefore, the processing of resource supplying request message finishes.
In practical application, the maximum resource information number of carrying in each resource supplying message is conditional, is assumed to be N, then when the subordinate territory need surpass N to the resource that the higher level territory pushes, needs to send a plurality of resource supplying messages and accomplishes resource supplying.The resource information number M that the subordinate territory can need push this is carried in the resource supplying request message; When the higher level territory receives the resource supplying request message of sending in this subordinate territory, can confirm the resource supplying message number that these these needs of subordinate territory send to this territory according to the resource information number M that wherein carries.Calculate the resource supplying message number that need send in the subordinate territory and can adopt following formula:
X=[(M+N-1)/N],
Wherein, "/" expression division; " [] " expression rounds downwards the result of calculation of (M+N-1)/N; X is this resource supplying message number that need send of this subordinate territory; M this resource information number that need push of this subordinate territory for carrying in this resource supplying request message; N is a carry-on maximum resource information number in each resource supplying message.
In addition, the subordinate territory need push according to the sequencing of resource updates when carrying out resource supplying; Only send a resource supplying message at every turn; After receiving the resource supplying confirmation message in higher level territory, if also have the more new resources that do not push, the next resource supplying message of then redispatching.Like this, the resource that can avoid in the subordinate territory back to upgrade is updated to the higher level territory earlier and the asynchronous problem of resource that possibly cause.
Above-mentioned resource supplying mode according to the subordinate territory; The higher level territory can be according to the resource information number of this needs propelling movement of each subordinate territory; And the message between higher level territory and this subordinate territory comes and goes duration; Confirm this resource supplying duration that needs of this subordinate territory, specifically can adopt following formula computational resource to push duration:
RD=TD*X;
Wherein, RD is the resource supplying duration in this subordinate territory, and TD is that the message between this subordinate territory and this territory comes and goes duration; X is this resource supplying message number that need send of this subordinate territory.
Here, the message that can obtain in advance in several ways between subordinate territory and the higher level territory comes and goes duration:
The subordinate territory obtain and the higher level territory between message come and go duration, and notify the higher level territory.For example, the subordinate territory is when logon message is sent in the higher level territory, the record transmitting time, when receiving the accreditation verification message that returns in the higher level territory, the recorder time, with the difference of time of reception and transmitting time as the round duration of the message between this subordinate territory and higher level territory.Perhaps, the logon message transmitting time is carried when logon message is sent in the higher level territory in the subordinate territory; After the higher level territory receives this logon message; Can calculate the transmission time of logon message according to the time that receives this logon message and logon message transmitting time, and logon message transmission time and accreditation verification message transmitting time be carried at return to the subordinate territory in the accreditation verification message; When the subordinate territory receives the accreditation verification message; Can calculate the transmission time of accreditation verification message according to the time that receives the accreditation verification message and accreditation verification message transmitting time, then with logon message transmission time and accreditation verification message transfer time and come and go duration as the message between this subordinate territory and higher level territory.Like this, when the resource supplying request message is sent in the subordinate territory to the higher level territory, the round duration of the message that calculates can be carried in this resource supplying request message and send to the higher level territory.
The higher level territory obtain and each subordinate territory between message come and go duration.For example, the message transmitting time is carried when logon message or resource supplying request message are sent in the higher level territory in the subordinate territory; When the higher level territory receives this message; Can calculate the transmission time of this message according to the message transmitting time of carrying in the time that receives this message and this message, this message transfer time multiply by 2 values that obtain as the message two-way time between this subordinate territory and higher level territory.
In addition, for each subordinate territory, all have certain resource supplying message transmitting capacity, here, said resource supplying message transmitting capacity is meant that this subordinate territory can be to the number of higher level territory transmission resource supplying message in the unit interval.Because each subordinate territory is when pushing resource; Only send a resource supplying message at every turn; Therefore; Can confirm the resource supplying message transmitting capacity in this subordinate territory according to the message between this subordinate territory and higher level territory two-way time; Suppose that be TD the message two-way time between this subordinate territory and higher level territory, then can with 1 with the merchant of TD resource supplying message transmitting capacity as this subordinate territory.
And, have certain resource supplying message processing capability TotalCapability for the higher level territory, here, said resource supplying message processing capability is meant that the higher level territory can handle the number of resource supplying message in the unit interval.TotalCapability is bigger, illustrates that then the resource supplying message processing capability in higher level territory is stronger, if only handle the resource supplying message in a subordinate territory, then can cause the wasting of resources.Therefore, the higher level territory can push message processing capability and determine whether to handle simultaneously the resource supplying message in a plurality of subordinates territory when calculating the resource supplying zero-time in subordinate territory according to the surplus resources of self.
Like this; Resource supplying duration according to aforementioned this subordinate territory that calculates; And resource supplying message transmitting capacity; Can search the resource supplying message transmitting capacity of the surplus resources propelling movement message processing capability in this territory on the time shaft after current point in time greater than this subordinate territory; And time span is confirmed as the zero-time of this time period the resource supplying zero-time in this subordinate territory greater than the time period of the resource supplying duration in this subordinate territory; Wherein, said surplus resources pushes message processing capability and is meant: on the time point in office, and the resource supplying message processing capability in this territory and the difference of resource supplying message transmitting capacity summation that on this time point, pushes all subordinate territories of resource to this territory.Suppose on the time point in office; There is n subordinate territory pushing resource to this territory; Then the surplus resources in this territory pushes message processing capability RemainCapability=TotalCapability-(R1+R2+...+Rn); Wherein, R1+R2+...+Rn is the resource supplying message transmitting capacity summation in said n subordinate territory.
Below in conjunction with Fig. 2, Fig. 3 the embodiment of the invention shown in Figure 1 is described.
Fig. 2 is the networking sketch map of the monitoring network system of multistage multiple domain, comprises territory A, territory B, territory C, territory D, territory E, territory F, and wherein territory A is the higher level territory, and territory B, C, D, E, F are the subordinate territory; The territory B of subordinate, C, D, E, F can be as required be pushed to higher level territory A to higher level territory A registration and with self part or all of shared resource.
Suppose that the priority order from high to low that preestablishes territory B, C, D, E, F is: B, E, D, C, F; If territory B, C, D, E, F have sent the resource supplying request message to territory A simultaneously; Then territory A is according to the priority in each subordinate territory; The resource supplying request message of processing domain B, E, D, C, F successively; Calculate the resource supplying duration in each subordinate territory; Confirm the resource supplying zero-time in each subordinate territory, and notify each subordinate territory to begin to push resource from each self-corresponding resource supplying zero-time.
The resource supplying message processing capability of at present supposing territory A is 5, and the resource supplying duration, resource supplying message transmitting capacity that finally calculate each subordinate territory are shown in table one:
|
The resource supplying duration |
Resource supplying message transmitting capacity |
B |
1.5 second |
3 |
E |
2 seconds |
2 |
D |
1 second |
2 |
C |
3 seconds |
2 |
F |
2.5 second |
1 |
Table one
Then territory A according to the priority in each territory to territory B; C; D; E; The resource supplying scheduling result embodiment of the invention as shown in Figure 3 of F is to the resource supplying scheduling result sketch map in each subordinate territory shown in Figure 2; Wherein, The resource supplying message processing capability of lines 30 representative domain A; Territory B wherein; C; D; E; The square frame that F is corresponding representes self to take the processing time (also being the resource supplying duration) of territory A along time shaft (the horizontal as shown in Figure 3 axle) length of direction, representes self to take the resource supplying message processing capability of territory A along resource supplying message processing capability axle (the vertical as shown in Figure 3 axle) length of direction.
Territory A is specific as follows to the resource supplying scheduling process of territory B, C, D, E, F:
Territory A is preferential to be selected and the resource supplying request message of processing domain B, and the resource supplying duration that calculates territory B is 1.5 seconds; Resource supplying message transmitting capacity is 3.Owing to begin also not have other subordinate territories to take the resource supplying message processing capability of territory A from current point in time; Territory A after the current point in time on the time period surplus resources message processing capability be 5; Therefore; The resource supplying zero-time that can confirm territory B is current point in time (being assumed to be 0), continues 1.5 seconds.To the resource supplying scheduling result of territory B as shown in Figure 3.
Then, territory A selects and the resource supplying request message of processing domain E, and the resource supplying duration that calculates territory E is 2 seconds; Resource supplying message transmitting capacity is 2.Because territory A is respectively 2,5 at the surplus resources propelling movement message processing capability of time period 0-1.5 and time period 1.5-2; The resource supplying message of all right parallel processing territory E; Therefore, the resource supplying zero-time of confirming territory E also is a current point in time, 2 seconds duration.To the resource supplying scheduling result of territory E as shown in Figure 3.
Follow, territory A selects and the resource supplying request message of processing domain D again, and the resource supplying duration that calculates territory D is 1 second; Resource supplying message transmitting capacity is 2.Owing in time period 0-1.5, arranged territory B and territory E to carry out resource supplying, in the period, it is 0 that the surplus resources of territory A pushes message processing capability at this section, therefore, and resource supplying message that can not while processing domain D; And territory A is respectively 3,5 at the surplus resources propelling movement message processing capability of time period 1.5-2 and time period 2-2.5, the resource supplying message of all right parallel processing territory D, and therefore, the resource supplying zero-time of confirming territory D is 1.5 seconds, 1 second duration.To the resource supplying scheduling result of territory D as shown in Figure 3.
Follow, territory A selects and the resource supplying request message of processing domain C again, and the resource supplying duration that calculates territory C is 3 seconds; Resource supplying message transmitting capacity is 2.Then owing in time period 1.5-2, arranged territory E and territory D to carry out resource supplying, in the period, it is 1 that the surplus resources of territory A pushes message processing capability at this section, therefore, and resource supplying message that can not while processing domain C; And territory A is respectively 3,5 at the surplus resources propelling movement message processing capability of time period 2-2.5 and time period 2.5-5, therefore, all right resource supplying message of processing domain C simultaneously, therefore, the resource supplying zero-time of confirming territory C is 2.To the resource supplying scheduling result of territory C as shown in Figure 3.
At last, territory A selects and the resource supplying request message of processing domain F, and the resource supplying duration that calculates territory F is 2.5 seconds; Resource supplying message transmitting capacity is 1.Because territory A is respectively 1,3 at the interior surplus resources propelling movement message processing capability of time period 1.5-2.5, time period 2.5-4; Therefore, all right resource supplying message of processing domain F simultaneously, therefore; The resource supplying zero-time of confirming territory F is 1.5, continues 2.5 seconds.To the resource supplying scheduling result of territory F as shown in Figure 3.
As can be seen from Figure 3, according to the method for the embodiment of the invention shown in Figure 1, both made full use of the disposal ability in higher level territory; That has avoided again that the resource supplying message too much possibly cause blocks up; Therefore, can rationally arrange the resource supplying time in each subordinate territory, improve the inter-domain resource sharing efficiency.
More than method embodiment of the present invention is described in detail, the present invention also provides a kind of inter-domain resource pusher, is applied to the higher level territory in the monitoring network system of multistage multiple domain.
Referring to Fig. 4, Fig. 4 is the structural representation of embodiment of the invention inter-domain resource pusher, and this device comprises: selected cell 401, processing unit 402; Wherein,
Selected cell 401; Be used to select the resource supplying request message in the highest subordinate territory of priority; The resource updates mark corresponding as if the resource updates mark that carries in this resource supplying request message and this subordinate territory is identical, then selects the resource supplying request message in the highest subordinate territory of next priority to handle; If the resource updates mark that the resource updates mark that carries in this resource supplying request message is corresponding with this subordinate territory is inequality, then this resource supplying request message is sent to processing unit 402; After being used to receive the selection notice of processing unit 402, select the resource supplying request message in the highest subordinate territory of next priority to handle;
Processing unit 402; Be used to receive the resource supplying request message that selected cell 401 is sent; Calculate the resource supplying zero-time in the subordinate territory of sending this message according to this resource supplying request message; Notify this subordinate territory to begin to push resource, and send the selection notice to selected cell 401 from said resource supplying zero-time.
Said processing unit 402 is used for when calculating the resource supplying zero-time in this subordinate territory according to this resource supplying request message:
Use following formula to calculate the resource supplying message number that this subordinate territory need be sent:
X=[(M+N-1)/N], wherein, "/" expression division; " [] " expression rounds downwards the result of calculation of (M+N-1)/N; X is this resource supplying message number that need send of this subordinate territory; M this resource information number that need push of this subordinate territory for carrying in this resource supplying request message; N is a carry-on maximum resource information number in each resource supplying message;
Use following formula to calculate the resource supplying duration that this subordinate territory needs:
RD=TD*X; Wherein, RD is the resource supplying duration that this subordinate territory needs, and TD comes and goes duration for this subordinate territory and the message between this territory that obtains in advance;
The surplus resources of searching this territory on the time shaft after current point in time pushes the resource supplying message transmitting capacity of message processing capability greater than this subordinate territory; And time span is confirmed as the zero-time of this time period the resource supplying zero-time in this subordinate territory greater than the time period of the resource supplying duration in this subordinate territory; Wherein, said surplus resources pushes message processing capability and is meant: on the time point in office, and the resource supplying message processing capability in this territory and the difference of resource supplying message transmitting capacity summation that on this time point, pushes all subordinate territories of resource to this territory.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, not all within spirit of the present invention and principle, any modification of being made, is equal to replacement, improvement etc., all should be included within the scope that the present invention protects.