CN113760333A - Software upgrading method and device, electronic equipment and computer readable storage medium - Google Patents

Software upgrading method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN113760333A
CN113760333A CN202111087361.0A CN202111087361A CN113760333A CN 113760333 A CN113760333 A CN 113760333A CN 202111087361 A CN202111087361 A CN 202111087361A CN 113760333 A CN113760333 A CN 113760333A
Authority
CN
China
Prior art keywords
software
upgrading
version
target
server
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
CN202111087361.0A
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.)
Beijing Eswin Computing Technology Co Ltd
Haining Eswin IC Design Co Ltd
Original Assignee
Beijing Eswin Computing Technology Co Ltd
Haining Eswin IC Design Co Ltd
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 Beijing Eswin Computing Technology Co Ltd, Haining Eswin IC Design Co Ltd filed Critical Beijing Eswin Computing Technology Co Ltd
Priority to CN202111087361.0A priority Critical patent/CN113760333A/en
Publication of CN113760333A publication Critical patent/CN113760333A/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

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 embodiment of the application provides a software upgrading method, a software upgrading device, electronic equipment and a computer readable storage medium, and relates to the technical field of computers, wherein the method comprises the following steps: in the process of upgrading target software in the embedded equipment to a target version, if the embedded equipment is powered off accidentally, the equipment can be powered on through the charging and discharging module in the embedded equipment, so that the equipment can successfully record the upgrading progress information of the target software, and after the embedded equipment is detected to be powered on again, the upgrading progress information is sent to the server, so that the server can continuously transmit the software data of the target version at a breakpoint according to the upgrading progress information without retransmitting the received software data, and the software upgrading efficiency is improved.

Description

