Invention content
For the defects in the prior art, the present invention provide a kind of software upgrade instruction distribution method, the communication server and
Terminal device solves the problems, such as that software upgrade instruction distribution delay is big and needs to occupy control centre's vast resources.
In a first aspect, the present invention provides a kind of communication server, including:
Unit is established, is connected for establishing with the long of at least one terminal device;
Transmitting element, for including the message of software version information to terminal device transmission, so that the terminal is set
It is standby to judge whether to need to carry out software upgrading according to the software version information, if then being taken with the communication mode of multicast from upgrading
It is engaged in obtaining software upgrade data at device.
Optionally, the transmitting element is further used for periodically including software version information to terminal device transmission
Heartbeat data packets, so that the terminal device judges whether to need to carry out software upgrading according to the software version information, if
Software upgrade data is then obtained at upgrade server with the communication mode of multicast.
Second aspect, the present invention also provides a kind of terminal device, including:
Unit is established, for being connected with the long of the communication server;
Receiving unit, for receiving the message for including software version information from the communication server;
Judging unit, for judging whether to need to carry out according to the software version information that the receiving unit receives
Software upgrading;
Execution unit, for being taken when judging unit judgement needs to carry out software upgrading with the communication mode of multicast from upgrading
It is engaged in obtaining software upgrade data at device.
Optionally, the execution unit includes:
Module occurs, for obtaining software upgrade data at upgrade server with the communication mode of multicast;
Receiving module, for receiving multiple data cells that upgrade server is sent with the communication mode of multicast, the number
According to the mark with the software upgrade data in the software upgrading request message that unit is upgrade server generation
Corresponding data cell;
Processing module, for obtaining the software upgrade data according to the multiple data cell received.
Optionally, the processing module is further used for when the number of the data cell received reaches preset value, profit
With forward error correction coding algorithm the software upgrade data is obtained according to the multiple data cells received;The data cell packet
It includes multiple original data units that upgrade server got by the software upgrade data and upgrade server utilizes the forward direction
Multiple verification data units that Correction-Coding Algorithm is obtained according to the original data units.
Optionally, the processing module is additionally operable to that according to the multiple data cells received correct software cannot be being obtained
When upgrading data, perform one or more in following operation:
Error correction is carried out to obtained software upgrade data using forward error correction coding algorithm;
The multiple data cell having been received by is abandoned, and continues to upgrade server with the communication mode of multicast
The multiple data cells sent;
Send corresponding data unit transmission request to upgrade server or other-end equipment so that upgrade server or
Other-end equipment returns to data cell corresponding with the software upgrade data.
Optionally, the receiving unit is further used for receiving that the communication server periodically sends includes software version
The heartbeat data packets of information.
The third aspect, the present invention also provides a kind of software upgrade instruction distribution method, including:
It establishes and is connected with the long of at least one terminal device;
Include the message of software version information to terminal device transmission, so that the terminal device is according to the software
Version information judges whether to need to carry out software upgrading, if then obtaining software at upgrade server with the communication mode of multicast
Upgrade data.
Optionally, the message that software version information is included to terminal device transmission, so that the terminal device
Judge whether to need according to the software version information to carry out software upgrading, if then with the communication mode of multicast from upgrade service
Software upgrade data is obtained at device, including:
Periodically include the heartbeat data packets of software version information to terminal device transmission, so that the terminal device root
Judge whether to need according to the software version information to carry out software upgrading, if then with the communication mode of multicast from upgrade server
Place obtains software upgrade data.
Fourth aspect, the present invention also provides a kind of software upgrade instruction distribution method, including:
It establishes and is connected with the long of the communication server;
Receive the message for including software version information from the communication server;
Judge whether to need to carry out software upgrading according to the software version information;
If so, software upgrade data is obtained at upgrade server with the communication mode of multicast.
Optionally, the communication mode with multicast obtains software upgrade data at upgrade server, including:
Include the software upgrading request message of the mark of software upgrade data to be obtained to upgrade server transmission;
Multiple data cells that upgrade server is sent with the communication mode of multicast are received, the data cell is the liter
The data cell corresponding with the mark of the software upgrade data in the software upgrading request message of grade server generation;
The multiple data cell according to receiving obtains the software upgrade data.
Optionally, the multiple data cell that the basis receives obtains the software upgrade data, including:
When the number of the data cell received reaches preset value, using forward error correction coding algorithm according to receiving
Multiple data cells obtain the software upgrade data;The data cell includes upgrade server by the software upgrade data
The multiple original data units and upgrade server got are using the forward error correction coding algorithm according to the initial data list
Multiple verification data units that member obtains.
Optionally, the multiple data cell that the basis receives obtains the software upgrade data, further includes:
When according to the multiple data cells received correct software upgrade data cannot be obtained, perform in following operation
It is one or more:
Error correction is carried out to obtained software upgrade data using forward error correction coding algorithm;
The multiple data cell having been received by is abandoned, and continues to upgrade server with the communication mode of multicast
The multiple data cells sent;
Send corresponding data unit transmission request to upgrade server or other-end equipment so that upgrade server or
Other-end equipment returns to data cell corresponding with the software upgrade data.
Optionally, the message for including software version information from the communication server is received, including:
Receive the heartbeat data packets for including software version information that the communication server is periodically sent.
As shown from the above technical solution, the present invention can be made by the way that the communication server and terminal device is made to establish long connection
The communication server replaces the distribution of control centre's software upgrade instruction, so as to which control centre does not need to and great amount of terminals equipment
Short connection is continually established and closes, thus software upgrade instruction distribution will not occupy the vast resources of control centre;It is and long
Connection frequently will not be established and be closed, and can be ensured that instruction is promptly distributed to each terminal, be reduced sending out and holding for instruction
Delay between row in time.So the present invention can solve, software upgrade instruction distribution delay is big and needs occupy control
Center vast resources problem, execution efficiency is high and operability is strong.
Specific embodiment
Purpose, technical scheme and advantage to make the embodiment of the present invention are clearer, below in conjunction with the embodiment of the present invention
In attached drawing, the technical solution in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
Part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
All other embodiments obtained without creative efforts shall fall within the protection scope of the present invention.
It should be noted that control centre herein refers to generating to any terminal equipment in belonging network
The device or device sets of control instruction;The communication server herein refers to distributing at least one terminal device
The device or device sets of instruction;Terminal device herein is referred in the belonging network in control centre by receiving simultaneously
Perform the equipment instructed from control centre.
For example, in one embodiment of the invention, above-mentioned control centre is specifically the control positioned at local net network center
Control server, the above-mentioned communication server are specifically to be specifically used for software upgrade instruction with what control server was connected in consolidated network
The small server of distribution, above-mentioned terminal device are specifically more PC devices in LAN.
For another example, in another embodiment of the invention, above-mentioned control centre is specifically the multiple services being located in internet
The set of device, the above-mentioned communication server are specifically be specifically used for software upgrade instruction distribution in the set of multiple servers one
Server, and above-mentioned terminal device is specifically any one equipment by control centrally through instruction control, can be based on appointing
The desktop computer for operating system of anticipating, laptop, tablet computer, smart mobile phone, personal digital assistant, music player devices, trip
Equipment of playing etc..
In addition, when short connection herein refers to that communication two party has data interaction, a connection is just established, data are sent
After the completion, then this connection is disconnected, i.e., connects the transmission for only completing a business every time.And it is corresponding, long connection refers at one
Multiple data packets can be continuously transmitted in connection, during holding is connected, if sent without data packet, both sides are needed to send out link
Detection packet.In the prior art, long connection is chiefly used in single-point to single-point and connects the few communication scenes of number, and short connection is more
For point to multi--point and connect many communication scenes of number.Its reason essentially consists in short connection and length is connected to the mode of foundation
With the difference of transmission mode.
Specifically with a short connection of simple TCP (Transmission Control Protocol, transmission control protocol)
For, terminal device initiates the connection request to server, and server is connected to request, and then both sides establish connection.Terminal device to
Server sends message, server response terminal device, and then primary read-write just completes, and at this time both sides' either of which can
To initiate to close attended operation, but typically terminal device first initiates to close attended operation, is primarily due to general service
Device closes connection immediately after will not having replied terminal device, is not excluded for special situation certainly.It can see from the description above
Go out, short connection is general only to transmit a read-write operation between terminal device and server.
If as can be seen that passing through short connection between control centre and terminal device from the instantiation procedure of above-mentioned short connection
Mode transmits instruction, then often sends an instruction and is required for establishing primary short connection, and all need after often having sent an instruction
Close primary short connection.Terminal device and the usual software upgrade instruction more concentrated in time in face of substantial amounts
Distribution flow, control centre need to establish the short connection of enormous amount in a short time, and will be all sent to per a instruction pair
Then the terminal device answered closes short connection after being sent.As it can be seen that free system resources of this process to control centre
Demand with the communication resource is all huge, it is easy to cause the congestion of downlink bandwidth;Simultaneously because establishing connection needs to spend
Certain time, thus the distribution flow instructed opposite can expend the time.
In view of the above-mentioned problems, the present invention provides a kind of software upgrade instruction distribution method, it is shown in Figure 1 go out this hair
A kind of step flow diagram of software upgrade instruction distribution method, this method include in bright one embodiment:
Step 101:It establishes and is connected with the long of at least one terminal device;
Step 102:Include the message of software version information to terminal device transmission so that the terminal device according to
The software version information judges whether to need to carry out software upgrading, if then with the communication mode of multicast at upgrade server
Obtain software upgrade data.
It should be noted that the executive agent for the method that the embodiment of the present invention is provided corresponds to above-mentioned " communication service
Device ", as described above, the communication server are the device or device sets for being instructed to the distribution of at least one terminal device, this
Invention does not limit its concrete implementation mode.
Specifically, in above-mentioned steps 101, the long connection at least one terminal device establish process can specifically include with
The interaction of multiple handshake data packet between terminal device.In above-mentioned steps 102, since terminal device can get itself
Software version information, thus can be compared with the software version information received, it determines whether to need to carry out software
Upgrading.For example, version number in the software version information that terminal device receives is " 1.6.8 ", and if terminal device itself
Version number in software version information is " 1.5.0 ", with " 1.6.8 " understand itself corresponding software version it is relatively low when, terminal is set
It is standby software upgrade data to be obtained at upgrade server by the communication mode of multicast, it is instructed with software upgrade.Separately
On the one hand, if the version information of the corresponding software of terminal device itself is " 1.6.8 ", it has been newest version to represent the software
, then terminal device can ignore this software upgrade instruction.
As it can be seen that due to the distribution instructed using long connection mode, the embodiment of the present invention can be by making communication service
Device establishes long connection the communication server to be made to replace the distribution of control centre's software upgrade instruction, so as to control with terminal device
Center processed does not need to continually establish and close short connection with great amount of terminals equipment, thus software upgrade instruction distribution will not occupy
The vast resources of control centre;And long connection frequently will not be established and be closed, and it is every can to ensure that instruction is promptly distributed to
One terminal reduces delay in time between the sending out and perform of instruction.So the embodiment of the present invention can solve software liter
Grade instruction distribution delay is big and needs to occupy control centre's vast resources problem, and execution efficiency is high and operability is strong.
By taking TCP long connections as an example, long establishment of connection and messaging procedure can carry out in the following manner:Terminal is set
Standby to be initiated the connection to the communication server, communication server receiving terminal equipment connection, both sides establish connection.Terminal device is with communicating
After server completes primary read-write, the connection between them can't actively close, and subsequent read-write operation will continue to use
This length connection.Moreover, in order to safeguard TCP long connections, the communication server can also send " heartbeat data packets " to terminal device to be come
Determine whether terminal device also maintains this TCP long connections.More specifically, it can be realized by procedure below:
As soon as if given TCP long is connected in two hours without any action, then the communication server is to terminal
Equipment sends out a heartbeat data packets, then terminal device might have situations below:
The first, terminal device still normal operation, and reachable from the communication server.The TCP responses of terminal device are normal,
And the communication server, it is also known that other side is normal, the communication server after 2 hours resets timer.
Second, terminal device has collapsed, and closes or restarting.In either case, eventually
The TCP long connections of end equipment all do not respond to.Server-side will cannot receive response to heartbeat data packets, and after waiting for 75 seconds
Judgement time-out.The communication server sends 10 same heartbeat data packets in total, each interval 75 seconds.If the communication server does not have
A response is received, it is considered as terminal device and has been switched off and terminate TCP long connections.
The third, terminal device is collapsed and has been restarted.The communication server will receive one to heartbeat data packets
Response, this response is can be so that the communication server terminates this TCP long connections.
4th kind, terminal device machine normal operation, but the communication of terminal device to the communication server is to interrupt, thus
Similar to above-mentioned the second situation, the communication server will be considered that terminal device has been switched off and terminates TCP long connections.
Therefore, the heartbeat data packets based on long connection send mechanism, can be using software upgrade instruction as heartbeat data packets
A part sent.That is, above-mentioned steps 102:Include the message of software version information to terminal device transmission, with
The terminal device is made to judge whether to need to carry out software upgrading according to the software version information, if then with the communication of multicast
Mode obtains software upgrade data at upgrade server, can specifically include the step of being not shown in figure:
Periodically include the heartbeat data packets of software version information to terminal device transmission, so that the terminal device root
Judge whether to need according to the software version information to carry out software upgrading, if then with the communication mode of multicast from upgrade server
Place obtains software upgrade data.
So as to, when terminal device receives the heartbeat data packets including software version information each time, can be carried out be
The no judgement for needing to carry out software upgrading, compares and individually carries out the transmission for including the message of software version information, Ke Yijin
Reduce to one step the work load of the communication server.
In addition, the communication server can be independently of seeking unity of action except control centre at least one in embodiments of the present invention
The software upgrade instruction distribution procedure of a terminal device.That is, control centre only needs to establish the reality with the communication server
Shi Tongxin, so that it may so that software upgrade instruction is rapidly issued to each terminal device, and itself not need to processing software upgrading
The flow of distribution is instructed, thus other control operating processes can be performed to a greater extent.
Moreover, software upgrade data, thus upgrade service are obtained with the communication mode of multicast just because of terminal device
Device can be formed by changing the terminal device in multicast group, it is possible to easily carry out the hair with a software upgrade data
The characteristics of sending, coordinating the mode of long connection distribution software upgrade instruction can make multiple ends after control centre updates software version
End equipment is divided into same multicast group, so as to obtain software upgrade data from upgrade server jointly, advantageously reduces net
Network load simultaneously improves data transmission efficiency.
Certainly, in other embodiments of the invention, the communication server can also be contained in control centre, specific
Flow can be carried out with the mode identical with above-mentioned technical proposal, and details are not described herein.
Based on same inventive concept, an embodiment of the present invention provides a kind of software upgrade instruction distribution method, referring to Fig. 2
A kind of step flow diagram of software upgrade instruction distribution method, this method packet in shown one embodiment of the invention
It includes:
Step 201:It establishes and is connected with the long of the communication server;
Step 202:Receive the message for including software version information from the communication server;
Step 203:Judge whether to need to carry out software upgrading according to the software version information;
Step 204:If so, software upgrade data is obtained at upgrade server with the communication mode of multicast.
Wherein, the method that the embodiment of the present invention is provided can be realized above any one based on " terminal device "
The flow of kind software upgrade instruction distribution, thus with corresponding technical characteristic, and the technical issues of identical can be solved, reach
Identical technique effect.
For example, corresponding to the above-mentioned example that software version information is sent using heartbeat data packets, above-mentioned steps 202:It receives
The message for including software version information from the communication server, can specifically include the step of being not shown in figure:
Receive the heartbeat data packets for including software version information that the communication server is periodically sent.
Certainly, after heartbeat data packets are received, whether terminal device can be carried out needing to carry out sentencing for software upgrading
It is disconnected, its judging result can also be fed back in the response, so as to which control centre be allow rapidly to be collected into all terminal devices
Software upgrading situation.
More specifically, software upgrade data is obtained at upgrade server with the communication mode of multicast in above-mentioned steps 204
Following step as shown in Figure 3 can be specifically included:
Step 301:The software upgrading for including the mark of software upgrade data to be obtained to upgrade server transmission is asked
Message;
Step 302:Receive multiple data cells that upgrade server is sent with the communication mode of multicast, the data cell
For the corresponding with the mark of the software upgrade data in the software upgrading request message of upgrade server generation
Data cell;
Step 303:The multiple data cell according to receiving obtains the software upgrade data.
Here, the communication protocol of multicast be typically all based on User Datagram Protocol (User Datagram Protocol,
UDP), can be specially one or more of following agreements:Long-range vector multicast Routing Protocol (Distance
Vector Multicast Routing Protocol, DVMRP), multicast Open Shortest Path First Protocol (Multicast
Open Shortest Path First, MOSPF), dense mode Protocol Independent Multicast (Protocol-independent
Multicast-Dense Mode, PIM-DM), benchmark tree protocol (Core Based Trees, CBT) and sparse mode independence group
Broadcast agreement (Protocol-independent Multicast-Sparse Mode, PIM-SM) etc..
Using above-mentioned technical proposal, upgrade server only need by size can reach the software upgrade data of tens GB with
The communication mode of multicast is sent to multiple terminals, and one of which is it may is that upgrade server tears life open according to software upgrade data
Multiple network nodes are given after into multiple data cells so that are mutually connected with other network nodes again after network node replicate data
Nothing so that data cell can be in netted diffusion in a communication network, and only exist a software upgrading in entire communication link
The data volume of data, thus the communication resource in network can be made full use of, avoid the net caused by point-to-point transmission mode
Network congestion improves the efficiency of transmission of software upgrade data.
Further, above-mentioned steps 303:The multiple data cell according to receiving obtains the software upgrading number
According to the following step being not shown can also be specifically included:
When the number of the data cell received reaches preset value, using forward error correction coding algorithm according to receiving
Multiple data cells obtain the software upgrade data;The data cell includes upgrade server by the software upgrade data
The multiple original data units and upgrade server got are using the forward error correction coding algorithm according to the initial data list
Multiple verification data units that member obtains.
Above-mentioned forward error correction (Forward Error Correction, FEC) encryption algorithm can be described as a kind of increase and pass
Transmission of data redundancy improves the algorithm of transmission reliability.By the algorithm, terminal device does not need to receive upgrade server
Transmitted all data cells can also restore whole initial data transmitted by upgrade server, i.e., in communication process
It can allow packet loss.Meanwhile the multiple data cells received can be also used for carrying out error correction to the initial data received, with
Further improve the reliability of transmission process.
On the other hand, in order to ensure the reliability of data transmission, above-mentioned steps 303:According to the multiple number received
The software upgrade data is obtained according to unit, the following step being not shown in figure can also be included:
When according to the multiple data cells received correct software upgrade data cannot be obtained, perform in following operation
It is one or more:
Error correction is carried out to obtained software upgrade data using forward error correction coding algorithm;
The multiple data cell having been received by is abandoned, and continues to upgrade server with the communication mode of multicast
The multiple data cells sent;
Send corresponding data unit transmission request to upgrade server or other-end equipment so that upgrade server or
Other-end equipment returns to data cell corresponding with the software upgrade data.
Specifically, based on above-mentioned forward error correction (Forward Error Correction, FEC) encryption algorithm, Ke Yi
Carry out correction process when cannot obtain correct software upgrade data to it, for example, using the multiple data cells for having redundancy come according to
Error correction is carried out according to forward error correction coding algorithm or attempts to obtain using the combination of a variety of multiple data cells correct
Software upgrade data.Alternatively, terminal device can also abandon the data cell that cannot obtain Correct software upgrading data, and continue
Multiple data cells that server is sent repeatedly are received, so as to which data cell caused for various reasons can equally be caused to lose
It loses or mistake can again receive in the data cell transmission process of next round, with the further reliability for ensureing communication.
In the case where above two mode fails, it can also send and correspond to upgrade server or other-end equipment
Data unit transmission request, on the one hand can obtain software upgrade data, the opposing party by collecting the data cell of missing
Face (can also be obtained with other transmission modes to obtain software upgrade data in the reliability of the transmission of the above method again
During guarantee, the probability that such case occurs can be fairly small, thus will not increase considerably the load of communication network on the whole).
In a preferred embodiment of the invention, software upgrading is obtained at upgrade server with the communication mode of multicast
The idiographic flow of data is as described below (with setting software upgrade data file and the IP of the multiple terminal devices as connection object
Location is given):
In file hierarchy, upgrade server is for software upgrade data file (or software upgrade data file mesh
Record), can first carry out fragment processing, such as by all software upgrade data files be divided into the identical file fragment of multiple sizes (when
The size for so having permitted file segment may be different, can be standardized by such as adding the conventional means of clear data
Or specially treated, similar situation hereafter repeat no more).It, can be in file fragment in order to ensure the reliability of communication
Check information is added, for example the file integrality check code and cyclic redundancy check that are generated according to file fragment encode, with life
Into the file transmission unit in file hierarchy.It, can be with after each file transmission unit is obtained for each terminal device
Utilize the file fragment that check information verifies and the consistency of original document segment.If there is a situation where it is inconsistent, can be with
This document transmission unit is abandoned to lay equal stress on new transmission;If verification can pass through, obtained file fragment is stored, it is to be obtained
Original software upgrade data file is obtained by the contrary operation of fragment again after All Files segment.It is then above upgrading and end
Process flow of the end equipment in file hierarchy.
In data hierarchy, upgrade server by each file transmission unit be divided into multiple sizes it is smaller, suitable for it is preceding to
The data block of Error Correction of Coding, such as size is multiple data blocks of 64KB.For each data block, further according to forward error correction
Coding generates the original data units and verification data unit of multiple same sizes, such as the initial data list of 64 1024 bytes
The error correction data unit of member and 64 1024 bytes (can make the number of original data units and the number phase of verification data unit
With to obtain preferable the file transmission reliability and smaller data redudancy).When carrying out forward error correction coding, it is based on
Coding standard can select Reed-Solomon coding standards.Principle based on forward error correction coding is 128 for above-mentioned sum
A data cell, most 64 original data units or verification data unit can be tolerated by receiving the terminal device of data cell
Lose simultaneously, that is, receive these data cells terminal device can by corresponding data convert algorithm according to sum at least
Original data units and verification data unit for 64 obtain original data block.It is then upgrade server and terminal device above
Process flow in data hierarchy.
On transmission level, upgrade server will multiple data corresponding with each data block with the communication mode of ip multicast
Unit is transferred to terminal device (be located at each data packet on communication link and include the data cell for having added protocol information head), eventually
End equipment is then prepared by the data cell received for restoring data block.
Specifically, upgrade server can be using original data units or verification data unit as the load of communication protocol head
It is sent to the multiple terminal devices specified simultaneously, and next round is and then sent after a wheel has been sent, Infinite Cyclic is gone down directly
To this process of upgrade server active termination.I.e.:Next data sheet is and then sent after a data cell has been sent
Member is sent until entire data block, and next number is and then sent after all data cells for having sent data block
It, can be again after all data blocks for having sent a file transmission unit according to block until entire file transmission unit is sent
All data blocks in this file transmission unit are retransmitted, until this process of upgrade server active termination.Certainly, on
State ip multicast communication protocol can there are many kinds of, such as asynchronous layered coding agreement etc., but these agreements all meet it is same
A essential characteristic:The entire chain road of communication process only exists a data, without more parts of identical data of simultaneous transmission.
Meanwhile the document transmission process of following manner control terminal equipment may be used in upgrade server:In communication protocol
" transmission ", " will stop " and " stop send " three classes mark is added in head, " current file transmission unit is for representative respectively
Newly send, terminal device should receive ", " current file transmission unit has been sent, if terminal device has received
Can stop receiving " and " terminal device should stop receiving immediately ".Upgrade server when sending file transmission unit can first to
The mark of data cell addition " transmission ";In all data for all data blocks for having sent this document transmission unit
After unit, before transmission data unit is stopped, to data cell addition " will stop " mark;And it is being finally stopped hair
When sending, to the mark of data cell addition " stopping sending ".Correspondingly, it is identified if terminal device is received with " transmission "
Data cell, then the data cell received is stored in the mark with the data cell according to the information in communication protocol head
Corresponding position, and after enough data cells are received by data convert algorithm come restoring data block;If terminal device
The data cell with " will stop " mark is received, then detects whether to have been obtained for all in this document transmission unit
Data block, if then stopping receiving;If terminal device receives the data cell with " stopping sending " mark, stop at once
Only receive and carry out exception treatment (such as to neighbouring communication node or upgrade server request be transmitted without being properly received again
File transmission unit).
It is above process flow of the upgrade server with terminal device on transmission level.
As it can be seen that the technical solution of the embodiment of the present invention illustrates on file hierarchy, data hierarchy and transmission level respectively
The specific embodiment of the above method so that only exist at most several parts of same data on entire communication link, thus subtract significantly
Lack occupancy of the software upgrade data distribution procedure to the communication resource, reduce the load of communication network.
Based on same inventive concept, an embodiment of the present invention provides a kind of communication server, it is shown in Figure 4 go out knot
Structure block diagram, the communication server include:
Unit 41 is established, is connected for establishing with the long of at least one terminal device;
Transmitting element 42, for including the message of software version information to terminal device transmission, so that the terminal
Equipment judges whether to need to carry out software upgrading according to the software version information, if then with the communication mode of multicast from upgrading
Software upgrade data is obtained at server.
As it can be seen that due to the distribution instructed using long connection mode, the embodiment of the present invention can be by making communication service
Device establishes long connection the communication server to be made to replace the distribution of control centre's software upgrade instruction, so as to control with terminal device
Center processed does not need to continually establish and close short connection with great amount of terminals equipment, thus software upgrade instruction distribution will not occupy
The vast resources of control centre;And long connection frequently will not be established and be closed, and it is every can to ensure that instruction is promptly distributed to
One terminal reduces delay in time between the sending out and perform of instruction.So the embodiment of the present invention can solve software liter
Grade instruction distribution delay is big and needs to occupy control centre's vast resources problem, and execution efficiency is high and operability is strong.
In addition, the communication server of the present embodiment can perform the flow in aforementioned embodiment of the method shown in FIG. 1, this reality
Example is applied not to be described in detail herein.
In addition, corresponding to the example of above-mentioned heartbeat data packets, the transmitting element can be further used for periodically to described
Terminal device sends the heartbeat data packets for including software version information, so that the terminal device is according to the software version information
Judge whether to need to carry out software upgrading, if then obtaining software upgrading number at upgrade server with the communication mode of multicast
According to.
So as to, when terminal device receives the heartbeat data packets including software version information each time, can be carried out be
The no judgement for needing to carry out software upgrading, compares and individually carries out the transmission for including the message of software version information, Ke Yijin
Reduce to one step the work load of the communication server.
Based on same inventive concept, the present invention also provides a kind of terminal device, it is shown in Figure 5 go out structural frames
Figure, the terminal device include:
Unit 51 is established, for being connected with the long of the communication server;
Receiving unit 52, for receiving the message for including software version information from the communication server;
Judging unit 53, the software version information for being received according to the receiving unit 52 judge whether needs
Carry out software upgrading;
Execution unit 54, for when the judgement of judging unit 53 needs to carry out software upgrading with the communication mode of multicast from liter
Software upgrade data is obtained at grade server.
Wherein, the terminal device that the embodiment of the present invention is provided can pass through interaction with any one above-mentioned communication server
Complete the distribution of software upgrade instruction, and the flow in executable aforementioned embodiment of the method shown in Fig. 2, the present embodiment is not
It is described in detail herein.
In one embodiment of the invention, above-mentioned execution unit 54 can specifically include following knots as shown in Figure 6
Structure:
Module 61 occurs, for obtaining software upgrade data at upgrade server with the communication mode of multicast;
Receiving module 62, it is described for receiving multiple data cells that upgrade server is sent with the communication mode of multicast
Data cell is the mark with the software upgrade data in the software upgrading request message of upgrade server generation
Know corresponding data cell;
Processing module 63, for obtaining the software upgrade data according to the multiple data cell received.
Using above-mentioned technical proposal, upgrade server only need by size can reach the software upgrade data of tens GB with
The communication mode of multicast is sent to multiple terminals, and one of which is it may is that upgrade server tears life open according to software upgrade data
Multiple network nodes are given after into multiple data cells so that are mutually connected with other network nodes again after network node replicate data
Nothing so that data cell can be in netted diffusion in a communication network, and only exist a software upgrading in entire communication link
The data volume of data, thus the communication resource in network can be made full use of, avoid the net caused by point-to-point transmission mode
Network congestion improves the efficiency of transmission of software upgrade data.
Further, corresponding to the example of above-mentioned heartbeat data packets, the receiving unit 52 can be further used for receiving
The heartbeat data packets for including software version information that the communication server is periodically sent.Certainly, heartbeat data packets are being received
Afterwards, terminal device can be carried out the judgement for whether needing to carry out software upgrading, can also feed back its judging result in the response,
So as to which control centre be allow rapidly to be collected into the software upgrading situation of all terminal devices.
On the other hand, the processing module 63 can be further used for reaching default in the number of the data cell received
During value, the software upgrade data is obtained according to the multiple data cells received using forward error correction coding algorithm;The number
The multiple original data units and upgrade server got according to unit including upgrade server by the software upgrade data utilize
Multiple verification data units that the forward error correction coding algorithm is obtained according to the original data units.
Above-mentioned forward error correction (Forward Error Correction, FEC) encryption algorithm can be described as a kind of increase and pass
Transmission of data redundancy improves the algorithm of transmission reliability.By the algorithm, terminal device does not need to receive upgrade server
Transmitted all data cells can also restore whole initial data transmitted by upgrade server, i.e., in communication process
It can allow packet loss.Meanwhile the multiple data cells received can be also used for carrying out error correction to the initial data received, with
Further improve the reliability of transmission process.
Further, the processing module 63 can be also used for obtain just according to the multiple data cells received
During true software upgrade data, perform one or more in following operation:
Error correction is carried out to obtained software upgrade data using forward error correction coding algorithm;
The multiple data cell having been received by is abandoned, and continues to upgrade server with the communication mode of multicast
The multiple data cells sent;
Send corresponding data unit transmission request to upgrade server or other-end equipment so that upgrade server or
Other-end equipment returns to data cell corresponding with the software upgrade data.
Specifically, based on above-mentioned forward error correction (Forward Error Correction, FEC) encryption algorithm, Ke Yi
Carry out correction process when cannot obtain correct software upgrade data to it, for example, using the multiple data cells for having redundancy come according to
Error correction is carried out according to forward error correction coding algorithm or attempts to obtain using the combination of a variety of multiple data cells correct
Software upgrade data.Alternatively, terminal device can also abandon the data cell that cannot obtain Correct software upgrading data, and continue
Multiple data cells that server is sent repeatedly are received, so as to which data cell caused for various reasons can equally be caused to lose
It loses or mistake can again receive in the data cell transmission process of next round, with the further reliability for ensureing communication.
In the case where above two mode fails, it can also send and correspond to upgrade server or other-end equipment
Data unit transmission request, on the one hand can obtain software upgrade data, the opposing party by collecting the data cell of missing
Face (can also be obtained with other transmission modes to obtain software upgrade data in the reliability of the transmission of the above method again
During guarantee, the probability that such case occurs can be fairly small, thus will not increase considerably the load of communication network on the whole).