CN115658103A - System upgrading method, electronic device and storage medium - Google Patents

System upgrading method, electronic device and storage medium Download PDF

Info

Publication number
CN115658103A
CN115658103A CN202211262304.6A CN202211262304A CN115658103A CN 115658103 A CN115658103 A CN 115658103A CN 202211262304 A CN202211262304 A CN 202211262304A CN 115658103 A CN115658103 A CN 115658103A
Authority
CN
China
Prior art keywords
mirror image
partition
image data
updated
upper computer
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
CN202211262304.6A
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.)
Hefei Yirui Communication Technology Co Ltd
Original Assignee
Hefei Yirui Communication Technology 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 Hefei Yirui Communication Technology Co Ltd filed Critical Hefei Yirui Communication Technology Co Ltd
Priority to CN202211262304.6A priority Critical patent/CN115658103A/en
Publication of CN115658103A publication Critical patent/CN115658103A/en
Pending legal-status Critical Current

Links

Images

Abstract

The embodiment of the application relates to the technical field of communication, and discloses a system upgrading method, electronic equipment and a storage medium. The method comprises the following steps: determining a current partition to be updated according to a mirror image configuration file sent by an upper computer; sending a mirror image data request of a partition to be updated to an upper computer and receiving mirror image data sent by the upper computer; under the condition that the partition to be updated is not the target partition, directly performing mirror image update on the partition to be updated, and sending a mirror image data request of the next partition to be updated to the upper computer after the update is finished; and when the partition to be updated is the target partition, caching the mirror image data, updating the mirror image of the partition to be updated in the system restart stage, and sending a mirror image data request of the next partition to be updated to the upper computer after the cache is finished. The mirror image file is acquired partition by partition for mirror image updating, so that the storage space requirement is reduced; and carrying out mirror image updating on the safety trust mechanism limiting partition in a restarting stage by using a preset loading program, so that the safety trust mechanism is prevented from being changed.

Description

