Disclosure of Invention
In order to solve the problems in the prior art, the invention provides an OTA upgrading method which is applied to an OTA server and is used for carrying out OTA upgrading in batches according to serial number information of an intelligent terminal, so that the condition that the server is overloaded due to the fact that a large number of intelligent terminals access the server in a centralized manner is avoided. Moreover, the system upgrade package is divided into a plurality of data packages to be transmitted successively, and the situation that a large amount of storage space of the intelligent terminal is occupied due to overlarge system upgrade package capacity is avoided.
The OTA upgrading method of the invention comprises the following steps:
s1: when receiving a system version query request automatically sent by an intelligent terminal, an OTA server queries whether a new system version exists in the OTA server;
s2: when the new system version is inquired, a pre-upgrading instruction is sent to the intelligent terminal;
s3: acquiring serial number information of an intelligent terminal, and adding an upgrading time character at the tail part of a system upgrading packet of the system version;
s4: when the last characters of the intelligent terminal serial number information are the same as the upgrading time characters at the tail part of the system upgrading packet, the OTA server sends an upgrading instruction to the intelligent terminal;
s5: the OTA server copies and segments the system upgrade package;
s6: and the OTA server sequentially sends the plurality of segmented system upgrade packages to the intelligent terminal one by one until all the segmented system upgrade packages are completely transmitted, and the OTA is an over-the-air downloading technology.
In a further improvement of the present invention, the OTA upgrading method further includes step S7, after receiving the complete system upgrade package, the intelligent terminal performs OTA upgrading.
The invention further improves, in step S1, when the OTA server inquires that no new system version exists, the OTA upgrade is directly ended.
The invention is further improved, in step S4, when the last characters of the intelligent terminal serial number information are different from the characters at the tail of the system upgrade package, the OTA upgrade is directly finished.
In step S1, an OTA upgrade program is preset in the intelligent terminal, and a system upgrade period is set, in which the intelligent terminal automatically sends a system version query request to the OTA server.
The invention is further improved in that in step S4, the intelligent terminal receiving the upgrade instruction feeds back an upgrade confirmation instruction to the OTA server, and in step S5, the OTA server processes the system upgrade package after receiving the upgrade confirmation instruction fed back by the intelligent terminal to the upgrade instruction.
The invention further improves, in step S6, when the intelligent terminal suddenly cuts off the network or cuts off the power, the method further includes the following steps:
s601: after the network of the intelligent terminal is recovered, the intelligent terminal and the OTA server automatically establish connection and send a request for continuing upgrading;
s602: after receiving the continuous upgrading request, the OTA server sends a continuous upgrading instruction to the intelligent terminal;
s603: after receiving the instruction of continuing upgrading, the intelligent terminal sends a character used for expressing the segmentation sequence at the tail part of the received last data packet to the OTA server;
s604: the OTA server reads the tail sequence characters of the plurality of segmented system upgrade packages in sequence, and when the tail sequence characters of the received data package are completely consistent with the tail sequence characters of one segmented system upgrade package, the OTA server sends the plurality of upgrade packages after the upgrade package in the segmentation sequence to the intelligent terminal one by one in sequence;
s605: and the OTA server finishes transmitting all the segmented system upgrading packets and finishes OTA upgrading.
The invention also provides an OTA server for realizing the OTA upgrading method, which comprises the following steps:
a receiving module: the system version query device is used for receiving a system version query request automatically sent by the intelligent terminal;
the query module: the system version query method comprises the steps of querying whether a new system version exists in an OTA server or not when a system version query request automatically sent by an intelligent terminal is received;
a first sending module: the system comprises a server, a system version server and an intelligent terminal, wherein the server is used for sending a pre-upgrading instruction to the intelligent terminal when a new system version is inquired;
an acquisition module: the intelligent terminal is used for acquiring serial number information of the intelligent terminal;
the system upgrade package processing module: the system upgrading method comprises the steps of adding an upgrading time character to the tail of a system upgrading packet of the system version;
a judging and sending module: the system comprises a terminal, a system upgrading package, a terminal, a system upgrading package and a system upgrading server, wherein the terminal is used for judging whether the last characters of the intelligent terminal serial number information are the same as the upgrading time characters at the tail part of the system upgrading package or not, and if so, sending an upgrading instruction to the intelligent terminal;
a copy partitioning module: the system upgrade package is used for copying and dividing the system upgrade package;
a second sending module: and the system upgrading device is used for sending the plurality of segmented system upgrading packages to the intelligent terminal one by one in sequence until all the segmented system upgrading packages are transmitted.
The invention also provides an OTA upgrading system comprising the OTA server, and the OTA upgrading system also comprises an intelligent terminal, wherein an OTA upgrading program is arranged in the intelligent terminal, and a system upgrading period is set, in the system upgrading period, the intelligent terminal automatically sends a system version inquiry request to the OTA server, and after receiving a complete system upgrading packet sent by the OTA, the OTA upgrading is carried out.
The invention is further improved, and the OTA upgrading program of the intelligent terminal comprises:
the system comprises a sending module, a receiving module and a processing module, wherein the sending module is used for automatically sending a system version query request to an OTA server, sending feedback confirmation information after receiving an upgrading instruction sent by the OTA server, and sending a continuous upgrading request after the network of the intelligent terminal is recovered and sending a character which is used for representing a segmentation sequence and is received before the network is disconnected;
the receiving module is used for receiving a pre-upgrading instruction, an upgrading instruction, a continuous upgrading instruction and a system upgrading packet which are sent by the OTA server;
the setting module is used for setting a third storage module;
the third storage module is used for storing a plurality of data packets sent by the OTA server;
the comparison module is used for comparing the data in the third storage module with the corresponding data of the original system of the intelligent terminal and sending the comparison result to the processing module;
the processing module is used for sending a replacement instruction to the replacement module when the received data in the third storage module is inconsistent with the corresponding data of the original system of the intelligent terminal; the processing module is further used for sending a deleting instruction to the deleting module when the data in the third storage module is received to be consistent with the corresponding data of the original system of the intelligent terminal;
the replacing module is used for replacing the data in the third storage module with the corresponding data of the original system after receiving the replacing instruction;
and the deleting module is used for deleting the data in the third storage module after receiving the deleting instruction.
Compared with the prior art, the invention has the beneficial effects that: after the intelligent terminal is disconnected or power-off, breakpoint continuous transmission is realized when the intelligent terminal is connected with the network again; OTA upgrading is carried out in batches according to serial number information of the intelligent terminal, so that the condition that the server is overloaded due to the fact that a large number of intelligent terminals access the server in a centralized manner is avoided; the system upgrade package can be divided into a plurality of data packages to be transmitted successively, and the situation that a large amount of storage space of the intelligent terminal is occupied due to overlarge system upgrade package capacity is avoided.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples.
As shown in fig. 1, the OTA upgrading method of the present invention includes the following steps:
s1: when receiving a system version query request automatically sent by an intelligent terminal, an OTA server queries whether a new system version exists in the OTA server;
s2: when the new system version is inquired, a pre-upgrading instruction is sent to the intelligent terminal;
s3: acquiring serial number information of an intelligent terminal, and adding an upgrading time character at the tail part of a system upgrading packet of the system version;
s4: when the last characters of the intelligent terminal serial number information are the same as the upgrading time characters at the tail part of the system upgrading packet, the OTA server sends an upgrading instruction to the intelligent terminal;
s5: the OTA server copies and segments the system upgrade package;
s6: and the OTA server sequentially sends the plurality of segmented system upgrade packages to the intelligent terminal one by one until all the segmented system upgrade packages are completely transmitted, and the OTA is an over-the-air downloading technology.
And a first storage module is arranged in the OTA server, and the system upgrade package is stored in the first storage module. The OTA server is provided with a clock module and a counting module, the clock cycle of the clock module is set according to the set system upgrading cycle and the number of all intelligent terminals needing OTA upgrading, the counting module is started every time when one clock cycle is finished, namely, 1 is added to the character of the tail part of the system upgrading packet representing the upgrading time.
When the system upgrading period is 30 days, and the number of all the intelligent terminals needing OTA upgrading is 3 ten thousand, the clock period of the clock module can be set to 1 day, and the character of the tail part of the system upgrading packet representing the upgrading time is added with 1 every 1 day, namely 3 ten thousand devices are upgraded in batches in the upgrading period of 30 days, so that the condition that the servers are overloaded due to the fact that a large number of intelligent terminals access the servers in a centralized mode is avoided;
and the intelligent terminal is provided with a third storage module for storing the received data packets, and when receiving one data packet, the intelligent terminal stores the data packet into the third storage module and compares the data in the storage module with the corresponding data of the original system of the intelligent terminal.
When the data in the storage module is different from the corresponding data of the original system of the intelligent terminal, replacing the corresponding data of the original system with the data in the storage module; when the data in the storage module is the same as the corresponding data of the original system of the intelligent terminal, deleting the data in the storage module until all the data packets in the second storage module of the OTA server are transmitted;
as shown in fig. 1, the OTA upgrading method further includes step S7, and after receiving the complete system upgrade package, the intelligent terminal performs OTA upgrading. And after the step S7 is executed and the OTA upgrade is finished, the system automatically enters a waiting period, the whole system upgrade period is divided into a plurality of clock periods according to the total number of the intelligent terminals needing to be upgraded, when the next clock period starts, the step S1 is skipped to execute, the OTA upgrade of the intelligent terminal with the clock period meeting the conditions is finished, and the OTA upgrade of all the intelligent terminal equipment is finished in the whole set system upgrade period.
In step S1 of the OTA upgrade method, when the OTA server finds that no new system version exists, the OTA upgrade is directly ended.
In step S4 of the OTA upgrading method, when the last characters of the intelligent terminal serial number information are different from the characters at the tail of the system upgrade package, the OTA upgrading is directly finished.
In step S1 of the OTA upgrading method, an OTA upgrading program is preset in the intelligent terminal, and a system upgrading period is set, in which the intelligent terminal automatically sends a system version query request to the OTA server.
In step S4 of the OTA upgrading method, the intelligent terminal that receives the upgrading instruction feeds back an upgrade confirmation instruction to the OTA server, and in step S5, the OTA server processes the system upgrading package after receiving the upgrade confirmation instruction fed back by the intelligent terminal to the upgrade instruction.
As shown in fig. 2, in step S6 of the OTA upgrading method, when the intelligent terminal suddenly cuts off the network or powers off, the method further includes the following steps:
s601: after the network of the intelligent terminal is recovered, the intelligent terminal and the OTA server automatically establish connection and send a request for continuing upgrading;
s602: after receiving the continuous upgrading request, the OTA server sends a continuous upgrading instruction to the intelligent terminal;
s603: after receiving the instruction of continuing upgrading, the intelligent terminal sends a character used for expressing the segmentation sequence at the tail part of the received last data packet to the OTA server;
s604: the OTA server reads the tail sequence characters of the plurality of segmented system upgrade packages in sequence, and when the tail sequence characters of the received data package are completely consistent with the tail sequence characters of one segmented system upgrade package, the OTA server sends the plurality of upgrade packages after the upgrade package in the segmentation sequence to the intelligent terminal one by one in sequence;
s605: and the OTA server finishes transmitting all the segmented system upgrading packets and finishes OTA upgrading.
As shown in fig. 3, the present invention further provides an OTA server for implementing the OTA upgrading method, including:
the system comprises a receiving module, a judging module and a sending module, wherein the receiving module is used for receiving a system version inquiry request and a continuous upgrading request sent by an intelligent terminal, receiving characters used for expressing a segmentation sequence at the tail part of a data packet sent by the intelligent terminal, and receiving feedback confirmation information sent by the intelligent terminal and allowing OTA upgrading to be started;
the query module is used for querying whether a new system version exists in the OTA server or not when receiving a system version query request automatically sent by the intelligent terminal;
the first sending module is used for sending a pre-upgrading instruction to the intelligent terminal when the new system version is inquired;
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring string number information of the intelligent terminal, and the last characters of the string number information represent fixed upgrading time of the intelligent terminal and are not modifiable;
the system upgrading package processing module is used for adding upgrading time characters at the tail part of the system upgrading package of the system version; the first storage module and the second storage module are also used for storing the system upgrading package; the system upgrading method is characterized by also comprising a clock module and a counting module, wherein the clock module is used for timing, the clock cycle is set according to the system upgrading cycle and the number of the intelligent terminals needing OTA upgrading, the counting module is used for counting, the counting module is started every time when one clock cycle is finished, and the counting module adds 1 to the character of the tail part of the system upgrading packet, which represents the upgrading time.
The judging and sending module is used for judging whether the last characters of the intelligent terminal serial number information are the same as the upgrading time characters at the tail part of the system upgrading packet or not, and if so, sending an upgrading instruction to the intelligent terminal;
the system upgrading system comprises a copying and dividing module, a first storage module, a second storage module and a judging module, wherein the copying and dividing module is used for copying and dividing the system upgrading packet, copying the system upgrading packet stored in the first storage module into the second storage module, and then dividing the system upgrading packet stored in the second storage module into a plurality of data packets;
and the second sending module is used for sending the plurality of divided system upgrading packages to the intelligent terminal one by one in sequence until all the divided system upgrading packages are completely transmitted.
As shown in fig. 4, the present invention further provides an OTA upgrading system including the OTA server, further including an intelligent terminal, where the intelligent terminal is provided with an OTA upgrading program and sets a system upgrading period, and in the system upgrading period, the intelligent terminal automatically sends a system version query request to the OTA server, and after receiving a complete system upgrading packet sent by the OTA, performs OTA upgrading.
The OTA upgrading program of the intelligent terminal comprises the following steps:
the system comprises a sending module, a receiving module and a sending module, wherein the sending module is used for sending a system version query request to the OTA server, and the system version query request is used for requesting the OTA server to query whether a system version higher than the current version of the intelligent terminal exists in the server or not; the sending module is also used for sending a request for continuing upgrading to the OTA server; the sending module is also used for sending a character which is used for representing a segmentation sequence at the tail part of the received last data packet to the OTA server after the intelligent terminal is recovered to normal when the intelligent terminal is disconnected from the network or the power is cut off; the sending module is further configured to send feedback confirmation information to the OTA server, where the feedback confirmation information indicates that it is agreed to start OTA upgrade, that is, the OTA server may start sending a system upgrade package to the intelligent terminal;
the receiving module is used for receiving a pre-upgrading instruction, an upgrading instruction, a continuous upgrading instruction and a system upgrading packet which are sent by the OTA server;
the setting module is used for setting a third storage module;
the third storage module is used for storing a plurality of data packets sent by the OTA server;
the comparison module is used for comparing the data in the third storage module with the corresponding data of the original system of the intelligent terminal and sending the comparison result to the processing module;
the processing module is used for sending a replacement instruction to the replacement module when the received data in the third storage module is inconsistent with the corresponding data of the original system of the intelligent terminal; the processing module is further used for sending a deleting instruction to the deleting module when the data in the third storage module is received to be consistent with the corresponding data of the original system of the intelligent terminal;
the replacing module is used for replacing the data in the third storage module with the corresponding data of the original system after receiving the replacing instruction;
and the deleting module is used for deleting the data in the third storage module after receiving the deleting instruction.
The invention has the beneficial effects that: after the intelligent terminal is disconnected or power-off, breakpoint continuous transmission is realized when the intelligent terminal is connected with the network again; OTA upgrading is carried out in batches according to serial number information of the intelligent terminal, so that the condition that the server is overloaded due to the fact that a large number of intelligent terminals access the server in a centralized manner is avoided; the system upgrade package can be divided into a plurality of data packages to be transmitted successively, and the situation that a large amount of storage space of the intelligent terminal is occupied due to overlarge system upgrade package capacity is avoided.
The above-described embodiments are intended to be illustrative, and not restrictive, of the invention, and all changes that come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein.