Summary of the invention
Technical problem to be solved by this invention is a kind of network updating method and system that improves network upgrade efficient to be provided, and to realize the main service side used of network upgrade.
The technical solution adopted for the present invention to solve the technical problems is: a kind of network updating method is provided, provides network updating service for main service side used at least one client, comprised the following steps:
The upgrade request message of the described client of main service side used reception;
Judge whether to have other clients and obtained the latest edition file;
If so, thus main service side usedly notify described client that the described client of having obtained the latest edition file is obtained the latest edition file as interim service end.
Further, the upgrade request message of described client is also carried the type of described client; Described client is identical with the type of described interim service end.
Described upgrade request message is also carried the current version information of described client; After the upgrade request message of the described client of main service side used reception, also the version information current according to described client judges whether that needs provide the latest edition file to described client, if so, judge whether to have other clients and obtained the latest edition file.
If do not have other clients to obtain the latest edition file, main service side used notify described client according to certain priority from the main service side used latest edition file that obtains.
The main service side used concrete steps of notifying described client that thereby the described client of having obtained the latest edition file is obtained the latest edition file as interim service end are:
The main service side used IP address that sends the client of having obtained the latest edition file to described client;
Described client is used as the described client of having obtained the latest edition file as interim service end, mentions upgrade request message according to the described IP address that obtains to described interim service end;
Interim service end notifies described client to obtain the latest edition file according to certain priority from described interim service end.
In above step, if main service side usedly send a plurality of IP addresses that obtained the client of latest edition file to described client, comprise that also described client selects the step of interim service end according to formation preference strategy, load sharing strategy or shortest path strategy from described a plurality of clients of having obtained the latest edition file.
The concrete steps that main service side used or interim service end notifies described client to obtain the latest edition file according to certain priority from described main service side used or interim service end are:
Main service side used or interim service end is calculated upgrading length of delay D according to the priority of described client;
Main service side used or interim service end issues the upgrade notification message of carrying described upgrading length of delay D to described client, and provides the latest edition file to described client when upgrading length of delay D expires.
Wherein, the account form of described upgrading length of delay D is: D=10i+s+m; I is the priority of described client, and s is the local side number of described client, and m is the frame-saw groove number of described client.
The another kind of account form of described upgrading length of delay D is: D=10i+s
0+ m
0Wherein, i is the priority of described client, s
0Be the absolute value of the difference of the local side of described client and main service side used or interim service end number, m
0Absolute value for the difference of the frame-saw groove of described client and main service side used or interim service end number.
The present invention also provides a kind of network upgrade system, comprise main service side used and at least one client, main service side used for providing network updating service to described at least one client, described main service side used upgrade request receiver module, judge module and the notification module of comprising;
The upgrade request receiver module is used for receiving the upgrade request message of described client;
Judge module is used for judging whether to have other clients and obtained the latest edition file;
Notification module was used in the situation that existing other clients were obtained the latest edition file, thereby notified described client that the described client of having obtained the latest edition file is obtained the latest edition file as interim service end.
Described main service side used and/or interim service end also comprises delay management module and upgrading module;
The delay management module is used for calculating upgrading length of delay D according to the priority of described client, and issues the upgrade notification message of carrying described upgrading length of delay D to described client;
The upgrading module is used for providing the latest edition file to described client when upgrading length of delay D expires.
The invention has the beneficial effects as follows, the present invention is by providing the mode of interim service end, avoid upgrading inefficiency that a plurality of clients cause to main service side used request upgrading simultaneously and the problem of network congestion, therefore effectively improved network upgrade efficient, alleviated network load.
For the client with different priorities, the present invention also provides rational upgrade service according to certain priority for it, the client of high priority type need not to wait for just can obtain the latest edition file for a long time, therefore can respond fast user's service request, further improve operating efficiency.
Embodiment
Below in conjunction with accompanying drawing, the specific embodiment of the present invention is elaborated.
Network updating method provided by the invention and system will obtain the client of latest edition file as interim service end, be other clients upgrade service is provided.
As shown in Figure 1, the network updating method of the first embodiment of the present invention provides network updating service for main service side used at least one client, comprises the following steps:
Step S100: the upgrade request message of main service side used reception client.According to service needed, may there be one or more dissimilar clients in system, for example a class client is for the treatment of media data, and a class client is used for realizing exchanges data, and a class client is for the treatment of communications protocol etc.
Generally, the client of same type is used identical application program, and dissimilar client is used different application programs, and therefore, the required latest edition file of program upgrade is usually according to the type of client and different.In present embodiment, main service side used itself or by the interim service end of the same type with the client that proposes upgrade request message, same latest edition file can be provided to client of the same type; If dissimilar client can share same latest edition file, also can be according to real needs, main service side used itself or by the interim service end dissimilar with the client that proposes upgrade request message, also can provide to dissimilar client same latest edition file.
Preferably, when there was the client of number of different types in system, the upgrade request message that client proposes had also been carried the type of client.Upgrade request message can be UDP (User DatagramProtocol: User Datagram Protocol) message etc.
In addition, in order to improve upgrading efficient, avoid repetition to provide the latest edition file to client, go back the current version information of application program in this client of portability in upgrade request message; After the upgrade request message of main service side used this client of reception, the version information current according to client judges whether that needs provide the latest edition file to this client.The main service side used database of inquiring about self for example, and compare with the version information that client provides, if the version file of client is not up-to-date, needing provides the latest edition file to client, enter step S101, otherwise the message that can need not to upgrade to this client feedback directly runs application it.
Step S101: main service side usedly judging whether that existing other clients obtained the latest edition file, is to enter step S102, otherwise enter step S103.If there is dissimilar client in system, the main service side used type that also needs according to the client in upgrade request message, judging whether provided the latest edition file to other clients of the same type, was to enter step S102, otherwise entered step S102.
The concrete judgment mode of this step has multiple, and for example the main service side used corresponding upgrading flag bit of client that can read judges.in a kind of execution mode, main service side usedly provide an edition upgrading situation of utilizing the upgrading flag bit to record various types of clients, after the upgrade request message of the arbitrary client of main service side used reception, read corresponding upgrading flag bit according to its type, if value is 1, show that the client that same kind is arranged obtains the latest edition file and (not only comprise and main service side usedly directly provide the latest edition file to this client, comprise that also main service side used this client of notifying obtained the situation of latest edition file by interim service end, in two kinds of situations, the main service side used IP address that all can record these clients so as with it as interim service end), enter step S102, if value is 0, the mark position 1 of should upgrading, and record this client the IP address in case with it as interim service end, then enter step S103.
in system, dissimilar client can share in the situation of same latest edition file, when a certain client during to main service side used transmission upgrade request message, the main service side used client that has got this same latest edition file according to its version information inquiry of carrying, need not to judge whether type both is identical, if existing other clients have been obtained this same latest edition file, directly enter the IP address that step S102 will obtain the client of this same latest edition file and send to the client of mentioning upgrade request message, notify it to select interim service end to upgrade, otherwise enter step S103.
Step S102: main service side used notice client will be obtained the client of latest edition file as interim service end, upgrade thereby obtain the latest edition file, specifically comprise following substep:
1) the main service side used client that proposes upgrade request message in the step S100 sends the IP address of the client of having obtained the latest edition file, other information such as the main service side used local side that also can further send the client of obtaining the latest edition file number and frame-saw groove are in order to determine its particular location.
If main service side usedly provided the latest edition file to a plurality of clients of the same type, main service side usedly can send IP address and other information a plurality of same types, client that obtained the latest edition file to the client of again mentioning upgrade request message.
2) the client client that will obtain the latest edition file is used as interim service end, according to mentioning upgrade request message from the main service side used IP address that obtains to this interim service end.
Substep 2) in, if main service side used to a plurality of IP addresses that obtained the client of latest edition file of client transmission, client also can therefrom be selected suitable interim service end according to formation preference strategy, load sharing strategy or shortest path strategy.
Particularly, the formation preference strategy refers to that client sends upgrade request message to the client that each had obtained the latest edition file successively, if can successfully obtain the latest edition file from a certain client, to select this client be interim service end and stop sending upgrade request message to remaining client, otherwise continue to send upgrade request message until travel through the client that all obtained the latest edition file.
The load sharing strategy refers to that client inquires about respectively its load condition according to the IP address that each obtained the client of latest edition file, after relatively, obtains wherein loading minimum one, and client selects the minimum client of this load as interim service end.
The shortest path strategy refers to that client calculates the distance of itself and self according to each information such as local side number, frame-saw groove number of having obtained the client of latest edition file, and the nearest client of chosen distance self is as interim service end.
3) after interim service end was received upgrade request message, the notice client was obtained the latest edition file according to certain priority from interim service end.
Step S103: the client of mentioning upgrade request message in main service side used notifying process S100 is upgraded from the main service side used latest edition file that obtains according to certain priority, this step is particularly useful for dissimilar client simultaneously from the main service side used situation of obtaining the latest edition file, can rationally process various upgrade request according to priority, for the client first of higher priority provides upgrade service.
The substep 3 of present embodiment step S102) or in step S103, main service side used or interim service end simultaneously client to obtain from main service side used or interim service end the mode that the latest edition file upgrades according to certain priority identical, be specially:
After main service side used or interim service end is received the upgrade request message of client, priority i according to this client calculates its upgrading length of delay D, then, main service side used or interim service end issues the upgrade notification message of carrying upgrading length of delay D to client, when upgrading length of delay D expired, main service side used or interim service end provided the latest edition file that client is upgraded to client.
The priority i of each client is directly corresponding with its type, can come record by overall array on main service side used, and directly determines when system initialization, and the value of i is larger, and expression priority is lower.When for example system comprises the client of n type, the corresponding i=1 of the client of limit priority, the corresponding i=n of the client of lowest priority.
Further, provide upgrade service in order to distinguish to the different clients of same priority i, also can consider the position of each client when calculating upgrading length of delay D, when considering the local side s of client and frame-saw groove m, also can calculate upgrading length of delay D by following formula:
D=10i+s+m
For example the upgrading length of delay of the client of limit priority is D=10+s+m, and the upgrading length of delay of the client of lowest priority is D=10n+s+m; The unit of upgrading length of delay D can be millisecond.This computational methods can make the client of high priority upgrade relatively earlier, have further satisfied user's request.
If the path length between the client of considering and main service side used or interim service end also can be calculated upgrading length of delay D by following formula:
D=10i+s
0+m
0
Wherein, s
0The absolute value of the difference of the local side s of finger client and main service side used or interim service end, m
0The absolute value of the difference of the frame-saw groove m of finger client and main service side used or interim service end.Obviously, this computational methods can make the nearer client of the main service side used or interim service end of distance upgrade relatively earlier, have improved upgrading efficient.
In prior art, when having dissimilar client simultaneously to main service side used initiation edition upgrading request, main service side used employing receives that first the strategy of first processing provides the latest edition file, the client of some high priority types may need to wait for just can obtain the latest edition file for a long time, therefore can't normally start, can not respond fast user's service request.And in present embodiment, main service side usedly provide upgrade service according to certain priority to client, and taken into full account priority and the position of different clients, more scientific and reasonable, significantly improved operating efficiency.
As shown in Figure 2, in the network updating method of the second execution mode, main service side used veneer provides upgrade service at least one client veneer, can be applicable to the multiple technologies such as CDN framework fields, specifically comprises the following steps:
Step S200: client Board Power up, operation boot.
Step S201: the client veneer sends upgrade request message to main service side used veneer, wherein carries type and the current version information of client veneer of this client veneer.
Step S202: main service side used veneer judges whether the current version file of this client veneer is up-to-date, is, enters step S211, otherwise enters step S203 after receiving upgrade request message.
Step S203: the current version file of this client veneer is not up-to-date, therefore need to provide the latest edition file to it, yet, main service side used veneer also needs to judge whether that according to the type of this client veneer other client veneers of existing same type obtained the latest edition file, for example can judge by reading corresponding upgrading flag bit.Be, enter step S204, otherwise enter step S208.
Step S204: main service side used veneer provided the latest edition file to other client veneers of the same type, the client veneer that needs to obtain the latest edition file is as interim service end, and therefore main service side used veneer sends IP address and other information of the client veneer that had obtained the latest edition file to the client veneer that proposes upgrade request message.
Step S205: the client veneer is received IP address and other information of the client veneer that obtained the latest edition file, and after selecting suitable interim service end, sends upgrade request message to interim service end.
Step S206: after the upgrade request message of interim service end reception from the client veneer, computational methods by the first described upgrading length of delay of embodiment D, calculate the upgrading length of delay D1 of client veneer, and issue the upgrade notification message of carrying upgrading length of delay D1 to the client veneer.
Step S207: upgrading length of delay D1 expires, and the client veneer is upgraded from the drop-down latest edition file of interim service end.
Step S208: do not have other client veneers of the same type to obtain and cross the latest edition file, main service side used veneer is by the computational methods of the first described upgrading length of delay of embodiment D, calculate the upgrading length of delay D2 of client veneer, and issue the upgrade notification message of carrying upgrading length of delay D2 to the client veneer.
Step S209: upgrading length of delay D2 expires, and the client veneer is upgraded from the drop-down latest edition file of main service side used veneer.
Step S210: whether the client veneer upgrades successfully, and is, enters step S211, repeats to propose upgrade request message otherwise get back to step S201.
Step S211: run application after the success of client single board updating.
As shown in Figure 3, the present invention has also protected a kind of network upgrade system, comprises main service side used 10 and at least one client 20, and main service side used 10 are used for providing network updating service at least one client 20.
Main service side used 10 comprise upgrade request receiver module 11, judge module 12, notification module 13, delay management module 14 and upgrading module 15.
Upgrade request receiver module 11 is used for receiving the upgrade request message of client 20, can comprise the type of client 20 in this upgrade request message, and the current version information of client 20 etc.
Judge module 12 is used for judging whether to have other clients 20 and obtained the latest edition file, be, thereby notify the client 20 that the client 20 that proposes upgrade request message will be obtained the latest edition file to obtain the latest edition file as interim service ends 30, otherwise the client 20 of notice proposition upgrade request message is obtained the latest edition file from main service side used 10.
If there is the client 20 of number of different types in system, judge module 12 also is used for judging whether to obtain the latest edition file by other clients 20 of same kind.Before this, judge module 12 also can judge whether that needs provide the latest edition file to this client 20 by the version information current according to client 20.
Notification module 13 is used for obtaining the latest edition file in the situation that judge module 12 draws existing other clients 20, the client 20 interim service ends 30 of conduct of notifying this client 20 will obtain the latest edition file are upgraded thereby obtain the latest edition file.
Particularly, notification module 13 sends the IP address of the client 20 of having obtained the latest edition file to client 20, the client 20 that notice client 20 will be obtained the latest edition file is used as interim service end 30, and mentions upgrade request message according to the IP address that obtains to interim service end 30.
In actual application, also can comprise delay management module 14 and upgrading module 15 in the client 20 of possibility as interim service end 30, upgrade so that the client 20 of proposition upgrade request message is obtained the latest edition file in a certain order.
Delay management module 14 is used for calculating upgrading length of delay D according to the priority of the client 20 that proposes upgrade request message, and issues the upgrade notification message of carrying upgrading length of delay D to this client 20.
Upgrading module 15 is used for providing the latest edition file to client 20 when upgrading length of delay D expires.
The present invention is by providing the mode of interim service end 30, avoided upgrading inefficiency that a plurality of clients 20 cause to main service side used 10 request upgradings simultaneously and the problem of network congestion, therefore effectively improved network upgrade efficient, alleviated network load.
Above content is in conjunction with concrete preferred implementation further description made for the present invention, can not assert that concrete enforcement of the present invention is confined to these explanations.For the general technical staff of the technical field of the invention, without departing from the inventive concept of the premise, can also make some simple deduction or replace, all should be considered as belonging to protection scope of the present invention.