System upgrading method, electronic device and storage medium
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a system upgrading method, electronic equipment and a storage medium.
Background
With the continuous development of communication technology, electronic products are continuously miniaturized, and small and miniature electronic products are gradually the most commonly used electronic devices in life. In order to realize the management and control operation and low energy consumption of the electronic device, it is generally adopted to control the normal operation of the electronic device through an embedded device or system.
The embedded device or system usually contains a plurality of partition images, and usually also has a partition protected by a security trust authentication mechanism, and in the process of upgrading the system of the embedded device or system, the images of all the partitions need to be upgraded, and the image of the current version is replaced by the image of the target version. In a currently common mode, one mode is to perform system upgrade by using an AB dual partition mode, and since data in data areas such as a kernel and a root file system in a running partition cannot be erased in real time, all mirror images are saved in a system partition that is not running, mirror image data of a target version is updated to a system partition that is not running, and then the system is switched to a partition system with updated mirror image data to run, and then data is gradually synchronized to another partition. The other mode is that a difference mechanism is used, a difference tool is customized according to requirements, the difference tool is used for carrying out difference analysis on the mirror image data of the target version and the mirror image data of the current version, a small mirror image data difference packet is manufactured to carry out increment upgrading on the system, however, the security trust mechanism of the system cannot be directly modified for the partition protected by the security trust mechanism, and the security trust mechanism of the system needs to be changed so as to authorize mirror image upgrading on the partition protected by the security trust mechanism.
However, the inventor of the present application finds that the current system upgrade method requires a large storage space to implement, or requires tool customization and system mechanism update, and is complex to implement and poor in adaptability.
The original method is that a USB port is needed to be configured at a product end during production and manufacturing, upgrading is performed by using the USB port, the product does not actually use the USB port, and the product cost is increased.
Disclosure of Invention
Some embodiments of the present application provide a system upgrade method, an electronic device, and a storage medium, which reduce a requirement for a storage space of an image update by acquiring an image file partition by partition to perform the image update; the image updating is simply and efficiently realized by carrying out image updating on the partition limited by the security trust mechanism according to the preset loading program in the restarting stage.
In order to solve at least the above technical problem, an embodiment of the present application provides a system upgrade method, including: receiving a mirror image configuration file sent by an upper computer, and determining a current partition to be updated according to the mirror image configuration file; sending a mirror image data request of the partition to be updated to the upper computer, and receiving mirror image data sent by the upper computer; under the condition that the partition to be updated is not a target partition, performing mirror image update on the partition to be updated according to the mirror image data, and sending a mirror image data request of the next partition to be updated to the upper computer after the update is completed; wherein the target partition comprises a data area constrained by a security trust mechanism and/or a raw data area without a file system; and when the partition to be updated is the target partition, caching the mirror image data, updating the mirror image of the partition to be updated in a system restart stage according to a preset loading program, and sending a mirror image data request of the next partition to be updated to the upper computer after the caching is finished.
In order to solve at least the above technical problem, an embodiment of the present application further provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the system upgrade method described above.
In order to solve at least the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the system upgrade method described above.
Compared with the prior art, the system upgrading method provided by the embodiment of the application determines the current partition to be updated according to the mirror image configuration file sent by the upper computer, generates a mirror image data request to the upper computer and acquires the mirror image data of the partition to be updated sent by the upper computer; then, under the condition that the current partition to be updated is not a partition restricted by a security trust mechanism or an original data area without a file system, performing mirror image update on the partition to be updated according to the acquired mirror image data; under the condition that the current partition to be updated is a partition constrained by a security trust mechanism or an original data area without a file system, caching the mirror image data, and performing mirror image update on the partition to be updated at the system restart stage according to a preset loading program; after the mirror image of the partition to be updated is updated or the mirror image data of the partition to be updated is cached, determining the next partition to be updated, and sending a mirror image data request of the next partition to be updated to the upper computer. The method has the advantages that the requirement of the mirror image updating process on the storage space of the embedded equipment or the system and the flow consumption in the mirror image updating process are reduced by acquiring the mirror image file data of the target version by partitions to update the partition mirror image, the partition mirror image updating limited by the security trust mechanism or the original data area without the file system is updated by the mirror image data of the preset loading program and the cache in the restarting stage, the mirror image updating of all the partition mirrors is simply and efficiently realized on the basis of not changing the security trust mechanism, the burning of the pre-installed firmware is convenient for manufacturers to manufacture products, and the adaptability and the practicability of the system updating method are improved.
In addition, before the receiving of the image configuration file sent by the upper computer, the method further comprises: switching the current system into a pre-configured upgrading system according to the received upgrading instruction; and establishing communication connection with the upper computer according to a preset upgrading program in the upgrading system. By configuring an independently operating upgrading system in advance, switching to the upgrading system after receiving an upgrading instruction, and establishing communication connection with an upper computer through the upgrading system according to a preset upgrading program to carry out mirror image upgrading, upgrading and normal operation of the embedded equipment or the system are independent from each other, and interference of mirror image upgrading on normally operating data is avoided.
In addition, according to the preset upgrading program in the upgrading system, the communication connection with the upper computer is established, and the method comprises the following steps: and establishing physical connection with the upper computer through a pre-established Ethernet physical interface, and allocating an IP address to the upper computer based on a dynamic host configuration protocol according to the preset upgrading program to establish communication connection. The embedded device is connected with the embedded device by pre-establishing a physical network port, and an IP address is allocated to the upper computer based on a dynamic host configuration protocol according to a preset upgrading program, so that the communication connection between the upper computer and the embedded device is realized by using a local area network, the embedded device can also obtain the mirror image data of a target version from the upper computer in an upgrading state, and the embedded device or the embedded system can be guaranteed to smoothly complete the mirror image upgrading.
In addition, the mirror image configuration file comprises the mirror image data check code of each partition to be updated, and after receiving the mirror image data issued by the upper computer, the mirror image configuration file further comprises: according to the current mirror image data check code of the partition to be updated, checking the mirror image data; and under the condition that the mirror image data is not verified, re-sending the current mirror image data request of the partition to be updated to the upper computer. The file check code is set in the configuration file, the received mirror image data is checked according to the data check code carried in the configuration file after the mirror image data is obtained, and the mirror image data is requested to the upper computer again under the condition that the check is failed, so that the correctness and the accuracy of the obtained mirror image data are ensured, the mirror image updating accuracy is improved, and the error updating of the mirror image is avoided.
In addition, the mirror data check code includes: a longitudinal redundancy check LRC code, a cyclic redundancy check CRC code, or a message digest MD5 value. By setting various optional file check codes, a proper file check code can be selected according to a specific application scene and actual requirements, and the adaptability of the system upgrading method to different scenes is improved.
In addition, the mirror image configuration file comprises the standard length of the mirror image data of the partition to be updated, and after receiving the mirror image data issued by the upper computer, the mirror image configuration file further comprises: detecting whether the actual length of the received mirror image data is consistent with the standard length of the mirror image data; and under the condition that the actual length of the received mirror image data is not matched with the standard length of the mirror image data, re-sending the current mirror image data request of the partition to be updated to the upper computer. The standard length of the mirror image data is set in the configuration file, after the mirror image data is obtained, the length of the received mirror image data is checked according to the standard length of the mirror image data carried in the configuration file, and the mirror image data is requested to the upper computer again under the condition that the check fails, so that the missing transmission or the loss of the mirror image data is avoided.
In addition, after the mirror image updating is performed on the partition to be updated according to the mirror image data and the caching is performed on the mirror image data, the method further includes: and sending a first response message to the upper computer, so that the upper computer updates the mirror image updating progress according to the first response message, and recovers the mirror image updating progress according to the mirror image updating progress under the condition that the mirror image updating progress is interrupted. The upper computer records the partition number of the finished mirror image data issuing by feeding back the first response message to the upper computer, and records the mirror image updating progress, so that the mirror image updating progress can be recovered according to the mirror image updating progress after the mirror image updating progress is interrupted, the overall updating efficiency under the condition that the mirror image updating progress is interrupted is ensured, and the mirror image data is prevented from being issued repeatedly.
In addition, the performing mirror image update on the partition to be updated in the restart phase according to the preset loader includes: after the mirror image updating of the partitions outside the target partition is finished, restarting the system according to the preset loading program; and in the process of restarting the system, reading the cached mirror image data through a loader, and performing mirror image updating on each target partition. By restarting the system after the mirror image of the non-target partition is updated according to the preset loading program, the loader can update the mirror image of each target partition according to the mirror image data in the cache region, thereby avoiding the need of changing the security trust mechanism of the system and simplifying the mirror image updating process of the system.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
FIG. 1 is a flow chart of a system upgrade method provided according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an electronic device according to another embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation manner of the present invention, and the embodiments may be mutually incorporated and referred to without contradiction.
The following description will specifically describe implementation details of the system upgrade method described in the present application with reference to specific embodiments, and the following description is only provided for facilitating understanding of the implementation details and is not necessary for implementing the present solution.
In a specific application, the system upgrade method may be applied to an embedded device with a built-in system, or a terminal with an embedded system, such as an electronic device like a computer, a mobile phone, etc., in this embodiment, the application to the embedded device is exemplified, and a process of system upgrade may refer to fig. 1, and at least includes the following steps:
step 101, receiving a mirror image configuration file sent by an upper computer, and determining a current partition to be updated according to the mirror image configuration file.
Specifically, the embedded device is in communication connection with an upper computer providing image file data of a target version under the condition that system upgrading is needed, and then receives an image configuration file sent by the upper computer according to the embedded device in a network communication mode. Such as socket transport, TCP transport, etc. The image configuration file is composed of a plurality of image file data areas to be upgraded, which are obtained by partitioning an image file to be packaged by an upper computer, and a plurality of image file names are corresponding to each image file data area. The embedded device decodes the configuration file after acquiring the mirror image configuration file sent by the upper computer, and then sequentially takes the mirror image file data areas as the current to-be-updated partition according to the sequence of the mirror image file data areas in the mirror image configuration file, and updates the mirror image file data areas one by one.
In some embodiments, before receiving the image configuration file sent by the upper computer, the method further includes: switching the current system into a pre-configured upgrading system according to the received upgrading instruction; and establishing communication connection with an upper computer according to a preset upgrading program in the upgrading system.
The embedded device is generally connected with the external device through the monitoring program under the normal working state, so that the external device can monitor and adjust the working state of the embedded device conveniently, and an upgrading instruction can be sent to the embedded device through the monitoring program under the condition that the system upgrading of the embedded device is needed. After receiving the upgrading instruction, the embedded device suspends the operation of the current system according to the prestored system switching instruction, switches to the preconfigured upgrading system and enters a recovery mode. The upgrading system is an independent minimum system, has a simply configured kernel operating system and an independent root file system, and is independent from a main system in normal operation and not interfered mutually. And then establishing communication connection with the upper computer in a recovery mode according to a preset upgrading program in the upgrading system. The upgrading system which runs independently is configured for the embedded equipment in advance, the upgrading system is switched to run after an upgrading instruction is received, and the upgrading system is in communication connection with the upper computer according to a preset upgrading program to carry out image upgrading, so that the system upgrading and the normal running of the embedded equipment are independent from each other, and the interference of the image upgrading on the data which runs normally is avoided.
In some embodiments, establishing a communication connection with an upper computer according to a preset upgrade program in an upgrade system includes: the method comprises the steps of establishing physical connection with an upper computer through a pre-established Ethernet physical interface, and allocating an IP address for the upper computer to establish communication connection based on a dynamic host configuration protocol according to a preset upgrading program.
When the embedded device performs system upgrade in the recovery mode, there is no network interface capable of allocating an IP address, and therefore, the embedded device cannot be connected to other devices having network interfaces, and therefore, an ethernet physical interface can be created in advance for the embedded device for use in the recovery mode, and a preset upgrade program is added to the upgrade system, and the preset upgrade program is used for allocating an IP address to a device that establishes physical connection through the ethernet physical interface created in advance based on a dynamic host configuration protocol to complete establishment of communication connection. The ethernet physical Interface may be constructed by module collocation, for example, constructing a Gigabit Media Independent Interface RGMII (Reduced Gigabit Media Independent Interface), a Gigabit Media Serial Interface SGMII (Serial Media Independent Interface), an UxSGMII, a network Interface of a PCIE Interface, and the like. After the embedded device is switched to the upgrading system and enters a recovery mode, a network cable, such as an RJ45 network cable, is firstly utilized to be physically connected with an upper computer through a preset network port, then a local area network interface drive is loaded according to a preset upgrading program, the upper computer connected through the preset network port is allocated with an IP address based on a dynamic host configuration protocol, and a TCP connection is established between the upper computer and the embedded device, so that the communication connection between the upper computer and the embedded device is realized. The embedded equipment is characterized in that the upper computer is physically connected with the embedded equipment through a pre-established physical network port, and an IP address is allocated to the upper computer based on a dynamic host configuration protocol according to a preset upgrading program, so that the upper computer is in communication connection with the embedded equipment through a local area network, the embedded equipment can also obtain the mirror image data of a target version from the upper computer in an upgrading state, and the embedded equipment or the embedded system can be guaranteed to smoothly complete mirror image upgrading.
And 102, sending a mirror image data request of the partition to be updated to the upper computer, and receiving mirror image data sent by the upper computer.
Specifically, after determining a to-be-updated partition which needs to be subjected to image upgrading currently according to an image configuration file, the embedded device sends an image data request of the to-be-updated partition to the upper computer, then receives image data sent by the upper computer according to the image data request, and stores the received image data in a cache area or a specific storage area.
In some embodiments, the mirror image configuration file includes a standard length of mirror image data of the partition to be updated, and after receiving the mirror image data issued by the upper computer, the method further includes: detecting whether the actual length of the received mirror image data is consistent with the standard length of the mirror image data or not; and under the condition that the actual length of the received mirror image data is not matched with the standard length of the mirror image data, the mirror image data request of the current partition to be updated is sent to the upper computer again.
The mirror image configuration file not only can comprise the partition result of each mirror image file data area and the file name of the mirror image file corresponding to each mirror image file data area, but also can comprise the standard length of the mirror image data (the size of the mirror image file) in each mirror image file data area, and the embedded device determines the actual length of the received mirror image data after receiving the mirror image data of the current partition to be updated sent by the upper computer, and compares the actual length with the standard length of the mirror image data corresponding to the current partition to be updated carried in the mirror image configuration file. And under the condition that the actual length of the mirror image data is not consistent with the standard length of the mirror image data, judging that the obtained mirror image data has errors, re-sending a mirror image data request of the current partition to be updated to the upper computer, receiving the mirror image data re-sent by the upper computer until the actual length of the received mirror image data is consistent with the standard length, and storing the mirror image data. The standard length of the mirror image data is set in the configuration file, the received mirror image data is verified according to the standard length of the mirror image data carried in the configuration file after the mirror image data is obtained, and the mirror image data is requested to the upper computer again under the condition that the verification fails, so that the mirror image data is prevented from being missed, lost or mistransmitted.
In some embodiments, the mirror image configuration file includes a mirror image data check code of each partition to be updated, and after receiving the mirror image data issued by the upper computer, the method further includes: according to the mirror image data check code of the current partition to be updated, checking the mirror image data; and under the condition that the mirror image data does not pass the verification, re-sending a mirror image data request of the current partition to be updated to the upper computer.
The mirror image configuration file can also comprise mirror image data check codes corresponding to all mirror image file data areas serving as partitions to be updated, the embedded device reads the mirror image data check codes of the current partitions to be updated after receiving mirror image data issued by the upper computer, performs data check on the mirror image data according to a preset algorithm according to the mirror image data check codes of the current partitions to be updated, judges that the mirror image data has errors when the mirror image data does not pass the data check, re-sends a mirror image data request of the current partitions to be updated to the upper computer, performs data check on the re-received mirror image data until the received mirror image data can pass the data check, and then stores the mirror image data and performs subsequent mirror image upgrading steps. The file check code is set in the configuration file, the received mirror image data is checked according to the data check code carried in the configuration file after the mirror image data is obtained, and the mirror image data is requested to the upper computer again under the condition that the check is failed, so that the correctness and the accuracy of the obtained mirror image data are ensured, the mirror image updating accuracy is improved, and the error updating of the mirror image is avoided.
In some embodiments, the mirrored data check code includes: a longitudinal redundancy check LRC code, a cyclic redundancy check CRC code, or a message digest MD5 value.
The mirror image data check code can be set according to the adopted mirror image data check mode, and the mirror image data check mode can be selected according to the requirements of the actual scene, for example, when the mirror image data is required to be guaranteed not to be tampered, the MD5 value can be selected as the mirror image check code, and when the integrity and the correctness of the mirror image data are required to be guaranteed, the CRC code can be selected as the mirror image check code. By setting various optional file check codes, a proper file check code can be selected according to a specific application scene and actual requirements, and the adaptability of the system upgrading method to different scenes is improved.
It should be noted that, after receiving the mirror image data request of the embedded device, the upper computer may also perform data verification on the mirror image data to be sent in advance before sending the mirror image data, and directly report an error and upgrade the system of the terminal embedded device if the verification fails. In the process of sending the mirror image data, the sending length of the sent mirror image data can be recorded, and after the sending length reaches the marked length of the mirror image data, the sending request of the next partition of the mirror image data is started to wait.
And 103, under the condition that the partition to be updated is not the target partition, performing mirror image update on the partition to be updated according to the mirror image data, and sending a mirror image data request of the next partition to be updated to the upper computer after the update is completed.
Specifically, after completing data verification on received mirror image data, the embedded device needs to detect whether a current partition to be updated belongs to a target partition, where the target partition includes a data area constrained by a security trust mechanism and/or an original data area without a file system. The data areas in the embedded device include data areas having file systems, such as a root file system, a kernel boot image, a communication coprocessor running image, and the like, which are typically large and may be referred to as a main partition. Also included are raw data areas without file systems, such as IP address databases, executable file format databases, etc., and sensitive data areas subject to security trust mechanisms, which are typically small and may be referred to as small partitions. In order to ensure the efficiency of image updating, the small partition can be used as a target partition to perform centralized updating in the restart phase.
The embedded device detects whether the current partition to be updated belongs to a target partition, performs mirror image update on the partition to be updated according to mirror image data stored in a cache area or a specific storage address under the condition that the partition to be updated is not the target partition, deletes the stored mirror image data of the current partition to be updated after the update is completed, determines the next partition to be updated according to a mirror image configuration file, and sends a mirror image data request of the next partition to be updated to the upper computer until the mirror image data cache or the mirror image update of all the partitions to be updated is completed.
And step 104, caching the mirror image data under the condition that the partition to be updated is the target partition, performing mirror image update on the partition to be updated in the system restart stage according to a preset loading program, and sending a mirror image data request of the next partition to be updated to the upper computer after the cache is completed.
Specifically, after detecting whether the current partition to be updated belongs to the target partition, the embedded device detects whether a target partition cache list exists or not when the partition to be updated is not the target partition, creates a target partition cache list when the target partition cache list does not exist, then adds the partition identifier of the current partition to be updated in the target partition cache list, allocates a mirror image data cache address to the current partition to be updated, and stores the mirror image data of the current partition to be updated in the cache area. And under the condition that the target partition cache list exists, directly updating the target partition cache list, and storing the mirror image data of the current partition to be updated to the cache area according to the allocated mirror image cache address. And then, when the embedded device is restarted according to the preset loading program, accurately carrying out mirror image updating on each target partition to be updated according to the partition identification of the target partition in the system restarting stage.
In addition, after the embedded device completes the caching of the mirror image data of the current partition to be updated, the embedded device determines the next partition to be updated according to the mirror image configuration file, and sends a mirror image data request of the next partition to be updated to the upper computer until the caching or the updating of the mirror image data of all the partitions to be updated is completed.
In some embodiments, performing a mirror update on a partition to be updated in a restart phase according to a preset loader includes: after the mirror image updating of the partitions outside the target partition is finished, restarting the system according to a preset loading program; and in the process of restarting the system, reading the cached mirror image data through a loader, and updating the mirror image of each target partition.
The method comprises the steps that before image updating is carried out on a to-be-updated partition which belongs to a target partition by an embedded device in a restarting stage according to a preset loading program, whether image updating is finished on the to-be-updated partition which does not belong to the target partition or not needs to be detected according to the preset loading program, after image updating is finished on the to-be-updated partition which does not belong to the target partition, restarting is carried out on an upgrading system according to the preset loading program, in the restarting process of the upgrading system, a loader reads a target partition cache list from a cache region according to the preset upgrading program, reads image data of each target partition one by one according to partition identification in the target partition cache list and image data cache addresses of each partition, and directly configures images of each target partition according to the read image data, so that image updating of each target partition is finished. And the cached mirror image data can be deleted after the mirror image updating of all the target partitions is finished. By restarting the system after the mirror image update of the non-target partition is completed according to the preset loading program, the loader can directly perform the mirror image update on the data area constrained by the security trust mechanism and the original data area of the rootless file system according to the mirror image data in the cache area, thereby avoiding the need of changing the security trust mechanism of the system, simplifying the mirror image update process of the system and facilitating the burning of pre-installed firmware when a manufacturer manufactures products.
In some embodiments, after performing mirror image update on the partition to be updated according to the mirror image data and after caching the mirror image data, the method further includes: and sending a first response message to the upper computer, so that the upper computer updates the mirror image updating progress according to the first response message, and recovering the mirror image updating progress according to the mirror image updating progress under the condition that the mirror image updating progress is interrupted.
The embedded device acquires the mirror image data partition by partition in the process of upgrading the system, and directly utilizes the mirror image data to update the mirror image or cache the mirror image data according to whether the current partition to be updated belongs to the target partition. Therefore, after the mirror image update or the mirror image data cache of the partition to be updated is completed, the embedded device sends a first response message to the upper computer, and the first response message is used for prompting that the upper computer finishes sending the current mirror image data of the partition to be updated and is used for the upper computer to update the recorded mirror image update progress. For example, when the upper computer issues the mirror image data according to the partition sequence in the mirror image configuration file, the upper computer may create an update progress record, record the number of partitions that have completed issuing the mirror image data, where an initial value of the update progress is 0, add 1 after receiving a first response message, and detect whether to complete issuing the mirror image data of all the partitions according to the update progress record. And under the condition that the total number of the partitions in the mirror image configuration file is i, when the upper computer detects that the current updating progress record is i, judging that the mirror image data of all the partitions are completely issued, and terminating the transmission of the mirror image data.
The system upgrade of the embedded device is interrupted for various reasons, the system upgrade can be restored after the interruption and then is connected with the upper computer again, the upper computer firstly judges whether the version of the mirror image data requested by the embedded device is consistent with the version of the mirror image data issued before the interruption before the mirror image data is issued, and reports upgrade errors and interrupts the system upgrade of the embedded device under the condition that the versions of the mirror image data requested by the embedded device are inconsistent. And under the condition of consistent versions, detecting the stored updating progress records, and directly starting to resume the issuing of the mirror image data from the most front partition in the partitions which have not finished the issuing of the mirror image data when the system is interrupted in the upgrading process according to the current updating progress records until the issuing of the mirror image data of all the partitions is finished, and terminating the transmission of the mirror image data.
In addition, the first response message may further include a partition identifier of the current partition to be updated, so that the upper computer directly identifies the partition to which the image data issue is completed, and then randomly selects one partition from the partitions to which the image data issue is not completed to issue the image data.
It should be noted that the above examples in the present embodiment are only for easy understanding, and do not limit the technical scheme of the present invention. The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
Another embodiment of the present application relates to an electronic device, as shown in fig. 2, including: at least one processor 201; and a memory 202 communicatively coupled to the at least one processor 201; the memory 202 stores instructions executable by the at least one processor 201, and the instructions are executed by the at least one processor 201, so that the at least one processor 201 can execute the system upgrade method in the above embodiments.
Where the memory and processor are connected by a bus, the bus may comprise any number of interconnected buses and bridges, the bus connecting together various circuits of the memory and the processor or processors. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor is transmitted over a wireless medium through an antenna, which further receives the data and transmits the data to the processor.
The processor is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And the memory may be used to store data used by the processor in performing operations.
Another embodiment of the present application relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (10)

