CN117632198A - Firmware upgrading method, device, storage medium and apparatus - Google Patents

Firmware upgrading method, device, storage medium and apparatus Download PDF

Info

Publication number
CN117632198A
CN117632198A CN202410109677.2A CN202410109677A CN117632198A CN 117632198 A CN117632198 A CN 117632198A CN 202410109677 A CN202410109677 A CN 202410109677A CN 117632198 A CN117632198 A CN 117632198A
Authority
CN
China
Prior art keywords
upgrade
upgrade file
firmware
package
file package
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.)
Granted
Application number
CN202410109677.2A
Other languages
Chinese (zh)
Other versions
CN117632198B (en
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.)
Luole Technology Co ltd
Original Assignee
Luole 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 Luole Technology Co ltd filed Critical Luole Technology Co ltd
Priority to CN202410109677.2A priority Critical patent/CN117632198B/en
Publication of CN117632198A publication Critical patent/CN117632198A/en
Application granted granted Critical
Publication of CN117632198B publication Critical patent/CN117632198B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The present invention relates to the field of firmware upgrade technologies, and in particular, to a firmware upgrade method, device, storage medium, and apparatus, where the method includes: receiving a firmware upgrade file, wherein the firmware upgrade file comprises a plurality of upgrade file packages, the upgrade file packages are defined as a first upgrade file package, a second upgrade file package … … an N-1 upgrade file package and an N upgrade file package according to a received time sequence, and N is a positive integer greater than 1; reading the first upgrade file package to the N-1 upgrade file package by using a blocking mode; determining that the upgrade file package to be received is an Nth upgrade file package; setting the reading state to be a non-blocking mode; and reading the Nth upgrade file package by using a non-blocking mode. The invention improves the timeliness of upgrading and brings good product experience to users while ensuring the accuracy of upgrading.

Description

