CN111309363A - Contiki operating system-based online upgrading method and device - Google Patents

Contiki operating system-based online upgrading method and device Download PDF

Info

Publication number
CN111309363A
CN111309363A CN202010154073.1A CN202010154073A CN111309363A CN 111309363 A CN111309363 A CN 111309363A CN 202010154073 A CN202010154073 A CN 202010154073A CN 111309363 A CN111309363 A CN 111309363A
Authority
CN
China
Prior art keywords
flash memory
operating system
packet
contiki
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010154073.1A
Other languages
Chinese (zh)
Inventor
于良波
李云
苏开荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing University of Post and Telecommunications
Original Assignee
Chongqing University of Post and Telecommunications
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing University of Post and Telecommunications filed Critical Chongqing University of Post and Telecommunications
Priority to CN202010154073.1A priority Critical patent/CN111309363A/en
Publication of CN111309363A publication Critical patent/CN111309363A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/656Updates while running

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention belongs to the technical field of embedded equipment, and particularly relates to an online upgrading method and device based on a Contiki operating system; the method comprises the steps that a sink node sends a Contiki operating system upgrading program data packet to each target node through a Deluge file transmission protocol; dividing a Flash memory into an external Flash memory and an internal Flash memory; a bootstrap program is preset on the internal Flash memory, and when the internal Flash memory is started, whether an upgrading program exists in the external Flash memory is detected; if not, the original operating system in the internal Flash memory is guided to start; if yes, detecting an updating instruction mark, copying an upgrading program of an external Flash memory into an internal Flash memory according to the read file length after confirming that an updating instruction is received, and replacing an original operating system by a mirror image; and realizing online upgrading. The invention greatly facilitates the upgrading of mass programs in the future.

Description