Software upgrading method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a software upgrading method and apparatus, an electronic device, and a computer-readable storage medium.
Background
As internet Technology has developed, local upgrades have difficulty meeting the demand for software upgrade diversification in various devices, and more software has begun to use Over-the-Air Technology (OTA), i.e., OTA upgrade Technology. The OTA upgrading technology is a technology for the terminal equipment to download an upgrading package on a remote server through a wireless network and upgrade a system or application.
Although the prior technical scheme divides a software upgrading package into a plurality of parts and downloads the parts by different threads, the OTA upgrading technology has certain reliability, but when the device is suddenly powered off, the reliability in the upgrading process is difficult to ensure, and once errors occur in the upgrading process, the OTA upgrading technology needs to be upgraded again, so that the upgrading efficiency is low.
Disclosure of Invention
The present application aims to solve at least one of the above-mentioned technical drawbacks, in particular the inefficient upgrading of software.
In a first aspect, a software upgrading method is provided, which is applied to an embedded device, where the embedded device includes a charge-discharge module, and the method includes:
when the embedded equipment is in a power-on state, responding to the upgrading triggering operation aiming at the target software in the embedded equipment, and acquiring the software data of the target version of the target software from the server;
when a power failure signal is detected, a charge-discharge module supplies power to the embedded equipment and records the upgrading progress information of the target software;
and when the embedded equipment is detected to be electrified again, sending the upgrading progress information to the server so that the server can continuously transmit the software data of the target version at the break point according to the upgrading progress information.
In an optional embodiment of the first aspect, when the embedded device is in a power-on state, the charge and discharge module is in a charge state, and if the embedded device is in a power-off state; when a power failure signal is detected, a charge-discharge module supplies power to the embedded equipment;
the power supply time for the embedded equipment by the charge-discharge module is not less than the time required for recording the upgrade progress information when the embedded equipment is powered off.
In an optional embodiment of the first aspect, further comprising:
when the record of the upgrading progress information is finished, setting an upgrading interruption mark as a first mark, wherein the first mark is used for identifying the interruption of the target software in the upgrading process;
sending the upgrade progress information to a server, including:
determining the value of an upgrade interruption flag; and if the value of the upgrading interruption mark is the first mark, sending upgrading progress information to the server, and updating the value of the upgrading interruption mark into a second mark.
In an optional embodiment of the first aspect, if the value of the upgrade interrupt flag is the second flag, the method further includes:
acquiring a current version identifier of target software and a version identifier of the latest version of the target software in a server;
comparing the current version identification with the version identification of the latest version of the target software in the server, if the version identification of the latest version is higher than the current version identification, sending a software upgrading prompt to the terminal equipment so as to receive the software data of the latest version sent by the server when an upgrading confirmation operation is received on the terminal equipment;
the software upgrading prompt is used for prompting whether the target software is upgraded to the latest version, and the terminal equipment is equipment bound and connected with the embedded equipment.
In an optional embodiment of the first aspect, the upgrade progress information includes version information of the target version, a total data amount of software data of the target version, a storage address of the acquired software data of the target version, and acquisition progress information;
sending the upgrade progress information to a server so that the server can continuously transmit the breakpoint of the software data of the target version according to the upgrade progress information, wherein the method comprises the following steps:
sending the upgrade progress information to the server so as to enable the server to execute the following operations:
if the software data of the target version is determined to exist according to the version information and the total data volume, providing software upgrading prompt information for a user through terminal equipment, wherein the software upgrading prompt information comprises a software upgrading option, the software upgrading option comprises a breakpoint transmission resuming option, a re-upgrading option and an upgrading stopping option, and the terminal equipment is equipment bound with the embedded equipment;
and if the selection operation of the user for the breakpoint resume option is acquired, performing breakpoint resume on the software data of the target version according to the storage address and the acquisition progress information.
In an optional embodiment of the first aspect, the acquisition progress information includes a data amount of the acquired software data of the target version and a ratio of the acquired data amount to a total data amount.
In an optional embodiment of the first aspect, when the power down signal is detected, the method further comprises:
and sending upgrade stop prompt information to the server to prompt the server to stop sending the software data of the target version.
In a second aspect, there is provided a software upgrading apparatus, comprising:
and the software data acquisition module is used for responding to the upgrading triggering operation aiming at the target software in the embedded equipment when the embedded equipment is in a power-on state and acquiring the software data of the target version of the target software from the server.
The power failure exception handling module is used for supplying power to the embedded equipment by the charge-discharge module when a power failure signal is detected, and recording the upgrading progress information of the target software;
and the breakpoint resume module is used for sending the upgrade progress information to the server after detecting that the embedded equipment is electrified again, so that the server can resume the breakpoint of the software data of the target version according to the upgrade progress information.
In an optional embodiment of the second aspect, when the embedded device is in a power-on state, the charge and discharge module is in a charge state; when a power failure signal is detected, a charge-discharge module supplies power to the embedded equipment;
the power supply time for the embedded equipment by the charge-discharge module is not less than the time required for recording the upgrade progress information when the embedded equipment is powered off.
In an optional embodiment of the second aspect, the system further includes an upgrade interruption flag setting module, specifically configured to:
when the record of the upgrading progress information is finished, setting an upgrading interruption mark as a first mark, wherein the first mark is used for identifying the interruption of the target software in the upgrading process;
sending the upgrade progress information to a server, including:
determining the value of an upgrade interruption flag; and if the value of the upgrading interruption mark is the first mark, sending upgrading progress information to the server, and updating the value of the upgrading interruption mark into a second mark.
In an optional embodiment of the second aspect, if the value of the upgrade interruption flag is the second flag, the system further includes a software upgrade prompting module, which is specifically configured to:
acquiring a current version identifier of target software and a version identifier of the latest version of the target software in a server;
comparing the current version identification with the version identification of the latest version of the target software in the server, if the version identification of the latest version is higher than the current version identification, sending a software upgrading prompt to the terminal equipment so as to receive the software data of the latest version sent by the server when an upgrading confirmation operation is received on the terminal equipment;
the software upgrading prompt is used for prompting whether the target software is upgraded to the latest version, and the terminal equipment is equipment bound and connected with the embedded equipment.
In an optional embodiment of the second aspect, the upgrade progress information includes version information of the target version, a total data amount of software data of the target version, a storage address of the acquired software data of the target version, and acquisition progress information;
the breakpoint resume module is specifically configured to send the upgrade progress information to the server, so that when the server performs breakpoint resume on the software data of the target version according to the upgrade progress information, the breakpoint resume module is configured to:
sending the upgrade progress information to the server so as to enable the server to execute the following operations:
if the software data of the target version is determined to exist according to the version information and the total data volume, providing software upgrading prompt information for a user through terminal equipment, wherein the software upgrading prompt information comprises a software upgrading option, the software upgrading option comprises a breakpoint transmission resuming option, a re-upgrading option and an upgrading stopping option, and the terminal equipment is equipment bound with the embedded equipment;
and if the selection operation of the user for the breakpoint resume option is acquired, performing breakpoint resume on the software data of the target version according to the storage address and the acquisition progress information.
In an optional embodiment of the second aspect, the acquisition progress information includes a data amount of the acquired software data of the target version and a ratio of the acquired data amount to a total data amount.
In an optional embodiment of the second aspect, the apparatus further includes a power down detection module, and when a power down signal is detected, the power down detection module is specifically configured to:
and sending upgrade stop prompt information to the server to prompt the server to stop sending the software data of the target version.
In a third aspect, an electronic device is provided, which includes:
the software upgrading method comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, and the software upgrading method of any one of the embodiments is realized when the processor executes the program.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the method of software upgrade of any of the above embodiments.
In a fifth aspect, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device implements the method provided in the embodiment of the first aspect when executed.
According to the software upgrading method, in the process of upgrading the target software in the embedded equipment to the target version, if the embedded equipment is powered off accidentally, the equipment can be powered on through the charging and discharging module in the embedded equipment, so that the equipment can successfully record the upgrading progress information of the target software, and after the embedded equipment is powered on again after the power failure is detected, the upgrading progress information is sent to the server, so that the server can continuously transmit the software data of the target version at the breakpoint according to the upgrading progress information. According to the scheme provided by the embodiment of the application, when the embedded device is powered off unexpectedly, the device can be timely powered on through the charging and discharging module, so that the device can timely store the upgrading progress information of the target software, and after the embedded device is powered on again, the embedded device can continuously transmit data with the server according to the upgrading progress information on the basis of the software data transmission progress before the power failure, so that the reliability of a software upgrading process is ensured, and meanwhile, the efficiency of software upgrading is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic flowchart of a software upgrading method according to an embodiment of the present application;
fig. 2 is a schematic diagram of waveforms when power is supplied through a charge-discharge module in a software upgrading method according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a software upgrading method according to an embodiment of the present application;
fig. 4 is an interaction diagram when an upgrade interruption flag is a first flag in a software upgrading method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a software upgrading apparatus according to an embodiment of the present application;
fig. 6 is a schematic flowchart of a software upgrading method according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a software upgrading apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The terms referred to in this application will first be introduced and explained:
the OTA upgrading technology is a technology for realizing remote management of mobile terminal equipment and SIM card data through an air interface of mobile communication. After years of application and development of public networks, the application and development of the public networks are mature, network operators realize the remote management of the SIM card through the OTA technology and can provide a mobile new service downloading function. In the embodiment of the application, the OTA upgrading technology can be applied between the embedded device and the server, and the embedded device obtains data required by software upgrading from the server.
Breakpoint resume, i.e. FTP (File Transfer Protocol). The client software breakpoint transmission refers to that when downloading or uploading, a downloading or uploading task (a file or a compressed packet) is artificially divided into several parts, each part is uploaded or downloaded by using a thread, and if a network fault is met, the uncompleted part can be continuously uploaded or downloaded from the uploaded or downloaded part without uploading or downloading from the beginning. The user can save time and improve speed.
At present, the OTA upgrading technology is widely applied in the embedded field. Although the current technical scheme divides the software upgrading packet into a plurality of parts and downloads the software upgrading packet by different threads, the data loss of the downloaded software upgrading packet caused by network faults is avoided, the reliability of the OTA upgrading technology is increased, but when the device is powered off suddenly, the method can not solve the technical problem of how to carry out breakpoint transmission after the embedded device is powered off suddenly, so that the reliability of the OTA upgrading technology in the upgrading process is difficult to ensure, and once the embedded device is powered off suddenly in the upgrading process, the software upgrading needs to be carried out again, so that the upgrading efficiency is low.
The present application provides a software upgrading method, apparatus, electronic device and computer readable storage medium, which aim to solve at least one of the above technical problems of the prior art.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
An embodiment of the present application provides a method for upgrading software, for example, the method is applied to an embedded device, and the embedded device may include a charging and discharging module, as shown in fig. 1, the method includes:
step S101, when the embedded device is in a power-on state, may respond to an upgrade trigger operation for target software in the embedded device, and obtain software data of a target version of the target software from the server.
In this embodiment of the present application, the embedded device may be a device that is composed of hardware and software and can operate independently, where the software content may include a software operating environment and an operating system thereof; the hardware content may include various aspects of signal processors, memory, communication modules, and the like. The embedded device being in the power-on state may be a state in which the embedded device enters a stable operation after being powered on.
When the embedded device is powered on and works normally, the upgrading triggering operation aiming at the target software in the embedded device can be received, and the software data of the target version of the target software is obtained from the server in response to the upgrading triggering operation. The target software may be application software for implementing embedded basic functions on the embedded device, or may be Firmware (Firmware), which is software in the system of the embedded device that serves as the lowest layer of the system.
Receiving an upgrade trigger operation for target software in the embedded device, and starting to acquire software data of a target version of the target software from the server in response to the upgrade trigger operation may include:
(1) the method comprises the steps of receiving upgrading triggering operation of a user aiming at target software in the embedded device through a display screen of the embedded device, for example, displaying a software upgrading setting interface in the display screen of the embedded device, enabling the user to select the target software to be upgraded in the software upgrading setting interface, enabling the embedded device to receive the upgrading triggering operation through the display screen by clicking an upgrading button, inputting a software upgrading instruction and the like, and sending a software upgrading request to a server. Optionally, the software upgrading request may carry a software identifier of the target software, a version identifier of the current version, and an identifier of the target version, and when the server receives and responds to the software upgrading request, the server sends software data of the target version of the target software to the embedded device.
(2) Receiving upgrading trigger operation aiming at target software in the embedded equipment through the terminal equipment bound with the embedded equipment; specifically, the terminal device may be bound to the embedded device through a preset application program to remotely control software in the embedded device, for example, each software and software version in the embedded device may be displayed in real time in the terminal device bound to the embedded device, a user may select target software to be upgraded from the software of the embedded device through the terminal device, and the terminal device sends an upgrade instruction to the embedded device, so that the embedded device responds to the upgrade instruction to obtain software data of the target version of the target software from the server.
In the embodiment of the application, the target software can be upgraded by acquiring the software data of the target version of the target software from the server, that is, the upgrade package of the target version of the target software is downloaded from the server.
And step S102, when a power failure signal is detected, the embedded equipment is powered by the charge-discharge module, and the upgrading progress information of the target software is recorded.
The embedded device may be in a power-off state, which is a state in which the embedded device cannot normally operate due to power failure, power loss, or failure of power quality.
When the power-down signal is detected, the charging and discharging module is already in a discharging state. The charge-discharge module can be composed of a charge-discharge circuit, specifically, the charge-discharge circuit can be a capacitor circuit, and according to the physical characteristics of the capacitor circuit, the charge-discharge circuit automatically discharges when the embedded device is in a power-down state, namely, the embedded device is immediately powered on once the device is powered off, so that the main control chip has enough time to perform power-down exception processing after the embedded device detects a power-down signal. The power failure exception handling may include recording upgrade progress information of the target software being upgraded before the power failure of the device. The upgrade progress information may include a current version number of the target software, a version number of the target version, a data volume of software data of the target version that has been acquired from the server, a total data volume of the target software of the target version, a data storage address, and the like, and is used to describe the upgrade progress of the target software before power failure and facilitate breakpoint resume after power is re-turned on.
It should be noted that, in the embodiment of the present application, the software data of the target version refers to data required for upgrading the target software, that is, the software needing to be upgraded, from the current version to the target version. If the server sends the target version of the software installation package of the target software to the embedded equipment during upgrading, the software data refers to the data in the target version of the software installation package, and if the server sends the differential package corresponding to the target version of the firmware and the current version of the firmware to the embedded equipment, the software data refers to the data in the differential package.
In some embodiments, the embedded device may further include a power failure detection module, when the embedded device suddenly enters a power failure state, the power failure detection module automatically supplies power to the embedded device, and meanwhile, the power failure detection module detects a power failure signal to trigger power failure exception handling, where the power failure exception handling may include recording upgrade progress information of target software being upgraded before the device loses power.
The specific implementation method may be to connect an output pin of the power failure detection module with an input pin of a General-purpose input/output (GPIO) port of the embedded device, where when the device is in a power-on state, an electrical signal received by the input pin of the main control chip and output by the output pin of the power failure detection module is a high level, and when the device suddenly enters a power-off state, the electrical signal received by the input pin of the main control chip is changed into a low level, and a power failure exception handling is triggered, that is, the main control chip may record upgrade progress information of target software being upgraded before the device is powered off.
In the embodiment of the application, when the embedded device is in a power-on state, that is, when the embedded device works normally, the power module in the embedded device supplies power, at this time, the charge and discharge module may be in a charging state, when a power-down signal is detected, the embedded device is in a power-down state, the power module cannot supply power normally, and the charge and discharge module may supply power to the embedded device.
For equipment comprising the charge-discharge module, when the equipment is powered off, the charge-discharge module can automatically enter a discharge state to supply power to the equipment.
The power supply duration can be controlled by setting the capacitor in the charge-discharge module, so that the power supply duration for supplying power to the embedded equipment by the charge-discharge module is not less than the time required for recording the upgrade progress information when the embedded equipment is powered off.
According to the embodiment, the device is powered on in time when the embedded device is powered off abnormally through the charging and discharging module, so that the main control chip can perform abnormal power failure processing, the upgrading progress information can be stored for enough time, and after the embedded device is powered on again, breakpoint continuous transmission can be performed according to the upgrading progress information, and the reliability and the efficiency of software upgrading are improved.
In some embodiments, when the power down signal is detected, the software upgrade method may further include:
and sending software upgrading stop prompt information to the server to prompt the server to stop sending the software data of the target version.
The software upgrading stop prompt message can describe that the current embedded equipment enters a power failure state by using simple characters and cannot normally receive software data of a target version of target software. After the server receives the software upgrade stop prompt message, the software upgrade stop prompt message can be further sent to the terminal device bound with the embedded device, and the current power failure state of the embedded device is displayed in the terminal device, so that a user can know that the embedded device cannot work normally at the first time, and the user can conveniently perform corresponding processing on the power failure device, for example, starting a standby power supply and the like. And prompting the server to stop sending the software data of the target version can realize the technical effects of reducing the load of the server and saving the computing resources.
In the embodiment of the application, the embedded device may include a power failure detection module, and when the power failure detection module detects the power failure information, the power failure exception handling may be triggered, where the power failure exception handling may include recording upgrade progress information corresponding to the target software, and sending software upgrade stop prompt information to the server to prompt the server to stop sending the software data of the target version.
In one example, as shown in fig. 2, a voltage waveform variation diagram for performing power down detection on an embedded device and performing temporary power supply on the device through a charge-discharge module is shown.
In the Ta period, the power supply module supplies power to the embedded equipment, the power supply voltage is Va, and appropriate voltage Vb is provided for the embedded equipment after voltage reduction and the like, so that the embedded equipment can normally work. Meanwhile, in the period of Ta, the capacitor circuit in the charge-discharge module is charged, that is, the charge-discharge module is in a charging state, and the voltage Vc of the capacitor is increased until the capacitor reaches a stable value after charging. Wherein, the Tc period is the charging time of the capacitor circuit.
At the critical point between the Ta time period and the Tb time period, the embedded device suddenly loses power, at the moment, the charge-discharge module discharges through the capacitor circuit, and the power supply voltage can be stabilized to be the voltage Vb required by the main control chip through the transformer, so that the embedded device obtains the power-down buffering time Tb. In Tb time, the device may perform power failure exception handling, for example, in this embodiment of the present application, the power failure exception handling may be that the master control chip records the upgrade progress information of the target software being upgraded before the device loses power.
Step S103, after detecting that the embedded device is powered on again, the upgrade progress information can be sent to the server, so that the server can continuously transmit the software data of the target version according to the upgrade progress information.
In the embodiment of the application, if it is detected that the embedded device is powered on again, the upgrade progress information may be sent to the server, and the server compares the target version of the target software (i.e., the version of the target software after the target software in the embedded device is upgraded) included in the upgrade progress information with the software version of the target software stored in the server to obtain a version comparison result, where the version comparison result may be used to determine whether the target software of the target version still exists in the server.
In some embodiments, when the server receives the upgrade progress information, the server may compare the version identifier of the target version (i.e., the version of the target software in the embedded device after the upgrade is completed) included in the upgrade progress information with the version identifiers of the versions of the target software stored in the server, so as to obtain a version comparison result. If the version comparison result indicates that the target software of the target version exists in the server, the server can automatically perform breakpoint continuous transmission on the software data according to the information, such as the data volume of the target software of the target version, the total data volume of the target software of the target version, the data storage address and the like, which is acquired by the embedded equipment in the upgrade progress information.
The terminal equipment can be respectively connected with the embedded equipment and the server, so that the states of the embedded equipment and the server can be displayed in real time in the terminal equipment. And if the comparison result shows that the target software of the target version exists in the server, a plurality of upgrading options, such as a breakpoint resuming option, a re-upgrading option, an upgrading stopping option and the like, can be displayed in the terminal equipment. The user can select according to the requirement, the terminal device sends notification messages corresponding to the options selected by the user to the embedded device and the server respectively based on the received option selection result, so that the server and the embedded device can perform corresponding processing according to the instruction of the user.
The details of how to control the upgrade of the embedded device through the terminal device will be described later.
In the software upgrading method in the embodiment, in the process of upgrading the target software in the embedded device to the target version, if the embedded device is powered off unexpectedly, the device can be powered on through the charging and discharging module in the embedded device, so that the device can successfully record the upgrading progress information of the target software, when the embedded device is detected to be powered on again, the upgrading progress information is sent to the server, the upgrading instruction returned by the server is received, and then the embedded device can continuously transmit the software data of the target version at the breakpoint based on the upgrading instruction and the upgrading progress information. When the embedded equipment is powered off accidentally, the equipment is powered on in time through the charging and discharging module, so that the equipment can save the upgrading progress information of the target software in time, and after the embedded equipment is powered on again, data can be continuously transmitted on the basis of the software data transmission progress before the power failure according to the upgrading progress information, so that the reliability of a software upgrading process is improved, and the efficiency of software upgrading is also improved.
In this embodiment of the application, the upgrade progress information may include version information of the target version, a total data amount of the software data of the target version, a storage address of the acquired software data of the target version, and acquisition progress information.
The version information of the target version of the target software can be a version number corresponding to the target version; the total data amount of the target version of software data may be a total size of the target version of software data of the target software; the storage address of the acquired software data of the target version may be a Flash (Flash EEPROM Memory) address where the embedded device stores the software data of the target version acquired from the server. The upgrading progress information can be recorded by a main control chip of the embedded device, and the main control chip is a core component of a main board or a hard disk in the embedded device, is a bridge for connecting each device or device module, and is also a brain for controlling the running work of the device.
In this embodiment of the application, the acquisition progress information may include a data amount of the acquired software data of the target version and a ratio of the acquired data amount to a total data amount of the software data of the target version before the power failure of the device, for example, if the total data amount of the software data of the target version is 800 kilobytes (kb), and the data amount of the target software of the target version is 500 kilobytes, a ratio of the acquired data amount to the total data amount of the software data of the target version is "62.5%", which describes an upgrade progress of the target software before the power failure. If the software data of the target software of the target version is divided into a plurality of upgrade sub-packets, the acquisition progress information may further include the number of the acquired upgrade sub-packets and a ratio of the number of the acquired upgrade sub-packets to the total number of the upgrade sub-packets, for example, when the number of the upgrade sub-packets corresponding to the target software of the target version is 10 and the number of the acquired upgrade sub-packets is 6, the ratio of the number of the acquired upgrade sub-packets to the total number of the upgrade sub-packets is "60%".
Sending the upgrade progress information to the server so that the server performs breakpoint continuous transmission on the software data of the target version according to the upgrade progress information, which may include the following steps:
sending the upgrading progress information of the target version to the server so as to enable the server to execute the following operations:
the server may store software data of multiple versions of the target software and version information corresponding to different versions, which may include the latest version and the historical version of the target software. The user can view various versions of the target software in the server through the webpage or the terminal device, for example, the user has the operation authority of the server, and can add or delete the target software of various versions in the server.
When the server receives the version information of the target version of the target software in the upgrade progress information, the server may compare the received version information of the target version with the version information of the target software stored in the server to determine that the software data of the target software of the target version exists in the server. Specifically, the version information may include a version number, a version number corresponding to the target version is obtained from the upgrade progress information and is matched with a version number of target software stored in the server, if the version number corresponding to the target version exists in the server, the total data amount of software data of the target version in the upgrade progress information and the first total data amount of the software data of the target version stored in the server are further compared, and if the total data amount of the software data of the target version is consistent with the first total data amount, it is determined that the software data of the target software of the target version exists in the server.
If the software data of the target version exists in the server according to the version information and the total data volume of the software data of the target version, sending confirmation information to the terminal equipment to inform the terminal equipment that the software data of the target version exists in the server; otherwise, an abnormal prompt is sent to the terminal equipment to prompt that the software data of the target version does not exist in the user server.
The method can further provide software upgrading prompt information corresponding to the target version for the user through the terminal device bound with the embedded device, can be used for prompting the version number of the target version of the user and the current version number of the target software to be upgraded, and provides software upgrading options for the user to select, wherein the software upgrading options can comprise a breakpoint resuming option, a re-upgrading option and an upgrading stopping option. Different options may correspond to different processing schemes. The processing scheme corresponding to the breakpoint resume option can indicate that the embedded equipment and the terminal equipment continue to download on the basis of the downloaded software data according to the stored upgrade progress information; the processing scheme corresponding to the re-upgrading option can be that the software data downloaded before the power failure of the equipment is abandoned, so that the embedded equipment obtains the software data of the target software of the target version from the server again; and the processing scheme corresponding to the upgrade stopping option is to terminate the software upgrade.
The terminal device can generate corresponding software upgrading instructions for the obtained selection operation of the user for the software upgrading options, and the software upgrading instructions are respectively sent to the server and the embedded device, or only sent to the server. For example, when the terminal device performs a selection operation on the breakpoint resume option by a user, a breakpoint resume instruction is generated and sent to the server and the embedded device, respectively, the server is instructed to send the software data which is not transmitted to the embedded device continuously, and the embedded device is informed of the preparation of receiving the data. Or only the breakpoint resume instruction can be sent to the server, and the server prompts the embedded device to receive the software data.
If the server obtains the selection operation of the user for the breakpoint resume option, the server may perform breakpoint resume on the software data of the target version according to the obtained progress information, which may specifically include the following steps: and the server acquires the selection operation of the user for the breakpoint resume option and continuously transmits the software data on the basis of the data transmission progress before the power failure according to the acquired progress information. For example, the size of the target software of the target version is 800 kilobytes, 300 kilobytes are transmitted before power failure, and if the server obtains the selection operation of the user for the breakpoint resume option, the remaining 500 kilobytes of software data are continuously sent to the embedded device.
In some embodiments, the server may perform breakpoint resuming on the software data of the target version according to the upgrade progress information, and may further include the following steps: if the server obtains the selection operation of the user for the breakpoint resume option, generating a corresponding upgrading instruction based on the selection operation, and sending the upgrading instruction to the embedded device; and after the embedded equipment receives an upgrading instruction returned by the server, sending a continuous downloading request to the server based on the stored upgrading progress information, and receiving the un-downloaded software data of the target version sent by the server.
In this embodiment of the application, the upgrade progress information recorded by the main control chip may include acquisition progress information, where the acquisition progress information refers to indication information of a data volume of software data of a target version that has been acquired by the embedded device from the server when the embedded device is powered off, and the server may determine, according to the indication information, data that needs to be sent to the embedded device when an endpoint resumes transmission, that is, a position where the endpoint resumes transmission is determined. The obtaining progress information may include at least one of the data volume of the obtained target software of the target version and a ratio of the obtained data volume to the total data volume of the software data of the target version before the power failure of the device. The server can send confirmation information to the terminal equipment after determining that the software data of the target version exists in the server according to the version information and the total data volume of the software data of the target version, and can send the acquired progress information and the confirmation information to the terminal equipment together, so that a user can know the upgrading progress of the target software in the equipment through the terminal equipment, and can select a proper option from the software upgrading options according to the upgrading progress.
In some embodiments, the server may send the acquisition progress information to the terminal device together with confirmation information, where the confirmation information may include, in addition to information informing that the software data of the target version exists in the terminal device server, a version comparison result, and may display, in the version comparison result, whether the latest version exists in addition to the target version, and if the latest version exists, may prompt, on the terminal device, a user whether the target software is updated to the latest version.
In some embodiments, the terminal device may obtain information of each version of the target software stored in the server from the server in real time, or the server may push information of each version of the target software in the server to the terminal device at certain time intervals, and may also push a version update message to the terminal device when the version of the target software in the server is updated.
The terminal device can view each version of the target software stored in the server and the corresponding software size (i.e. the first total data amount) of each version in real time, the embedded device can directly send the upgrade progress information to the terminal device, the terminal device compares the version information in the upgrade progress information and the total data volume of the software data of the target version with the version information and the first total data volume of each version of the target software stored in the server respectively, namely, the terminal equipment carries out version comparison, if the software data of the target version exists in the server, the terminal equipment displays the software upgrading prompt information to the user, the software upgrading prompting information can be used for prompting the version number of the target version and the current version number of the target software to be upgraded of the user, and providing a software upgrading option for the user to select. And generating corresponding upgrading instructions based on the selection operation of the user on the software upgrading options, and respectively sending the upgrading instructions to the server and the embedded equipment to execute the software upgrading operation corresponding to the upgrading instructions.
In other embodiments, the automatic breakpoint resuming function may be started by setting at the terminal device, and if the server receives the upgrade progress information sent by the embedded device, the server may further send the upgrade progress information to the terminal device, the terminal device may automatically extract the total data volume of the version information and the software data of the target version from the upgrade progress information, compare the total data volume of the version information and the software data of the target version with the version information and the first total data volume of each version of the target software stored in the server and received by the terminal device from the server, and if it is determined that the software data of the target version exists in the server, automatically generate a breakpoint resuming upgrade instruction, and send the breakpoint resuming instruction to the server and the embedded device by the terminal device, respectively, so as to implement automatic breakpoint resuming.
In the embodiment of the application, the upgrade interruption flag can be set, so that whether the embedded device is upgraded before power failure and whether the upgrade progress information is stored can be quickly judged after the embedded device is powered on again.
Specifically, when the charge-discharge module supplies power to the embedded device, if the update progress information of the software data of the target version is recorded, the update interruption flag may be set as a first flag, where the first flag is used to identify that the target software is interrupted in the update process. The specific form of the first mark is not limited in the embodiments of the present application, and may be specifically 0 or 1, "True" or "False", and is not specifically limited in the present application.
When the embedded device is powered on again, the method for sending the upgrade progress information to the server may include the following steps: the method comprises the steps of firstly determining the value of an upgrading interruption mark, if the upgrading interruption mark is set to be a first mark, indicating that the embedded equipment is upgrading target software before power failure, storing relevant upgrading progress information, reading the stored upgrading progress information by the equipment, sending the upgrading progress information to a server, and updating the upgrading interruption mark to be a second mark after the sending is finished.
The second identifier is used for being distinguished from the first identifier, and indicates that the equipment does not store related upgrading progress information of uncompleted upgrading tasks. When the embedded device is not abnormally powered down, the upgrade interruption flag can be set as the second identifier by default.
The form of the second identifier is not limited in the embodiments of the present application, as long as the second identifier is distinguishable from the first identifier. For example, the first identifier may be "true" and the second identifier may be "false".
The server compares the version information and the total data volume of the target version of software data with version information and first total data volume of each version of target software stored in the server respectively based on the version information in the received upgrade progress information and the total data volume of the target version of software data, if the target version of software data exists in the server, sending a confirmation message to the terminal device, informing the terminal device that the target version of the software data exists in the server, the software upgrading prompt information corresponding to the target version can be provided for the user through the terminal device bound with the embedded device, for prompting the user of the version number of the target version and the current version number of the target software to be upgraded, and providing software upgrade options for the user to select, the software upgrading options can include a breakpoint resuming option, a re-upgrading option and an upgrade stopping option. And generating corresponding upgrading instructions based on the selection operation of the user on the software upgrading options, and respectively sending the upgrading instructions to the server and the embedded equipment to execute the software upgrading operation corresponding to the upgrading instructions.
And if the fact that the software data of the target version does not exist in the server is determined, sending an exception prompt to the terminal equipment to prompt that the software data of the target version does not exist in the server of the user, so that upgrading cannot be carried out.
In an alternative embodiment, as shown in fig. 3, after the embedded device is powered off abnormally, the embedded power failure exception handling process may include the following steps:
(1) OTA upgrading is carried out on target software in the embedded equipment;
(2) when the embedded equipment is powered off accidentally, a power failure detection module in the embedded equipment detects a power failure signal and triggers power failure exception handling;
(3) the embedded device detects whether the software which is being upgraded by the OTA exists in the device, if so, the step (4) is carried out, and if not, the step (6) is carried out;
(4) storing software data in the OTA upgrading process through a main control chip in the embedded equipment;
(5) when the data is successfully stored, an upgrade interruption mark is set;
(6) and the embedded equipment finishes the process of processing the power failure exception.
In an alternative embodiment, when the upgrade interruption flag bit is the first flag, the interactive diagram of the software upgrade method in the present application is shown in fig. 4, and may include the following steps:
in this example, the target software to be upgraded in the embedded device is firmware in the embedded device.
(1) The embedded device obtains firmware upgrade data (i.e., target version of software data) from the server, with the firmware in an upgrading state.
(2) The embedded equipment suddenly enters a power-down state, and the charge and discharge module automatically supplies power to the equipment according to the physical characteristics of a charge and discharge circuit of the charge and discharge module; meanwhile, a power failure detection module detects a power failure signal and triggers power failure exception handling; the power failure exception handling may include: sending a device power down notification to the server to notify the server that data does not need to be sent again; and storing the upgrading progress information of the firmware of the target version, and setting an upgrading interruption flag bit as a first flag after the storing is finished.
(3) And when the embedded equipment is powered on again, determining the value of the upgrading interrupt mark.
(4) And if the upgrading interruption mark is the first mark, the embedded equipment sends upgrading progress information to the server.
(5) And the server compares the version information in the upgrading progress information and the total data volume of the software data of the target version with the version information and the first total data volume of each version of the target software stored in the server respectively to obtain a version comparison result. And the version comparison result is used for indicating whether the target version of the firmware exists in the server or not.
(6) And the server respectively sends version comparison results to the embedded equipment and the mobile terminal and informs the equipment and the mobile terminal whether the firmware of the target version exists in the server.
(7) And if the version comparison result shows that the firmware of the target version exists in the server, displaying a software upgrading option in the mobile terminal, and then receiving the selection operation of the user for the software upgrading option. The software upgrade options may include a breakpoint resume option, a re-upgrade option, and a stop upgrade option. The processing scheme corresponding to the breakpoint resume option can indicate that the embedded equipment and the mobile terminal continue to download on the basis of the downloaded software data according to the stored upgrade progress information; the processing scheme corresponding to the re-upgrading option can be that the software data downloaded before the power failure of the equipment is abandoned, so that the embedded equipment obtains the software data of the target software of the target version from the server again; and the processing scheme corresponding to the upgrade stopping option is to terminate the software upgrade.
(8) And the mobile terminal sends the selection operation of the user for the software upgrading option to the server.
(9) And the server can perform breakpoint continuous transmission on the software data of the target version according to the acquisition progress information in the upgrading progress information.
In this embodiment of the present application, if the value of the upgrade interruption flag is the second flag, the software upgrading method may further include the following steps:
(1) the embedded device acquires the current version identification of the target software and the version identification of the latest version of the target software in the server.
The current version identifier refers to a version identifier of a version before the target software in the embedded device is upgraded, and can be acquired from software information of the target software of the embedded device. The version identifier of the latest version of the target software in the server may be obtained directly from the server, or may be obtained from a terminal device connected to the server, which is not limited in this application.
Specifically, the terminal device may be a mobile terminal, and the mobile terminal may be connected to the server to display each version of the target software in the server in real time. If the version identification of the latest version of the target software is acquired from the mobile terminal, a software version acquisition request can be sent to the mobile terminal, and the mobile terminal sends the version identification of the latest version of the target software to the embedded equipment; if the display target software does not exist in the mobile terminal, the user can be prompted to 'no upgradeable software' on a display interface in the mobile terminal.
(2) Comparing the current version identification with the version identification of the latest version of the target software in the server, and if the version identification of the latest version is higher than the current version identification, the embedded equipment sends a software upgrading prompt of the target software to the terminal equipment; the software upgrading prompt is used for prompting whether the target software is upgraded to the latest version; if the current version identification is higher than or the same as the version identification of the latest version, the embedded device sends a prompt that the target software does not need to be upgraded to the terminal device, and informs a user that the current target software is the latest version and does not need to be upgraded.
Wherein, each version of the target software in the server can be added (uploaded) or deleted by a user with management authority in the server. When the latest version of the versions of the target software stored by the server is deleted by the user, the server may determine a comparatively latest version from the remaining versions of the target software, where the latest version of the target software in the server may be lower than the current version of the target software in the embedded device.
The version identifier may be a version number, a version release date, a version flag, and the like, and the present application is not limited thereto.
Specifically, the version id of the latest version is higher than the current version id, which may include one of the following situations:
the latest version has a version number higher than the current version number, for example, if the latest version has a version number of "2.0" and the current version number is "1.0", then the latest version has a version number higher than the current version number;
the release date of the latest version is after the release date of the current version, for example, the release date of the latest version is "0728" which represents twenty-eight days of july, while the release date of the current version is "0409" which represents nine days of april, the embedded device may compare the first two bits of the representative month first and then the last two bits of the representative month, and the specific comparison scheme is not limited in the present application;
the version flag of the latest version is higher than the current version flag in the preset version comparison rule, for example, a version flag "plus (enhanced version)" may be set to be higher than a version flag "pro (professional version)" in the version comparison rule, and if the version flag of the latest version is "plus" and the current version flag is "pro (professional version)", the embedded device may determine that the version flag of the latest version is higher than the current version flag in the preset version comparison rule according to the preset version comparison rule.
(3) When the terminal equipment receives the upgrading confirmation operation of the user aiming at the software upgrading prompt, the embedded equipment acquires the software data of the target software with the latest version from the server.
In some embodiments, since the latest version of the target software is stored in the server, when the update interruption flag is the second identifier, the embedded device may directly send a software version request to the server, obtain the version identifier of the latest version of the target software stored in the server from the server, further compare the version identifier of the latest version with the version identifier of the current version, and if the version identifier of the latest version is different from the version identifier of the current version, send a software update prompt to the terminal device to prompt whether to update the target software to the latest version.
In other embodiments, the current version identifier of the target software and the version identifiers of all existing versions of the target software may be obtained, and if the current version identifier is different from the version identifier of the latest version, a software upgrade prompt is sent to the terminal device. The user can select the target version which is desired to be upgraded from the software upgrading prompt, the target version may not be the latest version, and the target version is newer than the current version of the target software.
In the embodiment, whether target software which is not upgraded exists in the embedded device before sudden power failure and whether the upgrade progress information of the target software is completely recorded are quickly judged by setting the upgrade interruption mark, so that after the embedded device is powered on again, breakpoint continuous transmission can be performed on the basis of the downloaded software data of the target version according to the upgrade progress information, the re-downloading is avoided, and the reliability and the efficiency of a software upgrade process are improved. If the update interruption mark is the second mark, the embedded device can automatically send a software version request to the terminal device, receive the version identification of the latest version of the target software returned by the terminal device, compare the version identification of the latest version with the version identification of the current version, and prompt a user whether the target software needs to be updated to the latest version, so that the user does not need to compare the latest version with the current version of the target software, the user experience is improved, and the software update efficiency is also improved.
In order to explain the software upgrading method of the present application more clearly, the software upgrading method will be further described with reference to specific alternative embodiments.
In this optional embodiment, the terminal device may be a mobile terminal, the target software to be upgraded in the embedded device is a firmware in the embedded device, and the embedded device may include a charging and discharging module and a power failure detection module.
Fig. 5 shows a schematic structural diagram of an embedded device provided in an alternative embodiment of the present application, and as shown in fig. 5, the embedded device includes a main control chip 501, a power failure detection module 502, a power supply module 503, a control power supply module 504, and a charging and discharging module 505. The power module 503 is used to normally supply power to the embedded device when the embedded device is not abnormally powered down, and can charge the charging and discharging module 505. The control power supply module 504 can adjust the power supply voltage of the power supply module 503 and the charging and discharging module 505, so that the power supply voltage is adapted to the working voltage of the embedded device. The remaining modules are described above and will not be repeated here.
As shown in fig. 6, the software upgrading method provided in this alternative embodiment may include the following steps:
step S601, the embedded device acquires firmware upgrading data from a server, and the firmware is in an upgrading state;
step S602, the embedded device suddenly enters a power-down state, and the charging and discharging module automatically supplies power to the device according to the physical characteristics of a charging and discharging circuit of the embedded device; meanwhile, the power failure detection module receives power failure information and triggers power failure exception handling; the power failure exception handling may include: sending a device power down notification to the server to notify the server that data does not need to be sent again; and storing the upgrading progress information of the firmware of the target version, and if the upgrading progress information is stored completely. Setting an upgrade interruption flag as a first flag, otherwise, keeping the upgrade interruption flag as a second flag; the first flag may be "True" and the second flag may be "False";
step S603, after the embedded device is powered on again, determining the value of the upgrade interruption mark, if the upgrade interruption mark is the first mark, entering step S604, otherwise entering step S609;
step S604, the embedded device reads the upgrade progress information stored in the embedded device and sends the upgrade progress information to the server; the upgrade progress information may include an upgrade progress (percentage) of the target firmware, a total data amount of the target firmware of the target version, a downloaded data amount, a version number of the target version, a version number of a current version of the target firmware, and the like;
step S605, the server determines whether the firmware of the target version exists in the server based on the upgrading progress information, if not, the step S606 is carried out, and if so, the step S607 is carried out; specifically, the server may first detect whether the firmware with the same version number as that in the upgrade progress information exists in the server, and if so, compare the total data volume of the target firmware of the target version in the upgrade progress information with the total data volume of the firmware with the same version number as that in the server, if so, determine that the firmware of the target version exists in the server, otherwise, determine that the firmware of the target version does not exist in the server;
step S606, sending a firmware upgrading failure prompt to the mobile terminal, and ending the firmware upgrading process; the reason can be noted in the firmware upgrade failure prompt: the server side does not inquire the firmware of the target version;
step S607, the server sends the confirmation message to the mobile terminal, displays the software upgrading option through the mobile terminal, receives the selection operation of the user aiming at the software upgrading option and sends the operation to the server; the software upgrading options can comprise a breakpoint resuming option, a re-upgrading option and an upgrading stopping option, different options represent subsequent different processing schemes, and the processing scheme corresponding to the breakpoint resuming option can indicate that the embedded device and the mobile terminal continue to download on the basis of the downloaded software data according to the stored upgrading progress information; the processing scheme corresponding to the re-upgrading option can be that the software data downloaded before the power failure of the equipment is abandoned, so that the embedded equipment obtains the software data of the target software of the target version from the server again; if the processing scheme corresponding to the upgrade stopping option is to stop the software upgrade;
step S608, the server performs breakpoint resuming on the software data of the target version according to the upgrade progress information.
Step S609, when the upgrading interruption mark is a second mark, acquiring a current version mark of the target firmware in the embedded equipment, and sending a software version acquisition request to the mobile terminal; the software version acquisition request is used for acquiring the version identification of the latest version of the target firmware from the terminal equipment;
step S610, the mobile terminal sends the version identification of the latest version of the target firmware to the embedded equipment;
step S611, comparing the current version identifier with the version identifier of the latest version, if the current version identifier is different from the version identifier of the latest version, the step S612 is performed, and if the current version identifier is the same as the version identifier of the latest version, the step S613 is performed;
step S612, sending a software upgrading prompt of the target firmware to the terminal equipment, and if receiving a confirmation operation of a user for the software upgrading prompt sent by the mobile terminal, acquiring software data of the target firmware of the latest version from the server by the embedded equipment; the software upgrading prompt is used for prompting whether the target firmware is upgraded to the latest version;
step S613, the embedded device sends a prompt that the target firmware does not need to be upgraded to the mobile terminal, and informs the user that the current target firmware is the latest version and does not need to be upgraded.
An embodiment of the present application provides an electronic device, including: a memory and a processor; at least one program stored in the memory for execution by the processor, which when executed by the processor, implements: the reliability and the efficiency of software upgrading are improved.
An embodiment of the present application provides a software upgrading apparatus, as shown in fig. 7, the software upgrading apparatus 70 may include: a software data acquisition module 701, a progress information recording module 702 and a breakpoint resuming module 703,
a software data obtaining module 701, configured to, when the embedded device is in a powered-on state, respond to an upgrade trigger operation for target software in the embedded device, and obtain software data of a target version of the target software from the server;
the power failure exception handling module 702 is configured to, when a power failure signal is detected, supply power to the embedded device by using the charge-discharge module, and record upgrade progress information of the target software;
the breakpoint resuming module 703, when detecting that the embedded device is powered on again, sends the upgrade progress information to the server, so that the server performs breakpoint resuming on the software data of the target version according to the upgrade progress information.
According to the software upgrading device, in the process of upgrading the target software in the embedded equipment to the target version, if the embedded equipment is powered off accidentally, the equipment can be powered through the charging and discharging module in the embedded equipment, so that the equipment can successfully record the upgrading progress information of the target software, and after the embedded equipment is detected to be powered on again, the upgrading progress information is sent to the server, so that the server can continuously transmit the software data of the target version at the breakpoint according to the upgrading progress information. When the embedded equipment is powered off accidentally, the equipment is powered on in time through the charging and discharging module, so that the equipment can save the upgrading progress information of the target software in time, and after the embedded equipment is powered on again, the embedded equipment can continuously transmit data with the server according to the upgrading progress information on the basis of the software data transmission progress before the power failure, so that the reliability of a software upgrading process is improved, and the efficiency of software upgrading is also improved.
In the embodiment of the application, when the embedded device is in a power-on state, the charging and discharging module is in a charging state; when a power failure signal is detected, a charge-discharge module supplies power to the embedded equipment;
the power supply time for the embedded equipment by the charge-discharge module is not less than the time required for recording the upgrade progress information when the embedded equipment is powered off.
In this embodiment of the present application, the system further includes an upgrade interruption flag setting module, which is specifically configured to:
when the record of the upgrading progress information is finished, setting an upgrading interruption mark as a first mark, wherein the first mark is used for identifying the interruption of the target software in the upgrading process;
sending the upgrade progress information to a server, including:
determining the value of an upgrade interruption flag; and if the value of the upgrading interruption mark is the first mark, sending upgrading progress information to the server, and updating the value of the upgrading interruption mark into a second mark.
In this embodiment of the present application, if the value of the upgrade interruption flag is the second flag, the software upgrade module is further included, and is specifically configured to:
acquiring a current version identifier of target software and a version identifier of the latest version of the target software in a server;
comparing the current version identification with the version identification of the latest version of the target software in the server, if the version identification of the latest version is higher than the current version identification, sending a software upgrading prompt to the terminal equipment so as to receive the software data of the latest version sent by the server when an upgrading confirmation operation is received on the terminal equipment;
the software upgrading prompt is used for prompting whether the target software is upgraded to the latest version, and the terminal equipment is equipment bound and connected with the embedded equipment.
In the embodiment of the application, the upgrade progress information includes version information of a target version, total data volume of software data of the target version, a storage address of the acquired software data of the target version, and acquisition progress information;
the breakpoint resuming module 703 is specifically configured to, when sending the upgrade progress information to the server so that the server performs breakpoint resuming on the software data of the target version according to the upgrade progress information:
sending the upgrade progress information to the server so as to enable the server to execute the following operations:
if the software data of the target version is determined to exist according to the version information and the total data volume, providing software upgrading prompt information for a user through terminal equipment, wherein the software upgrading prompt information comprises a software upgrading option, the software upgrading option comprises a breakpoint transmission resuming option, a re-upgrading option and an upgrading stopping option, and the terminal equipment is equipment bound with the embedded equipment;
and if the selection operation of the user for the breakpoint resume option is acquired, performing breakpoint resume on the software data of the target version according to the storage address and the acquisition progress information.
In this embodiment of the application, the acquisition progress information includes the data volume of the acquired software data of the target version and a ratio of the acquired data volume to the total data volume.
In the embodiment of the present application, the apparatus further includes a power down detection module, and when a power down signal is detected, the power down detection module is specifically configured to:
and sending upgrade stop prompt information to the server to prompt the server to stop sending the software data of the target version.
In an alternative embodiment, an electronic device is provided, as shown in fig. 8, the electronic device 4000 shown in fig. 8 comprising: a processor 4001 and a memory 4003. Processor 4001 is coupled to memory 4003, such as via bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, and the transceiver 4004 may be used for data interaction between the electronic device and other devices, such as transmission of data and/or reception of data. In addition, the transceiver 4004 is not limited to one in practical applications, and the structure of the electronic device 4000 is not limited to the embodiment of the present application.
The Processor 4001 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 4001 may also be a combination that performs a computational function, including, for example, a combination of one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
Bus 4002 may include a path that carries information between the aforementioned components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 4002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
The Memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
The memory 4003 is used for storing application program codes (computer programs) for executing the present scheme, and is controlled by the processor 4001 to execute. Processor 4001 is configured to execute application code stored in memory 4003 to implement what is shown in the foregoing method embodiments.
The electronic devices include, but are not limited to, mobile terminals such as mobile phones, notebook computers, PADs, etc., and fixed terminals such as digital TVs, desktop computers, etc.
The present application provides a computer-readable storage medium, on which a computer program is stored, which, when running on a computer, enables the computer to execute the corresponding content in the foregoing method embodiments. Compared with the prior art, when the embedded device is powered off accidentally, the charging and discharging module supplies power to the device in time, so that the device can store the upgrading progress information of the target software in time, and after the embedded device is powered on again, the data can be continuously transmitted on the basis of the software data transmission progress before the power failure according to the upgrading progress information, the reliability of the software upgrading process is improved, and the efficiency of software upgrading is improved.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device realizes the following when executed:
in the process of upgrading target software in the embedded equipment to a target version, if the embedded equipment is powered off accidentally, the equipment can be powered on through a charging and discharging module in the embedded equipment, so that the equipment can successfully record the upgrading progress information of the target software, when the embedded equipment is detected to be powered on again, the upgrading progress information is sent to the server, an upgrading instruction returned by the server is received, and then the embedded equipment can continuously transmit the software data of the target version at a breakpoint based on the upgrading instruction and the upgrading progress information.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for those skilled in the art, several modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations should also be regarded as the protection scope of the present application.

