Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, to develop simultaneously embodiment below in conjunction with accompanying drawing, technical scheme of the present invention is described in detail.
See the schematic flow sheet that Fig. 1, Fig. 1 are embodiment of the present invention inter-domain resource method for pushing, comprise the following steps:
Step 101, select the resource supplying request message of the highest subordinate domain of priority.
When subordinate domain superior territory registration first, or when there is resource updates, all can send resource supplying request message in superior territory.Can carry the resource information number that this needs to push in described resource supplying request message, if this subordinate domain pushes resource to this territory first, then this needs the resource information number pushed to be the total number resource that this subordinate domain is shared to this territory; If this subordinate domain is not push resource to this territory first, then the resource information number that these needs push is the cumulative number of the resource that renewal occurred after resource supplying from last time.
Here, the priority of each subordinate domain pre-sets, can by the priority of each subordinate domain of multiple strategy setting, such as, the priority in each territory can be pre-set according to each subordinate domain importance in actual applications, priority can also be set according to the usage frequency of shared resource in each subordinate domain, the subordinate domain that the usage frequency for shared resource is higher higher priority is set.
If higher level territory receives the resource supplying request message of multiple subordinate domain simultaneously, then can according to the priority of the subordinate domain of transmission resource supplying request message, the resource supplying request message of the subordinate domain that priority treatment priority is the highest, and then select the resource supplying request message of subordinate domain that next priority is the highest, until be disposed by all resource supplying request messages.
Step 102, judge that the resource updates mark resource updates corresponding with this subordinate domain carried in the resource supplying request message of the subordinate domain that priority that this is selected is the highest marks whether identical, if so, then go to step 104 execution, otherwise, execution step 103;
In the present embodiment, for the ease of the source synchronous in subordinate domain and higher level territory, resource updates mark is used to mark the source synchronous situation in subordinate domain and higher level territory, such as, can mark as resource updates with the nearest resource updates time, when subordinate domain superior territory sends in resource updates request message, the nearest resource updates time is carried in resource updates request message; When higher level territory receives the resource updates request message of this subordinate domain, the nearest resource updates time of carrying in the nearest resource updates time can comparing this subordinate domain recorded in this territory and the resource updates request message of this subordinate domain received, if consistent, then illustrate that this subordinate domain is after last resource supplying, there is not resource updates, do not need again to push resource to this higher level territory, if inconsistent, then illustrate that this subordinate domain is after last resource supplying, there occurs resource updates again, need to push resource to higher level territory.
In addition, subordinate domain starts superior territory and pushes after resource, and higher level territory often receives and after processing a resource supplying message of subordinate domain, needs to upgrade resource updates mark corresponding to this subordinate domain, and return resource supplying confirmation message; After subordinate domain receives the resource supplying confirmation message in higher level territory, determine that the resource pushed before this successfully upgrades by higher level territory, and record the nearest resource updates time of the resource being successfully pushed to higher level territory accordingly.Like this, if in the process of resource supplying, higher level territory or subordinate domain break down, then when fault recovery, subordinate domain 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 push successfully more new resources and be again pushed to higher level territory, and do not need again all more new resources to be pushed to higher level territory again.Here, if subordinate domain shared resource is to multiple higher level territory, then need the nearest resource updates time of recording the resource being successfully pushed to this higher level territory for each higher level territory, in order to when pushing resource to this higher level territory, only the resource supplying of renewal will be there is after the time of this record to this higher level territory.
Step 103, calculate the resource supplying initial time of this subordinate domain according to this resource supplying request message, and notify that this subordinate domain pushes resource from described resource supplying initial time, perform step 104.
Here, the resource supplying request message of the subordinate domain that the priority of higher level territory to selection is the highest processes, after calculating the resource supplying initial time of this subordinate domain, resource supplying initial time is carried in resource supplying request confirmation message and returns to this subordinate domain; And after this subordinate domain receives the resource supplying request confirmation message in higher level territory, according to the resource supplying initial time of wherein carrying, from this resource supplying initial time, superior territory pushes resource, thus the situation simultaneously occurring a large amount of resource supplying messages can be avoided, therefore, the burden of higher level territory process resource supplying message can be alleviated, improve inter-domain resource sharing efficiency.
Step 104, select the resource supplying request message that next priority is the highest, and judge whether chosen successfully, if so, then go to step 102 execution, otherwise, perform step 105.
Here, after processing a resource supplying request message, need to continue to select the highest resource supplying request message of next priority to process, until all resource supplying request messages are disposed.
Step 105, the process of resource supplying request message terminate.
Here, the resource supplying request message failure selecting next priority the highest, illustrate there is not untreated resource supplying request message, therefore, the process of resource supplying request message terminates.
In actual applications, the maximum resource information number of carrying in each resource supplying message is conditional, is assumed to be N, then, when the resource needing superior territory to push when subordinate domain exceedes N number of, need to send multiple resource supplying message and complete resource supplying.This can need the resource information number M pushed to be carried in resource supplying request message by subordinate domain, when higher level territory receives the resource supplying request message that this subordinate domain sends, can determine this subordinate domain this needs the resource supplying message number that sends to this territory according to the resource information number M wherein carried.Calculating subordinate domain needs the resource supplying message number sent can adopt following formula:
X=[(M+N-1)/N],
Wherein, "/" represents division; " [] " expression rounds downwards the result of calculation of (M+N-1)/N; X is the resource supplying message number that these needs of this subordinate domain send; M is the resource information number that these needs of this subordinate domain carried in this resource supplying request message push; N is carry-on maximum resource information number in each resource supplying message.
In addition, subordinate domain, when carrying out resource supplying, needs to push according to the sequencing of resource updates, each only transmission resource supplying message, after receiving the resource supplying confirmation message in higher level territory, if the more new resources do not pushed in addition, then send next resource supplying message again.Like this, the asynchronous problem of resource that the resource upgraded after can avoiding in subordinate domain is first updated to higher level territory and may causes.
According to the above-mentioned resource supplying mode of subordinate domain, higher level territory this can need the resource information number pushed according to each subordinate domain, and the message between higher level territory and this subordinate domain comes and goes duration, determine this resource supplying duration needed of this subordinate domain, specifically can adopt following formulae discovery resource supplying duration:
RD=TD*X;
Wherein, RD is the resource supplying duration of this subordinate domain, and TD is that the message between this subordinate domain and this territory comes and goes duration; X is the resource supplying message number that these needs of this subordinate domain send.
Here, duration can be come and gone by the message obtained in advance between subordinate domain and higher level territory in several ways:
Message between subordinate domain acquisition and higher level territory comes and goes duration, and notifies higher level territory.Such as, subordinate domain sends logon message during in superior territory, record transmitting time, when receiving the accreditation verification message that higher level territory returns, record time of reception, comes and goes duration using the difference of time of reception and transmitting time as the message between this subordinate domain and higher level territory.Or, subordinate domain sends logon message during in superior territory, carry logon message transmitting time; After higher level territory receives this logon message, can according to the transmission time receiving time of this logon message and logon message transmitting time and calculate logon message, and logon message transmission time and accreditation verification message transmitting time are carried in accreditation verification message return to subordinate domain; When subordinate domain receives accreditation verification message, can according to the transmission time receiving time of accreditation verification message and accreditation verification message transmitting time and calculate accreditation verification message, then using logon message transmission time and accreditation verification message transfer time and come and go duration as the message between this subordinate domain and higher level territory.Like this, when subordinate domain sends resource supplying request message to higher level territory, the message calculated can be come and gone duration and be carried in this resource supplying request message and be sent to higher level territory.
Message between the acquisition of higher level territory and each subordinate domain comes and goes duration.Such as, subordinate domain sends logon message or resource supplying request message during in superior territory, message transmitting time is carried; When higher level territory receives this message, according to the transmission time receiving the message transmitting time of carrying in time of this message and this message and calculate this message, this message transfer time can be multiplied by 2 values obtained as the message two-way time between this subordinate domain and higher level territory.
In addition, for each subordinate domain, all have certain resource supplying message transmitting capacity, here, described resource supplying message transmitting capacity, refers to that this subordinate domain can send the number of resource supplying message in superior territory within the unit interval.Because each subordinate domain is when pushing resource, each only transmission resource supplying message, therefore, the resource supplying message transmitting capacity of this subordinate domain can be determined two-way time according to the message between this subordinate domain and higher level territory, suppose that the message two-way time between this subordinate domain and higher level territory is TD, then can using 1 with the business of the TD resource supplying message transmitting capacity as this subordinate domain.
And for higher level territory, there is certain resource supplying message processing capability TotalCapability, here, described resource supplying message processing capability, refers to that higher level territory can process the number of resource supplying message within the unit interval.TotalCapability is comparatively large, then illustrate that the resource supplying message processing capability in higher level territory is comparatively strong, if only process the resource supplying message of a subordinate domain, then can cause the wasting of resources.Therefore, higher level territory, when calculating the resource supplying initial time of subordinate domain, can push message processing capability according to the surplus resources of self and determine whether the resource supplying message that simultaneously can process multiple subordinate domain.
Like this, according to the resource supplying duration of aforementioned this subordinate domain calculated, and resource supplying message transmitting capacity, surplus resources time shaft after current point in time can being searched this territory pushes the resource supplying message transmitting capacity that message processing capability is greater than this subordinate domain, and time span is greater than the time period of the resource supplying duration of this subordinate domain, the initial time of this time period is defined as the resource supplying initial time of this subordinate domain; Wherein, described surplus resources pushes message processing capability and refers to: on a time point in office, the resource supplying message processing capability in this territory and the difference of resource supplying message transmitting capacity summation of all subordinate domain pushing resource on this time point to this territory.Suppose on a time point in office, n subordinate domain is had to push 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 of a described n subordinate domain.
Below in conjunction with Fig. 2, Fig. 3, the embodiment of the present invention shown in Fig. 1 is described.
Fig. 2 is the networking schematic diagram of the monitoring network system of multistage multi-domain, comprises territory A, territory B, territory C, territory D, territory E, territory F, and wherein territory A is higher level territory, and territory B, C, D, E, F are subordinate domain; Subordinate domain B, C, D, E, F can register and the part or all of shared resource of self is pushed to higher level territory A by superior territory A as required.
Suppose that the priority order from high to low presetting territory B, C, D, E, F is: B, E, D, C, F; If territory B, C, D, E, F have sent resource supplying request message to territory A simultaneously, then territory A is according to the priority of each subordinate domain, the resource supplying request message of processing domain B, E, D, C, F successively, calculate the resource supplying duration of each subordinate domain, determine the resource supplying initial time of each subordinate domain, and notify that each subordinate domain pushes resource from each self-corresponding resource supplying initial time.
Now suppose that the resource supplying message processing capability of territory A is 5, and finally calculate the resource supplying duration of each subordinate domain, resource supplying message transmitting capacity as shown in Table 1:
|
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 of the F embodiment of the present invention is as shown in Figure 3 to the resource supplying scheduling result schematic diagram of each subordinate domain shown in Fig. 2, wherein, the resource supplying message processing capability of lines 30 representative domain A, territory B wherein, C, D, E, square frame corresponding to F represents the processing time (also i.e. resource supplying duration) self taking territory A along the length in time shaft (axle horizontal as shown in Figure 3) direction, length along resource supplying message processing capability axle (axle vertical as shown in Figure 3) direction represents the resource supplying message processing capability self taking territory A.
The resource supplying scheduling process of territory A to territory B, C, D, E, F is specific as follows:
Territory A prioritizing selection the resource supplying request message of processing domain B, and the resource supplying duration calculating territory B is 1.5 seconds; Resource supplying message transmitting capacity is 3.Due to the resource supplying message processing capability also not having other subordinate domain to take territory A from current point in time, territory A after current point in time on the time period surplus resources message processing capability be 5, therefore, can determine that the resource supplying initial time of territory B is current point in time (being assumed to be 0), continue 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 calculating territory E is 2 seconds; Resource supplying message transmitting capacity is 2.2,5 are respectively because territory A pushes message processing capability at the surplus resources of time period 0-1.5 and time period 1.5-2, the resource supplying message of all right parallel processing territory E, therefore, determine that the resource supplying initial time of territory E is also current point in time, 2 seconds duration.To the resource supplying scheduling result of territory E as shown in Figure 3.
Again then, territory A selects and the resource supplying request message of processing domain D, and the resource supplying duration calculating territory D is 1 second; Resource supplying message transmitting capacity is 2.Owing to having arranged territory B and territory E to carry out resource supplying in time period 0-1.5, within this period, it is 0 that the surplus resources of territory A pushes message processing capability, therefore, and can not the resource supplying message of processing domain D simultaneously; 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, therefore, determines that the resource supplying initial time of territory D is 1.5 seconds, 1 second duration.To the resource supplying scheduling result of territory D as shown in Figure 3.
Again then, territory A selects and the resource supplying request message of processing domain C, and the resource supplying duration calculating territory C is 3 seconds; Resource supplying message transmitting capacity is 2.Then owing to having arranged territory E and territory D to carry out resource supplying in time period 1.5-2, within this period, it is 1 that the surplus resources of territory A pushes message processing capability, therefore, and can not the resource supplying message of processing domain C simultaneously; 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, the resource supplying message of all right processing domain C simultaneously, therefore, determines that the resource supplying initial time of territory C is 2.To the resource supplying scheduling result of territory C as shown in Figure 3.
Finally, territory A selects and the resource supplying request message of processing domain F, and the resource supplying duration calculating territory F is 2.5 seconds; Resource supplying message transmitting capacity is 1.1,3 are respectively because the surplus resources of territory A in time period 1.5-2.5, time period 2.5-4 pushes message processing capability, therefore, the resource supplying message of all right processing domain F simultaneously, therefore, determine that the resource supplying initial time of territory F is 1.5, continue 2.5 seconds.To the resource supplying scheduling result of territory F as shown in Figure 3.
As can be seen from Figure 3, the method for the embodiment of the present invention according to Fig. 1, had both taken full advantage of the disposal ability in higher level territory, what turn avoid that resource supplying message too much may cause blocks up, therefore, can resource supplying time of each subordinate domain of reasonable arrangement, improve inter-domain resource sharing efficiency.
Above embodiment of the method for the present invention is described in detail, has present invention also offers a kind of inter-domain resource pusher, be applied to the higher level territory in the monitoring network system of multistage multi-domain.
See the structural representation that Fig. 4, Fig. 4 are embodiment of the present invention inter-domain resource pushers, this device comprises: selected cell 401, processing unit 402; Wherein,
Selected cell 401, for selecting the resource supplying request message of subordinate domain that priority is the highest, if the resource updates mark resource updates corresponding with this subordinate domain carried in this resource supplying request message marks identical, then the resource supplying request message of the highest subordinate domain of next priority is selected to process; If the resource updates mark resource updates corresponding with this subordinate domain carried in this resource supplying request message marks not identical, then this resource supplying request message is sent to processing unit 402; After selection for receiving processing unit 402 notifies, the resource supplying request message of the highest subordinate domain of next priority is selected to process;
Processing unit 402, for receiving the resource supplying request message that selected cell 401 is sent, the resource supplying initial time of the subordinate domain sending this message is calculated according to this resource supplying request message, notify that this subordinate domain pushes resource from described resource supplying initial time, and send selection notice to selected cell 401.
Described processing unit 402 when calculating the resource supplying initial time of this subordinate domain according to this resource supplying request message, for:
This subordinate domain of following formulae discovery is used to need the resource supplying message number sent:
X=[(M+N-1)/N], wherein, "/" represents division; " [] " expression rounds downwards the result of calculation of (M+N-1)/N; X is the resource supplying message number that these needs of this subordinate domain send; M is the resource information number that these needs of this subordinate domain carried in this resource supplying request message push; N is carry-on maximum resource information number in each resource supplying message;
Use the resource supplying duration that this subordinate domain of following formulae discovery needs:
RD=TD*X; Wherein, RD is the resource supplying duration that this subordinate domain needs, and TD is that the message between this subordinate domain and this territory obtained in advance comes and goes duration;
Surplus resources propelling movement message processing capability time shaft after current point in time being searched this territory is greater than the resource supplying message transmitting capacity of this subordinate domain, and time span is greater than the time period of the resource supplying duration of this subordinate domain, the initial time of this time period is defined as the resource supplying initial time of this subordinate domain; Wherein, described surplus resources pushes message processing capability and refers to: on a time point in office, the resource supplying message processing capability in this territory and the difference of resource supplying message transmitting capacity summation of all subordinate domain pushing resource on this time point to this territory.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within the scope of protection of the invention.