Beverage equipment and firmware updating method thereof
By setting up the program backup area in the beverage device and reserveing a waiting time window, the problem that cannot be repaired after the MCU firmware upgrade failed is solved, and independent repair and stable firmware updates are achieved.
Patent Information
- Application Number
- CN202510998199.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-21
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-07-21
AI Technical Summary
During the firmware upgrade process of existing beverage equipment, the MCU's APROM area cannot be repaired after being damaged, resulting in a deadlock in the system, and the HMI module and the LDROM area cannot establish a communication connection, resulting in a failure in firmware upgrade or recovery.
Set up a program backup area in the human-computer interaction module, store the backup firmware files, and reserve a waiting time window in the boot program area, allowing the human-computer interaction module to establish a communication connection with the main control module, and use the backup firmware files to repair or upgrade firmware.
It realizes the independent repair capability when the main control module has limited storage capacity, avoids system deadlocks, and ensures the reliability and stability of firmware upgrades or recovery.
Smart Images

Figure CN120508308A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of firmware upgrade, and in particular to a beverage device and a firmware update method thereof. Background Art
[0002] Currently, in the firmware upgrade solution for beverage making equipment, the MCU (Microcontroller Unit) generally needs to rely on the HMI (Human-Machine Interface) to communicate with the APROM (Application Program ROM) area program in the MCU to complete the upgrade operation.
[0003] However, this approach has numerous drawbacks. For example, if an exception occurs during the upgrade process, the APROM area program will become corrupted and unable to run, completely rendering the MCU unable to upgrade and locking the system into a "deadlock" state, requiring repair only by returning the system to the factory or using specialized equipment. Furthermore, the MCU's LDROM (Loader ROM) area boot program starts extremely quickly, in approximately one second. This means that while the APROM area application program starts almost instantly, the HMI module, which needs to load a complex kernel and application program, can take upwards of 20 seconds to start. This prevents the HMI module from establishing a communication connection with the LDROM area during the initial startup phase. When the APROM area program is corrupted, firmware repair or upgrades become difficult. Summary of the Invention
[0004] Based on this, it is necessary to provide a beverage device and a firmware update method thereof to address the above problems.
[0005] According to a first aspect of an embodiment of the present application, a method for updating the firmware of a beverage device is provided. The beverage device includes a main control module and a human-computer interaction module. The main control module includes a boot program area and an application program area. The human-computer interaction module includes a program backup area. The method for updating the firmware of the beverage device is executed by the human-computer interaction module. The method for updating the firmware of the beverage device includes: After power-on startup, establishing a communication connection with the boot program area within a waiting time window reserved for the boot phase of the boot program area; Check the current upgrade status; In response to the current upgrade status being upgrade failure, detecting whether an external storage device storing a firmware file is connected; In response to not detecting access to an external storage device storing a firmware file, extracting a backup firmware file from the program backup area and transferring the backup firmware file to the boot program area, so as to write the backup firmware file to the application program area through the boot program area for firmware repair.
[0006] In one embodiment, the step of extracting the backup firmware file from the program backup area and transferring the backup firmware file to the boot program area, so as to write the backup firmware file to the application program area through the boot program area for firmware repair, includes: Extracting the backup firmware file from the program backup area; Detecting whether the extracted backup firmware file matches the main control module; In response to the backup firmware file matching the main control module, the backup firmware file is transmitted to the boot program area, so as to write the backup firmware file into the application program area through the boot program area to perform firmware repair.
[0007] In one embodiment, the program backup area stores a program version number of a backup firmware file; and the step of detecting whether the extracted backup firmware file matches the main control module includes: Detect whether the program version number of the extracted backup firmware file matches the chip model of the main control module.
[0008] In one embodiment, the step of transmitting the backup firmware file to the boot program area so as to write the backup firmware file to the application program area through the boot program area for firmware repair includes: Monitor write status; In response to the write status being a write success, controlling the main control module to restart; In response to the main control module successfully restarting, reading the program version number in the current application area, and comparing the program version number in the current application area with the version number of the backup firmware file; In response to the program version number in the current application program area being consistent with the version number of the backup firmware file, it is confirmed that the firmware repair is successful.
[0009] In one embodiment, the beverage device firmware update method further includes: In response to the write status being a write failure or the main control module failing to restart, returning to re-execute the step of extracting the backup firmware file from the program backup area; In response to returning to re-execute the step of extracting the backup firmware file from the program backup area for a preset number of times, if the write status is still write failure or the main control module still fails to restart, it is determined that the firmware repair has failed.
[0010] In one embodiment, the firmware update method for beverage equipment further includes: outputting a warning message in response to the inconsistency between the program version number in the current application area and the version number of the backup firmware file.
[0011] In one embodiment, the firmware update method for the beverage device further includes: in response to the backup firmware file not matching the main control module, outputting a warning message and stopping repair.
[0012] In one embodiment, the firmware update method for the beverage device further includes: in response to detecting that an external storage device storing a firmware file is connected, extracting the firmware file from the external storage device and transferring the firmware file to the boot program area, so as to write the firmware file to the application area through the boot program area to perform firmware repair.
[0013] In one embodiment, the beverage device firmware update method further includes: In response to the current upgrade status being upgrade success, detecting whether an external storage device storing a firmware file is connected; In response to detecting access to an external storage device storing a firmware file, the firmware file is extracted from the external storage device and transferred to the boot program area, so as to write the firmware file to the application area through the boot program area for firmware upgrade.
[0014] In one embodiment, after the step of extracting the firmware file from the external storage device and transferring the firmware file to the boot program area so as to write the firmware file to the application area through the boot program area for firmware upgrade, the firmware update method for the beverage device further comprises: In response to a successful upgrade, the firmware file corresponding to the current upgrade is stored as the backup firmware file in the program backup area.
[0015] In one embodiment, after the step of extracting the firmware file from the external storage device and transferring the firmware file to the boot program area so as to write the firmware file to the application area through the boot program area for firmware upgrade, the firmware update method for the beverage device further comprises: In response to an upgrade failure, the upgrade status is adjusted from upgrade success to upgrade failure.
[0016] According to a second aspect of an embodiment of the present application, a beverage device is provided, comprising a main control module and a human-computer interaction module, wherein the main control module comprises a boot program area and an application program area, the human-computer interaction module comprises a program backup area, wherein a backup firmware file is stored in the program backup area, and the human-computer interaction module is configured to execute the above-mentioned firmware update method for the beverage device.
[0017] The firmware update method for beverage equipment provided in this application prioritizes establishing a communication connection with the boot program area after power-on. Simultaneously, a certain waiting time window is reserved during the boot phase of the boot program area, allowing the human-computer interaction module to establish a communication connection with the boot program area during the initial power-on startup phase. This solves the problem in conventional technologies where the human-computer interaction module is unable to establish a communication connection with the main control module in a timely manner due to a startup timing difference between the human-computer interaction module and the main control module, and is unable to upgrade or restore programs in the application area through the human-computer interaction module. Furthermore, a program backup area is provided within the human-computer interaction module, and a backup firmware file is stored within the program backup area. When it is detected that the current upgrade status is an upgrade failure, i.e., the program in the application area is abnormal, and no external storage device for firmware update is connected, the backup firmware file stored in the program backup area of the human-computer interaction module can be directly used to repair the firmware in the application area of the main control module. This achieves redundant utilization of storage space within the human-computer interaction module and solves the problem of the main control module losing its self-repair capability upon an upgrade failure due to limited storage capacity. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A schematic diagram of the structure of a beverage device provided in one embodiment of the present application; Figure 2 A flowchart of a firmware update method for a beverage device provided in one embodiment of the present application; Figure 3 This is a flowchart of step S800 in the firmware update method for a beverage device provided in one embodiment of the present application; Figure 4 This is a flowchart of step S850 in the firmware update method for a beverage device provided in one embodiment of the present application; Figure 5 This is a flowchart of step S850 in a firmware update method for a beverage device provided by another embodiment of the present application; Figure 6 This is a flowchart of step S850 in a firmware update method for a beverage device provided by another embodiment of the present application; Figure 7 This is a flowchart of step S800 in a firmware update method for a beverage device provided in another embodiment of the present application; Figure 8A flowchart of a firmware update method for a beverage device provided in another embodiment of the present application; Figure 9 A flowchart of a firmware update method for a beverage device provided in another embodiment of the present application; Figure 10 This is a flowchart of a firmware update method for a beverage device provided by another embodiment of the present application. DETAILED DESCRIPTION
[0019] To facilitate understanding of the present application, a more comprehensive description of the present application will be provided below with reference to the accompanying drawings. The accompanying drawings illustrate preferred embodiments of the present application. However, the present application may be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and comprehensive understanding of the disclosure of the present application.
[0020] In this application, unless otherwise specified or limited, the terms "installed," "connected," "connect," "fixed," etc. should be understood in a broad sense. For example, they can refer to fixed connection, detachable connection, or integration; mechanical connection or electrical connection; direct connection or indirect connection through an intermediate medium; internal communication between two elements or interaction between two elements, unless otherwise specified. Those skilled in the art will understand the specific meanings of the above terms in this application based on specific circumstances.
[0021] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature specified as "first" or "second" may explicitly or implicitly include at least one of such features. Throughout the description of this application, "plurality" means at least two, for example, two, three, etc., unless otherwise specifically defined.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein in the specification of this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0023] In one embodiment, a method for updating firmware of a beverage device is provided, wherein the beverage device may include a coffee machine or the like.
[0024] Among them, reference Figure 1The beverage device includes a main control module (the aforementioned MCU) and a human-computer interaction module (the aforementioned HMI module). The main control module includes a boot program area (the aforementioned LDROM area) and an application program area (the aforementioned APROM area). The boot program area stores a boot loader, which is the first code executed after the system is powered on. The application program area stores the application program. When the main control module is powered on, the boot loader in the boot program area is first executed. If no firmware update command is received during this boot phase, the application program is executed in the APROM area. The human-computer interaction module includes a program backup area, which stores a backup firmware file. This backup firmware file can be the firmware file corresponding to the last successful upgrade or a firmware file selected by the user.
[0025] In this embodiment, the firmware update method of the beverage device can be executed by the human-computer interaction module. Figure 2 The firmware update method for the beverage device provided in this embodiment includes the following steps: Step S200: After power-on, a communication connection is established with the boot program area within a waiting time window reserved for the boot phase of the boot program area.
[0026] When the beverage equipment is powered on, the human-computer interaction module and the main control module start working. In traditional technology, after power-on startup, the boot program in the boot program area starts very quickly, about 1 second, and then jumps to run the application in the application area. That is to say, the startup of the application in the application area is almost instantaneous, while the human-computer interaction module often needs to load complex kernels and applications after power-on startup, which takes more than 20 seconds. Due to the above-mentioned startup timing difference, the human-computer interaction module and the main control module cannot establish a communication connection at the initial startup, which makes it impossible to upgrade or restore the program in the application area through the human-computer interaction module.
[0027] In view of the above problems, in this embodiment, the startup timing of the human-computer interaction module and the main control module is adjusted. Specifically, after the human-computer interaction module is powered on and started, before loading the complex kernel and application program, it first sends a connection instruction to the main control module. At the same time, after the main control module is powered on and started, the boot program area reserves a certain waiting time window in the boot phase of running the boot program to wait for receiving the connection instruction sent by the human-computer interaction module, so as to avoid the problem of not receiving the connection instruction of the human-computer interaction module in time due to the boot program in the boot program area starting too quickly.
[0028] The waiting time window can be set to less than 5 seconds, for example, 5 seconds, 4 seconds, 3 seconds, 2 seconds, or 1 second, etc., which are not listed here. Preferably, the waiting time window is set to 1 second. In addition, the waiting time window in the boot phase can also be determined based on the actual startup state of the human-computer interaction module to ensure that the human-computer interaction module can establish a communication connection with the boot program area before the main control module runs the application in the application area.
[0029] When the human-computer interaction module is powered on and started, it can establish a communication connection with the boot program area within the waiting time window reserved in the boot phase of the boot program area. After the two establish a communication connection, the firmware can be repaired or upgraded according to the actual upgrade status.
[0030] To establish communication between the human-computer interaction module and the bootloader area, this embodiment pre-installs a lightweight communication protocol, such as the UART (Universal Asynchronous Receiver / Transmitter) protocol, in the bootloader area. This protocol supports handshakes, data transmission, and command parsing with the human-computer interaction module. Furthermore, a separate communication thread is built into the human-computer interaction module and prioritized upon power-up to establish a communication connection with the bootloader area, delaying the loading of other applications.
[0031] In addition, when the main control module does not receive the connection instruction sent by the human-computer interaction module within the waiting time window reserved for the boot phase of the boot program area, the main control module no longer continues to wait for the connection instruction from the human-computer interaction module, but jumps to the application area to run the application.
[0032] Step S400: Detect the current upgrade status.
[0033] After the human-computer interaction module establishes a connection with the boot program area, it can first detect whether there is any abnormality in the current upgrade status. In this embodiment, the upgrade status can include upgrade success and upgrade failure. When the firmware upgrade is successful, the upgrade status can be set to upgrade success. When the firmware upgrade fails, the upgrade status can be set to upgrade failure. The upgrade status can be stored in the program backup area of the human-computer interaction module.
[0034] Step S600: In response to the current upgrade status being upgrade failure, detecting whether an external storage device storing a firmware file is connected.
[0035] If it is determined that the current upgrade status is an upgrade failure, it means that there is an abnormality in the program in the application area of the current main control module and it needs to be repaired. At this time, it is possible to first detect whether an external storage device storing firmware files is connected. If it is detected that an external storage device is connected and firmware files are stored in the external storage device, the firmware files in the external storage device can be retrieved for firmware repair in the application area. If no external storage device storing firmware files is detected, the backup firmware files can be retrieved from the program backup area in the human-computer interaction module for firmware repair in the application area. Among them, the external storage device can include an external device with storage function such as a USB flash drive that can be connected to the human-computer interaction module.
[0036] Step S800: In response to not detecting that an external storage device storing a firmware file is connected, extracting a backup firmware file from the program backup area and transferring the backup firmware file to the boot program area, so as to write the backup firmware file to the application program area through the boot program area for firmware repair.
[0037] As mentioned above, if it is determined that there is no external storage device storing the firmware file connected to the human-computer interaction module, the backup firmware file is extracted from the program backup area in the human-computer interaction module, and the backup firmware file is transferred to the boot program area, and then the backup firmware file is written to the application program area through the boot program area to perform firmware repair.
[0038] In traditional technology, the storage space within the main control module is very limited. The boot program area has approximately 4KB of space, which is mainly used to store a boot program of approximately 3KB in size. The application program area has approximately 128K of space, which is mainly used to store an application program of approximately 100KB in size. Due to the storage capacity of the main control module, the existing technology cannot reserve spare space in the boot program area and the application program area for storing firmware files. Once an upgrade anomaly causes the program in the application program area to be damaged, due to the lack of a redundant backup mechanism, the program will directly lose its self-repair capability and fall into an "upgrade deadlock" state. To address this problem, in this embodiment, an independent program backup area is set up in the human-computer interaction module with ample storage space, and backup firmware files are stored in the program backup area. This can overcome the storage capacity limit of the main control module. In the event of an upgrade anomaly, the backup firmware file in the program backup area can be called to restore the firmware, effectively ensuring the self-repair capability and avoiding the "upgrade deadlock" state.
[0039] The backup firmware file may be compressed and then stored in the program backup area, and the compression algorithm may be an L777 algorithm or the like.
[0040] In the firmware update method for the beverage equipment provided in this embodiment, the human-computer interaction module preferentially attempts to establish a communication connection with the boot program area after power-on. At the same time, a certain waiting time window is reserved in the boot phase of the boot program area, so that the human-computer interaction module can establish a communication connection with the boot program area at the initial power-on startup. This solves the problem in traditional technologies that the human-computer interaction module cannot establish a communication connection with the main control module in a timely manner due to the startup timing difference between the human-computer interaction module and the main control module, and cannot upgrade or restore the program in the application area through the human-computer interaction module.
[0041] Furthermore, after the human-computer interaction module establishes a connection with the boot program area, it can detect the current upgrade status. If the current upgrade status is upgrade failure, it will first detect whether an external storage device storing the firmware file is connected. If not, the backup firmware file is retrieved from the program backup area in the human-computer interaction module and transferred to the boot program area of the main control module, so that the backup firmware file can be written to the application area through the boot program area to perform firmware repair. That is, a program backup area is set in the human-computer interaction module, and a backup firmware file is stored in the program backup area. When it is detected that the current upgrade status is upgrade failure, that is, the program in the application area is abnormal, and there is no external storage device for firmware update connected, the backup firmware file stored in the program backup area of the human-computer interaction module can be directly used to repair the firmware of the application area in the main control module. This realizes the redundant use of the storage space in the human-computer interaction module and solves the problem of losing the self-repair capability once the upgrade fails due to the limited storage capacity in the main control module.
[0042] In one embodiment, referring to Figure 3 The step of extracting the backup firmware file from the program backup area and transferring the backup firmware file to the boot program area in step S800, so as to write the backup firmware file to the application program area through the boot program area for firmware repair, includes: Step S810: extracting the backup firmware file from the program backup area; Step S830: Detect whether the extracted backup firmware file matches the main control module; Step S850: In response to the backup firmware file matching the main control module, the backup firmware file is transmitted to the boot program area, so as to write the backup firmware file to the application program area through the boot program area to perform firmware repair.
[0043] After extracting the backup firmware file from the program backup area, in order to ensure that the backup firmware file is suitable for this firmware repair and improve the reliability of the firmware repair, you can first check whether the extracted backup firmware file matches the main control module. If they match, proceed to the next step, that is, transfer the backup firmware file to the boot program area, and then write the backup firmware file to the application program area through the boot program area for firmware repair. If they do not match, the subsequent repair program will not be entered.
[0044] In this embodiment, in addition to storing the backup firmware file, the program backup area may also store the program version number of the backup firmware file. Accordingly, in step S830, i.e., the step of detecting whether the extracted backup firmware file matches the main control module, it may be detected whether the program version number of the extracted backup firmware file matches the chip model of the main control module. That is, the program version number of the backup firmware file may be extracted from the program backup area, and the program version number of the backup firmware file may be compared with the chip model of the main control module. If the two match, it may be considered that the extracted backup firmware file matches the current main control module. If the two do not match, it may be considered that the extracted backup firmware file does not match the current main control module.
[0045] In one embodiment, referring to Figure 4 The step of transmitting the backup firmware file to the boot program area in step S850 so as to write the backup firmware file to the application program area through the boot program area for firmware repair may include: Step S851: monitor the writing status; Step S852: In response to the write status being a write success, controlling the main control module to restart; Step S853: In response to the main control module being successfully restarted, reading the program version number in the current application area, and comparing the program version number in the current application area with the version number of the backup firmware file; Step S854: In response to the program version number in the current application area being consistent with the version number of the backup firmware file, confirming that the firmware repair is successful.
[0046] That is, the human-computer interaction module can monitor the entire firmware update (repair / upgrade) process. Once it determines that the backup firmware file matches the main control module, it can transfer the backup firmware file to the boot program area, which then writes the backup firmware file to the application program area. During this process, the human-computer interaction module can monitor the write status. If the write status is successful, it can control the main control module to restart so that the application program area runs the written program to ensure that the written program is valid. When the main control restarts successfully, it can read the program version number in the current application program area and compare it with the program version number of the backup firmware file. If the two are consistent, the firmware repair is considered successful.
[0047] In one embodiment, referring to Figure 5 The firmware update method of the beverage device provided in this embodiment further includes the following steps: Step S855: In response to the write status being write failure or the main control module restart failure, returning to re-execute the step of extracting the backup firmware file from the program backup area; Step S856: In response to returning to re-execute the step of extracting the backup firmware file from the program backup area for a preset number of times, if the write status is still write failure or the main control module still fails to restart, it is confirmed that the firmware repair has failed.
[0048] That is, when the write status indicates write failure or the main control module fails to restart, the system can return to step S810, which involves extracting the backup firmware file from the program backup area, and retry the process. This improves the repair fault tolerance rate. Furthermore, the human-computer interaction module can monitor the number of retries. If the write status remains write failure or the main control module fails to restart after returning to retrieve the backup firmware file a preset number of times, no further retries will be made, confirming that the firmware repair has failed. This prevents an infinite retry loop while improving anti-interference capabilities and system reliability.
[0049] In this embodiment, the preset number of times can be set to 2 times, 3 times, 4 times, etc., and can be set specifically according to needs.
[0050] In one embodiment, referring to Figure 6 The firmware update method of the beverage device provided in this embodiment may further include the following steps: Step S857: In response to the inconsistency between the program version number in the current application area and the version number of the backup firmware file, output a warning message.
[0051] That is to say, after the main control module is successfully restarted, if the program version number read in the current application area is inconsistent with the version number of the backup firmware file, it is considered that the program version running in the current application area is different from the version of the extracted backup firmware file, that is, the program actually written to the application area is inconsistent with the firmware extracted from the program backup area and wanted to be written to the application area. At this time, a warning message can be output to prompt the user.
[0052] In one embodiment, referring to Figure 7 The firmware update method of the beverage device provided in this embodiment further includes the following steps: Step S840: In response to the backup firmware file not matching the main control module, output a warning message and stop repairing.
[0053] That is, when the backup firmware file extracted from the program backup area is incompatible with the main control module, it is considered that the backup firmware file is not suitable for this firmware repair. At this time, a warning message can be output to prompt the user and the repair program is stopped.
[0054] In one embodiment, referring to Figure 8 The firmware update method of the beverage device provided in this embodiment further includes the following steps: Step S900: In response to detecting that an external storage device storing a firmware file is connected, extract the firmware file from the external storage device and transfer the firmware file to the boot program area, so as to write the firmware file to the application program area through the boot program area to perform firmware repair.
[0055] That is, if it is detected that an external storage device storing a firmware file is connected to the human-computer interaction module, the firmware can be repaired through the external storage device first, that is, the firmware file is extracted from the external storage device and transferred to the boot program area, so that the firmware file can be written to the application area through the boot program area for firmware repair.
[0056] It should be noted that the specific process of repairing the firmware through the firmware file in the external storage device in step S900 is basically the same as the process of repairing the firmware through the backup firmware file in the program backup area of the human-computer interaction module in the aforementioned embodiment. Both can first detect whether the firmware file matches the main control module, and then detect the write status, restart the main control module, and detect whether the version number of the program in the application area is consistent with the version number of the firmware file. No further details will be given here.
[0057] In one embodiment, referring to Figure 9 The firmware update method of the beverage device provided in this embodiment may further include the following steps: Step S710: In response to the current upgrade status being upgrade success, detecting whether an external storage device storing a firmware file is connected; Step S720: In response to detecting that an external storage device storing a firmware file is connected, extract the firmware file from the external storage device and transfer the firmware file to the boot program area, so as to write the firmware file to the application area through the boot program area for firmware upgrade.
[0058] That is, if the detection determines that the current upgrade status is a successful upgrade, it can be considered that there is no abnormality in the program in the application area. At this time, it can be confirmed whether the program in the application area needs to be upgraded, that is, detect whether there is an external storage device storing firmware files connected to the human-computer interaction module. If there is an external storage device storing firmware files connected to the human-computer interaction module, the program in the application area can be upgraded through the firmware file in the external storage device, that is, extract the firmware file from the external storage device and transfer the firmware file to the boot program area, so that the firmware file can be written to the application area through the boot program area for firmware upgrade.
[0059] Among them, the step of upgrading the firmware through the firmware file in the external storage device in step S720 is basically the same as the process of repairing the firmware through the backup firmware file in the program backup area in the aforementioned embodiment. Both can first detect whether the firmware file matches the main control module, and then detect the write status, restart the main control module, and detect whether the version number of the program in the application area is consistent with the version number of the firmware file. No further details will be given here.
[0060] In one embodiment, referring to Figure 10 After step S720, i.e., extracting the firmware file from the external storage device and transferring the firmware file to the boot program area so as to write the firmware file to the application area via the boot program area for firmware upgrade, the firmware update method for the beverage device provided in this embodiment may further include the following steps: Step S730: In response to the upgrade being successful, the firmware file corresponding to the current upgrade is stored as the backup firmware file in the program backup area.
[0061] That is to say, after the firmware upgrade is successful, the firmware file corresponding to this upgrade can be stored as a backup firmware file in the program backup area so that it can be called during subsequent firmware repair. In actual application, after each successful firmware upgrade, the corresponding firmware file can be stored in the program backup area and overwrite the backup firmware file stored last time, thereby ensuring that the firmware file stored in the program backup area is the firmware file corresponding to the last successful upgrade. Of course, in this embodiment, the firmware files corresponding to the last n successful upgrades can also be stored in the program backup area, where n can be a positive integer greater than or equal to 2. For example, the firmware files corresponding to the last 2, 3, or 4 successful upgrades are all stored in the program backup area. Therefore, when repairing the firmware, one of the multiple stored backup firmware files can be selected for firmware repair.
[0062] In addition, after step S720, i.e., extracting the firmware file from the external storage device and transferring the firmware file to the boot program area so as to write the firmware file to the application program area through the boot program area for firmware upgrade, the firmware update method for the beverage device provided in this embodiment may further include the following steps: Step S740: In response to the upgrade failure, the upgrade status is adjusted from upgrade success to upgrade failure.
[0063] That is, when the firmware upgrade fails, the upgrade status can be adjusted from upgrade success to upgrade failure, thereby ensuring the accuracy of the upgrade status stored in the program backup area, so that the human-computer interaction module can detect the correct upgrade status at the first time when it is powered on next time, so as to repair the firmware in time.
[0064] In one embodiment, referring to Figure 1 , provides a beverage device, including a main control module and a human-computer interaction module, the main control module includes a boot program area and an application program area, the human-computer interaction module includes a program backup area, and the program backup area stores a backup firmware file, and the human-computer interaction module is configured to execute the above-mentioned firmware update method.
[0065] The beverage equipment provided in this embodiment and the firmware update method for the beverage equipment provided in the previous embodiment belong to the same inventive concept. Regarding the main control module, human-computer interaction module and specific firmware update method in the beverage equipment, please refer to the specific description of the firmware update method for the beverage equipment provided in the previous embodiment, which will not be repeated here.
[0066] In this embodiment, the complex logic of firmware update is migrated to the human-computer interaction module, which effectively reduces the computational workload and load of the main control module and significantly improves the stability of the entire system.
[0067] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the firmware update method of the beverage device is implemented.
[0068] According to a fourth aspect of the embodiments of the present application, a computer program product is provided, comprising a computer program, which implements the above-mentioned firmware update method for the beverage device when executed by a processor.
[0069] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the above-described method embodiments. Any reference to memory, storage, database, or other media used in the embodiments provided herein may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0070] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0071] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and such modifications and improvements are all within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for updating the firmware of a beverage device, characterized in that: The beverage device includes a main control module and a human-computer interaction module, the main control module includes a boot program area and an application program area, the human-computer interaction module includes a program backup area, and the firmware update method of the beverage device is executed by the human-computer interaction module side; The firmware update method of the beverage device includes: After power-on startup, establishing a communication connection with the boot program area within a waiting time window reserved for the boot phase of the boot program area; Check the current upgrade status; In response to the current upgrade status being upgrade failure, detecting whether an external storage device storing a firmware file is connected; In response to not detecting access to an external storage device storing a firmware file, extracting a backup firmware file from the program backup area and transferring the backup firmware file to the boot program area, so as to write the backup firmware file to the application program area through the boot program area for firmware repair.
2. The method for updating the firmware of the beverage device according to claim 1, wherein: The step of extracting the backup firmware file from the program backup area and transferring the backup firmware file to the boot program area, so as to write the backup firmware file into the application program area through the boot program area for firmware repair, includes: Extracting the backup firmware file from the program backup area; Detecting whether the extracted backup firmware file matches the main control module; In response to the backup firmware file matching the main control module, the backup firmware file is transmitted to the boot program area, so as to write the backup firmware file into the application program area through the boot program area to perform firmware repair.
3. The firmware update method of the beverage equipment according to claim 2, characterized in that: The program backup area stores the program version number of the backup firmware file; the step of detecting whether the extracted backup firmware file matches the main control module includes: Detect whether the program version number of the extracted backup firmware file matches the chip model of the main control module.
4. The method for updating the firmware of the beverage device according to claim 2, wherein: The step of transmitting the backup firmware file to the boot program area so as to write the backup firmware file into the application program area through the boot program area for firmware repair includes: Monitor write status; In response to the write status being a write success, controlling the main control module to restart; In response to the main control module successfully restarting, reading the program version number in the current application area, and comparing the program version number in the current application area with the version number of the backup firmware file; In response to the program version number in the current application program area being consistent with the version number of the backup firmware file, it is confirmed that the firmware repair is successful.
5. The method for updating the firmware of the beverage device according to claim 4, characterized in that: The firmware update method of the beverage device further includes: In response to the write status being a write failure or the main control module failing to restart, returning to re-execute the step of extracting the backup firmware file from the program backup area; In response to returning to re-execute the step of extracting the backup firmware file from the program backup area for a preset number of times, if the write status is still write failure or the main control module still fails to restart, it is determined that the firmware repair has failed.
6. The method for updating the firmware of the beverage device according to claim 4, characterized in that: The firmware update method for beverage equipment further includes: outputting a warning message in response to a discrepancy between the program version number in the current application program area and the version number of the backup firmware file.
7. The method for updating the firmware of the beverage device according to claim 2, wherein: The firmware update method for beverage equipment further includes: in response to the backup firmware file not matching the main control module, outputting a warning message and stopping repair.
8. The method for updating the firmware of the beverage device according to claim 1, wherein: The firmware update method for the beverage device further includes: in response to detecting that an external storage device storing a firmware file is connected, extracting the firmware file from the external storage device and transferring the firmware file to the boot program area, so as to write the firmware file to the application area through the boot program area to repair the firmware.
9. The method for updating the firmware of the beverage device according to claim 1, wherein: The firmware update method of the beverage device further includes: In response to the current upgrade status being upgrade success, detecting whether an external storage device storing a firmware file is connected; In response to detecting access to an external storage device storing a firmware file, the firmware file is extracted from the external storage device and transferred to the boot program area, so as to write the firmware file to the application area through the boot program area for firmware upgrade.
10. The method for updating the firmware of the beverage device according to claim 9, wherein: After the step of extracting the firmware file from the external storage device and transferring the firmware file to the boot program area, so as to write the firmware file to the application area through the boot program area for firmware upgrade, the firmware update method for the beverage device further includes: In response to a successful upgrade, the firmware file corresponding to the current upgrade is stored in the program backup area as the backup firmware file.
11. The method for updating the firmware of the beverage device according to claim 9, wherein: After the step of extracting the firmware file from the external storage device and transferring the firmware file to the boot program area, so as to write the firmware file to the application area through the boot program area for firmware upgrade, the firmware update method for the beverage device further includes: In response to an upgrade failure, the upgrade status is adjusted from upgrade success to upgrade failure.
12. A beverage device, characterized in that: It includes a main control module and a human-computer interaction module, the main control module includes a boot program area and an application program area, the human-computer interaction module includes a program backup area, and the program backup area stores a backup firmware file. The human-computer interaction module is configured to execute the firmware update method of the beverage device according to any one of claims 1 to 11.
Citation Information
Patent Citations
Method for upgrading firmware based on chip usbhid, terminal equipment and computer readable storage medium
CN112947978A
Method and system for online upgrading MCU firmware of satellite communication equipment
CN115080091A
Brick rescuing method and device for equipment flashing abnormity, equipment and readable storage medium
CN115373715A
System upgrading method, system upgrading device, processor and storage medium
CN119847555A
Firmware upgrade backup method and system based on external Flash and storage medium
CN120179272A