Contiki operating system-based online upgrading method and device
Technical Field
The invention belongs to the technical field of embedded equipment, and particularly relates to an online upgrading method and device based on a Contiki operating system.
Background
The Wireless Sensor Network (WSN) is a multi-hop, self-organizing network, which is composed of a certain number of Sensor nodes with small volume, low power consumption and low cost, and can be used for monitoring and forecasting the environment or infrastructure in a certain area. The intelligent home gateway also plays an important role in the field of Internet of things such as intelligent home, intelligent transportation and intelligent medical treatment. Along with the large-scale deployment of the wireless sensor network, the function upgrading, changing and BUG (BUG) repairing of the nodes are inevitable, the remote updating technology of the wireless mode does not need to fetch the nodes and rewrite programs, time and labor are saved, and the method is particularly significant for the wireless sensor network nodes arranged in remote or dangerous areas. Meanwhile, the flexible remote updating mode can meet the diversified requirements of the Internet of things.
The Contiki operating system is an open-source and highly-portable multi-task operating system, is suitable for a networking embedded system and a wireless sensor network, has very good portability and extremely low requirement on hardware, and can be operated on hardware platforms such as an 8051 singlechip, an MSP430, an AVR, an ARM, a PC and the like.
While remote updates to the Contiki operating system need to satisfy the following requirements: convenient use, safety, reliability and expandability. Colloquially, when a node needs to be updated, two problems need to be solved:
first, how to transfer data (e.g., system images, configuration files, applications) to the sensor nodes.
And secondly, how to update the sensor nodes.
The former is called code distribution protocol and the latter is called node side design. Remote update designs can be generally divided into three categories:
1. whole code image replacement: the method has the advantages of simplicity, reliability and easiness in implementation, and has the defect that for the sensor nodes with limited resources, the whole image needs to occupy a large amount of storage space of the nodes.
2. Only different codes are replaced: its advantages are minimal data transmission and low power consumption. The disadvantages are also obvious, an accurate algorithm is needed to find the difference between the original mapping and the new mapping, in addition, extremely complex node end design is needed, and the application range is narrow.
3. Based on module replacement: for the operating system with the modular design, the module is replaced by the unit, and similar to Linux dynamic module loading, corresponding operating system support with the modular design is required.
Disclosure of Invention
Based on the problems in the prior art, the invention mainly considers the whole code image replacement based on the Contiki Internet of things operating system, is simple to realize and is not easy to make mistakes in updating, because the online upgrading scheme of the Contiki operating system does not appear in the prior art.
In a first aspect of the present invention, the present invention provides an online upgrade method based on a Contiki operating system, the method comprising:
the sink node sends a data packet of an upgrading program of the Contiki operating system to each target node through a Deluge file transmission protocol;
the target node divides a Flash memory in a control module of the target node into an external Flash memory and an internal Flash memory in advance;
presetting a bootstrap program on an internal Flash memory, and detecting whether an upgrade program of a Contiki operating system exists in an external Flash memory when the bootstrap program is started;
if not, the original Contiki operating system in the internal Flash memory is guided to start;
if yes, detecting an update instruction mark, copying an upgrading program of a Contiki operating system stored in an external Flash memory into an internal Flash memory by a target node according to the read file length, namely the size of a mirror image, and replacing the original Contiki operating system with the mirror image after confirming that the update instruction is received; and realizing online upgrading.
In a second aspect of the present invention, the present invention provides an online upgrade apparatus based on a Contiki operating system, including:
the Deluge file transmission module is used for receiving a data packet of an upgrading program of the Contiki operating system;
the control module is used for dividing the external Flash memory and the internal Flash memory and replacing the original Contiki operating system by the mirror image;
the detection module is used for detecting whether an upgrading program of a Contiki operating system exists in an external Flash memory and detecting whether an updating instruction is received;
the external Flash memory is used for storing an upgrading program of the Contiki operating system;
and the internal Flash memory is used for storing the bootstrap program.
Preferably, the control module is generally an MCU, and may further include a wireless radio frequency transceiver module. In a third aspect of the present invention, the present invention further provides a single chip microcomputer, where the single chip microcomputer includes the above online upgrade apparatus.
The invention has the beneficial effects that:
the invention has convenient and reliable use and simple operation, and can be widely applied to the project of embedded system development. The scheme overcomes the defect that the conventional embedded system updates the program, greatly facilitates the upgrading of large-scale programs in the future and is beneficial to the development and maintenance work of engineering projects. In addition, the solution has a relatively sophisticated protection mechanism, which protects against unexpected situations when the program is updated. Because the program is divided into two areas for storage in the Flash, one internal Flash memory and one external memory, the program in the other area is erased only after the program in the memory in one area is updated, and the program loss is avoided.
Drawings
FIG. 1 is a flow chart of an online upgrade method based on a Contiki operating system according to the present invention;
FIG. 2 is a flow chart of data transmission using NACK (negative acknowledgement) mechanism in the present invention;
FIG. 3 is a flow chart of a process of a sink node transmitting data to a target node in the present invention;
FIG. 4 is a flow chart of a sink node sending a transmission instruction to a target node according to the present invention;
FIG. 5 is a flow chart of a target node receiving a transmission instruction of a sink node in accordance with the present invention;
FIG. 6 is a control module diagram employed by embodiments of the present invention;
FIG. 7 is a partition distribution diagram of a Flash memory according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more clearly and completely apparent, the technical solutions in the embodiments of the present invention are described below with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
As shown in FIG. 1, in an embodiment of the online upgrade method based on the Contiki operating system of the present invention, the method includes the following steps:
the sink node sends a data packet of an upgrading program of the Contiki operating system to each target node through a Deluge file transmission protocol;
the target node divides a Flash memory in the control module into an external Flash memory and an internal Flash memory in advance;
presetting a bootstrap program on an internal Flash memory, and detecting whether an upgrade program of a Contiki operating system exists in an external Flash memory when the bootstrap program is started;
if not, the original Contiki operating system in the internal Flash memory is guided to start;
if yes, detecting an update instruction mark, copying an upgrading program of a Contiki operating system stored in an external Flash memory into an internal Flash memory by a target node according to the read file length after confirming that the update instruction is received, and replacing the original Contiki operating system by a mirror image; and realizing online upgrading.
For the data packet of the upgrading program of the Contiki operating system sent by the sink node to each target node through the Deluge file transmission protocol:
receiving an upgrading program of a Contiki operating system between nodes (a sink node-a target node) through a remote communication technology; in general, when an embedded device (target node) of a wireless sensor node operates, the embedded device may be connected to an external device through a network or may not be connected to the external device. However, when upgrading the software therein, especially in remote upgrade, the embedded device must be connected with an external server or terminal (sink node) through a network, and the software upgrade of the embedded device is realized by operating on the server or terminal (that is, the software installed on the embedded device is replaced by the older version with the latest version of the software stored on the server or PC). In the process, the server or the PC is used as an upper computer, and the embedded device is used as a lower computer, and the server or the PC is connected with the lower computer through a network.
In one embodiment, a NACK (negative acknowledgement) mechanism is used to implement packet loss retransmission in order to improve transmission reliability. As shown in fig. 2, the process is performed as follows:
s11, the sink node divides the upgrade program of the Contiki operating system into a plurality of data packets and transmits the data packets as a unit;
s12, adding a plurality of field packet heads before the data packet to show the current packet sequence number and the total number of the transmission packets, and adding a parity check bit at the tail of the data packet;
s13, the target node compares whether the received sequence numbers of the two adjacent packets are continuous packet sequence numbers, so as to judge whether packet loss occurs;
for example, if the packet sequence number received this time is N, and the packet sequence number received next time is not N +1, it can be determined that the packet is lost.
S14, if no packet loss occurs, continuing to judge that the target node can pass the parity check;
s15, if packet loss or error check occurs, the target node sends an information request to the sink node for retransmission;
and S16, when the packet sequence number is equal to the total number of the transmission packets, judging that the transmission is finished.
In a more preferred embodiment of the present invention,
as shown in fig. 3, the process of the sink node transmitting data to the target node further includes:
s111, the target node judges the type of the received data packet, if the data content is the data content of the upgrading program, a packet sequence number field is checked, if the sequence number of the data packet with the packet loss is not in sequence but the data is correctly verified, the data packet is stored in an external Flash memory of the target node, packet loss information, namely the packet sequence number, is periodically sent to the sink node, and the step S112 is carried out; if the sequence numbers of the data packets received by the target node are arranged in sequence and verified correctly, the data packets are stored into an external Flash memory of the target node in sequence; the process advances to step S117;
s112, after receiving the packet loss information, the sink node records the information of the target node and continues to send data packets to the target node in sequence;
s113, judging whether the packet loss number in the network reaches a specified threshold, if so, entering a step S114, otherwise, entering a step S116;
s114, when the packet loss number in the network reaches a specified threshold value, the sink node sends a data transmission pause instruction, and retransmits a data packet to a target node with packet loss according to packet loss information;
s115, the target node with packet loss receives the retransmitted data packet, continues to check the packet sequence number, if the data packet is missing from the target node, the data packet is stored in a corresponding space in an external Flash memory of the target node, and if all the data packets are correctly received, the periodic transmission of the packet loss information is stopped; otherwise, the sink node forwards the data packet;
s116, when the packet loss number is lower than a set specified threshold, the sink node sends a continuous transmission instruction, sends data packets which are not transmitted to the target node, judges whether the transmission of all the data packets is finished, if so, the step S117 is carried out, otherwise, the step S113 is returned;
s117, if the target nodes still send packet loss information, the sink nodes respectively establish unicast links with the target nodes in sequence and carry out point-to-point transmission until no target node sends packet loss information in the network;
s118, before the transmission is finished, the sink node sends a node transmission state instruction, and the target node sends the serial number of the last data packet after receiving the instruction, so that whether all the target nodes correctly receive the data packets is judged, and if the serial number is wrong, the step S117 is executed; if any target node does not feed back any information, adopting exception management;
s119, the sink node sends a transmission ending instruction, and the target node starts a bootstrap program to update the Contiki operating system upgrading program.
In particular, the method comprises the following steps of,
for the process of sending the transmission instruction by the sink node, reference may be made to the process shown in fig. 4:
step 101, a sink node sends a transmission instruction;
step 102, judging whether packet loss information exists or not, if so, entering step 103, otherwise, entering step 110;
step 103, recording packet loss information;
step 104, judging whether the packet loss information is greater than a threshold value A, if so, entering step 105, otherwise, entering step 109;
step 105, sending a transmission pause instruction;
step 106, packet loss retransmission is carried out;
step 107, judging whether the packet loss number is smaller than a threshold value B, if so, entering step 108, otherwise, returning to step 106;
step 108, sending a continuous transmission instruction;
step 109, transmitting the next data packet;
step 110, judging whether the data transmission is finished, if so, entering step 111, otherwise, returning to step 101;
step 111, performing point-to-point transmission on the target node which does not complete receiving;
and step 112, after the transmission completion instruction is sent, the flow is ended.
For the process of receiving the transmission instruction by the target node, reference may be made to the process shown in fig. 5:
step 201, the node enters a transmission state, and the target node starts to receive data from the sink node; of course, the data may be transmitted in the form of data packets by means of the deluge file protocol;
step 202, the target node enters a channel to monitor;
step 203, judging whether the received packet is of a data type, if not, entering step 204, otherwise, entering step 206;
step 204, judging whether the data type transmits a completion instruction, and if the data type transmits the completion instruction, ending the process; otherwise, go to step 205;
step 205, executing the instruction, and returning to step 202;
step 206, judging whether the target node has packet loss, if not, entering step 207, otherwise, entering step 210;
step 207, judging whether the data check in the data packet is correct, if so, entering step 208, otherwise, entering step 210;
step 208, storing the data into a corresponding address according to the packet sequence number;
step 209, determining whether the target node correctly receives the transmitted data packet, if so, returning to step 202, otherwise, entering step 210;
step 210, periodically sending packet loss information, and returning to step 202.
It can be understood that the nodes in the present invention include a sink node and a target node, where the sink node is used to transmit the upgrade programs of the contiki operating system, and the target node is used to receive the upgrade programs and perform the upgrade under certain instructions, and of course, the nodes in the present invention are generally wireless sensor nodes.
Further, if the packet loss sequence numbers are not in sequence but the data is checked correctly in step (1), the method further includes offsetting the storage address by one or more data packet sizes for complementing the storage address of the lost data packet.
In one embodiment, the data transmission of the design adopts a Deluge file transmission protocol, which is one of distribution protocols, and can divide a large block of data into a plurality of pages of data, then divide each page of data into a plurality of data packets, transmit one data packet each time, transmit the next page after one page is transmitted, and have waiting time in the transmission gap. And sending the large block program to the target node through decomposition of the program.
Specifically, the data frame structure adopted by the Deluge file transfer protocol in this embodiment includes:
(1) data type, indicating whether the data packet is data content or control command: for example, 0xF0 represents data content, 0xF1 represents suspension of data transfer, 0xF2 represents continuation of data transfer, 0xF3 represents stop of transfer, 0xF4 represents completion of transfer, and 0xF5 represents transfer status. When the network packet loss is serious, the updating progress is controlled through the field.
(2) The packet sequence number is used as a basis for the node to judge packet loss and data reassembly, and if the packet content is a control command, the field is 0.
(3) The data packet content is specific data content and comprises an update file of an upgrading program of a contiki operating system;
(4) data verification; the present invention uses a CRC check.
In an embodiment, this embodiment provides an online upgrade apparatus based on a Contiki operating system, including:
the Deluge file transmission module is used for receiving a data packet of an upgrading program of the Contiki operating system;
the control module is used for dividing the external Flash memory and the internal Flash memory and replacing the original Contiki operating system by the mirror image;
the detection module is used for detecting whether an upgrading program of a Contiki operating system exists in an external Flash memory and detecting whether an updating instruction is received;
the external Flash memory is used for storing an upgrading program of the Contiki operating system;
and the internal Flash memory is used for storing the bootstrap program.
In one embodiment, for a target node, pre-dividing a Flash memory in a control module into an external Flash memory and an internal Flash memory mainly includes:
as shown in fig. 6 and 7, in the present embodiment, an STM32F103 is adopted as a control module, i.e., a single chip microcomputer; the Contiki operating system is preset in an internal Flash device of the STM32F103 with 512K starting from the address 0x08000000, the W25Q16 is an 8M external Flash memory for storing a system program to be updated, and the transceiver module selects SX 1278. Except for a common SPI interface, an SX1278 frame starting signal, an SX1278 frame ending signal and an FIFO overflow signal are transmitted through the GPIO interface between the master control and the wireless radio frequency transceiver, so that the communication speed is high, the inquiry of an MCU is avoided, and the node has better performance.
Dividing Flash in an internal Flash memory, namely STM32, putting a 32K BOOT bootstrap BOOT into an address starting from 0x08000000, and shifting back a preset Contiki, wherein the address starts from 0x 08008008000.
When STM32 starts, firstly, BOOT program is executed, whether Contiki of new version exists in external Flash device (W25Q16) is detected, if no, original Contiki in internal Flash is guided to start, if yes, updating instruction mark is detected, if updating instruction is received, the new version Contiki is copied to internal Flash according to read file length, namely mirror image size, and old system is covered.
The external Flash memory comprises a read-write memory and a file memory, wherein the read-write memory is used for storing an upgrading program of the Contiki operating system, and the file memory is used for storing files of the Contiki operating system and at least comprises a dynamic application module.
Specifically, the external Flash memory is divided into two areas, one of which is directly read and written and is used for storing an upgrading program of a Contiki operating system, namely a new version system; and another file system, which is Contiki, for storing dynamic application modules and other data.
The method comprises the following steps that a bootstrap program is preset on an internal Flash memory, and when the bootstrap program is started, whether an upgrade program of a Contiki operating system exists in an external Flash memory or not is detected, wherein the bootstrap program comprises the following steps:
the BOOT program performs the following functions:
(1) the version function is detected. Reading the first two bytes to obtain a version number;
(2) a copy function. Copying data of the external Flash to Flash of the STM 32;
(3) and (4) a jump function. And jumping from the BOOT program to a mirror image address to execute the Contiki, and firstly relocating an interrupt vector table of the Contiki to avoid calling an interrupt function of the BOOT program when the Contiki is interrupted. The stack is then initialized for use by the C program. Finally, copying the Contiki operation address to an instruction register to complete the jump.
The BOOT program BOOT is a firmware program for the embedded system to complete the loading and starting task, and the embodiment mainly applies the BOOT program to the contiki operating system update of each target node, i.e. each wireless sensor node. And (3) solidifying a BOOT program at the initial position of the program, normally guiding the system to start, and replacing the old system with the new system mirror image when detecting that the system has a new version and receiving an updating instruction to realize system updating.
The system image contains 5 parts: version number, update flag, file length, check code and mirror image content. The version number of 1 byte represents the version of the system image in the current Flash and is a mark for judging whether to execute updating; the 1 byte updating mark is used for controlling the updating time, setting after receiving an updating instruction, and detecting the version number and the field to determine whether to update when starting next time; a file length of 4 bytes represents the mirror size; and the CRC is used for checking the received mirror image, and the received mirror image is checked for two times in total, wherein the first time is to compare the received mirror image calculation CRC with a check code sent by the sink node, and the other time is to calculate the CRC again before updating, so that the memory is prevented from being possibly damaged by external factors (such as static electricity).
In a specific embodiment, the following is the actual operation method of the remote online upgrade scheme based on the Contiki operating system:
1. and opening the serial port debugging assistant software to generate a software interface.
2. And sending a corresponding file writing instruction in a serial port debugging assistant window, enabling the sink node to enter a file receiving mode, clicking a file sending option of the serial port debugging assistant, selecting a system upgrading program to be transmitted, and then clicking to confirm to send.
3. After the sink node successfully receives the system upgrade program, the sink node sends a corresponding update instruction in the serial port debugging assistant window, the sink node transmits the system upgrade program to a target node to be upgraded through a corresponding remote communication technology after receiving the system upgrade program, and the target node sends the upgraded system version number after successfully upgrading and displays the system version number in the serial port debugging assistant window, namely the upgrade is successful.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: ROM, RAM, magnetic or optical disks, and the like.
The above-mentioned embodiments, which further illustrate the objects, technical solutions and advantages of the present invention, should be understood that the above-mentioned embodiments are only preferred embodiments of the present invention, and should not be construed as limiting the present invention, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (8)