1. A method for system upgrade, comprising:
receiving a mirror image configuration file sent by an upper computer, and determining a current partition to be updated according to the mirror image configuration file;
sending a mirror image data request of the partition to be updated to the upper computer, and receiving mirror image data issued by the upper computer;
under the condition that the partition to be updated is not a target partition, performing mirror image update on the partition to be updated according to the mirror image data, and sending a mirror image data request of the next partition to be updated to the upper computer after the update is completed; wherein the target partition comprises a data area constrained by a security trust mechanism and/or a raw data area without a file system;
and when the partition to be updated is the target partition, caching the mirror image data, updating the mirror image of the partition to be updated in a system restarting stage according to a preset loading program, and sending a mirror image data request of the next partition to be updated to the upper computer after the cache is finished.
2. The system upgrading method according to claim 1, further comprising, before the receiving the image configuration file sent by the upper computer:
switching the current system into a pre-configured upgrading system according to the received upgrading instruction;
and establishing communication connection with the upper computer according to a preset upgrading program in the upgrading system.
3. The system upgrading method according to claim 2, wherein establishing a communication connection with the upper computer according to a preset upgrading program in the upgrading system includes:
and establishing physical connection with the upper computer through a pre-established Ethernet physical interface, and allocating an IP address to the upper computer based on a dynamic host configuration protocol according to the preset upgrading program to establish communication connection.
4. The system upgrading method according to claim 1, wherein the image configuration file includes an image data check code of each partition to be updated, and after receiving the image data issued by the upper computer, the method further includes:
according to the current mirror image data check code of the partition to be updated, checking the mirror image data;
and under the condition that the mirror image data is not verified, re-sending the current mirror image data request of the partition to be updated to the upper computer.
5. The system upgrade method according to claim 4, wherein the mirror data check code comprises: a longitudinal redundancy check LRC code, a cyclic redundancy check CRC code, or a message digest MD5 value.
6. The system upgrading method according to claim 1, wherein the image configuration file includes a standard length of image data of the partition to be updated, and after receiving the image data sent by the upper computer, the method further includes:
detecting whether the actual length of the received mirror image data is consistent with the standard length of the mirror image data;
and under the condition that the actual length of the received mirror image data is not matched with the standard length of the mirror image data, re-sending the current mirror image data request of the partition to be updated to the upper computer.
7. The system upgrade method according to claim 1, further comprising, after the mirror updating the partition to be updated according to the mirror data and after the caching the mirror data:
and sending a first response message to the upper computer, so that the upper computer updates the mirror image updating progress according to the first response message, and recovers the mirror image updating progress according to the mirror image updating progress under the condition that the mirror image updating progress is interrupted.
8. The system upgrading method according to any one of claims 1 to 7, wherein the performing image update on the partition to be updated in a restart phase according to a preset loader includes:
after the mirror image updating of the partitions outside the target partition is finished, restarting the system according to the preset loading program;
and in the process of restarting the system, reading the cached mirror image data through a loader, and performing mirror image updating on each target partition.
9. An electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the system upgrade method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the system upgrade method of any one of claims 1 to 8.
CN202211262304.6A 2022-10-14 2022-10-14 System upgrading method, electronic device and storage medium Pending CN115658103A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211262304.6A CN115658103A (en) 2022-10-14 2022-10-14 System upgrading method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211262304.6A CN115658103A (en) 2022-10-14 2022-10-14 System upgrading method, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN115658103A true CN115658103A (en) 2023-01-31

