Summary of the invention
For defect of the prior art, the invention provides a kind of software upgrade instruction distribution method, the communication server and terminal device, solve software upgrade instruction distribution delay large and need to take control center's ample resources problem.
First aspect, the invention provides a kind of communication server, comprising:
Setting up unit, being connected with the long of at least one terminal device for setting up;
Transmitting element, for sending the message comprising software version information to described terminal device, to make described terminal device judge whether to need to carry out software upgrading according to described software version information, if then obtain software upgrade data with the communication mode of multicast from upgrade server.
Alternatively, described transmitting element is further used for regularly sending to described terminal device the heartbeat data packets comprising software version information, to make described terminal device judge whether to need to carry out software upgrading according to described software version information, if then obtain software upgrade data with the communication mode of multicast from upgrade server.
Second aspect, present invention also offers a kind of terminal device, comprising:
Set up unit, for being connected with the long of the communication server;
Receiving element, for receiving the message comprising software version information from the described communication server;
Judging unit, the described software version information for receiving according to described receiving element judges whether to need to carry out software upgrading;
Performance element, obtains software upgrade data with the communication mode of multicast from upgrade server during for judging to need to carry out software upgrading at judging unit.
Alternatively, described performance element comprises:
There is module, for obtaining software upgrade data with the communication mode of multicast from upgrade server;
Receiver module, for receiving multiple data cells that upgrade server sends with the communication mode of multicast, described data cell is the data cell corresponding with the mark of the described software upgrade data in described software upgrading request message that described upgrade server generates;
Processing module, for obtaining described software upgrade data according to the described multiple data cell received.
Alternatively, described processing module is further used for when the number of the data cell received reaches preset value, utilizes forward error correction coding algorithm to obtain described software upgrade data according to the multiple data cells received; Described data cell comprises multiple original data units that upgrade server got by described software upgrade data and multiple checking data unit that upgrade server utilizes described forward error correction coding algorithm to obtain according to described original data units.
Alternatively, described processing module is not also for when obtaining correct software upgrade data according to multiple data cells of receiving, and what perform in following operation is one or more:
Forward error correction coding algorithm is utilized to carry out error correction to the software upgrade data obtained;
Abandon the described multiple data cell received, and continuation receives multiple data cells that upgrade server sends with the communication mode of multicast;
Send corresponding data unit transmission request to upgrade server or other-end equipment, return the data cell corresponding with described software upgrade data to make upgrade server or other-end equipment.
Alternatively, described receiving element is further used for receiving the heartbeat data packets comprising software version information that the described communication server regularly sends.
The third aspect, present invention also offers a kind of software upgrade instruction distribution method, comprising:
Set up and be connected with the long of at least one terminal device;
The message comprising software version information is sent, to make described terminal device judge whether to need to carry out software upgrading according to described software version information, if then obtain software upgrade data with the communication mode of multicast from upgrade server to described terminal device.
Alternatively, the described message comprising software version information to described terminal device transmission, to make described terminal device judge whether to need to carry out software upgrading according to described software version information, if then obtain software upgrade data with the communication mode of multicast from upgrade server, comprising:
The heartbeat data packets comprising software version information is regularly sent to described terminal device, to make described terminal device judge whether to need to carry out software upgrading according to described software version information, if then obtain software upgrade data with the communication mode of multicast from upgrade server.
Fourth aspect, present invention also offers a kind of software upgrade instruction distribution method, comprising:
Set up and be connected with the long of the communication server;
Receive the message comprising software version information from the described communication server;
Judge whether to need to carry out software upgrading according to described software version information;
If so, then software upgrade data is obtained with the communication mode of multicast from upgrade server.
Alternatively, described with the communication mode of multicast from upgrade server obtain software upgrade data, comprising:
The software upgrading request message comprising the mark of software upgrade data to be obtained is sent to upgrade server;
Receive multiple data cells that upgrade server sends with the communication mode of multicast, described data cell is the data cell corresponding with the mark of the described software upgrade data in described software upgrading request message that described upgrade server generates;
Described multiple data cell according to receiving obtains described software upgrade data.
Alternatively, described multiple data cell that described basis receives obtains described software upgrade data, comprising:
When the number of the data cell received reaches preset value, forward error correction coding algorithm is utilized to obtain described software upgrade data according to the multiple data cells received; Described data cell comprises multiple original data units that upgrade server got by described software upgrade data and multiple checking data unit that upgrade server utilizes described forward error correction coding algorithm to obtain according to described original data units.
Alternatively, described multiple data cell that described basis receives obtains described software upgrade data, also comprises:
When not obtaining correct software upgrade data according to multiple data cells of receiving, what perform in following operation is one or more:
Forward error correction coding algorithm is utilized to carry out error correction to the software upgrade data obtained;
Abandon the described multiple data cell received, and continuation receives multiple data cells that upgrade server sends with the communication mode of multicast;
Send corresponding data unit transmission request to upgrade server or other-end equipment, return the data cell corresponding with described software upgrade data to make upgrade server or other-end equipment.
Alternatively, receive the message comprising software version information from the described communication server, comprising:
Receive the heartbeat data packets comprising software version information that the described communication server regularly sends.
As shown from the above technical solution, the present invention can be connected by making the communication server and terminal device set up length the distribution making the communication server replace control center's software upgrade instruction, thus control center does not need set up continually with great amount of terminals equipment and close short connection, thus software upgrade instruction distribution can not take the ample resources of control center; And long connection can not be set up frequently and close, can ensure that instruction is promptly distributed to each terminal, reduce delay in time between the sending and perform of instruction.So it is large and need to take control center's ample resources problem that the present invention can solve software upgrade instruction distribution delay, and execution efficiency is high and workable.
In instructions of the present invention, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, to disclose and to help to understand in each inventive aspect one or more to simplify the present invention, in the description above to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes.But, the method for the disclosure should not explained the following intention in reflection: namely the present invention for required protection requires feature more more than the feature clearly recorded in each claim.Or rather, as claims below reflect, all features of disclosed single embodiment before inventive aspect is to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
It will be understood by those skilled in the art that adaptively to change the module in the equipment in embodiment and they are arranged and be in one or more equipment that this embodiment is different.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit is mutually exclusive part, any combination can be adopted to combine all processes of all features disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can use with arbitrary array mode.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions that microprocessor or digital signal processor (DSP) can be used in practice to realize according to the some or all parts in the equipment of a kind of browser terminal of the embodiment of the present invention.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computing machine of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.
Last it is noted that above each embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to foregoing embodiments to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein some or all of technical characteristic; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme, it all should be encompassed in the middle of the scope of claim of the present invention and instructions.
Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
It should be noted that, control center herein refers to for generating device to the steering order of any terminal equipment in belonging network or device sets; The communication server herein refers to for dividing the device or device sets that send instructions at least one terminal device; Terminal device herein refers in the belonging network being in control center by receiving and performing the equipment from control center's instruction.
Such as, in one embodiment of the invention, above-mentioned control center is specifically positioned at the Control Server at local net network center, the small server of distributing specifically for software upgrade instruction that the above-mentioned communication server is specifically connected with Control Server in consolidated network, the multiple stage PC device of above-mentioned terminal device specifically in LAN (Local Area Network).
For another example, in another embodiment of the invention, above-mentioned control center is specifically arranged in the set of multiple servers of internet, specifically for a server of software upgrade instruction distribution in the set of the above-mentioned communication server specifically multiple server, and the above-mentioned terminal device specifically equipment that controlled by instruction of any one controlled center, can be the desktop computer, notebook computer, panel computer, smart mobile phone, personal digital assistant, music player devices, game station etc. based on any operating system.
In addition, short connection herein refers to communication two party when having a data interaction, and just set up a connection, after data are sent completely, then disconnect this and connect, namely each connection only completes the transmission of a business.And corresponding, long connection refers to connect at one to send multiple packet continuously, during connection keeps, if do not have Packet Generation, needs both sides to send out link detecting bag.In the prior art, long connection is used for single-point to single-point and the few communication scenes of linking number, and short connection is used for point to multi--point and a lot of communication scenes of linking number.Its reason is mainly short connection and the long difference being connected to the mode of foundation and transmission mode.
Be specifically example with a simple TCP (Transmission Control Protocol, transmission control protocol) short connection, terminal device initiates connection request to server, and server receives request, and then both sides connect.Terminal device sends message to server, server response terminal device, then once read and write and just complete, at this time both sides any one can initiate close attended operation, all generally but that terminal device first initiates to close attended operation, main because general server closes connection after can not having replied terminal device immediately, certainly not getting rid of has special situation.As can be seen from description above, short connection generally only can transmit a read-write operation between terminal device and server.
As can be seen from the instantiation procedure of above-mentioned short connection, if transmit instruction by short connected mode between control center and terminal device, so often send an instruction all to need to set up once short connection, and all need after often sending an instruction to close once short connection.In the face of terminal device and the usually comparatively concentrated in time software upgrade instruction distribution flow of substantial amounts, control center needs the short connection of setting up enormous amount at short notice, and every a instruction is all sent to corresponding terminal device, then after being sent, close short connection.Visible, the demand of this process to the free system resources of control center and the communication resource is all huge, is easy to cause blocking up of downlink bandwidth; Need owing to connecting to spend certain hour, the distribution flow of thus instruction can the relative expenses time simultaneously.
For the problems referred to above, the invention provides a kind of software upgrade instruction distribution method, shown in Figure 1 go out one embodiment of the invention in a kind of steps flow chart schematic diagram of software upgrade instruction distribution method, the method comprises:
Step 101: set up and be connected with the long of at least one terminal device;
Step 102: send the message comprising software version information to described terminal device, to make described terminal device judge whether to need to carry out software upgrading according to described software version information, if then obtain software upgrade data with the communication mode of multicast from upgrade server.
It should be noted that, the executive agent of the method that the embodiment of the present invention provides corresponds to above-mentioned " communication server ", as described above, the communication server is that the present invention does not limit its concrete implementation for dividing the device or device sets that send instructions at least one terminal device.
Particularly, in above-mentioned steps 101, and the long connection establishment process of at least one terminal device specifically can comprise the mutual of repeatedly handshake data bag between terminal device.In above-mentioned steps 102, because terminal device can get the software version information of self, thus can compare with the software version information received, thus determine whether to need to carry out software upgrading.Such as, version number in the software version information that terminal device receives is " 1.6.8 ", if and the version number in the software version information of terminal device self is " 1.5.0 ", time lower with " 1.6.8 " self corresponding software version known, terminal device can obtain software upgrade data, with software upgrade instruction by the communication mode of multicast from upgrade server.On the other hand, if the version information of the corresponding software of terminal device self is " 1.6.8 ", representing this software has been up-to-date version, and so terminal device just can ignore this software upgrade instruction.
Visible, due to the distribution adopting long connected mode to carry out instruction, the embodiment of the present invention can be connected by making the communication server and terminal device set up length the distribution making the communication server replace control center's software upgrade instruction, thus control center does not need set up continually with great amount of terminals equipment and close short connection, thus software upgrade instruction distribution can not take the ample resources of control center; And long connection can not be set up frequently and close, can ensure that instruction is promptly distributed to each terminal, reduce delay in time between the sending and perform of instruction.So it is large and need to take control center's ample resources problem that the embodiment of the present invention can solve software upgrade instruction distribution delay, and execution efficiency is high and workable.
Connect so that TCP is long, long establishment of connection and messaging procedure can carry out in the following manner: terminal device initiates to connect to the communication server, and communication server receiving terminal equipment connection, both sides connect.After terminal device and the communication server complete and once read and write, the connection between them can't initiatively be closed, and follow-up read-write operation can continue to use this long connection.And connect to safeguard that TCP is long, the communication server also can send " heartbeat data packets " to determine to terminal device terminal device and whether also maintains the long connection of this TCP.More specifically, it can pass through following process implementation:
If given TCP is long be connected in two hours without any action, then the communication server just sends out a heartbeat data packets to terminal device, and so terminal device may have following situation:
The first, terminal device still normally runs, and can reach from the communication server.The TCP response of terminal device is normal, and the communication server also knows that the other side is normal, and the communication server is after 2 hours by timer reset.
The second, terminal device collapses, and closes or restarting.In either case, the TCP of terminal device long connection does not all respond.Service end can not receive the response to heartbeat data packets, and judge time-out in wait after 75 seconds.The communication server sends 10 same heartbeat data packets altogether, 75 seconds, each interval.If the communication server does not receive a response, it just thinks that terminal device has been closed and stopped the long connection of TCP.
The third, terminal device collapse also restarts.The communication server will receive a response to heartbeat data packets, and this response to make the communication server stop the long connection of this TCP.
4th kind, terminal device machine normally runs, but terminal device is interrupt to the communication of the communication server, is thus similar to above-mentioned the second situation, and the communication server can think that terminal device has been closed and stopped that TCP is long to be connected.
Therefore, based on the long heartbeat data packets transmit mechanism connected, the part of software upgrade instruction as heartbeat data packets can be sent.Namely, above-mentioned steps 102: send the message comprising software version information to described terminal device, judge whether to need to carry out software upgrading according to described software version information to make described terminal device, if then obtain software upgrade data with the communication mode of multicast from upgrade server, can specifically comprise not shown step:
The heartbeat data packets comprising software version information is regularly sent to described terminal device, to make described terminal device judge whether to need to carry out software upgrading according to described software version information, if then obtain software upgrade data with the communication mode of multicast from upgrade server.
Thus, when terminal device receives the heartbeat data packets comprising software version information each time, the judgement the need of carrying out software upgrading can being carried out, comparing and carrying out the transmission of the message comprising software version information individually, the work load of the communication server can be reduced further.
In addition, the communication server can independent of the software upgrade instruction distribution procedure of seeking unity of action outside control center at least one terminal device in embodiments of the present invention.That is, control center only needs to set up the real-time Communication for Power with the communication server, software upgrade instruction just can be made to be issued to each terminal device rapidly, and self not need the flow process that process software upgrade is distributed, thus can perform other control operation flow processs to a greater extent.
And, software upgrade data is obtained with the communication mode of multicast just because of terminal device, thus upgrade server can by changing the terminal device composition in multicast group, just can carry out the transmission with a software upgrade data easily, the long feature connecting the mode of distributing software upgrade is coordinated to make multiple terminal device be divided into same multicast group after heart update software version in the controlling, thus jointly from upgrade server, obtain software upgrade data, be conducive to reducing network load and improving data transmission efficiency.
Certainly, in other embodiments of the invention, the communication server also can be contained in the middle of control center, and its idiographic flow can be undertaken by the mode identical with technique scheme, does not repeat them here.
Based on same inventive concept, embodiments provide a kind of software upgrade instruction distribution method, shown in Figure 2 go out one embodiment of the invention in a kind of steps flow chart schematic diagram of software upgrade instruction distribution method, the method comprises:
Step 201: set up and be connected with the long of the communication server;
Step 202: receive the message comprising software version information from the described communication server;
Step 203: judge whether to need to carry out software upgrading according to described software version information;
Step 204: if so, then obtain software upgrade data with the communication mode of multicast from upgrade server.
Wherein, the method that the embodiment of the present invention provides, based on " terminal device ", can realize the flow process of above any one software upgrade instruction distribution, thus have corresponding technical characteristic, and identical technical matters can be solved, reach identical technique effect.
Such as, send the example of software version information corresponding to above-mentioned employing heartbeat data packets, above-mentioned steps 202: receive the message comprising software version information from the described communication server, can specifically comprise not shown step:
Receive the heartbeat data packets comprising software version information that the described communication server regularly sends.
Certainly, after receiving heartbeat data packets, terminal device just can carry out the judgement the need of carrying out software upgrading, can also feed back its judged result in the response, thus makes control center can collect the software upgrading situation of all terminal devices rapidly.
More specifically, obtain software upgrade data with the communication mode of multicast from upgrade server in above-mentioned steps 204 and specifically can comprise following step as shown in Figure 3:
Step 301: send the software upgrading request message comprising the mark of software upgrade data to be obtained to upgrade server;
Step 302: receive multiple data cells that upgrade server sends with the communication mode of multicast, described data cell is the data cell corresponding with the mark of the described software upgrade data in described software upgrading request message that described upgrade server generates;
Step 303: the described multiple data cell according to receiving obtains described software upgrade data.
Here, the communication protocol of multicast is all generally based on User Datagram Protocol (UserDatagram Protocol, UDP), can be specially in following agreement one or more: long-range vector multileaving Routing Protocol (Distance Vector Multicast RoutingProtocol, DVMRP), multicast OSPF (Multicast OpenShortest Path First, MOSPF), dense mode Protocol Independent Multicast (Protocol-independent Multicast-Dense Mode, PIM-DM), benchmark tree protocol (Core Based Trees, and sparse mode Protocol Independent Multicast (Protocol-independent Multicast-Sparse Mode CBT), PIM-SM) etc.
Adopt technique scheme, upgrade server only needs the software upgrade data that size can be reached tens GB to send to multiple terminal with the communication mode of multicast, wherein a kind of situation can be give multiple network node after upgrade server tears the multiple data cell of generation open according to software upgrade data, exchange each other's needs with other network nodes again after making network node copy data, data cell is made to be netted diffusion in a communication network, and in whole communication link, only there is the data volume of a software upgrade data, thus the communication resource in network can be made full use of, avoid the network congestion that point-to-point transmission mode causes, improve the transfer efficiency of software upgrade data.
Further, above-mentioned steps 303: the described multiple data cell according to receiving obtains described software upgrade data, specifically can also comprise the following step do not illustrated in the drawings:
When the number of the data cell received reaches preset value, forward error correction coding algorithm is utilized to obtain described software upgrade data according to the multiple data cells received; Described data cell comprises multiple original data units that upgrade server got by described software upgrade data and multiple checking data unit that upgrade server utilizes described forward error correction coding algorithm to obtain according to described original data units.
Above-mentioned forward error correction (Forward Error Correction, FEC) encryption algorithm can be described as a kind of transmission data redudancy that increases to improve the algorithm of transmission reliability.By this algorithm, terminal device does not need to receive all data cells that upgrade server sends, and can restore whole raw data that upgrade server sends yet, namely can allow packet loss in communication process.Meanwhile, the multiple data cells received can also be used for carrying out error correction to the raw data received, to improve the reliability of transmitting procedure further.
On the other hand, in order to ensure the reliability that data are transmitted, above-mentioned steps 303: the described multiple data cell according to receiving obtains described software upgrade data, not shown following step can also be comprised:
When not obtaining correct software upgrade data according to multiple data cells of receiving, what perform in following operation is one or more:
Forward error correction coding algorithm is utilized to carry out error correction to the software upgrade data obtained;
Abandon the described multiple data cell received, and continuation receives multiple data cells that upgrade server sends with the communication mode of multicast;
Send corresponding data unit transmission request to upgrade server or other-end equipment, return the data cell corresponding with described software upgrade data to make upgrade server or other-end equipment.
Particularly, based on above-mentioned forward error correction (Forward Error Correction, FEC) encryption algorithm, correction process can be carried out to it when correct software upgrade data can not be obtained, such as utilizing has multiple data cells of redundancy to carry out error correction according to forward error correction coding algorithm, or uses the array mode of multiple multiple data cell to attempt obtaining correct software upgrade data.Or, terminal device also can abandon the data cell that can not obtain Correct software upgrade data, and continue multiple data cells that reception server sends repeatedly, thus the data unit loss that causes for various reasons or mistake can be made equally all again can to receive in the data cell process of transmitting of next round, to ensure the reliability of communication further.
When above-mentioned two kinds of modes all lost efficacy, also corresponding data unit transmission request can be sent to upgrade server or other-end equipment, software upgrade data can be obtained on the one hand by the data cell of collecting disappearance, also again software upgrade data can be obtained (when the reliability of the transmission of said method can be guaranteed with other transmission modes on the other hand, the probability that this situation occurs can be quite little, thus can not increase considerably the load of communication network on the whole).
In the present invention's preferred embodiment, obtain the idiographic flow of software upgrade data (establish software upgrade data file and be all given as the IP address of multiple terminal devices of connection object) as described below using the communication mode of multicast from upgrade server:
In file hierarchy, upgrade server is for software upgrade data file (or software upgrade data file directory), first can carry out burst process, the identical file fragment of multiple size is such as divided into by all software upgrade data files (certainly to have the size of permitted file fragment may be different, it can be undertaken standardizing or special processing by the conventional means of such as adding clear data, and analogue hereafter all repeats no more).In order to ensure the reliability of communication, check information can be added in file fragment, such as according to file integrality check code and the cyclic redundancy check (CRC) coding of file fragment generation, with the file transfer unit on spanned file level.For each terminal device, after obtaining each file transfer unit, check information can be utilized to verify the consistance of file fragment and the source document fragment obtained.If there is inconsistent situation, this file transmission unit can be abandoned and to lay equal stress on new transmission; If verification can be passed through smoothly, then the file fragment obtained is stored, after All Files fragment to be obtained, obtain original software upgrade data file by the contrary operation of burst again.Below be then upgrading and the treatment scheme of terminal device in file hierarchy.
In data hierarchy, upgrade server each file transfer unit is divided into multiple size less, the data block that is suitable for forward error correction coding, such as size is multiple data blocks of 64KB.For each data block, original data units and the checking data unit of multiple formed objects is generated again, the error correction data unit of the original data units of such as 64 1024 bytes and 64 1024 bytes (can make the number of original data units identical with the number of checking data unit to obtain preferably the file transmission reliability and less data redudancy) according to forward error correction coding.When carrying out forward error correction coding, based on coding standard can select Reed-Solomon coding standard.Based on the principle of forward error correction coding, for the above-mentioned data cell ading up to 128, receive the terminal device of data cell and can tolerate that maximum 64 original data units or checking data unit are lost simultaneously, namely receive these data cells terminal device can by the data convert algorithm of correspondence according to sum be at least 64 original data units and checking data unit obtain original data block.Below be then upgrade server and the treatment scheme of terminal device in data hierarchy.
On transmission level, upgrade server with the communication mode of ip multicast by the multiple data unit transmission corresponding with each data block to terminal device (each packet be positioned on communication link comprises the data cell having added protocol information head), terminal device is then that restoring data block is prepared by the data cell that receives.
Concrete, original data units or checking data unit can be sent to multiple terminal devices of specifying as the load of communication protocol head by upgrade server simultaneously, and send one take turns after and then send next round, infinite loop is gone down until this process of upgrade server active termination.That is: after sending a data cell, next data cell is and then sent until whole data block is sent, when and then sending next data block after all data cells sending a data block until whole file transfer unit is sent, when all data blocks in this file transfer unit can be resend after all data blocks sending a file transfer unit again, until this process of upgrade server active termination.Certainly, the communication protocol of above-mentioned IP multicast can have a variety of, such as asynchronous layered coding agreement etc., but these agreements all meet same essential characteristic: the whole link of communication process only exists a data, and do not need to transmit many parts of identical data simultaneously.
Simultaneously, upgrade server can the document transmission process of control terminal in the following way: in communication protocol head, add " sending ", " being about to stop " and " stopping sending " three classes identify, represent " current file transmission unit is new transmission; terminal device should receive ", " current file transmission unit is sent, if terminal device receives, can stop receiving " and " terminal device should stop receiving immediately " respectively.Upgrade server first can add the mark of " sending " to data cell when sending file transfer unit; After all data cells of all data blocks sending this file transmission unit, before stopping sends data cell, add the mark of " being about to stop " to data cell; And when final stopping sends, add the mark of " stopping sending " to data cell.Correspondingly, if terminal device receives the data cell identified with " sending ", then according to the information in communication protocol head, the data cell received is stored in the position corresponding with the mark of this data cell, and carrys out restoring data block by data convert algorithm after receiving enough data cells; If terminal device receives the data cell identified with " being about to stop ", then detect all data blocks whether obtained in this file transmission unit, if then stop receiving; If when terminal device receives the data cell identified with " stopping sending ", then stop at once receiving and carry out exception treatment (such as again transmitting the file transfer unit of not success reception to neighbouring communication node or upgrade server request).
Be more than that upgrade server and terminal device are transmitting the treatment scheme on level.
Visible, the technical scheme of the embodiment of the present invention describes the embodiment of said method respectively on file hierarchy, data hierarchy and transmission level, to make on whole communication link only to exist several parts of same data at the most, thus greatly reduce software upgrade data distribution procedure taking the communication resource, reduce the load of communication network.
Based on same inventive concept, embodiments provide a kind of communication server, shown in Figure 4 go out structured flowchart, this communication server comprises:
Setting up unit 41, being connected with the long of at least one terminal device for setting up;
Transmitting element 42, for sending the message comprising software version information to described terminal device, to make described terminal device judge whether to need to carry out software upgrading according to described software version information, if then obtain software upgrade data with the communication mode of multicast from upgrade server.
Visible, due to the distribution adopting long connected mode to carry out instruction, the embodiment of the present invention can be connected by making the communication server and terminal device set up length the distribution making the communication server replace control center's software upgrade instruction, thus control center does not need set up continually with great amount of terminals equipment and close short connection, thus software upgrade instruction distribution can not take the ample resources of control center; And long connection can not be set up frequently and close, can ensure that instruction is promptly distributed to each terminal, reduce delay in time between the sending and perform of instruction.So it is large and need to take control center's ample resources problem that the embodiment of the present invention can solve software upgrade instruction distribution delay, and execution efficiency is high and workable.
In addition, the communication server of the present embodiment can perform the flow process in the embodiment of the method shown in aforesaid Fig. 1, and the present embodiment does not describe in detail at this.
In addition, corresponding to the example of above-mentioned heartbeat data packets, described transmitting element can be further used for regularly sending to described terminal device the heartbeat data packets comprising software version information, to make described terminal device judge whether to need to carry out software upgrading according to described software version information, if then obtain software upgrade data with the communication mode of multicast from upgrade server.
Thus, when terminal device receives the heartbeat data packets comprising software version information each time, the judgement the need of carrying out software upgrading can being carried out, comparing and carrying out the transmission of the message comprising software version information individually, the work load of the communication server can be reduced further.
Based on same inventive concept, present invention also offers a kind of terminal device, shown in Figure 5 go out structured flowchart, this terminal device comprises:
Set up unit 51, for being connected with the long of the communication server;
Receiving element 52, for receiving the message comprising software version information from the described communication server;
Judging unit 53, the described software version information for receiving according to described receiving element 52 judges whether to need to carry out software upgrading;
Performance element 54, obtains software upgrade data with the communication mode of multicast from upgrade server during for judging to need to carry out software upgrading at judging unit 53.
Wherein, the terminal device that the embodiment of the present invention provides can with any one communication server above-mentioned by having carried out the distribution of software upgrade instruction alternately, and the flow process that can perform in the embodiment of the method shown in aforesaid Fig. 2, the present embodiment does not describe in detail at this.
In one embodiment of the invention, above-mentioned performance element 54 specifically can comprise following structure as shown in Figure 6:
There is module 61, for obtaining software upgrade data with the communication mode of multicast from upgrade server;
Receiver module 62, for receiving multiple data cells that upgrade server sends with the communication mode of multicast, described data cell is the data cell corresponding with the mark of the described software upgrade data in described software upgrading request message that described upgrade server generates;
Processing module 63, for obtaining described software upgrade data according to the described multiple data cell received.
Adopt technique scheme, upgrade server only needs the software upgrade data that size can be reached tens GB to send to multiple terminal with the communication mode of multicast, wherein a kind of situation can be give multiple network node after upgrade server tears the multiple data cell of generation open according to software upgrade data, exchange each other's needs with other network nodes again after making network node copy data, data cell is made to be netted diffusion in a communication network, and in whole communication link, only there is the data volume of a software upgrade data, thus the communication resource in network can be made full use of, avoid the network congestion that point-to-point transmission mode causes, improve the transfer efficiency of software upgrade data.
Further, corresponding to the example of above-mentioned heartbeat data packets, described receiving element 52 can be further used for receiving the heartbeat data packets comprising software version information that the described communication server regularly sends.Certainly, after receiving heartbeat data packets, terminal device just can carry out the judgement the need of carrying out software upgrading, can also feed back its judged result in the response, thus makes control center can collect the software upgrading situation of all terminal devices rapidly.
On the other hand, described processing module 63 can be further used for when the number of the data cell received reaches preset value, utilizes forward error correction coding algorithm to obtain described software upgrade data according to the multiple data cells received; Described data cell comprises multiple original data units that upgrade server got by described software upgrade data and multiple checking data unit that upgrade server utilizes described forward error correction coding algorithm to obtain according to described original data units.
Above-mentioned forward error correction (Forward Error Correction, FEC) encryption algorithm can be described as a kind of transmission data redudancy that increases to improve the algorithm of transmission reliability.By this algorithm, terminal device does not need to receive all data cells that upgrade server sends, and can restore whole raw data that upgrade server sends yet, namely can allow packet loss in communication process.Meanwhile, the multiple data cells received can also be used for carrying out error correction to the raw data received, to improve the reliability of transmitting procedure further.
Further, described processing module 63 can also be used for when not obtaining correct software upgrade data according to multiple data cells of receiving, and what perform in following operation is one or more:
Forward error correction coding algorithm is utilized to carry out error correction to the software upgrade data obtained;
Abandon the described multiple data cell received, and continuation receives multiple data cells that upgrade server sends with the communication mode of multicast;
Send corresponding data unit transmission request to upgrade server or other-end equipment, return the data cell corresponding with described software upgrade data to make upgrade server or other-end equipment.
Particularly, based on above-mentioned forward error correction (Forward Error Correction, FEC) encryption algorithm, correction process can be carried out to it when correct software upgrade data can not be obtained, such as utilizing has multiple data cells of redundancy to carry out error correction according to forward error correction coding algorithm, or uses the array mode of multiple multiple data cell to attempt obtaining correct software upgrade data.Or, terminal device also can abandon the data cell that can not obtain Correct software upgrade data, and continue multiple data cells that reception server sends repeatedly, thus the data unit loss that causes for various reasons or mistake can be made equally all again can to receive in the data cell process of transmitting of next round, to ensure the reliability of communication further.
When above-mentioned two kinds of modes all lost efficacy, also corresponding data unit transmission request can be sent to upgrade server or other-end equipment, software upgrade data can be obtained on the one hand by the data cell of collecting disappearance, also again software upgrade data can be obtained (when the reliability of the transmission of said method can be guaranteed with other transmission modes on the other hand, the probability that this situation occurs can be quite little, thus can not increase considerably the load of communication network on the whole).
Embodiments of the invention disclose:
A1, a kind of communication server, is characterized in that, comprising:
Setting up unit, being connected with the long of at least one terminal device for setting up;
Transmitting element, for sending the message comprising software version information to described terminal device, to make described terminal device judge whether to need to carry out software upgrading according to described software version information, if then obtain software upgrade data with the communication mode of multicast from upgrade server.
A2, the communication server according to claim A1, it is characterized in that, described transmitting element is further used for regularly sending to described terminal device the heartbeat data packets comprising software version information, to make described terminal device judge whether to need to carry out software upgrading according to described software version information, if then obtain software upgrade data with the communication mode of multicast from upgrade server.
B3, a kind of terminal device, is characterized in that, this terminal device comprises:
Set up unit, for being connected with the long of the communication server;
Receiving element, for receiving the message comprising software version information from the described communication server;
Judging unit, the described software version information for receiving according to described receiving element judges whether to need to carry out software upgrading;
Performance element, obtains software upgrade data with the communication mode of multicast from upgrade server during for judging to need to carry out software upgrading at judging unit.
B4, terminal device according to claim B3, it is characterized in that, described performance element comprises:
There is module, for obtaining software upgrade data with the communication mode of multicast from upgrade server;
Receiver module, for receiving multiple data cells that upgrade server sends with the communication mode of multicast, described data cell is the data cell corresponding with the mark of the described software upgrade data in described software upgrading request message that described upgrade server generates;
Processing module, for obtaining described software upgrade data according to the described multiple data cell received.
B5, terminal device according to claim B4, it is characterized in that, described processing module is further used for when the number of the data cell received reaches preset value, utilizes forward error correction coding algorithm to obtain described software upgrade data according to the multiple data cells received; Described data cell comprises multiple original data units that upgrade server got by described software upgrade data and multiple checking data unit that upgrade server utilizes described forward error correction coding algorithm to obtain according to described original data units.
B6, terminal device according to claim B5, is characterized in that, described processing module is not also for when obtaining correct software upgrade data according to the multiple data cells received, and what perform in following operation is one or more:
Forward error correction coding algorithm is utilized to carry out error correction to the software upgrade data obtained;
Abandon the described multiple data cell received, and continuation receives multiple data cells that upgrade server sends with the communication mode of multicast;
Send corresponding data unit transmission request to upgrade server or other-end equipment, return the data cell corresponding with described software upgrade data to make upgrade server or other-end equipment.
B7, according to the terminal device in claim B1 to B6 described in any one, it is characterized in that, described receiving element is further used for receiving the heartbeat data packets comprising software version information that the described communication server regularly sends.
C8, a kind of software upgrade instruction distribution method, is characterized in that, comprising:
Set up and be connected with the long of at least one terminal device;
The message comprising software version information is sent, to make described terminal device judge whether to need to carry out software upgrading according to described software version information, if then obtain software upgrade data with the communication mode of multicast from upgrade server to described terminal device.
C9, method according to claim C8, it is characterized in that, the described message comprising software version information to described terminal device transmission, judge whether to need to carry out software upgrading according to described software version information to make described terminal device, if then obtain software upgrade data with the communication mode of multicast from upgrade server, comprising:
The heartbeat data packets comprising software version information is regularly sent to described terminal device, to make described terminal device judge whether to need to carry out software upgrading according to described software version information, if then obtain software upgrade data with the communication mode of multicast from upgrade server.
D10, a kind of software upgrade instruction distribution method, is characterized in that, comprising:
Set up and be connected with the long of the communication server;
Receive the message comprising software version information from the described communication server;
Judge whether to need to carry out software upgrading according to described software version information;
If so, then software upgrade data is obtained with the communication mode of multicast from upgrade server.
D11, method according to claim D10, is characterized in that, describedly obtains software upgrade data with the communication mode of multicast from upgrade server, comprising:
The software upgrading request message comprising the mark of software upgrade data to be obtained is sent to upgrade server;
Receive multiple data cells that upgrade server sends with the communication mode of multicast, described data cell is the data cell corresponding with the mark of the described software upgrade data in described software upgrading request message that described upgrade server generates;
Described multiple data cell according to receiving obtains described software upgrade data.
D12, method according to claim D11, it is characterized in that, described multiple data cell that described basis receives obtains described software upgrade data, comprising:
When the number of the data cell received reaches preset value, forward error correction coding algorithm is utilized to obtain described software upgrade data according to the multiple data cells received; Described data cell comprises multiple original data units that upgrade server got by described software upgrade data and multiple checking data unit that upgrade server utilizes described forward error correction coding algorithm to obtain according to described original data units.
D13, method according to claim D12, it is characterized in that, described multiple data cell that described basis receives obtains described software upgrade data, also comprises:
When not obtaining correct software upgrade data according to multiple data cells of receiving, what perform in following operation is one or more:
Forward error correction coding algorithm is utilized to carry out error correction to the software upgrade data obtained;
Abandon the described multiple data cell received, and continuation receives multiple data cells that upgrade server sends with the communication mode of multicast;
Send corresponding data unit transmission request to upgrade server or other-end equipment, return the data cell corresponding with described software upgrade data to make upgrade server or other-end equipment.
D14, according to the method in claim D10 to D13 described in any one, to it is characterized in that, receive the message comprising software version information from the described communication server, comprising:
Receive the heartbeat data packets comprising software version information that the described communication server regularly sends.