1. An online upgrading method based on a Contiki operating system is characterized by comprising the following steps:
the sink node sends a data packet of an upgrading program of the Contiki operating system to each target node through a Deluge file transmission protocol;
the target node divides a Flash memory in a control module of the target node into an external Flash memory and an internal Flash memory in advance;
presetting a bootstrap program on an internal Flash memory, and detecting whether an upgrade program of a Contiki operating system exists in an external Flash memory when the bootstrap program is started;
if not, the original Contiki operating system in the internal Flash memory is guided to start;
if yes, detecting an update instruction mark, copying an upgrading program of a Contiki operating system stored in an external Flash memory into an internal Flash memory by a target node according to the read file length, namely the size of a mirror image, and replacing the original Contiki operating system with the mirror image after confirming that the update instruction is received; and realizing online upgrading.
2. The online upgrade method based on the Contiki OS according to claim 1, wherein the sink node sending the data packet of the upgrade program of the Contiki OS to each destination node through the Deluge file transfer protocol comprises:
the sink node divides the upgrading program of the Contiki operating system into a plurality of data packets and transmits the data packets by taking the data packets as units;
adding a packet head of a plurality of fields in front of a data packet to represent the current packet serial number and the total number of transmission packets, and adding a parity check bit at the tail of the data packet;
the target node compares whether the received sequence numbers of the two adjacent packets are continuous packet sequence numbers or not so as to judge whether packet loss occurs or not;
if the packet loss does not occur, continuously judging that the target node can pass the parity check;
if packet loss or error check occurs, the target node sends an information request to the sink node for retransmission;
when the packet sequence number is equal to the total number of the transmission packets, the transmission is determined to be finished.
3. The Contiki-based online upgrade method according to claim 1 or 2, wherein the process of the sink node transmitting data to the target node further comprises:
(1) the target node judges the type of the received data packet, if the data content of the upgrading program is the data content of the upgrading program, a packet sequence number field is checked, if the sequence number of the data packet with the packet loss is not in sequence but the data is correctly verified, the data packet is stored in an external Flash memory, packet loss information, namely the packet sequence number, is periodically sent to the sink node, and the step (2) is carried out; if the sequence numbers of the data packets received by the target node are arranged in sequence and verified correctly, the data packets are stored into an external Flash memory of the target node in sequence; entering the step (7);
(2) after receiving the packet loss information, the sink node records the information of the target node and continues to send data packets to the target node in sequence;
(3) judging whether the packet loss number in the network reaches a specified threshold value, if so, entering the step (4), otherwise, entering the step (6);
(4) when the packet loss number in the network reaches a specified threshold value, the sink node sends a data transmission pause instruction, and retransmits a data packet to a target node with packet loss according to packet loss information;
(5) the target node with the lost packet receives the retransmitted data packet, continuously checks the packet serial number, if the data packet is missing from the target node, stores the data packet into a corresponding space in an external Flash memory of the target node, and if all the data packets are correctly received, stops periodically sending the lost packet information; otherwise, the sink node forwards the data packet;
(6) when the number of the lost packets is lower than a set designated threshold, the sink node sends a continuous transmission instruction, sends data packets which are not transmitted to the target node, judges whether the transmission of all the data packets is finished, if so, enters the step (7), otherwise, returns to the step (3);
(7) if the target nodes still send packet loss information, the sink node establishes unicast links with the target nodes respectively according to the sequence and carries out point-to-point transmission until no target node sends packet loss information in the network;
(8) before the transmission is finished, the sink node sends a node transmission state instruction, and the target node sends the sequence number of the last data packet after receiving the instruction, so that whether all the target nodes correctly receive the data packet is judged, and if the sequence number is wrong, the step (7) is executed; if any target node does not feed back any information, adopting exception management;
(9) the sink node sends a transmission ending instruction, and the target node starts a bootstrap program to update the Contiki operating system upgrading program.
4. The Contiki OS-based online upgrade method according to claim 3, wherein the step (1) further comprises offsetting the storage address by one or more packet sizes for complementing the storage address of the lost packet if the packet loss sequence number is out of order and the data is verified correctly.
5. The Contiki-based online upgrade method according to claim 3, wherein the packet type includes adopting field division as data content or control command; the data content adopts a 0xF0 field, and the control commands comprise a pause data transmission command adopting a 0xF1 field, a continue data transmission command adopting a 0xF2 field, a stop transmission command adopting a 0xF3 field, a transmission completion command adopting a 0xF4 field and a transmission state adopting a 0xF5 field.
6. The online upgrading method based on the Contiki operating system as claimed in claim 1, wherein the boot program is started up by the control module detecting the version function of the upgrading program of the Contiki operating system, reading the first byte to obtain the version number, copying the external Flash memory to the internal Flash memory; jumping to a mirror image address to execute a Contiki operating system, and relocating an interrupt vector table of the Contiki operating system; copying the operating address of the Contiki operating system to the instruction register to complete the jump.
7. An online upgrade device based on a Contiki operating system, comprising:
the Deluge file transmission module is used for receiving a data packet of an upgrading program of the Contiki operating system;
the control module is used for dividing the external Flash memory and the internal Flash memory and replacing the original Contiki operating system by the mirror image;
the detection module is used for detecting whether an upgrading program of a Contiki operating system exists in an external Flash memory and detecting whether an updating instruction is received;
the external Flash memory is used for storing an upgrading program of the Contiki operating system;
and the internal Flash memory is used for storing the bootstrap program.
8. The online upgrading device based on the Contiki operating system as claimed in claim 7, wherein the external Flash memory comprises a read-write memory and a file memory, the read-write memory is used for storing the upgrading program of the Contiki operating system, the file memory is used for storing the files of the Contiki operating system and at least comprises a dynamic application module.
CN202010154073.1A 2020-03-07 2020-03-07 Contiki operating system-based online upgrading method and device Pending CN111309363A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010154073.1A CN111309363A (en) 2020-03-07 2020-03-07 Contiki operating system-based online upgrading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010154073.1A CN111309363A (en) 2020-03-07 2020-03-07 Contiki operating system-based online upgrading method and device