Firmware upgrading method, device, storage medium and apparatus
Technical Field
The present invention relates to the field of firmware upgrade technologies, and in particular, to a firmware upgrade method, device, storage medium, and apparatus.
Background
The Internet of things technology has been widely used in the field of pet home appliances, and has led to technological innovation in the field. However, the increasing traffic scenario demands have also brought new technical challenges, such as: when the pet home appliances need to be added or optimized, firmware upgrading is needed for system software. During firmware upgrades, OTA (Over-The-Air) is a common way to transfer firmware update data into devices Over a wireless network. When the existing OTA firmware is upgraded, users often encounter problems of accuracy and timeliness of the OTA firmware. The accuracy and timeliness of OTA upgrades are important factors affecting user experience, and research and development engineers are urgently needed to conduct research and discussion.
Disclosure of Invention
The present invention aims to solve at least one of the technical problems existing in the prior art. Therefore, the invention provides a firmware upgrading method which can effectively solve the problem of clamping in the firmware upgrading process.
The invention also provides a firmware upgrading device.
The invention also provides firmware upgrading equipment.
The invention further proposes a storage medium.
A firmware upgrade method according to an embodiment of the first aspect of the present invention is used for upgrading firmware of a socket-enabled device, and includes:
receiving a firmware upgrade file, wherein the firmware upgrade file comprises a plurality of upgrade file packages, the upgrade file packages are defined as a first upgrade file package, a second upgrade file package … … an N-1 upgrade file package and an N upgrade file package according to a received time sequence, and N is a positive integer greater than 1;
reading the first upgrade file package to the N-1 upgrade file package by using a blocking mode;
determining that the upgrade file package to be received is an Nth upgrade file package;
setting the reading state to be a non-blocking mode;
and reading the Nth upgrade file package by using the non-blocking mode.
According to the firmware upgrading method provided by the embodiment of the invention, any one of the first upgrading file packet to the N-1 upgrading file packet is read in the blocking reading mode, and the N upgrading file packet is read in the non-blocking reading mode, so that the defect that the support socket equipment is frequently blocked during firmware upgrading is overcome, the upgrading efficiency in the firmware upgrading process is optimized, and good product experience is brought to users.
A firmware upgrade apparatus according to an embodiment of the second aspect of the present invention includes a memory, a processor, and a firmware upgrade program stored on the memory and executable on the processor, the firmware upgrade program configured to implement the steps of the firmware upgrade method as described above.
According to a storage medium of an embodiment of the third aspect of the present invention, a firmware upgrade program is stored on the storage medium, which when executed by a processor implements the steps of the firmware upgrade method as described above.
A firmware upgrade apparatus according to an embodiment of a fourth aspect of the present invention includes:
the file receiving module is used for receiving a firmware upgrade file, the firmware upgrade file comprises a plurality of upgrade file packages, the upgrade file packages are defined as a first upgrade file package, a second upgrade file package … … an N-1 upgrade file package and an N upgrade file package according to the received time sequence, and N is a positive integer greater than 1;
the blocking reading module is used for reading the first upgrade file package to the N-1 upgrade file package by using a blocking mode;
the file packet determining module is used for determining that the upgrade file packet to be received is an Nth upgrade file packet;
a non-blocking setting module for setting the read state to a non-blocking mode;
and the non-blocking reading module is used for reading the Nth upgrade file packet by using the non-blocking mode.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
FIG. 1 is a schematic diagram of a firmware upgrade apparatus of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart of a firmware upgrade method according to a first embodiment of the present invention;
FIG. 3 is a flowchart of a firmware upgrade method according to a second embodiment of the present invention;
FIG. 4 is a block diagram of a firmware upgrade apparatus according to a first embodiment of the present invention;
fig. 5 is an effect evaluation chart of an embodiment of the firmware upgrade method and other embodiments of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic diagram of a firmware upgrade apparatus of a hardware running environment according to an embodiment of the present invention.
As shown in fig. 1, the firmware upgrade apparatus may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display (Display), and the optional user interface 1003 may also include a standard wired interface, a wireless interface, and the wired interface for the user interface 1003 may be a USB interface in the present invention. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) Memory or a stable Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the architecture shown in fig. 1 is not limiting of the firmware upgrade apparatus and may include more or fewer components than shown, or may combine certain components, or may be a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a firmware upgrade program may be included in a memory 1005, which is one type of computer storage medium.
In the firmware upgrade apparatus shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server, and performing data communication with the background server; the user interface 1003 is mainly used for connecting peripherals; the firmware upgrade apparatus calls a firmware upgrade program stored in the memory 1005 through the processor 1001 and executes the firmware upgrade method provided by the embodiment of the present invention.
Based on the above hardware structure, an embodiment of the firmware upgrading method of the present invention is presented.
The technical scheme of the invention is as follows: development engineers often experience problems of jamming when upgrading firmware supporting socket devices; this problem affects especially the user experience. To find the cause of this problem, research engineers make various guesses and attempts, such as, for example, various environmental factors in upgrades and various technical means in upgrades. To verify these hypotheses, research and development engineers have made various targeted experiments, none of which address the problem of jamming encountered when upgrading firmware supporting socket devices. This problem is not significantly ameliorated until development engineers attempt to read some of the upgrade data in a non-blocking mode. The inventor then makes repeated experiments and scheme corrections to the guess, resulting in the method of the present application that can effectively solve the problem of jamming encountered when upgrading firmware supporting socket devices.
To facilitate understanding by those skilled in the art, the inventors have summarized some of the solutions that he tried and tested in solving the problem of upgrading firmware supporting socket devices as shown in fig. 5. It should be noted that fig. 5 does not restore the process of the present invention as a whole, but rather, to facilitate understanding by those skilled in the art, the overall presentation of schematic properties from the standpoint of results, and the process of investigation by the inventors in the actual invention creation is not generally regular and ordered as presented in fig. 5. As shown in fig. 5, the inventors have tried at least 20 kinds of technical solutions, wherein technical solution 1 is a technical solution commonly used in the prior art. The inventor discovers that the technical scheme used in the technical scheme 4 can improve the timeliness of the upgrade while ensuring the upgrade accuracy, even the technical scheme 4 improves the timeliness by about 36.95% on the basis of the technical scheme 1, in the technical field of firmware upgrade, the timeliness of the firmware upgrade is not easy to be improved by more than 30%, and the firmware upgrade efficiency of the technical scheme 4 greatly improves the product experience of users. In addition, in the experimental trials of the packet reading mode (e.g., technical solutions 1 to 14), only one of the preconditions for the OTA upgrade (i.e., no data loss) is implemented in technical solutions 1 and 4, and the other technical solutions, although all reduce the time required for the upgrade, certainly cannot implement the OTA upgrade because of the data loss.
It should be noted that, the upgrading time-consuming conclusion in fig. 5 is an average numerical conclusion after multiple experiments corresponding to the technical scheme; the data loss conclusion is a probability conclusion after multiple experiments corresponding to the technical scheme, that is, the technical scheme 1 and the technical scheme 4 have extremely low probability of data loss, and the other technical schemes have extremely high probability of data loss.
Referring to fig. 2, fig. 2 is a flowchart illustrating a firmware upgrading method according to a first embodiment of the present invention.
In a first embodiment, the firmware upgrade method includes the steps of:
step S10: and receiving a firmware upgrade file, wherein the firmware upgrade file comprises a plurality of upgrade file packages, the upgrade file packages are defined as a first upgrade file package, a second upgrade file package … … an N-1 upgrade file package and an N upgrade file package according to the received time sequence, and N is a positive integer greater than 1.
It should be noted that, the execution body of the embodiment may be a computing service device with functions of data processing, network communication and program running, such as a pet household appliance including a pet feeder, a pet water fountain, an electric cat litter box, or other electronic devices capable of implementing the above functions.
It should be understood that in the firmware OTA upgrading process of the internet of things device, the whole firmware will be very large, and in order to ensure the stability and transmission efficiency of the upgrading process, the whole firmware file will be split into a plurality of smaller upgrade file packages for transmission. Each upgrade package may include firmware data, verification data, version information, and the like.
It is understood that the firmware may be software in an embedded system or a low-level program in a solid state storage device, primarily for controlling the operation and function of the hardware device. It may be located in the non-volatile memory of computer systems, smartphones, network devices, embedded devices, and other electronic devices.
It should be noted that, unlike operating systems and applications, firmware may be pre-programmed, that is, it is written at the device production stage, and is generally only updated by a specific update process.
Step S20: and reading the first upgrade file package to the N-1 upgrade file package by using the blocking mode.
It will be appreciated that the blocking mode means that the device does not perform other tasks during the process of receiving and processing a package, and that the blocking mode is used during the process of receiving a firmware upgrade package to ensure the accuracy of package reading.
It should be understood that, in order to ensure the upgrade accuracy from the first upgrade package to the N-1 upgrade package, the preferred embodiment is: and reading the first upgrade file package to the N-1 upgrade file package by using the blocking mode.
In the scheme of this embodiment, before the last packet of upgrade data is acquired to perform firmware upgrade, the firmware upgrade is to transmit all upgrade data packets before the last packet of data in a blocking mode, so that safe transmission of all upgrade data packets before the last packet of data can be ensured and loss of the upgrade data packets in the transmission process can be avoided. It will be appreciated that in the blocking mode, data transmission will be suspended until all necessary conditions are met to ensure the integrity of the data transmission. Therefore, the present embodiment can ensure the successful progress of firmware upgrade and avoid the potential problem in the data transmission process by using the blocking mode to transmit all the upgrade data packets before the last packet of data, thereby improving the reliability and stability of the system.
Step S30: and determining that the upgrade file package to be received is an Nth upgrade file package.
Step S40: the read state is set to non-blocking mode.
Step S50: and reading the Nth upgrade file package by using the non-blocking mode.
It will be appreciated that non-blocking mode means that the device, when performing an input operation, if no data is available, the socket will immediately return to an incorrect or specific state, rather than being kept waiting.
In the embodiment of the invention, the first upgrade file package is read to the N-1 upgrade file package through the blocking read mode, and the N upgrade file package is read through the non-blocking read mode, so that the defect that the support socket equipment is frequently blocked during firmware upgrade is overcome while the upgrade accuracy is ensured, and good product experience is brought to users.
As shown in fig. 5, in the firmware upgrading method supporting the socket device, the technical scheme used for reading the first upgrade package to the N-1 upgrade package in the blocking read mode and reading the N upgrade package in the non-blocking read mode improves the timeliness of the upgrade while ensuring the accuracy of the upgrade, and even the technical scheme 4 improves the timeliness by about 36.95% on the basis of the technical scheme 1.
The inventors have acknowledged that the cause of the problem of the stuck phenomenon in the existing firmware upgrade method for upgrading the support socket device has not been found until now. More precisely, the inventor has not found the reason why the last packet may have a stuck phenomenon for more than 1 minute in the existing firmware upgrading method for upgrading the socket device by performing experiments and analysis. After the inventors have obtained the method of the embodiment of the present invention, the mechanism of the embodiment of the present invention may be explained as follows: the read mode of the socket has a blocking mode and a non-blocking mode, in which, when an input operation (read operation) is performed, if no data is available, the socket returns to an error or a specific state immediately instead of waiting all the time; sockets in non-blocking mode do not block the thread or process that called them, but return immediately, giving the application the opportunity to continue execution. The embodiment of the invention utilizes the characteristic of the non-blocking mode, particularly uses the non-blocking mode in the last upgrading file packet, so that when the last packet of upgrading data packet is upgraded by the firmware, the firmware upgrading process can be exited in the non-blocking mode, thereby solving the problem of blocking during OTA upgrading.
As shown in fig. 5, if the non-blocking mode is used in the upgrade file package before the last package, a problem of data loss occurs. That is, the firmware upgrading method of the embodiment of the invention can ensure the upgrading accuracy and improve the timeliness of the upgrading.
Those skilled in the art will appreciate that since socket operation in the blocking mode is automatically blocked, no additional thread synchronization and locking mechanism is required, which can simplify the complexity of concurrent programming and reduce the occurrence of thread security problems; when the transmission buffer area of the socket is full, the transmission operation is automatically blocked, so that the transmission rate is controlled, and the loss or overflow of data is avoided. This is also why firmware upgrades in the prior art all use a blocking mode transmission.
Thus, in the embodiment of the invention, the first upgrade package is read in the blocking mode, then the data in the package are processed in the correct sequence, then the second upgrade package, the third upgrade package and the subsequent upgrade packages are read and processed in the same mode until the last upgrade package is processed, the reading mode of the socket is set to be a non-blocking mode after the last upgrade package is processed, and when the last upgrade package is read in the non-blocking mode, the device can complete the upgrade process and exit the firmware upgrade program more quickly because the device does not need to wait for the transmission of new data.
The benefit of this embodiment is that the integrity and proper order of the data is ensured when using the blocking mode to read and process most upgrade packages. The latency of transmission and processing is then minimized by using non-blocking mode to increase the efficiency of firmware upgrades.
Before the last packet of upgrade data is acquired to upgrade firmware, program codes for setting a reading mode of a socket to be a non-blocking mode are as follows:
setting non-blocking mode
Int flags = fcntl(socket,F_GETFL,θ);
flags ׀= 0_NONBLOCK;
fcntl(socket,F_GETFL,flags);
The embodiment discloses a firmware upgrading method, which comprises the following steps: receiving a firmware upgrade file, wherein the firmware upgrade file comprises a plurality of upgrade file packages, the upgrade file packages are defined as a first upgrade file package, a second upgrade file package … … an N-1 upgrade file package and an N upgrade file package according to a received time sequence, and N is a positive integer greater than 1; reading the first upgrade file package to the N-1 upgrade file package by using a blocking mode; determining that the upgrade file package to be received is an Nth upgrade file package; setting the reading state to be a non-blocking mode; and reading the Nth upgrade file package by using a non-blocking mode. According to the firmware upgrading method provided by the embodiment of the invention, the first upgrading file packet is read to the N-1 upgrading file packet in the blocking reading mode, and the N upgrading file packet is read in the non-blocking reading mode, so that the defect that the support socket equipment is frequently blocked during firmware upgrading is overcome, the upgrading efficiency in the firmware upgrading process is optimized, and good product experience is brought to users.
Referring to fig. 3, fig. 3 is a flowchart illustrating a second embodiment of the firmware upgrading method according to the present invention, and based on the first embodiment shown in fig. 2, the second embodiment of the firmware upgrading method according to the present invention is proposed.
In a second embodiment, the step S30 includes:
step S301: and acquiring the length of the unreceived upgrade file package.
Step S302: and if the length of the unreceived upgrade file package is less than or equal to the preset length, judging that the upgrade file package to be received is an Nth upgrade file package.
It should be noted that, the data length of the update package that is not received by the device may be obtained by communicating with the server or from metadata of the update package, for example, comparing the length of the update package that is not received with a preset length. Wherein the preset length is a fixed value determined according to the packetization policy, such as the length of a single upgrade file packet. If the length of the unreceived upgrade file package is less than or equal to the preset length, the upgrade file package to be received can be judged to be the nth upgrade file package.
Further, in this embodiment, the step S301 specifically includes:
the total length of the received upgrade file package is acquired.
And acquiring the length of the unreceived upgrade file packet according to the length of the firmware upgrade file and the total length.
It should be noted that, the device adds up the length of each received upgrade file packet to obtain a total length. This total length may represent the sum of the lengths of all upgrade packages that have been successfully received and stored on the device so far. The total length of the firmware upgrade file is known, that is, the size of the entire upgrade package, and the received total length is the result of the calculation in the previous step, and then the total length of the firmware upgrade file is subtracted from the received total length, so that the length of the unreceived upgrade file package is obtained.
Determining that the upgrade package to be received is the nth upgrade package, in this embodiment, the step S30 may further include:
acquiring a position label of the upgrade file package;
and determining the upgrade file package to be received as an Nth upgrade file package according to the position label.
It should be noted that the location tag may be metadata in the upgrade package, which provides sequence information about the package in all upgrade data. This tag may be in the form of a sequence number, segment number, offset, etc. Once the location tag is obtained, the control logic of the update process may interpret the information to identify what package this particular file package is. For example, if the position tag is a serial number, then this serial number directly indicates its order; if it is an offset, the sequence number can be determined by additional calculations.
Further, before the step S30, the method further includes:
step S01: and acquiring target firmware information.
Step S02: and if the target firmware information is the information for starting firmware upgrading, executing the firmware upgrading progress.
It should be noted that the target firmware information may include a size, a version, vendor information, compatibility data, and the like of the firmware. The device may analyze the acquired firmware information to determine if it is a signal triggering a firmware upgrade. For example, to check whether the new firmware is newer than the existing firmware or whether there is an upgrade request. If the firmware information indicates that the upgrade process needs to be started or continued, the device may acquire the current upgrade progress in a variety of ways, such as checking a record of the received firmware package, verifying the integrity and continuity of the firmware package on the device, and so forth.
Further, before the step S30, the method further includes:
step S03: and acquiring the firmware upgrading progress.
Step S04: and judging the upgrade file packet to be received as an Nth upgrade file packet according to the firmware upgrade progress and the length of the unreceived upgrade file packet.
In order to accurately perform the operation of reading the nth upgrade package through the non-blocking read mode, the firmware upgrade progress and the length of the unreceived upgrade package may be comprehensively utilized to determine whether the upgrade package to be received is the nth upgrade package. First, the firmware upgrade progress may be determined according to the number or percentage of upgrade file packages that have been received and processed; second, the length of the unreceived upgrade file package refers to the amount of upgrade data that has not been transmitted into the device or system during the firmware upgrade process. For example, when the firmware upgrade progress is 99% and the length of the unreceived upgrade file package is smaller than the preset length, determining that the upgrade file package to be received is the nth upgrade file package; if the firmware upgrade progress is less than 99% or the length of the unreceived upgrade file package is greater than the preset length, determining that the upgrade file package to be received is not the nth upgrade file package. The embodiment comprehensively utilizes the firmware upgrading progress and the length of the unreceived upgrading file packet, can more accurately judge that the upgrading file packet to be received is the Nth upgrading file packet, and executes corresponding actions in a non-blocking reading mode.
Meanwhile, it can be understood by those skilled in the art that, in order to accurately perform the operation of reading the nth upgrade package through the non-blocking reading mode, the location tag and the length of the unreceived upgrade package can be comprehensively utilized to determine whether the upgrade package to be received is the nth upgrade package; or comprehensively utilizing the position label and the firmware upgrading progress to judge whether the upgrading file packet to be received is the Nth upgrading file packet.
In order to more accurately perform the operation of reading the nth upgrade package through the non-blocking read mode, the determination of whether the upgrade package to be received is the nth upgrade package may also be performed using the location tag, the firmware upgrade progress, and the length of the unreceived upgrade package.
In the embodiment of the invention, the upgrade file package is a hex format file package; or the upgrade file packet is a bin format file packet; or, the upgrade file package is an elf format file package.
In addition, the embodiment of the invention also provides a storage medium, wherein the storage medium stores a firmware upgrade program, and the firmware upgrade program realizes the steps of the firmware upgrade method when being executed by a processor.
In addition, referring to fig. 4, an embodiment of the present invention further proposes a firmware upgrade apparatus for upgrading firmware of a socket-enabled device, where the firmware upgrade apparatus includes:
the file receiving module 10 is configured to receive a firmware upgrade file, where the firmware upgrade file includes a plurality of upgrade file packages, and define the plurality of upgrade file packages as a first upgrade file package, a second upgrade file package … …, an nth-1 upgrade file package, and an nth upgrade file package according to a received time sequence, where N is a positive integer greater than 1;
a blocking reading module 20 for reading the first upgrade package to the N-1 upgrade package using a blocking mode;
a file packet determining module 30, configured to determine that the upgrade file packet to be received is an nth upgrade file packet;
a non-blocking setting module 40 for setting the read state to a non-blocking mode;
a non-blocking reading module 50, configured to read the nth upgrade file package using the non-blocking mode.
The embodiment discloses a firmware upgrade device, the device includes: the file receiving module 10 is configured to receive a firmware upgrade file, where the firmware upgrade file includes a plurality of upgrade file packages, and define the plurality of upgrade file packages as a first upgrade file package, a second upgrade file package … …, an nth-1 upgrade file package, and an nth upgrade file package according to a received time sequence, where N is a positive integer greater than 1; a blocking reading module 20 for reading the first upgrade package to the N-1 upgrade package using a blocking mode; a file packet determining module 30, configured to determine that the upgrade file packet to be received is an nth upgrade file packet; a non-blocking setting module 40 for setting the read state to a non-blocking mode; a non-blocking reading module 50, configured to read the nth upgrade file package using the non-blocking mode. According to the method, the device and the system, the first upgrade file package is read to the N-1 upgrade file package through the blocking reading mode, and the N upgrade file package is read through the non-blocking reading mode, so that the defect that socket equipment is supported to be blocked frequently during firmware upgrade is overcome, the upgrade efficiency in the firmware upgrade process is optimized, and good product experience is brought to users.
Other embodiments or specific implementation manners of the firmware upgrade apparatus of the present invention may refer to the above method embodiments, and are not described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the terms first, second, third, etc. do not denote any order, but rather the terms first, second, third, etc. are used to interpret the terms as names.
From the above description of embodiments, it will be clear to a person skilled in the art that the above embodiment method may be implemented by means of software plus a necessary general hardware platform, but may of course also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. read only memory mirror (Read Only Memory image, ROM)/random access memory (Random Access Memory, RAM), magnetic disk, optical disk), comprising instructions for causing an end user device (which may be a mobile phone, a computer, a server, an air conditioner, or a network user device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

1. A method of firmware upgrade for upgrading firmware of a supporting socket device, the method comprising:
receiving a firmware upgrade file, wherein the firmware upgrade file comprises a plurality of upgrade file packages, the upgrade file packages are defined as a first upgrade file package, a second upgrade file package … … an N-1 upgrade file package and an N upgrade file package according to a received time sequence, and N is a positive integer greater than 1;
reading the first upgrade file package to the N-1 upgrade file package by using a blocking mode;
determining that the upgrade file package to be received is an Nth upgrade file package;
setting the reading state to be a non-blocking mode;
and reading the Nth upgrade file package by using the non-blocking mode.
2. The firmware upgrade method of claim 1, wherein the step of determining that the upgrade package to be received is an nth upgrade package comprises:
acquiring the length of an unreceived upgrade file packet;
and if the length of the unreceived upgrade file package is less than or equal to the preset length, judging that the upgrade file package to be received is an Nth upgrade file package.
3. The firmware upgrade method of claim 2, wherein the step of acquiring the length of the unreceived upgrade file package comprises:
acquiring the total length of the received upgrade file package;
and acquiring the length of the unreceived upgrade file packet according to the length of the firmware upgrade file and the total length.
4. The firmware upgrade method of claim 2, wherein, before the step of determining that the upgrade package to be received is an nth upgrade package, the method further comprises:
acquiring a firmware upgrading progress;
and judging the upgrade file packet to be received as an Nth upgrade file packet according to the firmware upgrade progress and the length of the unreceived upgrade file packet.
5. The firmware upgrade method of claim 4, wherein prior to the step of obtaining a firmware upgrade progress, the method further comprises:
acquiring target firmware information;
and if the target firmware information is the information for starting firmware upgrading, executing the firmware upgrading progress.
6. The firmware upgrade method of any one of claims 1 to 5, wherein the step of determining that the upgrade package to be received is an nth upgrade package comprises:
acquiring a position label of the upgrade file package;
and determining the upgrade file package to be received as an Nth upgrade file package according to the position label.
7. A firmware upgrade method as claimed in any one of claims 1 to 5, wherein the upgrade package is a hex format package, or a bin format package, or an elf format package.
8. A firmware upgrade apparatus for upgrading firmware of a supporting socket device, the apparatus comprising:
the file receiving module is used for receiving a firmware upgrade file, the firmware upgrade file comprises a plurality of upgrade file packages, the upgrade file packages are defined as a first upgrade file package, a second upgrade file package … … an N-1 upgrade file package and an N upgrade file package according to the received time sequence, and N is a positive integer greater than 1;
the blocking reading module is used for reading the first upgrade file package to the N-1 upgrade file package by using a blocking mode;
the file packet determining module is used for determining that the upgrade file packet to be received is an Nth upgrade file packet;
a non-blocking setting module for setting the read state to a non-blocking mode;
and the non-blocking reading module is used for reading the Nth upgrade file packet by using the non-blocking mode.
9. A firmware upgrade apparatus, said apparatus comprising: a memory, a processor, and a firmware upgrade program stored on the memory and executable on the processor, the firmware upgrade program configured to implement the steps of the firmware upgrade method of any of claims 1-7.
10. A storage medium having stored thereon a firmware upgrade program which, when executed by a processor, implements the steps of the firmware upgrade method of any one of claims 1 to 7.
CN202410109677.2A 2024-01-26 2024-01-26 Firmware upgrading method, device, storage medium and apparatus Active CN117632198B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410109677.2A CN117632198B (en) 2024-01-26 2024-01-26 Firmware upgrading method, device, storage medium and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410109677.2A CN117632198B (en) 2024-01-26 2024-01-26 Firmware upgrading method, device, storage medium and apparatus

Publications (2)

Publication Number Publication Date
CN117632198A true CN117632198A (en) 2024-03-01
CN117632198B CN117632198B (en) 2024-05-07

Family

ID=90029028

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410109677.2A Active CN117632198B (en) 2024-01-26 2024-01-26 Firmware upgrading method, device, storage medium and apparatus

Country Status (1)

Country Link
CN (1) CN117632198B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050289213A1 (en) * 2004-06-25 2005-12-29 International Business Machines Corporation Switching between blocking and non-blocking input/output
US20110283256A1 (en) * 2009-12-18 2011-11-17 Syddansk Universitet Method, computer program product, and system for non-blocking dynamic update of statically typed class-based object-oriented software
CN106775447A (en) * 2016-11-14 2017-05-31 成都广达新网科技股份有限公司 A kind of disk file read-write method of rate control based on asynchronous non-obstruction
CN107743137A (en) * 2016-09-27 2018-02-27 腾讯科技(深圳)有限公司 A kind of file uploading method and device
CN110022332A (en) * 2018-01-09 2019-07-16 武汉斗鱼网络科技有限公司 A kind of Hyper text transfer security protocol Proxy Method, device, equipment and medium
CN111443957A (en) * 2020-03-24 2020-07-24 华为技术有限公司 Application stuck processing method and device and electronic equipment
CN114398050A (en) * 2021-12-03 2022-04-26 北京罗克维尔斯科技有限公司 Charging pile software upgrading method, device, equipment and storage medium
CN115794186A (en) * 2022-09-09 2023-03-14 网易(杭州)网络有限公司 Game data hot updating method, device, server and storage medium
CN115883360A (en) * 2022-11-25 2023-03-31 苏州赫里奥网络技术有限公司 Remote upgrading method based on multi-layer grading of Internet of things
CN117376339A (en) * 2023-09-27 2024-01-09 重庆赛力斯新能源汽车设计院有限公司 OTA-based vehicle ECU upgrading method, device, equipment and medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050289213A1 (en) * 2004-06-25 2005-12-29 International Business Machines Corporation Switching between blocking and non-blocking input/output
US20110283256A1 (en) * 2009-12-18 2011-11-17 Syddansk Universitet Method, computer program product, and system for non-blocking dynamic update of statically typed class-based object-oriented software
CN107743137A (en) * 2016-09-27 2018-02-27 腾讯科技(深圳)有限公司 A kind of file uploading method and device
CN106775447A (en) * 2016-11-14 2017-05-31 成都广达新网科技股份有限公司 A kind of disk file read-write method of rate control based on asynchronous non-obstruction
CN110022332A (en) * 2018-01-09 2019-07-16 武汉斗鱼网络科技有限公司 A kind of Hyper text transfer security protocol Proxy Method, device, equipment and medium
CN111443957A (en) * 2020-03-24 2020-07-24 华为技术有限公司 Application stuck processing method and device and electronic equipment
CN114398050A (en) * 2021-12-03 2022-04-26 北京罗克维尔斯科技有限公司 Charging pile software upgrading method, device, equipment and storage medium
CN115794186A (en) * 2022-09-09 2023-03-14 网易(杭州)网络有限公司 Game data hot updating method, device, server and storage medium
CN115883360A (en) * 2022-11-25 2023-03-31 苏州赫里奥网络技术有限公司 Remote upgrading method based on multi-layer grading of Internet of things
CN117376339A (en) * 2023-09-27 2024-01-09 重庆赛力斯新能源汽车设计院有限公司 OTA-based vehicle ECU upgrading method, device, equipment and medium

Also Published As

Publication number Publication date
CN117632198B (en) 2024-05-07

Similar Documents

Publication Publication Date Title
CN109614048B (en) Data read-write method and device based on flash memory and computer readable storage medium
US20130227356A1 (en) Apparatus and method for handling rebooting of mobile terminal
EP2375323A1 (en) Firmware image update and management
US8171192B2 (en) Hardware-assisted device configuration detection
US20110265072A1 (en) Dynamic Installation of Files for Running Programs
CN110457049B (en) Method and device for realizing plug-in automation, electronic equipment and storage medium
CN112015447B (en) System updating method and device of electronic equipment, electronic equipment and storage medium
CN111752740A (en) Microservice anomaly compensation method, microservice anomaly compensation device, microservice anomaly compensation equipment and computer readable storage medium
CN113778914A (en) Apparatus, method, and computing device for performing data processing
CN110597545A (en) Hot patch intelligent upgrading method and system based on OTA component
CN115762625A (en) Method, system, electronic device and storage medium for verifying eMMC function
CN112634973A (en) Data rereading method and system of storage medium, terminal device and storage medium
CN117632198B (en) Firmware upgrading method, device, storage medium and apparatus
CN109032612B (en) Interface calling method and device of hybrid application and computer readable storage medium
CN105893233B (en) Method and system for automatically testing firmware
US20060037013A1 (en) Program update apparatus, method, and medium
US11934517B2 (en) Systems and methods for reliably injecting control flow integrity into binaries without source code
CN111666102A (en) File format conversion method, chip verification method, related device and network chip
CN116954674A (en) eMMC firmware upgrading method, firmware upgrading equipment and storage device
CN111427588A (en) Suspending installation of firmware packages
US20190073134A1 (en) Methods for resetting a flash memory device and apparatuses using the same
CN107688479B (en) Android system network cluster, construction method thereof, and Android system network cluster data processing method and system
CN114296764A (en) System upgrading method and device, storage medium and electronic equipment
CN113495735A (en) Upgrade package installation method, device, equipment and readable storage medium
CN111522564A (en) Method and device for identifying system upgrading state and computer readable 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
GR01 Patent grant
GR01 Patent grant