Control method and device of image forming equipment and storage medium
By hash verification of the firmware program of the image forming device, the threat of flashing behavior to device security is solved, the stable operation of the device and high-quality printing are achieved, and the economic benefits of the manufacturer are improved.
Patent Information
- Application Number
- CN202510185780.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-06-10
AI Technical Summary
The flashing behavior poses a threat to the security of printing equipment, resulting in premature wear of internal components of the equipment, degraded printing quality, equipment failure and increased risk of data security.
By hashing the firmware program of the image forming device, the target hash value is generated and stored, and then the same hash algorithm is used to generate a check hash value during the firmware program operation, and the working status of the device is controlled based on the verification results to prevent potential risks.
It effectively prevents firmware program tampering, ensures the safety and stability of the equipment, avoids equipment failures and degradation in print quality, and improves the economic benefits of the manufacturer.
Smart Images

Figure CN120122903A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data protection, and in particular, to a control method, device, and readable storage medium for an image forming apparatus. Background Art
[0002] When a firmware program is burned into a chip, a printing device has a strict consumable certification program. It is required that only when an official or certified consumable is installed and successfully passes the certification, the printing device will perform a printing operation. The core purpose of this mechanism is to protect the printing device from potential security risks brought by non-original consumables. For example, non-original consumables may cause ink or toner leakage due to unqualified manufacturing processes or materials, thereby corroding the print head or other internal components. In addition, the physical dimensions or chemical properties of non-original consumables may be incompatible with the device, resulting in problems such as print head clogging, paper jams, or device overheating, seriously affecting the normal operation of the device. Through the strict consumable certification program, the printing device can ensure that the used consumables meet the design standards, thereby ensuring the long-term stable operation of the device and providing users with high-quality printing effects.
[0003] However, by means of technology modification (commonly known as flashing), the certification program in the printing device is modified, enabling the printing device to bypass the normal consumable verification process and perform printing without using official certified consumables. This behavior poses a serious threat to the security of the printing device. First, non-original consumables may lack necessary quality control, and their components or performance may not meet the requirements of the printing device, which may cause premature wear or damage to internal components of the device (such as consumable roller components like the photosensitive drum or developing roller). For example, inferior ink may contain impurities that clog the print head nozzles, or the toner particles may be uneven, resulting in a decline in print quality or even a malfunction of the printing device. Second, the flashed printing device may not be able to correctly identify the status of the consumables, such as the ink level or toner concentration, causing the device to continue running when the consumables are exhausted, thereby causing irreversible damage to the print head or other key components. In addition, the flashing behavior may also damage the firmware integrity of the device, making it more vulnerable to external malicious attacks or virus infections, further threatening the data security and user privacy of the device.
[0004] From the perspective of device operation, the flashing behavior may cause the firmware of the printing device to run unstably, resulting in frequent error messages, task interruptions, or system crashes. This not only affects the user experience but also may shorten the service life of the device. More importantly, the flashed device may not be able to receive firmware updates provided by the manufacturer normally, and these updates usually contain important security patches and performance optimizations. The lack of these updates will expose the device to more security risks.
[0005] Therefore, preventing the flashing behavior and improving the usage safety of printing devices have become the key issues that need to be urgently solved in the current printing industry. Summary of the Invention
[0006] The present invention aims to solve at least one of the technical problems existing in the prior art.
[0007] To this end, an object of the present invention is to provide a control method for an image forming device, which improves the usage safety of the image forming device, can also avoid problems such as image forming device failures and print quality degradation, and at the same time improves the economic benefits of manufacturers.
[0008] To this end, a second object of the present invention is to provide a control device for an image forming device.
[0009] To this end, a third object of the present invention is to provide an image forming device.
[0010] To this end, a fourth object of the present invention is to provide a storage medium.
[0011] To achieve the above object, an embodiment of the first aspect of the present invention discloses a control method for an image forming device, including: performing a hash calculation on the data of the firmware program of the image forming device to generate at least one target hash value for characterizing the integrity of the firmware program, and storing the at least one target hash value in a preset storage area; using the same hash algorithm as that used when generating the target hash value to perform a hash calculation on the data of the currently running firmware program to generate a verification hash value corresponding to the at least one target hash value; performing a hash verification on the currently running firmware program based on the verification hash value and the target hash value; and controlling the working state of the image forming device according to the hash verification result.
[0012] A control method for an image forming apparatus according to an embodiment of the present invention calculates a hash value for data of a firmware program of the image forming apparatus according to different calculation requirements, and can correspondingly obtain at least one target hash value, and stores the at least one target hash value in a preset storage area, effectively preventing the possibility of the firmware program itself tampering with or forging the target hash value, and ensuring the accuracy and reliability of the calculation of the target hash value. After that, during the operation of the firmware program, the same hash algorithm as that for calculating the target hash value is used to calculate the hash value of the currently running firmware program, so that one or more verification hash values can be obtained, and these verification hash values are compared with their corresponding target hash values one by one to complete the hash verification, and the working state of the image forming apparatus is controlled based on the comparison result, which can avoid the further expansion of potential risks or damages, prompt the user or administrator to repair, update or perform a security check on the firmware program, and then ensure that the image forming apparatus can resume its normal working state and continuously provide reliable printing services, thereby improving the use safety of the image forming apparatus, and can also avoid problems such as image forming apparatus failures and printing quality degradation, and at the same time improve the economic benefits of the manufacturer.
[0013] In addition, the control method for an image forming apparatus according to the above embodiment of the present invention may further have the following additional technical features: In some embodiments, when calculating a hash value for data of the firmware program of the image forming apparatus to generate at least one target hash value for characterizing the integrity of the firmware program, it includes: calculating a hash value for the data of the firmware program to obtain a first type of target hash value, where the first type of target hash value includes one target hash value.
[0014] In some embodiments, when calculating a hash value for data of the firmware program of the image forming apparatus to generate at least one target hash value for characterizing the integrity of the firmware program, it further includes: segmenting the data of the firmware program according to a preset data length, calculating a hash value for each segmented data to obtain a second type of target hash value, where the second type of target hash value includes multiple target hash values.
[0015] In some embodiments, when calculating a hash value for data of the firmware program of the image forming apparatus to generate at least one target hash value for characterizing the integrity of the firmware program, it further includes: identifying functional programs in the firmware program, calculating a hash value for data of the functional programs to obtain a third type of target hash value, where the firmware program includes one or more of the functional programs, and the third type of target hash value includes one or more target hash values.
[0016] In some embodiments, when identifying the functional programs in the firmware program, it includes: obtaining the flag information of the functional program, where the flag information includes the starting address and data length corresponding to the functional program; and determining the functional program according to the starting address and the data length.
[0017] In some embodiments, when performing hash verification on the currently running firmware program based on the verification hash value and the target hash value, it includes: after the image forming device is powered on, comparing the verification hash value corresponding to the first type of target hash value with the first type of target hash value. If the verification hash value corresponding to the first type of hash value is consistent with the first type of target hash value, the verification is successful; otherwise, the verification fails.
[0018] In some embodiments, when performing hash verification on the currently running firmware program based on the verification hash value and the target hash value, it includes: during the running of the firmware program, comparing one or more verification hash values corresponding to the second type of target hash value with the second type of target hash value one by one at regular or irregular intervals. If all the verification hash values corresponding to the second type of target hash value are consistent with the second type of target hash value, the verification is successful; otherwise, the verification fails.
[0019] In some embodiments, when performing hash verification on the currently running firmware program based on the verification hash value and the target hash value, it includes: when the image forming device runs to the functional program, comparing the verification hash value corresponding to the third type of target hash value with the third type of target hash value. If the verification hash value corresponding to the third type of target hash value is consistent with the third type of target verification hash value, the verification is successful; otherwise, the verification fails.
[0020] In some embodiments, when controlling the working state of the image forming device according to the hash verification result, it includes: when the data verification of the firmware program is successful, controlling the image forming device to execute the firmware program.
[0021] In some embodiments, when controlling the working state of the image forming device according to the hash verification result, it includes: when the data verification of the firmware program fails, controlling the image forming device to execute a data protection mechanism, where the data protection mechanism includes at least one of controlling the image forming device to stop executing the firmware program, controlling the PC (Program Counter) pointer to point to a null address, restarting the image forming device, and controlling the image forming device to enter a preset infinite loop state.
[0022] In some embodiments, the control method of the image forming apparatus further includes: when the firmware program is running, the data stored in the preset storage area is configured to be unreadable by external devices.
[0023] To achieve the above object, an embodiment of the second aspect of the present invention discloses a control device for an image forming apparatus, including: a first calculation module configured to perform a hash calculation on data of a firmware program of the image forming apparatus to generate at least one target hash value for characterizing the integrity of the firmware program, and store the at least one target hash value in a preset storage area; a second calculation module configured to perform a hash calculation on data of the currently running firmware program by using the same hash algorithm as that used when generating the target hash value to generate a verification hash value corresponding to the at least one target hash value; a verification module configured to perform a hash verification on the currently running firmware program based on the verification hash value and the target hash value; and a control module configured to control an operating state of the image forming apparatus according to a hash verification result.
[0024] According to the control device for an image forming apparatus of an embodiment of the present invention, the first calculation module performs a hash calculation on data of a firmware program of the image forming apparatus according to different calculation requirements, and can correspondingly obtain at least one target hash value, and stores the at least one target hash value in a preset storage area, effectively preventing the possibility of the firmware program itself tampering with or forging the target hash value, and ensuring the accuracy and reliability of the calculation of the target hash value. Subsequently, during the running of the firmware program, the second calculation module performs a hash calculation on the currently running firmware program by using the same hash algorithm as that used for calculating the target hash value, so as to obtain one or more verification hash values. The verification module compares these verification hash values with their corresponding target hash values one by one to complete the hash verification. The control module controls the operating state of the image forming apparatus based on the comparison result, which can avoid further expansion of potential risks or damages, prompt a user or an administrator to perform repair, update, or security check of the firmware program, and further ensure that the image forming apparatus can resume a normal operating state and continuously provide reliable printing services, thereby improving the use safety of the image forming apparatus, avoiding problems such as image forming apparatus failures and printing quality degradation, and also improving the economic benefits of the manufacturer.
[0025] To achieve the above object, an embodiment of the third aspect of the present invention discloses an image forming apparatus, including: the control device for an image forming apparatus according to the embodiment of the second aspect of the present invention; or a processor, a memory, and a control program for an image forming apparatus stored in the memory and executable on the processor, where when the control program for the image forming apparatus is executed by the processor, the control method of the image forming apparatus according to the embodiment of the first aspect of the present invention is implemented.
[0026] An image forming apparatus according to an embodiment of the present invention calculates a hash value of data of a firmware program of the image forming apparatus according to different calculation requirements, and can correspondingly obtain at least one target hash value, and stores the at least one target hash value in a preset storage area, effectively preventing the possibility of the firmware program itself tampering with or forging the target hash value, ensuring the accuracy and reliability of the calculation of the target hash value. After that, during the operation of the firmware program, the same hash algorithm as that for calculating the target hash value is used to calculate the hash value of the currently running firmware program, so that one or more verification hash values can be obtained. These verification hash values are compared with their corresponding target hash values one by one to complete the hash verification, and the working state of the image forming apparatus is controlled based on the comparison result, which can avoid the further expansion of potential risks or damages, prompt the user or administrator to repair, update or perform a security check on the firmware program, and then ensure that the image forming apparatus can restore the normal working state and continuously provide reliable printing services, thereby improving the use safety of the image forming apparatus, and can also avoid problems such as image forming apparatus failures and printing quality degradation, and at the same time improve the economic benefits of the manufacturer.
[0027] To achieve the above object, an embodiment of the fourth aspect of the present invention discloses a storage medium, on which a control program of an image forming apparatus is stored. When the control program of the image forming apparatus is executed by a processor, it implements the control method of the image forming apparatus described in the first aspect embodiment of the present invention.
[0028] A storage medium according to an embodiment of the present invention, when the control program of the image forming apparatus stored thereon is executed by a processor, calculates a hash value of data of the firmware program of the image forming apparatus according to different calculation requirements, and can correspondingly obtain at least one target hash value, and stores the at least one target hash value in a preset storage area that cannot be read during the operation of the firmware program, effectively preventing the possibility of the firmware program itself tampering with or forging the target hash value, ensuring the accuracy and reliability of the calculation of the target hash value. After that, during the operation of the firmware program, the same hash algorithm as that for calculating the target hash value is used to calculate the hash value of the currently running firmware program, so that one or more verification hash values can be obtained. These verification hash values are compared with their corresponding target hash values one by one to complete the hash verification, and the working state of the image forming apparatus is controlled based on the comparison result, which can avoid the further expansion of potential risks or damages, prompt the user or administrator to repair, update or perform a security check on the firmware program, and then ensure that the image forming apparatus can restore the normal working state and continuously provide reliable printing services, thereby improving the use safety of the image forming apparatus, and can also avoid problems such as image forming apparatus failures and printing quality degradation, and at the same time improve the economic benefits of the manufacturer.
[0029] Additional aspects and advantages of the present invention will be given in part in the following description, become apparent in part from the following description, or be learned by practice of the present invention. Description of the Drawings
[0030] The above and / or additional aspects and advantages of the present invention will become apparent and be readily understood from the following description of embodiments in conjunction with the accompanying drawings, in which: Figure 1 is a flowchart of a control method for an image forming apparatus according to an embodiment of the present invention; Figure 2 is a block diagram of a control device of an image forming apparatus according to an embodiment of the present invention; Figure 3 is a block diagram of an image forming apparatus according to an embodiment of the present invention; Figure 4 is a block diagram of an image forming apparatus according to another embodiment of the present invention. Detailed Description of the Embodiments
[0031] Embodiments of the present invention will be described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. Embodiments of the present invention will be described in detail below.
[0032] Reference will be made below to Figure 1 describe a control method for an image forming apparatus according to an embodiment of the present invention.
[0033] Figure 1 is a flowchart of a control method for an image forming apparatus according to an embodiment of the present invention. As Figure 1 shown, the control method of the image forming apparatus includes the following steps: Step S1, perform a hash calculation on data of a firmware program of the image forming apparatus to generate at least one target hash value for characterizing the integrity of the firmware program, and store the at least one target hash value in a preset storage area.
[0034] Among them, the image forming apparatus includes, for example, a printing device; the firmware program is used to control various functions of the image forming apparatus, for example, including a consumable authentication process. If the firmware program is a consumable authentication program, the image forming apparatus will perform a printing operation only after the consumable authentication program is burned into the image forming apparatus and passes the authentication.
[0035] In an embodiment, to ensure the integrity of the firmware program of an image forming device, a standard hash algorithm is used to calculate the hash of the data of the firmware program during the firmware program burning stage. Among them, the standard hash algorithm includes, for example, but is not limited to, MD5 (Message-Digest Algorithm 5), SHA-1 (Secure Hash Algorithm 1), SHA-256 (Secure Hash Algorithm 256), etc. Subsequently, according to specific calculation requirements, these algorithms can map the data of the firmware program to at least one target hash value. These target hash values, as the characterization of the integrity of the firmware program, have a high degree of uniqueness and integrity. Then, these calculated target hash values are securely stored in a preset storage area. When the firmware program runs, the firmware program can only read the data stored in the preset storage area and cannot modify / write data to the preset storage area. For example, during the running process of the firmware program, the hash storage value in the preset storage area can be read through specific interface code for comparison with the hash calculation value to achieve hash verification. However, the firmware program cannot write a hash value to the preset storage area, thereby preventing a third party from modifying the hash storage value of the program, improving data security, and preventing data from being tampered with. On the other hand, external devices such as burners cannot access and read the data stored in the preset storage area, so they cannot modify or write data to the preset storage area, thus preventing external devices from tampering with the hash storage value and improving data security.
[0036] It can be seen that the above design effectively prevents the possibility of the firmware program itself from tampering with or forging the target hash value, ensures the accuracy and reliability of the target hash value calculation, improves the data security of the entire firmware program, and thus provides a solid foundation for the integrity verification of the firmware program.
[0037] In the process of storing at least one target hash value into a preset storage area, for example, three types of target hash values are obtained, and the storage space will be dynamically allocated according to the number of target hash values actually included in each type of target hash value. Specifically, if three types of target hash values are obtained through hash calculation, then when storing these target hash values, the number of target hash values included in the first type of target hash value will be checked first. If there is only one target hash value in the first type of target hash value, a corresponding storage space will be allocated for it in the preset storage area. Then, for the second type of target hash value, if there are five target hash values included in the second type of target hash value, five consecutive storage spaces will be allocated in the preset storage area to store these five target hash values respectively. Finally, for the third type of target hash value, if there is also only one target hash value in the third type of target hash value, a storage space will also be allocated for it in the preset storage area. This method of flexibly allocating storage space according to the number of target hash values not only ensures the reasonable utilization of the storage space, but also guarantees that each target hash value can be stored safely and independently, thus effectively maintaining the integrity verification mechanism of the firmware program.
[0038] Step S2: Use the same hash algorithm as when generating the target hash value to perform a hash calculation on the data of the currently running firmware program to generate a verification hash value corresponding to at least one target hash value.
[0039] In the embodiment, in order to verify the integrity of the currently running firmware program, the exact same hash algorithm as when generating the target hash value in the burning stage (such as MD5, SHA-1, SHA-256, etc.) will be used to perform a complete hash calculation process on all the data of the current firmware program, thereby generating one or more verification hash values, and these verification hash values will be compared one-to-one or one-to-many with the target hash values. By comparing the matching degree between the two, it can be accurately determined whether the currently running firmware program has undergone unauthorized changes since it was correctly burned. This method ensures the accuracy and effectiveness of the verification process, and thus guarantees that the firmware program is not tampered with or damaged.
[0040] Step S3: Perform a hash verification on the currently running firmware program based on the verification hash value and the target hash value.
[0041] In an embodiment, the process of performing a hash check on the currently running firmware program based on the verification hash value and the target hash value is a process of comparing, one by one, the verification hash value calculated from the data of the currently running firmware program through the same hash algorithm with the target hash value pre-stored in the preset storage area. To verify whether the two are exactly the same, so as to accurately determine whether the integrity of the currently running firmware program is maintained, that is, to confirm whether it has been tampered with or damaged in any form since it was correctly burned into the image forming device. If the verification hash value is exactly the same as the target hash value, it indicates that the firmware program is running normally and has not been tampered with; otherwise, it may mean that the firmware program has been tampered with or damaged.
[0042] Step S4, control the working state of the image forming device according to the hash check result.
[0043] In an embodiment, by comparing the verification hash value of the currently running firmware program with the target hash value stored in the preset storage area, the integrity of the firmware program is accurately determined, and based on this, the process of deciding whether the image forming device should continue to work or perform other specific operations. Specifically, if the verification hash value is exactly the same as the target hash value, it means that the firmware program has not been tampered with, and the image forming device will maintain the normal working state and continue to execute the printing task; otherwise, if the two do not match, it may mean that the firmware program has been damaged or tampered with. At this time, in order to protect the data security of the image forming device and the firmware program, the printing work may be immediately suspended, and the image forming device may be switched to the data protection mechanism to avoid further expansion of potential risks or damages, so as to prompt the user or administrator to repair, update or perform a security check on the firmware program, thereby ensuring that the image forming device can resume the normal working state and continuously provide reliable printing services.
[0044] Thus, the control method of the above image forming device calculates the hash value of the data of the firmware program of the image forming device according to different calculation requirements, and can correspondingly obtain at least one target hash value, and stores the at least one target hash value in a preset storage area, effectively preventing the possibility of the firmware program itself tampering with or forging the target hash value, and ensuring the accuracy and reliability of the calculation of the target hash value. After that, during the operation of the firmware program, the same hash algorithm as that for calculating the target hash value is used to calculate the hash value of the currently running firmware program, so that one or more verification hash values can be obtained. These verification hash values are compared with their corresponding target hash values one by one to complete the hash verification, and the working state of the image forming device is controlled based on the comparison result, which can avoid the further expansion of potential risks or damages, prompt the user or administrator to repair, update or perform a security check on the firmware program, and then ensure that the image forming device can resume its normal working state and continuously provide reliable printing services, thereby improving the use safety of the image forming device, and can also avoid problems such as image forming device failures and printing quality degradation, and at the same time improve the economic benefits of the manufacturer.
[0045] In an embodiment of the present invention, when calculating the hash value of the data of the firmware program of the image forming device to generate at least one target hash value for characterizing the integrity of the firmware program, it includes: calculating the hash value of the data of the firmware program to obtain a first type of target hash value, where the first type of target hash value includes one target hash value.
[0046] In an embodiment of the present invention, when calculating the hash value of the data of the firmware program of the image forming device to generate at least one target hash value for characterizing the integrity of the firmware program, it further includes: segmenting the data of the firmware program according to a preset data length, calculating the hash value of each segmented data to obtain a second type of target hash value, where the second type of target hash value includes multiple target hash values.
[0047] In an embodiment of the present invention, when calculating the hash value of the data of the firmware program of the image forming device to generate at least one target hash value for characterizing the integrity of the firmware program, it further includes: identifying the functional programs in the firmware program, calculating the hash value of the data of the functional programs to obtain a third type of target hash value, where the firmware program includes one or more functional programs, and the third type of target hash value includes one or more target hash values.
[0048] In the embodiment, in order to comprehensively and accurately characterize the integrity of the firmware program of the image forming device, multiple hash calculation strategies can be adopted to generate the target hash value.
[0049] Specifically, during the startup process of the image forming device, the data of the entire firmware program can be directly subjected to hash calculation to obtain the first type of target hash value, which is used as the target hash value representing the integrity status of the entire firmware program.
[0050] Secondly, in order to more meticulously detect any potential changes in the data of the firmware program, the data of the firmware program is divided into multiple data segments according to a preset data length. For example, the firmware program is segmented by 512 bytes, and hash calculation is performed on each segment of data respectively, so as to obtain a series of second type of target hash values. These target hash values together constitute a detailed verification of the segmented integrity of the firmware program.
[0051] In addition, after identifying each functional program included in the firmware program, hash calculation is independently performed on the data of each functional program to generate the third type of target hash values. These target hash values respectively correspond to the integrity verification of different functional modules in the firmware program. Through the above methods, not only can the integrity verification information at the overall level of the firmware program be obtained, but also the verification information at the segmented level and the functional module level can be obtained, thereby realizing multi-level and all-round guarantee of the integrity of the firmware program.
[0052] In an embodiment of the present invention, when identifying the functional programs in the firmware program, it includes: obtaining the flag information of the functional program, where the flag information includes the starting address and data length corresponding to the functional program; determining the functional program according to the starting address and data length.
[0053] In the embodiment, in order to accurately identify each functional program in the firmware program, the flag information of the functional program will be obtained. The flag information corresponding to each functional program can directly point to the specific location of the functional program in the firmware program. Specifically, the flag information contains two key elements, namely the starting address and data length corresponding to the functional program. The starting address can be understood as a positioning point to indicate the start position of the functional program in the storage area where the firmware program is located; while the data length provides the size information of the space occupied by the functional program. Through these two key elements, the scope of each functional program can be accurately located in the firmware program. This identification method based on flag information not only improves the accuracy of functional program identification, but also greatly simplifies the complexity of the identification process, laying a solid foundation for subsequent hash calculation and firmware integrity verification work.
[0054] In an embodiment of the present invention, when performing hash verification on the currently running firmware program based on the verification hash value and the target hash value, it includes: after turning on the image forming device, comparing the verification hash value corresponding to the first type of target hash value with the first type of target hash value. If the verification hash value corresponding to the first type of hash value is consistent with the first type of target hash value, the verification is successful; otherwise, the verification fails.
[0055] In an embodiment, after the image forming device (i.e., when the image forming device starts running and loads the firmware program), the first type of target hash value is obtained from a preset storage area. Subsequently, a hash calculation is performed on the entire firmware program that is currently loaded and running to obtain a verification hash value. Then, the calculated verification hash value is compared one by one with the stored first type of target hash value. If the verification hash value is exactly the same as the corresponding target hash value, it indicates that the firmware program has not been tampered with since the last verification, and the verification result is successful. Conversely, if the verification hash value is inconsistent with the corresponding target hash value, it is immediately determined that the verification fails, indicating that the firmware program may have been illegally modified. In this way, users or administrators can verify the security and integrity of the data based on the verification result.
[0056] In an embodiment of the present invention, when performing a hash verification on the currently running firmware program based on the verification hash value and the target hash value, it includes: when the firmware program is running, comparing one or more verification hash values corresponding to the second type of target hash value with the second type of target hash value one by one at regular or irregular intervals. If all the verification hash values corresponding to the second type of target hash value are consistent with the second type of target hash value, the verification is successful; otherwise, the verification fails.
[0057] In an embodiment, during the running of the firmware program, whether it is executed regularly at a preset time interval or executed irregularly triggered by a specific event or condition, one or more verification hash values are generated for the data of the currently running firmware program. These verification hash values are then compared one by one with the second type of target hash value stored in the preset storage area. The second type of target hash value represents the target hash value of the firmware program in the correct and untampered state. Only when all the calculated verification hash values are exactly the same as the corresponding second type of target hash value does it indicate that the firmware program has remained intact and has not been illegally modified since the last verification, and at this time, the verification result is determined to be successful. On the contrary, if any one of the verification hash values is inconsistent with the corresponding second type of target hash value, it means that the firmware program may have been tampered with, and the verification result will be immediately determined to be a failure. This dynamic verification process can timely detect potential security problems of the firmware program, ensure the stable and reliable operation of the image forming device, and thus improve the reliability of the data verification of the firmware program.
[0058] Among them, the regular verification mechanism will repeatedly perform hash calculations at preset time intervals. Although this can ensure the verification frequency of the firmware program, it may also bring a problem. During the waiting stage (i.e., the time interval between two verifications), if the firmware program happens to be tampered with during this period, then this tampering may not be detected immediately. At this time, the repeatedly calculated verification hash values may still be based on the old data before the tampering, and thus cannot accurately reflect the current state of the firmware program.
[0059] In contrast, the irregular verification mechanism can flexibly deal with this problem and trigger the verification process according to actual needs or specific events. Therefore, the hash verification can be performed at any time when the firmware program is running, which greatly reduces the waiting stage. In this way, irregular verification can detect any potential tampering of the firmware program more promptly, improving the timeliness and accuracy of the verification.
[0060] Therefore, periodically and irregularly performing hash verification on the data of the currently running firmware program can improve the accuracy of data calculation, thereby improving the security and reliability of the verification.
[0061] In addition, the image forming device can process different data segments of the firmware program at the same time, and independently perform hash calculations on each data segment to generate a corresponding verification hash value. For example, when the data of the first segment of the firmware program is being processed and a verification hash value is calculated, the data of the second segment of the firmware program can also be hashed at the same time to generate another verification hash value. This parallel processing method ensures that the verification work of multiple data segments can be carried out at the same time without waiting for the verification of the previous data segment to be completed. Subsequently, the verification hash value calculated by each segment of the firmware program is compared with its corresponding pre-stored target hash value. Regardless of the verification result of the first segment of the firmware program, it will not affect the comparison process of the verification hash value of the second segment or other data segments with their respective target hash values. This parallel verification mechanism significantly shortens the overall verification time and improves the efficiency of firmware program integrity verification.
[0062] In one embodiment of the present invention, when a hash check is performed on a currently running firmware program based on a check hash value and a target hash value, it includes: when the image forming device runs to a functional program, comparing the check hash value corresponding to the third type of target hash value with the third type of target hash value; if the check hash value corresponding to the third type of target hash value is consistent with the check hash value of the third type of target, the check succeeds; otherwise, the check fails.
[0063] In an embodiment, when the image forming device runs to a functional program, the data of the current functional program will be calculated and a verification hash value will be generated. This verification hash value will then be compared with the third type of target hash value in the pre-stored area. If the verification hash value is completely consistent with the third type of target hash value, it can be confirmed that the functional program has remained intact since the last verification and has not been illegally modified. At this time, the verification result is judged to be successful. On the contrary, if the verification hash value is inconsistent with the third type of target hash value, it means that the functional program may have been tampered with, or there are other integrity issues. At this time, the verification result will be judged to be a failure. This ensures that the image forming device can perform the printing task as expected, avoiding potential failures or security risks caused by program tampering.
[0064] Among them, the functional program refers to the relatively important and highly confidential program in the firmware program, and each firmware program may include one or more functional programs.
[0065] When a functional program is selected for hash verification, the integrity verification of this functional program will be focused on first. If the current verification of the functional program fails, that is, the data is incorrect or tampered with, for security and stability considerations, the subsequent verification process will be stopped immediately, and the verification of other functional programs will not continue. Only when the verification result of the current functional program is successful, ensuring the accuracy of its data, will the verification of the next functional program be continued. This mechanism ensures that each functional program in the firmware program meets the expected security and performance standards, thus maintaining the reliability, security, and confidentiality of the entire firmware program. For example, if the firmware program includes two functional programs, during the hash verification of the first functional program, the second functional program will not be verified simultaneously or in advance, but will strictly follow the order to ensure the accuracy of each step.
[0066] In addition, during the operation of the firmware program, at least one of the first type of target hash value, the second type of target hash value, and the third type of target hash value can be selected for hash verification according to actual needs.
[0067] For example, after the image forming device is started, in order to ensure the integrity and security of the firmware program, a comprehensive hash calculation is first performed on the entire firmware program to generate a verification hash value, and this value is compared with the first type of target hash value. If the verification hash value is consistent with the first type of target hash value, it indicates that the firmware program is in an untampered state when powered on, and the verification is successful, and the image forming device can continue with subsequent operations. Subsequently, hash calculations are performed on the segmented data of the firmware program to generate multiple verification hash values. During this process, when the firmware program runs to a certain critical functional program, the data of this functional program will be immediately subjected to a hash calculation, and the obtained verification hash value will be compared with the third type of target hash value. Only when the verification hash value of this functional program is exactly matched with the third type of target hash value, that is, the verification is successful, will the hash verification of the other segmented data after the functional program be continued. If the verification hash value of any functional program is inconsistent with the corresponding target hash value, the subsequent verification process will be immediately stopped and directly determined as a verification failure to ensure that the image forming device will not face security risks due to running a possibly tampered firmware program.
[0068] This selective verification mechanism allows for flexible adjustment of the verification scope and strictness according to security level requirements, performance considerations, or specific operating scenarios, thereby ensuring that the firmware program can maintain its proper functions and security during operation while avoiding unnecessary performance overhead.
[0069] In an embodiment of the present invention, when controlling the working state of an image forming device according to the hash verification result, it includes: when the data verification of the firmware program is successful, controlling the image forming device to execute the firmware program.
[0070] In the embodiment, when the hash verification of the firmware program is completed and it is confirmed that the data verification result of the firmware program is successful, this means that the integrity of the firmware program has been verified and it has not been tampered with or damaged. Based on this verification result, the image forming device will be controlled to normally execute the verified firmware program. This step is to ensure that the image forming device can operate stably and guarantee the security and reliability of the firmware program based on the accuracy of the verification. Thus, the image forming device can efficiently execute its printing tasks and other functions on the premise of ensuring that the firmware program has not been illegally modified.
[0071] In an embodiment of the present invention, when controlling the working state of an image forming device according to the hash verification result, it includes: when the data verification of the firmware program fails, controlling the image forming device to execute a data protection mechanism, where the data protection mechanism includes at least one of controlling the image forming device to stop executing the firmware program, controlling the PC pointer to point to a null address, restarting the image forming device, and controlling the image forming device to enter a preset infinite loop state.
[0072] In the embodiment, when the data verification of the firmware program fails, the image forming device will immediately execute the data protection mechanism. The data protection mechanism includes but is not limited to: the image forming device will stop executing the currently possibly tampered or damaged firmware program to prevent the operation of potential malicious code; secondly, it may control the PC pointer to point to a null address, which is a security measure aimed at preventing the image forming device from continuing to execute an uncertain or tampered code segment; in addition, the image forming device may also automatically restart to attempt to clear temporary program failures or restore to a known safe state; finally, the image forming device may be controlled to enter a preset infinite loop state, which is a fail-safe mechanism used to prevent the image forming device from performing any operations that may further damage the image forming device or leak sensitive information when it cannot resume normal operation. The combined use of these data protection mechanisms aims to minimize the security risks and data losses that may be brought about by the failure of the data verification of the firmware program, ensure that the image forming device can respond appropriately when facing potential threats, thereby improving the use safety of the image forming device, and at the same time avoiding problems such as a decline in printing quality caused by image forming device failures, and further improving the economic benefits of the manufacturer.
[0073] In an embodiment of the present invention, the control method of the image forming device further includes: when the firmware program is running, the data stored in the preset storage area is configured to be unreadable by external devices.
[0074] Among them, external devices include, for example, programmers and the like.
[0075] In the embodiment, when the firmware program is running, the data stored in the preset storage area cannot be read by external devices such as programmers, which can prevent a third party from modifying or writing the target hash value through a programmer or other means, effectively preventing malicious users or attackers from circumventing the integrity check of the hash verification by changing the target hash value, and thus improving the accuracy of the target hash value calculation and the verification security.
[0076] During the running process of the firmware program, the firmware program can read the target hash value corresponding to the verification hash value through specific interface code to compare the verification hash value with its corresponding target hash value, and complete the hash verification based on the comparison result. However, the firmware program also cannot modify or write data into the preset storage area, thereby avoiding data tampering or forgery and improving data security.
[0077] In summary, according to the control method of the image forming device in the embodiment of the present invention, the data of the firmware program of the image forming device is subjected to hash calculation according to different calculation requirements, and at least one target hash value can be correspondingly obtained and stored in the preset storage area, effectively preventing the possibility of the firmware program itself tampering with or forging the target hash value, and ensuring the accuracy and reliability of the target hash value calculation. Then, during the running process of the firmware program, the same hash algorithm as that for calculating the target hash value is used to perform hash calculation on the currently running firmware program, so that one or more verification hash values can be obtained. These verification hash values are compared with their corresponding target hash values one by one to complete the hash verification, and the working state of the image forming device is controlled based on the comparison result, which can avoid the further expansion of potential risks or damages, prompt the user or administrator to repair, update or perform a security check on the firmware program, and thus ensure that the image forming device can resume the normal working state and continuously provide reliable printing services, thereby improving the use safety of the image forming device, avoiding problems such as image forming device failures and printing quality degradation, and at the same time improving the economic benefits of the manufacturer.
[0078] The present invention also proposes a control device 100 for an image forming device in an embodiment.
[0079] Such as Figure 2As shown, it is a structural block diagram of a control device of an image forming apparatus according to an embodiment of the present invention. The control device 100 of the image forming apparatus includes: a first calculation module 110, a second calculation module 120, a verification module 130, and a control module 140.
[0080] Among them, the first calculation module 110 is configured to perform a hash calculation on the data of the firmware program of the image forming apparatus to generate at least one target hash value for characterizing the integrity of the firmware program, and store the at least one target hash value in a preset storage area; the second calculation module 120 is configured to perform a hash calculation on the data of the currently running firmware program using the same hash algorithm as when generating the target hash value to generate a verification hash value corresponding to the at least one target hash value; the verification module 130 is configured to perform a hash verification on the currently running firmware program based on the verification hash value and the target hash value; the control module 140 is configured to control the working state of the image forming apparatus according to the hash verification result.
[0081] In an embodiment of the present invention, when the first calculation module 110 performs a hash calculation on the data of the firmware program of the image forming apparatus to generate at least one target hash value for characterizing the integrity of the firmware program, it includes: performing a hash calculation on the data of the firmware program to obtain a first type of target hash value, where the first type of target hash value includes one target hash value.
[0082] In an embodiment of the present invention, when the first calculation module 110 performs a hash calculation on the data of the firmware program of the image forming apparatus to generate at least one target hash value for characterizing the integrity of the firmware program, it further includes: segmenting the data of the firmware program according to a preset data length, performing a hash calculation on each segmented data to obtain a second type of target hash value, where the second type of target hash value includes multiple target hash values.
[0083] In an embodiment of the present invention, when the first calculation module 110 performs a hash calculation on the data of the firmware program of the image forming apparatus to generate at least one target hash value for characterizing the integrity of the firmware program, it further includes: identifying the function programs in the firmware program, performing a hash calculation on the data of the function programs to obtain a third type of target hash value, where the firmware program includes one or more function programs, and the third type of target hash value includes one or more target hash values.
[0084] In an embodiment of the present invention, when the first calculation module 110 identifies the function programs in the firmware program, it includes: obtaining the flag information of the function programs, where the flag information includes the starting address and data length corresponding to the function programs; determining the function programs according to the starting address and data length.
[0085] In one embodiment of the present invention, when the verification module 130 performs hash verification on the currently running firmware program based on the verification hash value and the target hash value, it includes: after the image forming device is turned on, comparing the verification hash value corresponding to the first type of target hash value with the first type of target hash value. If the verification hash value corresponding to the first type of hash value is consistent with the first type of target hash value, the verification is successful; otherwise, the verification fails.
[0086] In one embodiment of the present invention, when the verification module 130 performs hash verification on the currently running firmware program based on the verification hash value and the target hash value, it includes: during the running of the firmware program, comparing one or more verification hash values corresponding to the second type of target hash value with the second type of target hash value one by one at regular or irregular intervals. If all the verification hash values corresponding to the second type of target hash value are consistent with the second type of target hash value, the verification is successful; otherwise, the verification fails.
[0087] In one embodiment of the present invention, when the verification module 130 performs hash verification on the currently running firmware program based on the verification hash value and the target hash value, it includes: when the image forming device runs to the function program, comparing the verification hash value corresponding to the third type of target hash value with the third type of target hash value. If the verification hash value corresponding to the third type of target hash value is consistent with the third type of target verification hash value, the verification is successful; otherwise, the verification fails.
[0088] In one embodiment of the present invention, when the control module 140 controls the working state of the image forming device according to the hash verification result, it includes: when the data verification of the firmware program is successful, controlling the image forming device to execute the firmware program.
[0089] In one embodiment of the present invention, when the control module 140 controls the working state of the image forming device according to the hash verification result, it includes: when the data verification of the firmware program fails, controlling the image forming device to execute a data protection mechanism, where the data protection mechanism includes at least one of controlling the image forming device to stop executing the firmware program, controlling the PC pointer to point to an empty address, restarting the image forming device, and controlling the image forming device to enter a preset infinite loop state.
[0090] In one embodiment of the present invention, during the running of the firmware program, the data stored in the preset storage area is configured to be unreadable by external devices.
[0091] The control device 100 of the image forming apparatus according to an embodiment of the present invention, the first calculation module 110 performs a hash calculation on the data of the firmware program of the image forming apparatus according to different calculation requirements, and can correspondingly obtain at least one target hash value, and stores the at least one target hash value in a preset storage area, effectively preventing the possibility of the firmware program itself tampering with or forging the target hash value, ensuring the accuracy and reliability of the target hash value calculation. After that, during the running process of the firmware program, the second calculation module 120 performs a hash calculation on the currently running firmware program by using the same hash algorithm as that for calculating the target hash value, so as to obtain one or more verification hash values. The verification module 130 compares these verification hash values with their corresponding target hash values one by one to complete the hash verification. The control module 140 controls the working state of the image forming apparatus based on the comparison result, which can avoid the further expansion of potential risks or damages, prompt the user or administrator to repair, update or perform a security check on the firmware program, and further ensure that the image forming apparatus can resume the normal working state and continuously provide reliable printing services, thereby improving the use safety of the image forming apparatus, and can also avoid problems such as image forming apparatus failures and printing quality degradation, and at the same time improve the economic benefits of the manufacturer.
[0092] A further embodiment of the present invention provides an image forming apparatus 200.
[0093] In one embodiment of the present invention, as Figure 3 shown, the image forming apparatus 200 according to the embodiment of the present invention includes the control device 100 of the image forming apparatus described in any one of the above embodiments of the present invention.
[0094] In another embodiment of the present invention, as Figure 4 shown, the image forming apparatus 200 according to the embodiment of the present invention includes a processor, a memory, and a control program of the image forming apparatus stored in the memory and executable on the processor. When the control program of the image forming apparatus is executed by the processor, it implements the control method of the image forming apparatus described in any one of the above embodiments of the present invention.
[0095] It should be noted that when the image forming apparatus 200 is controlled, its specific implementation manner is similar to the specific implementation manner of the control method of the image forming apparatus or the control device 100 of the image forming apparatus in any one of the above embodiments of the present invention. Therefore, for a detailed exemplary description of the process of controlling the image forming apparatus 200, reference can be made to the relevant description part of the control method of the image forming apparatus or the control device 100 of the image forming apparatus described above. To reduce redundancy, it will not be repeated here.
[0096] An image forming apparatus 200 according to an embodiment of the present invention calculates a hash value of data of a firmware program of the image forming apparatus according to different calculation requirements, and can correspondingly obtain at least one target hash value, and stores the at least one target hash value in a preset storage area that cannot be read during the operation of the firmware program, effectively preventing the possibility of the firmware program itself tampering with or forging the target hash value, and ensuring the accuracy and reliability of the calculation of the target hash value. After that, during the operation of the firmware program, a hash algorithm same as that for calculating the target hash value is used to calculate a hash value of the currently running firmware program, so that one or more verification hash values can be obtained. These verification hash values are compared with their corresponding target hash values one by one to complete the hash verification, and the working state of the image forming apparatus is controlled based on the comparison result, which can avoid the further expansion of potential risks or damages, prompt the user or administrator to perform repair, update or security check of the firmware program, and then ensure that the image forming apparatus can restore the normal working state and continuously provide reliable printing services, thereby improving the use safety of the image forming apparatus, and can also avoid problems such as image forming apparatus failures and printing quality degradation, and at the same time improve the economic benefits of the manufacturer.
[0097] A further embodiment of the present invention also discloses a storage medium, on which a control program of an image forming apparatus is stored. When the control program of the image forming apparatus is executed by a processor, it implements the control method of the image forming apparatus described in any one of the above embodiments of the present invention.
[0098] For a storage medium according to an embodiment of the present invention, when the control program of the image forming apparatus stored thereon is executed by a processor, a hash value of data of the firmware program of the image forming apparatus is calculated according to different calculation requirements, and at least one target hash value can be correspondingly obtained, and the at least one target hash value is stored in a preset storage area that cannot be read during the operation of the firmware program, effectively preventing the possibility of the firmware program itself tampering with or forging the target hash value, and ensuring the accuracy and reliability of the calculation of the target hash value. After that, during the operation of the firmware program, a hash algorithm same as that for calculating the target hash value is used to calculate a hash value of the currently running firmware program, so that one or more verification hash values can be obtained. These verification hash values are compared with their corresponding target hash values one by one to complete the hash verification, and the working state of the image forming apparatus is controlled based on the comparison result, which can avoid the further expansion of potential risks or damages, prompt the user or administrator to perform repair, update or security check of the firmware program, and then ensure that the image forming apparatus can restore the normal working state and continuously provide reliable printing services, thereby improving the use safety of the image forming apparatus, and can also avoid problems such as image forming apparatus failures and printing quality degradation, and at the same time improve the economic benefits of the manufacturer.
[0099] In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "schematic embodiments", "examples", "specific examples", or "some examples", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example.
[0100] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A method for controlling an image forming device, characterized in that: include: Performing hash calculation on data of a firmware program of the image forming device to generate at least one target hash value for characterizing the integrity of the firmware program, and storing the at least one target hash value in a preset storage area; Using the same hash algorithm as that used to generate the target hash value, hash calculation is performed on data of the currently running firmware program to generate a verification hash value corresponding to the at least one target hash value; Performing a hash check on the currently running firmware program based on the check hash value and the target hash value; The working state of the image forming device is controlled according to the hash verification result.
2. The method for controlling an image forming apparatus according to claim 1, wherein: When performing hash calculation on data of a firmware program of the image forming device to generate at least one target hash value for characterizing the integrity of the firmware program, the method includes: A hash calculation is performed on the data of the firmware program to obtain a first type of target hash value, wherein the first type of target hash value includes a target hash value.
3. The method for controlling an image forming apparatus according to claim 1, wherein: When performing hash calculation on data of the firmware program of the image forming device to generate at least one target hash value for characterizing the integrity of the firmware program, the method further includes: The data of the firmware program is segmented according to a preset data length, and a hash calculation is performed on each segmented data to obtain a second type of target hash value, wherein the second type of target hash value includes multiple target hash values.
4. The method for controlling an image forming apparatus according to claim 1, wherein: When performing hash calculation on data of the firmware program of the image forming device to generate at least one target hash value for characterizing the integrity of the firmware program, the method further includes: Identify the functional program in the firmware program, perform hash calculation on the data of the functional program, and obtain a third type of target hash value, wherein the firmware program includes one or more of the functional programs, and the third type of target hash value includes one or more target hash values.
5. The method for controlling an image forming apparatus according to claim 4, wherein: When identifying the functional program in the firmware program, it includes: Acquire the flag information of the function program, wherein the flag information includes the starting address and data length corresponding to the function program; The function program is determined according to the start address and the data length.
6. The method for controlling an image forming apparatus according to claim 2, wherein: When performing a hash check on the currently running firmware program based on the check hash value and the target hash value, the method includes: After the image forming device is turned on, the verification hash value corresponding to the first type of target hash value is compared with the first type of target hash value. If the verification hash value corresponding to the first type of hash value is consistent with the first type of target hash value, the verification succeeds; otherwise, the verification fails.
7. The method for controlling an image forming apparatus according to claim 3, wherein: When performing a hash check on the currently running firmware program based on the check hash value and the target hash value, the method includes: When the firmware program is running, one or more verification hash values corresponding to the second type of target hash value are compared with the second type of target hash value one by one regularly or irregularly. If all verification hash values corresponding to the second type of target hash value are consistent with the second type of target hash value, the verification is successful; otherwise, the verification fails.
8. The method for controlling an image forming apparatus according to claim 4, wherein: When performing a hash check on the currently running firmware program based on the check hash value and the target hash value, the method includes: When the image forming device runs to the function program, the verification hash value corresponding to the third type target hash value is compared with the third type target hash value. If the verification hash value corresponding to the third type target hash value is consistent with the third type target verification hash value, the verification succeeds; otherwise, the verification fails.
9. The method for controlling an image forming device according to any one of claims 6 to 8, characterized in that: When the working state of the image forming device is controlled according to the hash verification result, it includes: When the data verification of the firmware program succeeds, the image forming apparatus is controlled to execute the firmware program.
10. The method for controlling an image forming device according to any one of claims 6 to 8, characterized in that: When the working state of the image forming device is controlled according to the hash verification result, it includes: When the data verification of the firmware program fails, the image forming device is controlled to execute a data protection mechanism, wherein the data protection mechanism includes at least one of controlling the image forming device to stop executing the firmware program, controlling a PC pointer to point to a null address, restarting the image forming device, and controlling the image forming device to enter a preset dead loop state.
11. The method for controlling an image forming apparatus according to claim 1, wherein: Also includes: When the firmware program is running, the data stored in the preset storage area is configured to be unable to be read by an external device.
12. A control device for an image forming apparatus, characterized in that: include: A first calculation module, configured to perform a hash calculation on data of a firmware program of the image forming device to generate at least one target hash value for characterizing the integrity of the firmware program, and store the at least one target hash value in a preset storage area; a second calculation module, configured to perform a hash calculation on data of a currently running firmware program using the same hash algorithm as that used to generate the target hash value, so as to generate a verification hash value corresponding to the at least one target hash value; A verification module, configured to perform a hash verification on the currently running firmware program based on the verification hash value and the target hash value; A control module is used to control the working state of the image forming device according to the hash verification result.
13. An image forming device, characterized in that: include: The control device of the image forming apparatus according to claim 12; or, A processor, a memory, and a control program for an image forming device stored in the memory and executable on the processor, wherein the control program for the image forming device implements the control method for the image forming device as claimed in any one of claims 1 to 11 when executed by the processor.
14. A storage medium, characterized in that: The storage medium stores a control program of an image forming device, and when the control program of the image forming device is executed by a processor, the control method of the image forming device according to any one of claims 1 to 11 is implemented.