Publications (1)

Publication Number Publication Date
CN111309363A true CN111309363A (en) 2020-06-19

Family

ID=71149560

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010154073.1A Pending CN111309363A (en) 2020-03-07 2020-03-07 Contiki operating system-based online upgrading method and device

Country Status (1)

Country Link
CN (1) CN111309363A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328560A (en) * 2020-11-25 2021-02-05 北京无线电测量研究所 File scheduling method and system
CN112579123A (en) * 2020-12-10 2021-03-30 珠海格力电器股份有限公司 Method for programming update program through USB interface and controller
CN113031868A (en) * 2021-03-24 2021-06-25 联想(北京)有限公司 Control method and device of memory
CN113114730A (en) * 2021-03-22 2021-07-13 深圳市晨北科技有限公司 Upgrading method and device, terminal equipment and storage medium
CN114924778A (en) * 2022-04-01 2022-08-19 北京遥测技术研究所 Program upgrading method based on ZYNQ redundant backup
CN114924778B (en) * 2022-04-01 2024-04-26 北京遥测技术研究所 Program upgrading method based on ZYNQ redundancy backup

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103259632A (en) * 2013-05-24 2013-08-21 上海大学 Wireless sensor network data reliable aggregation method based on continuous-collecting single-transmitting model
CN104090796A (en) * 2014-07-08 2014-10-08 成都万维图新信息技术有限公司 Embedded device program updating method and system
CN104768081A (en) * 2015-04-17 2015-07-08 武汉兴图新科电子股份有限公司 Packet loss retransmission method for achieving flow control
CN105573810A (en) * 2016-03-23 2016-05-11 重庆邮电大学 Remote upgrade method and remote upgrade device for wireless sensor network node
CN104038845B (en) * 2014-06-30 2017-10-17 新华三技术有限公司 Message transmitting method and device
CN109101261A (en) * 2018-08-06 2018-12-28 沈阳维尔环保工程有限公司 A kind of the remote online upgrade method and system of data acquisition transmission instrument terminal
WO2019120292A1 (en) * 2017-12-21 2019-06-27 南京德朔实业有限公司 Battery pack and method for data transmission between battery pack and electronic device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103259632A (en) * 2013-05-24 2013-08-21 上海大学 Wireless sensor network data reliable aggregation method based on continuous-collecting single-transmitting model
CN104038845B (en) * 2014-06-30 2017-10-17 新华三技术有限公司 Message transmitting method and device
CN104090796A (en) * 2014-07-08 2014-10-08 成都万维图新信息技术有限公司 Embedded device program updating method and system
CN104768081A (en) * 2015-04-17 2015-07-08 武汉兴图新科电子股份有限公司 Packet loss retransmission method for achieving flow control
CN105573810A (en) * 2016-03-23 2016-05-11 重庆邮电大学 Remote upgrade method and remote upgrade device for wireless sensor network node
WO2019120292A1 (en) * 2017-12-21 2019-06-27 南京德朔实业有限公司 Battery pack and method for data transmission between battery pack and electronic device
CN109101261A (en) * 2018-08-06 2018-12-28 沈阳维尔环保工程有限公司 A kind of the remote online upgrade method and system of data acquisition transmission instrument terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李云 等: ""基于Q-Learning算法的毫微微小区功率控制算法"" *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328560A (en) * 2020-11-25 2021-02-05 北京无线电测量研究所 File scheduling method and system
CN112579123A (en) * 2020-12-10 2021-03-30 珠海格力电器股份有限公司 Method for programming update program through USB interface and controller
CN113114730A (en) * 2021-03-22 2021-07-13 深圳市晨北科技有限公司 Upgrading method and device, terminal equipment and storage medium
CN113114730B (en) * 2021-03-22 2022-09-27 深圳市晨北科技有限公司 Upgrading method and device, terminal equipment and storage medium
CN113031868A (en) * 2021-03-24 2021-06-25 联想(北京)有限公司 Control method and device of memory
CN113031868B (en) * 2021-03-24 2023-07-21 联想(北京)有限公司 Memory control method and device
CN114924778A (en) * 2022-04-01 2022-08-19 北京遥测技术研究所 Program upgrading method based on ZYNQ redundant backup
CN114924778B (en) * 2022-04-01 2024-04-26 北京遥测技术研究所 Program upgrading method based on ZYNQ redundancy backup

