Invention content
The brief overview about the present invention is given below, in order to provide the basic reason about certain aspects of the inventionSolution.It should be appreciated that this general introduction is not the exhaustive general introduction about the present invention.It is not intended to determine the key of the present inventionOr pith, nor is it intended to limit the scope of the present invention.Its purpose only provides certain concepts in simplified form, withThis is as the preamble in greater detail discussed later.
To solve the above problems, the present invention proposes a kind of SCM Based sensor node remote upgrade method.
A kind of SCM Based sensor node remote upgrade method, including:
Establish the communication connection of server and sensor node;
Sensor node detects whether to receive the version number of the more new application of server transmission and total packet number;
If it is, the version number of more new application and total packet number described in sensor node return;
After server receives version number and the total packet number of the more new application, more new procedures are packet-by-packet issued;
Sensor node indicates to be 1 to update after having received more new procedures;
Sensor node detects the update mark when being 1, deletes former application program, and more new procedures described in reading intoRow upgrading, juxtaposition update are identified as 0.
SCM Based sensor node remote upgrade method provided by the invention, can effectively to distance sensor intoRow is safeguarded.
Specific embodiment
Illustrate the embodiment of the present invention with reference to the accompanying drawings.It is retouched in the attached drawing of the present invention or a kind of embodimentThe elements and features stated can be combined with elements and features illustrated in one or more other drawings or embodiments.It should be noted that it in order to understand purpose, is omitted known to unrelated to the invention, those of ordinary skill in the art in attached drawing and explanationComponent and processing expression and description.
With reference to figure 1 and Fig. 2, the present embodiment provides a kind of SCM Based sensor node remote upgrade method, including:
Step S101 establishes the communication connection of server and sensor node;
Step S102, sensor node detect whether to receive the version number of the more new application of server transmission and totalPacket number;
Step S103, if it is, the version number of more new application and total packet number described in sensor node return;
Step S104 after server receives version number and the total packet number of the more new application, packet-by-packet issues updateProgram;
Step S105, sensor node indicate to be 1 to update after having received more new procedures;
Step S106, sensor node detects the update mark when being 1, deletes former application program, and described in readingMore new procedures are upgraded, and juxtaposition update is identified as 0.
Specifically, sensor node software is divided into bootstrap and application program two parts.Sensor node is started to workWhen Bootloader, bootstrap is for judging whether there is program update, will be new if update original program erasingProgram is written, and starts new application program, does not update and directly initiate original application program;Application program is current for being responsible forThe whole flow process control of sensor node, the data storage of acquisition, processing, transmission and remote upgrade including data and markWill updates.
Sending instructions under server end makes sensor node Connection Service device, and server end detects the company of sensor nodeIt connects, issues the version number of more new application and total packet number, sensor detects version number and the Zong Bao of the more new applicationIt is several, it is returned, server packet-by-packet issues more new procedures, and sensor node is received after each packet more new procedures to describedServer carries out response, and the data packet of more new procedures is stored in specified region, when sensor node has received more new proceduresAfter disconnect, and to mark is updated for 1, restart sensor node software, into bootstrap, bootstrap detects moreWhether new logo is 1, if it is, former application program is deleted, new application program from memory block is read, puts update markIt is 0.
If the sensor node response is incorrect or without response, server takes repeating transmission measure, more than default timeAfter number retransmits failure, this upgrading failure is judged.
If upgrading failure, the communication connection with sensor is established again, and sensor node is received updated journey with last timeWhen sequence version is consistent, paid-in packet number and current version are back to server, server is unwrapped the beginning and issued from next.
SCM Based sensor node remote upgrade method provided by the invention, can effectively to distance sensor intoRow is safeguarded.
Although the present invention and its advantage is described in detail it should be appreciated that without departing from by appended claimVarious changes, replacement and transformation can be carried out in the case of the spirit and scope of the present invention limited.Moreover, the model of the applicationEnclose the specific embodiment for being not limited only to the described process of specification, equipment, means, method and steps.In the art is commonTechnical staff performs and corresponding reality described herein from the disclosure it will be readily understood that can be used according to the present inventionApply the essentially identical function of example or obtain process essentially identical with it result, existing and that future is to be developed, equipment,Means, method or step.Therefore, appended claim purport includes such process, equipment, hand in the range of themSection, method or step.