Family

ID=84987404

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211262304.6A Pending CN115658103A (en) 2022-10-14 2022-10-14 System upgrading method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN115658103A (en)

Similar Documents

Publication Publication Date Title
EP2456257B1 (en) Method and system for upgrading wireless data card
RU2419839C2 (en) Software update system and method for portable ota supporting mobile terminal
US20070294685A1 (en) Program upgrade system and method for ota-capable portable device
CN106020875B (en) Firmware update management method and device of embedded terminal
CN110730104A (en) Method for upgrading multi-device batch firmware of mesh network device
CN107066300B (en) Firmware upgrading method of storage device and storage device
WO2009074444A2 (en) Updating firmware of an electronic device
GB2532299A (en) Over-the-air updates for BLE devices
US10235048B2 (en) Data processing method and smart device
WO2015074435A1 (en) Method and apparatus for updating firmware of mobile terminal
CN110569053A (en) method for upgrading application chip in electronic equipment and electronic equipment
CN114911500A (en) Terminal upgrading method, terminal and system
US11403113B2 (en) Server with system setting data synchronization function
CN111984287A (en) Equipment upgrading method and system
CN111522571A (en) Equipment upgrading method and device, terminal equipment and storage medium
CN115658103A (en) System upgrading method, electronic device and storage medium
CN114780122A (en) Embedded equipment firmware updating method and embedded equipment
CN112181461B (en) Upgrading method, network module, equipment, server and upgrading system
CN112559349A (en) Program running method and device
CN114301779B (en) Image file configuration method and device, AP equipment and network system
CN114968314B (en) Firmware upgrading method and device for display equipment, electronic equipment and storage medium
CN117742761A (en) Firmware updating method and device, storage medium and electronic equipment
CN115599311B (en) Polarity inversion method and apparatus, storage medium, and electronic apparatus
WO2022134918A1 (en) Virtual machine attribute changing method and apparatus, storage medium, and electronic device
CN117055926A (en) Remote upgrading method and Internet of things equipment

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