Claims (10)

1. A software upgrading method is applied to embedded equipment and is characterized in that the embedded equipment comprises a charging and discharging module, and the method comprises the following steps:
when the embedded equipment is in a power-on state, responding to an upgrading triggering operation aiming at target software in the embedded equipment, and acquiring software data of a target version of the target software from a server;
when a power failure signal is detected, the charge-discharge module supplies power to the embedded equipment and records the upgrading progress information of the target software;
and when the embedded equipment is detected to be powered on again, sending the upgrading progress information to a server so that the server can continuously transmit the software data of the target version at the break point according to the upgrading progress information.
2. The software upgrading method according to claim 1, wherein when the embedded device is in a power-on state, the charging and discharging module is in a charging state; when a power failure signal is detected, the charge-discharge module supplies power to the embedded equipment;
the power supply time for the embedded equipment by the charge-discharge module is not less than the time required for recording the upgrading progress information when the embedded equipment is powered off.
3. The software upgrading method according to claim 1, characterized in that the method further comprises:
when the upgrade progress information is recorded, setting an upgrade interruption mark as a first mark, wherein the first mark is used for identifying that the target software is interrupted in the upgrade process;
the sending the upgrade progress information to a server includes:
determining a value of the upgrade interruption flag; and if the value of the upgrading interruption mark is the first mark, sending the upgrading progress information to a server, and updating the value of the upgrading interruption mark into a second mark.
4. The method of claim 3, wherein if the value of the upgrade interrupt flag is the second flag, the method further comprises:
acquiring a current version identifier of the target software and a version identifier of the latest version of the target software in a server;
comparing the current version identification with the version identification of the latest version of the target software in the server, if the version identification of the latest version is higher than the current version identification, sending a software upgrading prompt to terminal equipment so as to receive the software data of the latest version sent by the server when an upgrading confirmation operation is received on the terminal equipment;
the software upgrading prompt is used for prompting whether the target software is upgraded to the latest version, and the terminal device is a device bound and connected with the embedded device.
5. The software upgrading method according to any one of claims 1 to 4, wherein the upgrading progress information includes version information of the target version, a total data amount of software data of the target version, a storage address of the acquired software data of the target version, and acquisition progress information;
the sending the upgrade progress information to the server so that the server performs breakpoint continuous transmission on the software data of the target version according to the upgrade progress information includes:
sending the upgrade progress information to the server to enable the server to execute the following operations:
if the software data of the target version is determined to exist according to the version information and the total data volume, providing software upgrading prompt information to a user through terminal equipment, wherein the software upgrading prompt information comprises software upgrading options, the software upgrading options comprise a breakpoint resuming option, a re-upgrading option and an upgrading stopping option, and the terminal equipment is equipment bound with the embedded equipment;
and if the selection operation of the user for the breakpoint resume option is acquired, performing breakpoint resume on the software data of the target version according to the storage address and the acquisition progress information.
6. The software upgrading method according to claim 5, wherein the obtaining progress information includes a data amount of the obtained software data of the target version and a ratio of the obtained data amount to the total data amount.
7. The software upgrading method of claim 1, wherein when a power down signal is detected, the method further comprises:
and sending upgrade stop prompt information to the server to prompt the server to stop sending the software data of the target version.
8. A software upgrading apparatus, comprising:
the software data acquisition module is used for responding to the upgrading triggering operation aiming at the target software in the embedded equipment when the embedded equipment is in a power-on state and acquiring the software data of the target version of the target software from a server;
the power failure exception handling module is used for supplying power to the embedded equipment by the charge-discharge module when a power failure signal is detected, and recording the upgrading progress information of the target software;
and the breakpoint resuming module is used for sending the upgrading progress information to a server after detecting that the embedded equipment is electrified again, so that the server performs breakpoint resuming on the software data of the target version according to the upgrading progress information.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the software upgrade method of any one of claims 1-7 when executing the program.
10. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, implements the software upgrade method of any one of claims 1-7.
CN202111087361.0A 2021-09-16 2021-09-16 Software upgrading method and device, electronic equipment and computer readable storage medium Pending CN113760333A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111087361.0A CN113760333A (en) 2021-09-16 2021-09-16 Software upgrading method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111087361.0A CN113760333A (en) 2021-09-16 2021-09-16 Software upgrading method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN113760333A true CN113760333A (en) 2021-12-07