Similar Documents

Publication Publication Date Title
CN111309363A (en) Contiki operating system-based online upgrading method and device
CN106569847B (en) Method for vehicle-mounted system to realize IAP remote upgrade based on mobile network
CN109460245B (en) Remote upgrading method for embedded system
CN109189445B (en) Method for upgrading program of equipment of Internet of things
EP0762705B1 (en) Method for transmitting data via a network
CN109240730B (en) Singlechip online upgrading method and system
US6470391B2 (en) Method for transmitting data via a network in a form of divided sub-packets
CN109101261A (en) A kind of the remote online upgrade method and system of data acquisition transmission instrument terminal
CN104899065A (en) Method and system for batch online recovery and software online upgrading
CN105573810A (en) Remote upgrade method and remote upgrade device for wireless sensor network node
CN101815988A (en) Firmware image update and management
CN111008033A (en) Universal DSP (digital signal processor) online upgrading system and upgrading method based on serial port
CN112947977B (en) Online software upgrading method and system
CN101605189B (en) System and method for upgrading intelligent platform management controller (IPMC) on line
CN113608772B (en) Application program upgrading method and device
CN104102519A (en) Firmware updating method of rack-mounted server and device thereof
CN113905039A (en) System upgrade file transmission method, device and system
CN108958752A (en) Single-chip microcontroller online upgrade system and method
CN116755749A (en) On-board MCU upgrading method, on-board MCU, board card and information processing system
KR100516551B1 (en) Remote software upgrade method and system in optical network
CN112905206A (en) Circuit upgrading method based on serial port
JP2002358177A (en) Image forming apparatus, serial communication method for the apparatus, program for allowing computer to perform the method and recording medium with the program recorded thereon
CN116483409A (en) Remote firmware updating method, system, electronic equipment and storage medium
CN114756270B (en) Automatic driving system firmware upgrading method and automatic driving system
CN116781688A (en) Internet of things terminal remote upgrading method and device based on reinforcement learning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination