Off-line upgrading method and device for food processer and electronic equipment
By detecting pluggable storage devices in the smart cooking machine, identifying and upgrading target files, the problem of not being able to upgrade without a network connection is solved, and an efficient and secure offline upgrade experience is achieved.
Patent Information
- Application Number
- CN202411843707.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-14
- Publication Date
- 2025-03-28
AI Technical Summary
Smart cooking machines cannot perform software upgrades and data management without network connection, which affects the user experience.
By detecting the connection of pluggable storage devices, triggering the device identification program, enumerating files, extracting file type identification, determining matching with preset types, identifying target upgrade files, and performing incremental updates.
It realizes system upgrade and data management in offline state, improves user experience, reduces the volume and time of upgrade files, and ensures the security and compatibility of upgrades.
Smart Images

Figure CN119718377A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to an offline upgrade method, device and electronic device for a food processor. Background Art
[0002] With the rapid development of science and technology, smart home devices have gradually entered thousands of households. Among them, smart food processors have become an indispensable part of modern kitchens with their convenient operation and intelligent functions. Smart food processors can automatically complete the food processing and cooking process through built-in programs, greatly simplifying cooking operations and improving cooking efficiency and safety. In order to maintain the optimization of equipment performance and adapt to the ever-changing user needs and new cooking technologies, it is particularly important to regularly update the software and upgrade the functions of food processors.
[0003] Currently, most smart food processors rely on Wi-Fi or other forms of wireless network connections to receive new software updates and synchronize data. Without a network connection, the functions of smart food processors are limited, and software upgrades and data management cannot be achieved, affecting the user experience.
[0004] Therefore, there is an urgent need for an offline upgrade method, device and electronic device for a food processor. Summary of the invention
[0005] The present application provides an offline upgrade method, device and electronic device for a food processor, which can perform system upgrades and data management in an offline state, thereby improving the user experience.
[0006] In a first aspect of the present application, a method for offline upgrading of a food processor is provided, the method comprising: detecting whether a pluggable storage device is connected; if it is determined that the pluggable storage device is connected, triggering a device identification program; according to the device identification program, enumerating each file under the root directory and subdirectory of the pluggable storage device; reading the file header information of each file, and extracting the file type identifier of each file according to the file header information; determining whether the file type identifier matches a preset type; if it is determined that the file type identifier matches the preset type, identifying the file corresponding to the file type identifier as a target upgrade file; and incrementally updating the system files of the food processor based on the target upgrade file.
[0007] By adopting the above technical solution, by detecting the connection of the pluggable storage device and triggering the device identification program, the externally connected upgrade media can be automatically discovered without the need for manual selection by the user, thereby improving the convenience of the upgrade. By enumerating the files of the pluggable storage device and extracting the file type identifier, the target upgrade file can be accurately identified to avoid selecting the wrong file for upgrading. By judging whether the file type identifier matches the preset type, non-upgrade files can be effectively filtered out to prevent system damage caused by erroneous upgrades. Finally, by upgrading the system files through incremental updates, the size of the upgrade files and the time required for the upgrade can be greatly reduced, thereby improving the upgrade efficiency. The entire upgrade process is completed entirely inside the food processor, does not rely on an Internet connection, can adapt to a usage environment with no network or unstable network, and improves the user experience.
[0008] Optionally, the detecting whether there is a pluggable storage device connection specifically includes: detecting whether there is an external storage device connected through a USB interface; if it is detected that the external storage device is connected, establishing a communication connection with the external storage device and reading the device type of the external storage device; judging whether the device type is a pluggable device type according to a preset device type list; if it is determined that the device type is a pluggable device type, determining that there is a pluggable storage device connection.
[0009] By adopting the above technical solution, the access of the external storage device is detected through the USB interface, and various types of pluggable storage media, such as U disk, mobile hard disk, etc., can be supported, expanding the range of choices for upgrade paths. By establishing a communication connection with the external storage device and reading the device type, it is possible to accurately determine whether the accessed device is a legal device that can be used for upgrading, thereby avoiding the misconnection and data leakage of illegal devices. By comparing with the preset device type list, the supported media type can be quickly identified to improve the efficiency and accuracy of device identification. Once confirmed as a legal pluggable storage device, the target upgrade file can be further read to perform subsequent upgrade operations. This method can realize the rapid, accurate and secure identification and connection of various upgrade media through standardized USB communication protocols and device type judgment mechanisms, and provide a reliable data channel for subsequent upgrade file reading and verification, thereby ensuring the feasibility and compatibility of the food processor upgrade function.
[0010] Optionally, if it is determined that the file type identifier matches the preset type, after identifying the file corresponding to the file type identifier as a target upgrade file, the method also includes: obtaining a first version number of the target upgrade file and obtaining a second version number of the system file; if it is determined that the first version number is higher than the second version number, retaining the target upgrade file; if it is determined that the first version number is lower than or equal to the second version number, deleting the target upgrade file.
[0011] By adopting the above technical solution, by obtaining the first version number of the target upgrade file and the second version number of the system file, and making a high and low version judgment, it is possible to effectively avoid the upgrade file of a lower version or the same version from being mistakenly selected as the upgrade source, and prevent system failures caused by version downgrades or repeated upgrades. By retaining the target upgrade file that is higher than the current system version, it can be ensured that the upgraded system has newer and better features and performance. By deleting the target upgrade file that is lower than or equal to the current system version, storage space can be saved and the management and maintenance costs of the upgrade file can be optimized. This method can achieve version control and optimized management of the food processor system through version number comparison, ensure that the target upgrade file is compatible with the current system, and meet the user's demand for the new version, thereby improving the upgrade experience and user satisfaction of the food processor product.
[0012] Optionally, after the system file of the food processor is incrementally updated based on the target upgrade file, the method further includes: obtaining a target version number of the target system file of the food processor, which is a system file obtained after the target system file is incrementally updated; determining whether the target version number is the first version number; if it is determined that the target version number is the first version number, determining that the system upgrade of the food processor is successful; if it is determined that the target version number is not the first version number, determining that the system upgrade of the food processor has failed.
[0013] By adopting the above technical solution, by obtaining the target version number of the target system file after the upgrade and comparing it with the first version number of the target upgrade file, the actual effect of the target system file can be evaluated and whether the upgrade is successful can be accurately determined. By comparing the consistency of the version numbers, it can be verified whether the target upgrade file is correctly applied during the incremental update process and whether the upgraded system has reached the expected version target. If the version numbers are consistent, it means that the incremental update is executed correctly and successfully upgraded to the new version. However, if the version numbers are inconsistent, it means that a deviation or anomaly occurred during the incremental update process, resulting in a failure of the system upgrade. This method objectively verifies the actual effect of the incremental update of the food processor system by comparing the version numbers.
[0014] Optionally, the incremental update of the system files of the food processor based on the target upgrade file specifically includes: parsing the target upgrade file to extract incremental update information, the incremental update information including an update file list, a modification position of each file to be updated, and the modification content of each file to be updated, the update file list including a plurality of files to be updated; for each file to be updated, writing the modification content to the corresponding modification position; and modifying the version number of the food processor to the second version number.
[0015] By adopting the above technical solution, by parsing the target upgrade file and extracting the incremental update information, the files to be updated, the modification location and the modification content that need to be updated can be accurately located, and the refined incremental update of the system files can be realized. By updating the file list, multiple files to be updated can be processed in batches, the update tasks can be uniformly planned and scheduled, and the modification of multiple files can be performed in parallel, thereby accelerating the incremental update process of the entire system. At the same time, the incremental update retains the other parts of the original file to the maximum extent by modifying the specific content of the file at a fixed point, reducing the impact of the update on user data and applications, and reducing the upgrade risk. After the upgrade is completed, by modifying the system version number, it can be clearly marked that the system has been upgraded to the new version, which is convenient for subsequent version management and problem location. This method realizes the accurate, efficient and safe incremental update of the food processor system files by parsing the incremental update information, while improving the system performance and functions, minimizing the impact of the upgrade on the user, thus bringing a smoother and more reliable upgrade experience.
[0016] Optionally, before incrementally updating the system file of the food processor based on the target upgrade file, the method further includes: copying the system file to obtain a backup file, and saving the backup file to a preset path.
[0017] By adopting the above technical solution, by copying and backing up the original system files before the incremental update, a security guarantee and rollback mechanism can be provided for the system upgrade. The backup file is a complete snapshot of the original system state, recording all files and configuration information of the system before the upgrade. During the upgrade process, if any abnormality or failure occurs, the original system can be restored from the backup file to ensure that the basic functions of the food processor are available. At the same time, the backup file in the preset path can also be used as a recovery source after the upgrade fails, for the upgrade program to directly read and restore, simplifying the recovery process. This method provides reliable security and fault recovery capabilities for the incremental upgrade of the food processor through system file backup, ensuring that it can quickly roll back to the pre-upgrade state when the upgrade fails, minimizing the upgrade risk, and maintaining the continuity of the system and the integrity of the data.
[0018] Optionally, after incrementally updating the system file of the food processor based on the target upgrade file, the method further includes: restarting the food processor and verifying the integrity of the target system file; if it is determined that the target system file is complete, running the food processor based on the target system file; if it is determined that the target system file is incomplete, restoring the backup file from the preset path to the food processor.
[0019] By adopting the above technical solution, by restarting the food processor and verifying the integrity of the target system file, the actual effect of the incremental update can be verified to ensure that the upgraded system can operate normally. The system restart can load and apply all updated files to make the upgrade truly effective. If the integrity verification passes, it means that the incremental updates are all successful and the upgraded system is complete and reliable. At this time, the upgrade program can guide the food processor from the target system file to enter the normal operating state of the new version system. If the integrity verification fails, it means that some files are damaged, lost or not as expected during the incremental update process, and the upgraded system has defects. At this time, the upgrade program can execute the fallback strategy, read and restore the backup file before the upgrade from the preset path, and quickly fall back to the original stable version to ensure the normal availability of the food processor and control the impact of the upgrade failure to the minimum range. This method performs final inspection and confirmation on the incremental upgrade of the food processor system through restart and integrity verification, and provides fault-tolerant mechanisms such as fast fallback and automatic retry when the upgrade fails, thereby maximizing the success rate, reliability and security of the food processor system upgrade.
[0020] In a second aspect of the present application, an offline upgrade device for a food processor is provided, the device comprising: a detection module and a processing module, wherein: the detection module is used to detect whether a pluggable storage device is connected; the processing module is used to trigger a device identification program if it is determined that the pluggable storage device is connected; the processing module is also used to enumerate the various files under the root directory and subdirectory of the pluggable storage device according to the device identification program; the processing module is also used to read the file header information of each of the files, and extract the file type identifier of each of the files according to the file header information; the processing module is also used to determine whether the file type identifier matches a preset type; the processing module is also used to identify the file corresponding to the file type identifier as a target upgrade file if it is determined that the file type identifier matches the preset type; the processing module is also used to incrementally update the system files of the food processor based on the target upgrade file.
[0021] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are both used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any one of the methods described above.
[0022] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed, any of the methods described above is executed.
[0023] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. By detecting the connection of the pluggable storage device and triggering the device identification program, the externally connected upgrade media can be automatically discovered without the need for manual selection by the user, which improves the convenience of the upgrade. By enumerating the files of the pluggable storage device and extracting the file type identifier, the target upgrade file can be accurately identified to avoid selecting the wrong file for upgrade. By judging whether the file type identifier matches the preset type, non-upgrade files can be effectively filtered out to prevent system damage caused by incorrect upgrades. Finally, upgrading the system files through incremental updates can greatly reduce the size of the upgrade files and the time required for the upgrade, thereby improving the upgrade efficiency. The entire upgrade process is completed entirely inside the food processor, does not rely on an Internet connection, and can adapt to environments with no network or unstable network.
[0024] 2. By detecting the access of external storage devices through the USB interface, it can support various types of pluggable storage media, such as U disk, mobile hard disk, etc., expanding the range of choices for upgrade paths. By establishing a communication connection with the external storage device and reading the device type, it can be accurately determined whether the accessed device is a legal device that can be used for upgrading, avoiding the misconnection and data leakage of illegal devices. By comparing with the preset device type list, the supported media types can be quickly identified to improve the efficiency and accuracy of device identification. Once confirmed as a legal pluggable storage device, the target upgrade file can be further read to perform subsequent upgrade operations. This method can achieve fast, accurate and secure identification and connection of multiple upgrade media through standardized USB communication protocols and device type judgment mechanisms, providing a reliable data channel for subsequent upgrade file reading and verification, thereby ensuring the feasibility and compatibility of the food processor upgrade function.
[0025] 3. By obtaining the first version number of the target upgrade file and the second version number of the system file, and making a high and low version judgment, it can effectively avoid the upgrade file of the lower version or the same version from being mistakenly selected as the upgrade source, and prevent system failures caused by version downgrades or repeated upgrades. By retaining the target upgrade file that is higher than the current system version, it can be ensured that the upgraded system has newer and better features and performance. By deleting the target upgrade file that is lower than or equal to the current system version, storage space can be saved and the management and maintenance costs of the upgrade file can be optimized. This method can achieve version control and optimized management of the food processor system through version number comparison, ensure that the target upgrade file is compatible with the current system, and meet the user's demand for the new version, thereby improving the upgrade experience and user satisfaction of the food processor product. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1It is a flowchart of an offline upgrade method of a food processor disclosed in an embodiment of the present application; Figure 2 It is a module schematic diagram of an offline upgrade device for a food processor disclosed in an embodiment of the present application; Figure 3 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.
[0027] Explanation of the reference numerals: 201, detection module; 202, processing module; 300, electronic device; 301, processor; 302, communication bus; 303, user interface; 304, network interface; 305, memory. DETAILED DESCRIPTION
[0028] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0029] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.
[0030] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0031] This application provides an offline upgrade method for a food processor, referring to Figure 1 , Figure 1 1 is a flow chart of an offline upgrade method for a food processor provided in an embodiment of the present application. The method is applied to a food processor. The method includes steps S101 to S107, which are as follows: Step S101: Detect whether there is a pluggable storage device connected.
[0032] In step S101, it is detected through the USB interface whether an external storage device is connected; if it is detected that an external storage device is connected, a communication connection is established with the external storage device, and the device type of the external storage device is read; according to the preset device type list, it is determined whether the device type is a pluggable device type; if it is determined that the device type is a pluggable device type, it is determined that a pluggable storage device is connected.
[0033] Specifically, the food processor continuously monitors whether an external storage device is inserted through its USB interface. Specifically, the USB interface controller detects the voltage and signal changes on the USB bus in real time, and triggers a USB interrupt event once a new device is found. The food processor's interrupt service program reads the device descriptor of the newly connected device, which contains key information such as the device type, manufacturer ID, and product ID. The food processor pre-stores a preset device type list for pluggable storage devices, which lists the type codes of common USB flash drives, mobile hard drives, and other devices. The interrupt service program compares the type code of the newly connected device with the preset device type list. If they match, it confirms that the newly connected device is a pluggable storage device and sends an event notification of "pluggable storage device connection detected" to the system.
[0034] Step S102: If it is determined that a pluggable storage device is connected, a device identification procedure is triggered.
[0035] In step S102, the system driver module of the food processor subscribes to the event of "pluggable storage device connection detected". Once the event notification is received, the device identification program is started to further identify and configure the pluggable storage device. The device identification program first obtains the unique identifier of the pluggable storage device according to the event notification, such as the device path, logical unit number, etc. Then loads the universal driver of the pluggable storage device, such as the USB mass storage device driver. Next, the food processor tries to mount the file system on the pluggable storage device, such as FAT32, NTFS, etc. If the file system is mounted successfully, it means that the pluggable storage device has been identified and configured, and file access operations can be performed.
[0036] Step S103: enumerate the files in the root directory and subdirectories of the pluggable storage device according to the device identification program.
[0037] In step S103, the food processor enumerates the files under the root directory and subdirectories of the pluggable storage device according to the device identification program; after the device identification program successfully mounts the file system of the pluggable storage device, the directories and files on it can be accessed through the file system API. The food processor first accesses the root directory according to the device identification program, obtains all the files and subdirectories information under the root directory, and records them in a file list. Next, the food processor traverses this file list. If the list item is a subdirectory, it recursively accesses all the files and subdirectories under this subdirectory and records them in the file list; if the list item is a file, it directly records it in the file list. In this way, through recursive traversal, a complete list of all files on the pluggable storage device can be obtained.
[0038] Step S104: Read the file header information of each file, and extract the file type identifier of each file according to the file header information.
[0039] In step S104, after the food processor obtains a list of all files on the pluggable storage device, it will read and analyze the header data of these files one by one through the device identification program to determine whether they are upgrade files for the food processor. Specifically, the food processor reads the first few dozen bytes of each file through the device identification program and parses them according to the preset file header format. The header data of the upgrade file will contain some special identifiers (file type identifiers), such as magic numbers, version numbers, and file types. After extracting the file type identifier, the food processor records it in the corresponding item of the file list.
[0040] Step S105: Determine whether the file type identifier matches the preset type.
[0041] In step S105, the food processor has a preset type list pre-installed, which records the file type identifiers corresponding to various upgrade files, such as "FW" for firmware upgrade files and "CF" for configuration parameter files. The food processor compares the file type identifiers of each file extracted in step S104 with the preset types in the preset type list one by one to determine whether there is a completely matching item.
[0042] Step S106: If it is determined that the file type identifier matches the preset type, the file corresponding to the file type identifier is identified as a target upgrade file.
[0043] In step S106, for files whose file type identifiers can match the preset types, the food processor identifies them as target upgrade files for this upgrade.
[0044] In a possible implementation, after step S106, the method further includes: obtaining a first version number of the target upgrade file, and obtaining a second version number of the system file; if it is determined that the first version number is higher than the second version number, retaining the target upgrade file; if it is determined that the first version number is lower than or equal to the second version number, deleting the target upgrade file.
[0045] Specifically, after successfully identifying the target upgrade file in step S106, the food processor further compares the version number of the target upgrade file with the current system version number of the food processor to decide whether to retain the target upgrade file. The specific process is as follows: the food processor extracts the version number information from the file header of the target upgrade file. Usually, the version number is encoded in a fixed field in the file header. For example, in the file header format of step S104, the version number occupies 2 bytes. The upgrade program reads the content of these 2 bytes and parses the numerical form of the version number according to the preset encoding rules (such as BCD code), which is called the "first version number". Next, the food processor accesses the system configuration information and reads the version number of the current system file. The version information of the operating system is generally stored in a specific location such as a registry and a configuration file. Similarly, the food processor finds the location of the system version number of the food processor and reads its value, which is called the "second version number".
[0046] After obtaining the first version number and the second version number, the food processor compares the two versions. Since the version number is usually composed of multiple parts, such as "major version number. Minor version number. Revision number. Compile number", it is necessary to perform segmented comparison to determine the version level. Specifically, the food processor compares the corresponding parts of the two version numbers segment by segment from high to low until the first unequal part is found. If the version number of this part of the target upgrade file is larger, the first version number is higher than the second version number; conversely, if the version number of this part of the system file is larger, or the two version numbers are exactly the same, the first version number is lower than or equal to the second version number.
[0047] If it is determined that the first version number is higher than the second version number, it means that the version of the target upgrade file is higher than the current system of the food processor and is a valid upgrade file. Therefore, the food processor will retain the target upgrade file and copy it to the upgrade directory specified by the system for subsequent formal upgrades. If the first version number is lower than or equal to the second version number, it means that the version of the target upgrade file is either older than the current system version or the same as the current version, which is an invalid upgrade. At this time, the food processor will directly delete the target upgrade file and remove its path from the upgrade task list.
[0048] For example, suppose the current system version of the food processor is "V2.1.0", and the version of the upgrade file "UPGRADE.BIN" is "V2.0.5". The major version numbers of the two versions are the same, both 2; but the minor version number of the system version is 1, which is higher than the minor version number of the upgrade file 0. Therefore, the upgrade program determines that the version of "UPGRADE.BIN" is lower than the current system and is an invalid upgrade. Therefore, the file is deleted and no longer included in the subsequent upgrade process.
[0049] Step S107: Based on the target upgrade file, incrementally update the system files of the food processor.
[0050] In step S107, the target upgrade file is parsed to extract incremental update information, which includes an update file list, a modification position of each file to be updated, and a modification content of each file to be updated. The update file list includes multiple files to be updated. For each file to be updated, the modification content is written to the corresponding modification position. The version number of the food processor is modified to the second version number.
[0051] Specifically, the food processor parses the target upgrade file and extracts the incremental update information contained therein. Since the upgrade file adopts a specific packaging format, the parsing process will be strictly carried out in accordance with the packaging format. Usually, the incremental update package consists of a file header, an index table, a data area, and other parts. The file header describes the basic information of the package, such as the target version number, compression algorithm, etc.; the index table records the information of each file to be updated, such as the file name, modification location, offset address and length of the modified content, etc.; the data area stores the entity data of the modified content. The food processor parses out each field of the incremental package in turn according to the format specification.
[0052] Among them, the information parsed from the index table includes the update file list, the modification location and modification content of each file to be updated. The update file list records the names or paths of all files involved in this incremental update. These files are the target files of this update, and the food processor will modify them one by one. Each file to be updated has a corresponding item in the index table, which records in detail the location where the file needs to be modified. The modification location is usually represented by offset + length, which can be a continuous interval or multiple discontinuous intervals. In addition, the storage location and length of the modified content in the data area are also described in the corresponding item of the file. After reading this information from the index table, the food processor starts to perform the actual file modification operation. For each file in the update list, the food processor first finds its complete path in the local file system according to its file name or path. Then, the upgrade program opens the system file, locates the modification location specified in the index table, reads the corresponding modification content from the data area, writes it to the modification location of the system file, and completes the modification of the system file. After the modification is completed, the food processor closes the system file and saves it, and then continues to modify the next file until all files to be updated are modified. Finally, the food processor updates the version number of the system. The system version number is usually saved in a specific configuration file or registry entry, and the food processor modifies it to the target version number (i.e., the first version number) of the upgrade file.
[0053] In a possible implementation, before step S107, the method further includes: copying the system file to obtain a backup file, and saving the backup file to a preset path.
[0054] Specifically, before performing an incremental update of system files, in order to prevent the system from failing to operate normally due to an update failure or anomalies after the update, the food processor usually first performs a complete backup of the current system files so that it can be restored to the state before the update in time when an update error occurs. The specific steps are as follows: The backup module of the food processor will traverse the system partition and identify all system files that need to be backed up. The food processor records the paths of these system files in a backup file list for subsequent backup operations. Then, the food processor creates a special backup directory on the storage device of the food processor according to the preset path. The food processor copies the system files in the backup file list to the preset path one by one.
[0055] In one possible implementation, after incrementally updating the system files of the food processor based on the target upgrade file, the method further includes: restarting the food processor and verifying the integrity of the target system files; if it is determined that the target system files are complete, running the food processor based on the target system files; if it is determined that the target system files are incomplete, restoring the backup files to the food processor from a preset path.
[0056] Specifically, after completing the incremental update, the food processor will automatically restart. Restarting allows the updated target system files to take effect and load them into memory for operation. When restarting, the food processor will first completely shut down all running applications and services to ensure that the target system files are not occupied or tampered with by other processes.
[0057] After the reboot is complete, the food processor enters the system integrity verification phase. This phase is performed by the system boot program, and its purpose is to check whether the key target system files are intact and can be loaded and run normally. The food processor reads and verifies the key files in the system partition one by one according to the predetermined file list, such as the operating system kernel, root file system, startup configuration, etc. The verification method is usually to calculate the hash value of the file (such as MD5 or SHA256) and compare it with the pre-stored hash value. If the hash values of all target system files are consistent with the pre-stored hash values, it means that the target system files are complete and can be loaded and run. If the integrity verification passes, the food processor boots from the target system file and enters the normal operating state. At this time, the user can use the various functions of the food processor normally.
[0058] If the integrity verification fails, that is, the target system files are missing, damaged, or tampered with, the food processor will abort the boot process and trigger the upgrade rollback mechanism. At this point, the food processor will restore the original system files from the previously backed up system files to the system partition, overwriting the problematic target system files. During the recovery process, the food processor will first clear the system partition, then decompress and copy the original system files from the backup files to ensure that the restored system files are exactly the same as before the upgrade. After the recovery is complete, the food processor will restart again, boot based on the restored original system files, and roll back to the stable state before the upgrade.
[0059] In a possible implementation, after step S107, the method further includes: obtaining a target version number of a target system file of the food processor, which is a system file obtained by incrementally updating a system file; determining whether the target version number is a first version number; if it is determined that the target version number is the first version number, determining that the system upgrade of the food processor is successful; if it is determined that the target version number is not the first version number, determining that the system upgrade of the food processor has failed.
[0060] After the food processor completes the incremental update of the system file, it also performs a verification step of the upgrade result to confirm whether the updated system version is consistent with the first version number of the target upgrade file. The specific steps of the verification process are as follows: First, the food processor obtains the actual version number of the updated target system file, such as "V1.2.0". This version number reflects the actual version of the current system and is called the target version number. Next, the food processor compares the obtained target version number with the first version number of the target upgrade file. The first version number is extracted from the upgrade file header in step S106 and represents the target version of the target upgrade file. The food processor compares the character string of the target version number with the first version number for equality to determine whether the upgrade is successful.
[0061] If the comparison result is equal, that is, the target version number is exactly the same as the first version number, it means that the food processor system has been successfully upgraded. At this time, the food processor will record the result of the successful upgrade and trigger the corresponding success prompt, such as a light, a buzzer, etc., to inform the user that the upgrade has been completed. If the comparison result is not equal, that is, the target version number is inconsistent with the first version number, it means that the incremental update has not reached the expected target version, and the food processor system upgrade has failed. At this time, the food processor will record the result of the failed upgrade and the possible cause of the error, and trigger the corresponding failure prompt, such as a flashing red light, an error prompt tone, etc., to remind the user that the upgrade was unsuccessful and that you may need to retry or seek technical support.
[0062] Reference Figure 2 The present application also provides an offline upgrade device for a food processor, which is a food processor, and the food processor includes a detection module 201 and a processing module 202; wherein: the detection module 201 is used to detect whether a pluggable storage device is connected; the processing module 202 is used to trigger a device identification program if it is determined that a pluggable storage device is connected; the processing module 202 is also used to enumerate the various files under the root directory and subdirectory of the pluggable storage device according to the device identification program; the processing module 202 is also used to read the file header information of each file, and extract the file type identifier of each file according to the file header information; the processing module 202 is also used to determine whether the file type identifier matches a preset type; the processing module 202 is also used to identify the file corresponding to the file type identifier as a target upgrade file if it is determined that the file type identifier matches the preset type; the processing module 202 is also used to incrementally update the system files of the food processor based on the target upgrade file.
[0063] In a possible implementation, the detection module 201 detects whether a pluggable storage device is connected, specifically including: the processing module 202 detects whether an external storage device is connected through a USB interface; if the detection module 201 detects that an external storage device is connected, it establishes a communication connection with the external storage device and reads the device type of the external storage device; the processing module 202 determines whether the device type is a pluggable device type based on a preset device type list; if the processing module 202 determines that the device type is a pluggable device type, it determines that a pluggable storage device is connected.
[0064] In a possible implementation, if the processing module 202 determines that the file type identifier matches the preset type, then after identifying the file corresponding to the file type identifier as the target upgrade file, the method also includes: the processing module 202 obtains the first version number of the target upgrade file and obtains the second version number of the system file; if the processing module 202 determines that the first version number is higher than the second version number, the target upgrade file is retained; if the processing module 202 determines that the first version number is lower than or equal to the second version number, the target upgrade file is deleted.
[0065] In a possible implementation, after the processing module 202 incrementally updates the system file of the food processor based on the target upgrade file, the method further includes: the processing module 202 obtains the target version number of the target system file of the food processor, which is a system file obtained after the target system file is incrementally updated; the processing module 202 determines whether the target version number is the first version number; if the processing module 202 determines that the target version number is the first version number, it is determined that the system upgrade of the food processor is successful; if the processing module 202 determines that the target version number is not the first version number, it is determined that the system upgrade of the food processor has failed.
[0066] In a possible implementation, the processing module 202 performs an incremental update on the system files of the food processor based on the target upgrade file, specifically including: the processing module 202 parses the target upgrade file, extracts the incremental update information, the incremental update information includes an update file list, the modification location of each file to be updated, and the modification content of each file to be updated, the update file list includes multiple files to be updated; the processing module 202 writes the modification content to the corresponding modification location of each file to be updated; the processing module 202 modifies the version number of the food processor to the second version number.
[0067] In a possible implementation, before the processing module 202 incrementally updates the system files of the food processor based on the target upgrade file, the method further includes: the processing module 202 copies the system files to obtain a backup file, and saves the backup file to a preset path.
[0068] In one possible implementation, after the processing module 202 incrementally updates the system files of the food processor based on the target upgrade file, the method further includes: the processing module 202 restarts the food processor and verifies the integrity of the target system files; if the processing module 202 determines that the target system files are complete, the processing module 202 runs the food processor based on the target system files; if the processing module 202 determines that the target system files are incomplete, the processing module 202 restores the backup files from a preset path to the food processor.
[0069] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0070] The present application also provides an electronic device. Figure 3 , Figure 3 The electronic device 300 may include: at least one processor 301 , at least one network interface 304 , a user interface 303 , a memory 305 , and at least one communication bus 302 .
[0071] The communication bus 302 is used to realize the connection and communication between these components.
[0072] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.
[0073] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0074] Among them, the processor 301 may include one or more processing cores. The processor 301 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the processor 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 301, and it can be implemented separately through a chip.
[0075] Among them, the memory 305 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may optionally also be at least one storage device located away from the aforementioned processor 301. Refer to Figure 3 , the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module and an application program of an offline upgrade method of a food processor.
[0076] exist Figure 3In the electronic device 300 shown, the user interface 303 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 301 can be used to call the application program storing a method for offline upgrading of a food processor in the memory 305, and when executed by one or more processors 301, the electronic device 300 executes one or more of the methods described in the above embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0077] The present application also provides a computer-readable storage medium, which stores instructions. When executed by one or more processors 301, the electronic device 300 executes one or more of the methods described in the above embodiments.
[0078] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0079] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0080] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0081] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0082] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.
[0083] The above is only an exemplary embodiment of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, those skilled in the art will easily think of other embodiments of the present disclosure.
[0084] This application is intended to cover any variation, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the art not described in the present disclosure. The description and examples are to be regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. An offline upgrade method for a food processor, characterized in that: The method comprises: Detect whether there is a pluggable storage device connection; If it is determined that the pluggable storage device is connected, triggering a device identification procedure; According to the device identification program, enumerate the files in the root directory and subdirectories of the pluggable storage device; Reading the file header information of each of the files, and extracting the file type identifier of each of the files according to the file header information; Determine whether the file type identifier matches a preset type; If it is determined that the file type identifier matches the preset type, identifying the file corresponding to the file type identifier as a target upgrade file; Based on the target upgrade file, the system files of the food processor are incrementally updated.
2. The method according to claim 1, characterized in that The detecting whether there is a pluggable storage device connection specifically includes: Detect whether there is an external storage device connected through the USB interface; If it is detected that the external storage device is connected, a communication connection is established with the external storage device, and a device type of the external storage device is read; According to the preset device type list, determine whether the device type is a pluggable device type; If it is determined that the device type is a pluggable device type, it is determined that the pluggable storage device is connected.
3. The method according to claim 1, characterized in that: If it is determined that the file type identifier matches the preset type, then after identifying the file corresponding to the file type identifier as a target upgrade file, the method further includes: Obtaining a first version number of the target upgrade file, and obtaining a second version number of the system file; If it is determined that the first version number is higher than the second version number, retaining the target upgrade file; If it is determined that the first version number is lower than or equal to the second version number, the target upgrade file is deleted.
4. The method according to claim 3, characterized in that After incrementally updating the system file of the food processor based on the target upgrade file, the method further includes: Obtaining a target version number of a target system file of the food processor, the target system file being a system file obtained by incrementally updating the system file; Determine whether the target version number is the first version number; If it is determined that the target version number is the first version number, it is determined that the system upgrade of the food processor is successful; If it is determined that the target version number is not the first version number, it is determined that the system upgrade of the food processor has failed.
5. The method according to claim 4, characterized in that The incrementally updating the system file of the food processor based on the target upgrade file specifically includes: Parsing the target upgrade file to extract incremental update information, wherein the incremental update information includes an update file list, a modification position of each file to be updated, and a modification content of each file to be updated, wherein the update file list includes a plurality of files to be updated; For each file to be updated, writing the modified content to the corresponding modification position; The version number of the food processor is changed to the second version number.
6. The method according to claim 4, characterized in that Before incrementally updating the system file of the food processor based on the target upgrade file, the method further includes: The system file is copied to obtain a backup file, and the backup file is saved to a preset path.
7. The method according to claim 6, characterized in that After incrementally updating the system file of the food processor based on the target upgrade file, the method further includes: Restarting the food processor and verifying the integrity of the target system file; If it is determined that the target system file is complete, operating the food processor based on the target system file; If it is determined that the target system file is incomplete, the backup file is restored from the preset path to the food processor.
8. An offline upgrade device for a food processor, characterized in that: The device comprises a detection module (201) and a processing module (202), wherein: The detection module (201) is used to detect whether a pluggable storage device is connected; The processing module (202) is used to trigger a device identification program if it is determined that the pluggable storage device is connected; The processing module (202) is further used to enumerate the files in the root directory and subdirectories of the pluggable storage device according to the device identification program; The processing module (202) is further used to read the file header information of each of the files, and extract the file type identifier of each of the files according to the file header information; The processing module (202) is further used to determine whether the file type identifier matches a preset type; The processing module (202) is further configured to identify the file corresponding to the file type identifier as a target upgrade file if it is determined that the file type identifier matches the preset type; The processing module (202) is also used to incrementally update the system files of the food processor based on the target upgrade file.
9. An electronic device, characterized in that: The electronic device (300) comprises a processor (301), a memory (305), a user interface (303) and a network interface (304), wherein the memory (305) is used to store instructions, the user interface (303) and the network interface (304) are used to communicate with other devices, and the processor (301) is used to execute the instructions stored in the memory (305) so that the electronic device (300) executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is executed.
Citation Information
Cited By
Firmware updating method, electronic equipment and storage medium
CN120428992A
Firmware updating method, electronic equipment, firmware updating device and firmware updating system
CN120428995A