Family

ID=78795935

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111087361.0A Pending CN113760333A (en) 2021-09-16 2021-09-16 Software upgrading method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113760333A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114281361A (en) * 2021-12-22 2022-04-05 深圳市元征科技股份有限公司 Software processing method and device, electronic equipment and storage medium
CN114817820A (en) * 2022-06-30 2022-07-29 深圳希施玛数据科技有限公司 Early warning method for website data upgrading and related device
CN114827128A (en) * 2022-03-30 2022-07-29 厦门紫光展锐科技有限公司 Breakpoint continuous transmission method and related equipment
CN117112310A (en) * 2023-10-18 2023-11-24 苏州元脑智能科技有限公司 Background task progress saving and restoring method, device, equipment and storage medium
CN114827128B (en) * 2022-03-30 2024-07-05 厦门紫光展锐科技有限公司 Breakpoint continuous transmission method and related equipment

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1487740A (en) * 2002-09-30 2004-04-07 北京中视联数字系统有限公司 Software downloading method in digital TV broadcast
CN102033770A (en) * 2010-12-17 2011-04-27 中兴通讯股份有限公司 Touch screen firmware upgrading method and device for mobile terminal
CN103347095A (en) * 2013-07-22 2013-10-09 广州市交通信息中心 Wireless firmware updating method used in vehicle networking system
CN105162841A (en) * 2015-08-03 2015-12-16 广东美的环境电器制造有限公司 Domestic appliance control method and system
CN106210877A (en) * 2016-08-17 2016-12-07 青岛海信电器股份有限公司 The method for upgrading system of intelligent television and device
WO2017035759A1 (en) * 2015-08-31 2017-03-09 深圳市瑞耐斯技术有限公司 Method and system of rapid data backup on a solid state drive upon abnormal power off
CN108848418A (en) * 2018-06-25 2018-11-20 四川长虹网络科技有限责任公司 Set-top box concentrates upgrade method
CN108874695A (en) * 2017-05-11 2018-11-23 西部数据技术公司 Data are saved when electric power is closed
CN109240721A (en) * 2018-08-24 2019-01-18 江苏恒宝智能系统技术有限公司 A kind of method of MCU online upgrading
CN110112820A (en) * 2019-04-04 2019-08-09 上海挚想科技有限公司 The mobile power source of unexpected power down protection is supported to lease equipment and its power-off protection method
CN110351314A (en) * 2018-04-03 2019-10-18 厦门雅迅网络股份有限公司 The remote upgrade method and computer readable storage medium of automobile controller
CN110597665A (en) * 2019-09-18 2019-12-20 普联技术有限公司 Power-down protection device
CN111506326A (en) * 2020-04-07 2020-08-07 Oppo(重庆)智能科技有限公司 Method, device and equipment for upgrading terminal equipment and storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1487740A (en) * 2002-09-30 2004-04-07 北京中视联数字系统有限公司 Software downloading method in digital TV broadcast
CN102033770A (en) * 2010-12-17 2011-04-27 中兴通讯股份有限公司 Touch screen firmware upgrading method and device for mobile terminal
CN103347095A (en) * 2013-07-22 2013-10-09 广州市交通信息中心 Wireless firmware updating method used in vehicle networking system
CN105162841A (en) * 2015-08-03 2015-12-16 广东美的环境电器制造有限公司 Domestic appliance control method and system
WO2017035759A1 (en) * 2015-08-31 2017-03-09 深圳市瑞耐斯技术有限公司 Method and system of rapid data backup on a solid state drive upon abnormal power off
CN106210877A (en) * 2016-08-17 2016-12-07 青岛海信电器股份有限公司 The method for upgrading system of intelligent television and device
CN108874695A (en) * 2017-05-11 2018-11-23 西部数据技术公司 Data are saved when electric power is closed
CN110351314A (en) * 2018-04-03 2019-10-18 厦门雅迅网络股份有限公司 The remote upgrade method and computer readable storage medium of automobile controller
CN108848418A (en) * 2018-06-25 2018-11-20 四川长虹网络科技有限责任公司 Set-top box concentrates upgrade method
CN109240721A (en) * 2018-08-24 2019-01-18 江苏恒宝智能系统技术有限公司 A kind of method of MCU online upgrading
CN110112820A (en) * 2019-04-04 2019-08-09 上海挚想科技有限公司 The mobile power source of unexpected power down protection is supported to lease equipment and its power-off protection method
CN110597665A (en) * 2019-09-18 2019-12-20 普联技术有限公司 Power-down protection device
CN111506326A (en) * 2020-04-07 2020-08-07 Oppo(重庆)智能科技有限公司 Method, device and equipment for upgrading terminal equipment and storage medium

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114281361A (en) * 2021-12-22 2022-04-05 深圳市元征科技股份有限公司 Software processing method and device, electronic equipment and storage medium
CN114827128A (en) * 2022-03-30 2022-07-29 厦门紫光展锐科技有限公司 Breakpoint continuous transmission method and related equipment
CN114827128B (en) * 2022-03-30 2024-07-05 厦门紫光展锐科技有限公司 Breakpoint continuous transmission method and related equipment
CN114817820A (en) * 2022-06-30 2022-07-29 深圳希施玛数据科技有限公司 Early warning method for website data upgrading and related device
CN114817820B (en) * 2022-06-30 2022-10-14 深圳希施玛数据科技有限公司 Early warning method for website data upgrading and related device
CN117112310A (en) * 2023-10-18 2023-11-24 苏州元脑智能科技有限公司 Background task progress saving and restoring method, device, equipment and storage medium
CN117112310B (en) * 2023-10-18 2024-02-20 苏州元脑智能科技有限公司 Background task progress saving and restoring method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN113760333A (en) Software upgrading method and device, electronic equipment and computer readable storage medium
CN103748569B (en) The system and method without driving operation of USB device
EP3147782A1 (en) Method and device for upgrading software
CN104199706A (en) Firmware upgrade method and device for eMMC
CN113064619A (en) Firmware upgrading method, device, system, equipment and storage medium
CN104915306A (en) Data operation control method and device manager
CN103810010A (en) Information processing method and first electronic device terminal
CN114201197A (en) Firmware upgrading method and device, electronic equipment and readable storage medium
CN103440146A (en) BIOS updating method based on cloud storage
CN114489711A (en) Terminal upgrading method and device and storage medium
CN110399151A (en) A kind of firmware update, device, equipment and medium
CN107836107A (en) Message processing device, device, information processing system, information processing method and message handling program
CN110970954B (en) Charging control method and device, storage medium and split type electronic equipment
CN111610995B (en) Device firmware upgrading method and device, electronic device and storage medium
CN104350476A (en) A method and a device for adjusting a version checking period
CN111284352A (en) Transport vehicle charging method and system
WO2016206437A1 (en) Rom package generation method and device
CN112527363A (en) Software package version updating method, device, system, equipment and medium
US9479565B2 (en) Selecting a network connection for data communications with a networked device
CN110970948A (en) Charging control method and device, storage medium and split type electronic equipment
JP2020101889A (en) Module, information processing device provided with module, program data update method for updating program data of module
JP2000259538A (en) Network control unit, network setting method and storage medium storing computer readable program
CN109547999B (en) Method for managing integrated circuit card, corresponding card and device
CN118093320A (en) Method and device for monitoring processor information, storage medium and electronic equipment
CN117032583A (en) Data reading method, device, equipment and storage medium

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
CB02 Change of applicant information

Address after: Room 263, block B, science and technology innovation center, 128 Shuanglian Road, Haining Economic Development Zone, Haining City, Jiaxing City, Zhejiang Province, 314400

Applicant after: Haining yisiwei IC Design Co.,Ltd.

Applicant after: Beijing ESWIN Computing Technology Co.,Ltd.

Address before: Room 263, block B, science and technology innovation center, 128 Shuanglian Road, Haining Economic Development Zone, Haining City, Jiaxing City, Zhejiang Province, 314400

Applicant before: Haining yisiwei IC Design Co.,Ltd.

Applicant before: Beijing yisiwei Computing Technology Co.,Ltd.

CB02 Change of applicant information