A firmware illegal flashing active monitoring method and system for embedded systems

By calculating the runtime verification value during embedded system operation and comparing the signature with the MD5 digest, the problem of verifying illegal writes during operation in existing technologies is solved, thereby improving the security and reliability of embedded systems.

CN123179388APending Publication Date: 2026-11-27SHANGHAI AEROSPACE CONTROL TECH INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611166529.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-03
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing signature verification and functional verification methods are insufficient for effectively verifying illegal writes and abnormal situations during the operation of embedded systems.

Method used

During the operation of the embedded system, the runtime verification value is calculated by reading the boot partition data, signed with the Ed25519 private key and written to the verification mark, and the consistency is monitored and verified in real time. The MD5 digest is compared with the preset value to achieve active detection of illegal flashing.

Benefits of technology

It implements abnormal condition detection during embedded system operation, improving security and reliability, and automatically shuts down the system to prevent damage when illegal writes are detected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123179388A_ABST
    Figure CN123179388A_ABST
Patent Text Reader

Abstract

A firmware illegal flashing active monitoring method for an embedded system, steps are as follows: (1) based on the hash digest of the first boot partition, the second boot partition and the supporting accessory marker, a check mark is obtained and written at the tail of the first boot partition; (2) when the embedded system initiates a read-write request to the external load, data is read from the embedded system, and a running state check value is calculated; (3) the running state check value is compared with the preset check reference value, if the running state check value is consistent with the preset check reference value, the embedded system does not appear the firmware illegal flashing situation, and the external load normally responds to the read-write request; otherwise, steps (2)-(3) are repeatedly executed until the running state check value is consistent with the preset check reference value or the preset retry number is reached; if the preset retry number is reached, the running state check value is still inconsistent with the preset check reference value, then the embedded system is closed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method and system for actively detecting illegal firmware flashing in embedded systems, belonging to the field of embedded electronics technology. Background Technology

[0002] Currently, embedded systems are widely used in industrial control, communication equipment, smart terminals, automotive electronics, and aerospace. After the design of an embedded system is completed, it may face risks such as external environmental interference, data transmission errors, abnormal storage media, and even potential malicious attacks. These risks can lead to the tampering, corruption, or unauthorized replacement of the embedded system program, resulting in logical errors, functional abnormalities, or failures during system operation. Therefore, it is necessary to perform signature verification and functional verification on the embedded system's program and data. However, existing signature verification and functional verification methods are mostly performed before the embedded system starts up, making it difficult to verify against unauthorized writes and abnormal conditions during system operation. Summary of the Invention

[0003] The technical problem solved by this invention is to overcome the shortcomings of existing technologies and provide a method and system for actively monitoring illegal firmware flashing in embedded systems. This invention reads data from the boot partition and calculates a runtime checksum during embedded system operation. Based on this runtime checksum, it determines whether illegal flashing has occurred in the embedded system, thus solving the problem that existing methods struggle to verify illegal flashing and abnormal situations during system operation.

[0004] The technical solution of this invention is: A method for proactively detecting illegal firmware flashing in embedded systems includes the following steps: (1) Calculate the hash digests of the first boot partition and the second boot partition of the embedded system respectively, and concatenate the hash digests of the first boot partition, the hash digests of the second boot partition and the SHA-256 hash digests of the embedded system accessory identifier to obtain the aggregate digest; execute step (2). (2) Sign the aggregate digest using the Ed25519 private key to obtain the signed data; then execute step (3). (3) Use the signature data to form a verification mark and write the verification mark at the end of the first boot partition of the embedded system; execute step (4). (4) Run the embedded system and wait for the embedded system to initiate a read / write request to the external load; if the embedded system is detected to have initiated a read / write request to the external load, then execute step (5); otherwise, continue to wait for the embedded system to initiate a read / write request to the external load. (5) Read some data from the head of the first boot partition of the embedded system and define it as the first header data; read some data from the head of the second boot partition of the embedded system and define it as the second header data; read the runtime verification flag of the embedded system from the tail of the first boot partition of the embedded system and define the read verification flag as the runtime verification flag; execute step (6). (6) Concatenate the first header data, the second header data, and the running verification flag to form consistency verification data; execute step (7); (7) Calculate the MD5 digest of the consistency check data to obtain the runtime check value; execute step (8); (8) Compare the running state verification value with the preset verification reference value. If the running state verification value is consistent with the preset verification reference value, the embedded system has not experienced an illegal firmware flashing situation, the external load responds normally to the read and write requests of the embedded system, and the entire method flow ends; otherwise, execute step (9). (9) Repeat steps (5) to (8) until the running state verification value is consistent with the preset verification reference value or the preset number of retries is reached; if the running state verification value is still inconsistent with the preset verification reference value when the preset number of retries is reached, then shut down the embedded system.

[0005] Furthermore, in step (1), the hash digest of the first boot partition of the embedded system is calculated as follows: the last 512 bytes of data of the first boot partition of the embedded system are removed, and the remaining data in the first boot partition is used to calculate the hash digest of the first boot partition.

[0006] Furthermore, in step (2), the signature data byte length is 64 bytes; in step (3), the verification mark byte length is 512 bytes, of which the first 448 bytes of the verification mark data is random data generated by the hardware true random number generator, and the last 64 bytes of the data is the signature data.

[0007] Furthermore, in step (5), the first header data is 256 bytes of data in the header of the first boot partition of the embedded system, and the second header data is 256 bytes of data in the header of the second boot partition of the embedded system.

[0008] Furthermore, in step (9), there is a waiting interval between two adjacent executions of steps (5) to (8), and the duration of the waiting interval increases exponentially with the number of retries.

[0009] Secondly, this invention also proposes an active monitoring system for illegal firmware flashing in embedded systems. The active monitoring system is used to monitor illegal firmware flashing in embedded systems. The embedded system supports multiple external payloads. The active monitoring system is deployed on an FPGA. The active monitoring system includes a tag generation module, a running status verification module, and an active protection module. The tag generation module calculates the hash digests of the first boot partition and the second boot partition of the embedded system, respectively. It then concatenates the hash digests of the first boot partition, the second boot partition, and the SHA-256 hash digest of the embedded system's accessory identifier to obtain an aggregate digest. The tag generation module signs the aggregate digest using the Ed25519 private key to obtain signature data, and uses the signature data to form a verification tag, which is then written to the end of the first boot partition of the embedded system. The runtime status verification module monitors in real time whether the embedded system has initiated read / write requests to the external payload. When it detects that the embedded system has initiated read / write requests to the external payload, the runtime status verification module first checks whether the verification result register of the FPGA contains the verification operation result. The verification operation result includes verification pass and verification failure. If the verification result register of the FPGA contains the verification operation result, the runtime status verification module controls the external payload to process the read / write request initiated by the embedded system based on the stored verification operation result. Otherwise, the runtime status verification module performs the verification operation, stores the generated verification operation result in the verification result register of the FPGA, and controls the external payload to process the read / write request initiated by the embedded system based on the generated verification operation result. The active protection module monitors in real time whether the verification result register of the FPGA contains the verification operation result. If the verification operation result is successful, the active protection module does not perform any operation; if the verification operation result is unsuccessful, the active protection module performs the protection operation.

[0010] Furthermore, the operation status verification module controls the embedded system to process read and write requests initiated to the external payload based on the stored verification operation results. Specifically, when the stored verification operation result is that the verification passed, the operation status verification module sends an allow call signal to the external payload. After receiving the allow call signal, the external payload responds normally to the read and write requests of the embedded system. When the stored verification operation result is that the verification failed, the operation status verification module sends a reject call signal to the external payload. After receiving the reject call signal, the external payload rejects the read and write requests of the embedded system. The operation status verification module controls the embedded system to process the read and write requests of the external payload based on the generated verification operation result. Specifically, when the generated verification operation result is that the verification is passed, the operation status verification module sends an allow call signal to the external payload. After receiving the allow call signal, the external payload responds normally to the read and write requests of the embedded system. When the generated verification operation result is that the verification is failed, the operation status verification module sends a reject call signal to the external payload. After receiving the reject call signal, the external payload rejects the read and write requests of the embedded system.

[0011] Furthermore, the runtime verification module performs the verification operation as follows: the runtime verification module reads a portion of data from the header of the first boot partition of the embedded system, defining it as first header data; it reads a portion of data from the header of the second boot partition of the embedded system, defining it as second header data; it reads the runtime verification mark of the embedded system from the tail of the first boot partition of the embedded system, defining the read verification mark as a runtime verification mark; then, the runtime verification module concatenates the first header data, the second header data, and the runtime verification mark to form consistency verification data, and calculates the MD5 digest of the consistency verification data to obtain the runtime verification value; finally, the runtime verification module compares the runtime verification value with a preset verification reference value. If the runtime verification value matches the preset verification reference value, the verification operation result generated by the runtime verification module is verification passed; otherwise, the verification operation result generated by the runtime verification module is verification failed.

[0012] Furthermore, the running status verification module reads data from the head of the first boot partition, the head of the second boot partition, and the tail of the first boot partition of the embedded system through the DMA engine configured by the PCIe interface inside the FPGA.

[0013] Furthermore, the active protection module performs the protection operation as follows: the active protection module repeatedly sends verification signals to the operation status verification module; the operation status verification module performs a verification operation once for each verification signal received, and stores the newly generated verification operation result in the FPGA's verification result register, while overwriting the original verification operation result stored in the verification result register; the active protection module stops sending verification signals when it detects that the verification operation result in the verification result register is a successful verification, or when the number of times the verification signal is sent reaches a preset sending threshold. When the number of times the active protection module sends the verification signal reaches the preset sending threshold and the verification result in the verification result register is still a verification failure, the active protection module shuts down the embedded system by disconnecting the board-level power supply. The active protection module has a waiting interval between two consecutive transmissions of verification signals, and the duration of the waiting interval increases exponentially with the number of transmissions.

[0014] The advantages of this invention compared to the prior art are: (1) This invention reads the data of the boot partition and calculates the runtime verification value during the runtime of the embedded system. Based on the runtime verification value, it judges whether there is illegal writing in the embedded system, realizes the detection of abnormal situations during the runtime of the embedded system, and improves the security and reliability of the embedded system during runtime.

[0015] (2) When the present invention detects that an illegal write has occurred in the embedded system, it will perform multiple repeated checks to ensure the accuracy of the check results. At the same time, after multiple repeated checks, if the check result is still that the embedded system has an illegal write, the present invention will control the embedded system to automatically shut down to prevent the embedded system from being damaged.

[0016] (3) The monitoring system proposed in this invention stores the test results of whether the embedded system has been illegally written into the FPGA register. When the embedded system sends a read / write request to the external load, it directly reads the test results from the FPGA register and processes the read / write request based on the test results, which speeds up the processing speed of the embedded system to handle the external load and improves the real-time response of the embedded system. Attached Figure Description

[0017] Figure 1 This is a flowchart of an active monitoring method for illegal firmware flashing in embedded systems according to the present invention. Figure 2 This is a schematic diagram of the active monitoring system for illegal firmware flashing in an embedded system according to the present invention. Figure 3 This is a hardware architecture diagram of an active monitoring system for illegal firmware flashing in embedded systems according to the present invention. Figure 4 This is a schematic diagram illustrating the signature data generation process and configuration of an active monitoring system for illegal firmware flashing in embedded systems according to the present invention. Figure 5 This is a schematic diagram illustrating the process of generating runtime verification values ​​for an active monitoring system for illegal firmware flashing in embedded systems, as described in this invention. Detailed Implementation

[0018] The specific embodiments of the present invention will now be described in further detail with reference to the accompanying drawings.

[0019] like Figure 1 As shown, this invention provides a method for actively detecting illegal firmware flashing in embedded systems, with the following steps: (1) Calculate the hash digests of the first boot partition and the second boot partition of the embedded system respectively, and concatenate the hash digests of the first boot partition, the hash digests of the second boot partition and the SHA-256 hash digests of the embedded system accessory identifier to obtain the aggregate digest; execute step (2). (2) Sign the aggregate digest using the Ed25519 private key to obtain the signed data; then execute step (3). (3) Use the signature data to form a verification mark and write the verification mark at the end of the first boot partition of the embedded system; execute step (4). (4) Run the embedded system and wait for the embedded system to initiate a read / write request to the external load; if the embedded system is detected to have initiated a read / write request to the external load, then execute step (5); otherwise, continue to wait for the embedded system to initiate a read / write request to the external load. (5) Read some data from the head of the first boot partition of the embedded system and define it as the first header data; read some data from the head of the second boot partition of the embedded system and define it as the second header data; read the runtime verification flag of the embedded system from the tail of the first boot partition of the embedded system and define the read verification flag as the runtime verification flag; execute step (6). (6) Concatenate the first header data, the second header data, and the running verification flag to form consistency verification data; execute step (7); (7) Calculate the MD5 digest of the consistency check data to obtain the runtime check value; execute step (8); (8) Compare the running state verification value with the preset verification reference value. If the running state verification value is consistent with the preset verification reference value, the embedded system has not experienced an illegal firmware flashing situation, the external load responds normally to the read and write requests of the embedded system, and the entire method flow ends; otherwise, execute step (9). (9) Repeat steps (5) to (8) until the running state verification value is consistent with the preset verification reference value or the preset number of retries is reached; if the running state verification value is still inconsistent with the preset verification reference value when the preset number of retries is reached, then shut down the embedded system.

[0020] Furthermore, in step (1), the hash digest of the first boot partition of the embedded system is calculated as follows: the last 512 bytes of data of the first boot partition of the embedded system are removed, and the remaining data in the first boot partition is used to calculate the hash digest of the first boot partition.

[0021] Furthermore, in step (1), the accessory identifier refers to the unique identifier of each external load belonging to the system.

[0022] Furthermore, in step (2), the signature data byte length is 64 bytes; in step (3), the verification mark byte length is 512 bytes, of which the first 448 bytes of the verification mark data is random data generated by the hardware true random number generator, and the last 64 bytes of the data is the signature data.

[0023] Furthermore, in step (5), the first header data is 256 bytes of data in the header of the first boot partition of the embedded system, and the second header data is 256 bytes of data in the header of the second boot partition of the embedded system.

[0024] Furthermore, in step (9), there is a waiting interval between two adjacent executions of steps (5) to (8), and the duration of the waiting interval increases exponentially with the number of retries.

[0025] Secondly, such as Figure 2 As shown, this invention also proposes an active monitoring system for illegal firmware flashing in embedded systems. The active monitoring system is used to monitor illegal firmware flashing in embedded systems. The embedded system supports multiple external payloads. The active monitoring system is deployed on an FPGA. The active monitoring system includes a tag generation module, a running status verification module, and an active protection module. The tag generation module calculates the hash digests of the first and second boot partitions of the embedded system, respectively. It then concatenates the hash digests of the first and second boot partitions with the SHA-256 hash digest of the embedded system's accessory identifier to obtain an aggregate digest. The tag generation module signs the aggregate digest using the Ed25519 private key to obtain signature data, and uses this signature data to form a verification tag, which is then written to the end of the first boot partition of the embedded system. A schematic diagram of the signature data generation is shown below. Figure 4 As shown; The runtime status verification module monitors in real time whether the embedded system has initiated read / write requests to the external payload. When it detects that the embedded system has initiated read / write requests to the external payload, the runtime status verification module first checks whether the verification result register of the FPGA contains the verification operation result. The verification operation result includes verification pass and verification failure. If the verification result register of the FPGA contains the verification operation result, the runtime status verification module controls the external payload to process the read / write request initiated by the embedded system based on the stored verification operation result. Otherwise, the runtime status verification module performs the verification operation, stores the generated verification operation result in the verification result register of the FPGA, and controls the external payload to process the read / write request initiated by the embedded system based on the generated verification operation result. The active protection module monitors in real time whether the verification result register of the FPGA contains the verification operation result. If the verification operation result is successful, the active protection module does not perform any operation; if the verification operation result is unsuccessful, the active protection module performs the protection operation.

[0026] The monitoring system proposed in this invention stores the verification results of whether the embedded system has been illegally written to the FPGA register. When the external load sends a read / write request to the embedded system, the verification result is read directly from the FPGA register, and the read / write request is processed directly based on the verification result. This speeds up the embedded system's processing of external loads and improves the real-time response of the embedded system.

[0027] Furthermore, the embedded system includes a main control unit, a hardware computing and acceleration unit, and a storage unit. The main control unit uses an RK3588 SoC, integrating four Cortex-A76 cores at 2.4GHz and four Cortex-A55 cores at 1.8GHz, running the PREEMPT_RT real-time Linux kernel, responsible for image layout management, verification scheduling, and unified failure semantic execution. The hardware computing and acceleration unit is a Xilinx Kintex-7 XC7K325T FPGA coprocessor, coupled to the main control unit through an AXI-Lite 32-bit interface. The storage unit uses industrial-grade eMMC 5.1 block devices with a capacity of 8-32GB, and the partition layout remains unchanged from the existing standard. The external payloads include aerospace-specific equipment such as an IMU inertial measurement unit and servo actuators, each payload carrying a 128-byte unique identifier. The overall relationship between the main control unit, the active monitoring system, and the external payloads is as follows: Figure 3 As shown.

[0028] Furthermore, the operation status verification module controls the embedded system to process read and write requests initiated to the external payload based on the stored verification operation results. Specifically, when the stored verification operation result is that the verification passed, the operation status verification module sends an allow call signal to the external payload. After receiving the allow call signal, the external payload responds normally to the read and write requests of the embedded system. When the stored verification operation result is that the verification failed, the operation status verification module sends a reject call signal to the external payload. After receiving the reject call signal, the external payload rejects the read and write requests of the embedded system. The operation status verification module controls the embedded system to process the read and write requests of the external payload based on the generated verification operation result. Specifically, when the generated verification operation result is that the verification is passed, the operation status verification module sends an allow call signal to the external payload. After receiving the allow call signal, the external payload responds normally to the read and write requests of the embedded system. When the generated verification operation result is that the verification is failed, the operation status verification module sends a reject call signal to the external payload. After receiving the reject call signal, the external payload rejects the read and write requests of the embedded system.

[0029] Furthermore, the runtime verification module performs the verification operation as follows: The runtime verification module reads partial data from the header of the first boot partition of the embedded system, defining it as first header data; reads partial data from the header of the second boot partition of the embedded system, defining it as second header data; reads the runtime verification flag of the embedded system from the tail of the first boot partition of the embedded system, defining the read verification flag as the runtime verification flag; then, the runtime verification module concatenates the first header data, the second header data, and the runtime verification flag to form consistency verification data, and calculates the MD5 digest of the consistency verification data to obtain the runtime verification value; a schematic diagram of generating the runtime verification value is shown below. Figure 5 As shown; finally, the running status verification module compares the running status verification value with the preset verification reference value. If the running status verification value is consistent with the preset verification reference value, the verification operation result generated by the running status verification module is verification passed; otherwise, the verification operation result generated by the running status verification module is verification failed.

[0030] Furthermore, the runtime verification value is programmed into the FPGA's 256-bit read-only verification register via the JTAG interface for storage. When the runtime verification value matches the preset verification reference value, the runtime verification module stores the register value 0xAAAAAAAA in the FPGA's verification result register, indicating that the verification result is successful. Otherwise, the runtime verification module stores the register value 0xFFFFFFFF in the FPGA's verification result register, indicating that the verification result is unsuccessful. Any missing values, reading errors, or inconsistent digests encountered during the comparison between the runtime verification value and the preset verification reference value will be judged as verification failure.

[0031] Furthermore, the running status verification module reads data from the head of the first boot partition, the head of the second boot partition, and the tail of the first boot partition of the embedded system through the DMA engine configured by the PCIe interface inside the FPGA.

[0032] Furthermore, the active protection module performs the protection operation as follows: the active protection module repeatedly sends verification signals to the operation status verification module; the operation status verification module performs a verification operation once for each verification signal received, and stores the newly generated verification operation result in the FPGA's verification result register, while overwriting the original verification operation result stored in the verification result register; the active protection module stops sending verification signals when it detects that the verification operation result in the verification result register is a successful verification, or when the number of times the verification signal is sent reaches a preset sending threshold. When the number of times the active protection module sends verification signals reaches the preset sending threshold and the verification result in the verification result register is still a verification failure, the active protection module shuts down the embedded system by disconnecting the board-level power supply. When the present invention detects an illegal write situation in the embedded system, it will perform multiple repeated verifications to ensure the accuracy of the verification results. At the same time, after multiple repeated verifications, if the verification result is still that the embedded system has an illegal write situation, the present invention will control the embedded system to automatically shut down to prevent the embedded system from being damaged.

[0033] The active protection module on the FPGA sends a shutdown signal to the embedded system via a dedicated GPIO pin to control the shutdown of the onboard power supply, thereby achieving hardware-level safety isolation.

[0034] The active protection module has a waiting interval between two consecutive transmissions of verification signals. The duration of the waiting interval increases exponentially with the number of transmissions. The initial waiting interval is 1ms, and the preset transmission threshold is 3 times.

[0035] Based on the above method and system introduction, this invention reads the data of the boot partition and calculates the runtime verification value during embedded system runtime, and judges whether there is illegal writing in the embedded system based on the runtime verification value, thereby realizing the detection of abnormal situations during embedded system runtime and improving the security and reliability of embedded system runtime.

[0036] The parts of this invention not described in detail are common knowledge to those skilled in the art.

Claims

1. A method for actively detecting illegal firmware flashing in embedded systems, characterized in that, The steps are as follows: (1) Calculate the hash digests of the first boot partition and the second boot partition of the embedded system respectively, and concatenate the hash digests of the first boot partition, the hash digests of the second boot partition and the SHA-256 hash digests of the embedded system accessory identifier to obtain the aggregate digest; execute step (2). (2) Sign the aggregate digest using the Ed25519 private key to obtain the signature data; then execute step (3). (3) Use the signature data to form a verification mark and write the verification mark at the end of the first boot partition of the embedded system; execute step (4). (4) Run the embedded system and wait for the embedded system to initiate a read / write request to the external load; if the embedded system is detected to have initiated a read / write request to the external load, then execute step (5); otherwise, continue to wait for the embedded system to initiate a read / write request to the external load. (5) Read a portion of the data from the header of the first boot partition of the embedded system and define it as the first header data; read a portion of the data from the header of the second boot partition of the embedded system and define it as the second header data; Read the runtime verification flag of the embedded system from the tail of the first boot partition of the embedded system, and define the read verification flag as the runtime verification flag; execute step (6). (6) Concatenate the first header data, the second header data, and the running verification flag to form consistency verification data; execute step (7); (7) Calculate the MD5 digest of the consistency check data to obtain the runtime check value; execute step (8); (8) Compare the running state verification value with the preset verification reference value. If the running state verification value is consistent with the preset verification reference value, the embedded system has not experienced an illegal firmware flashing situation, the external load responds normally to the read and write requests of the embedded system, and the entire method flow ends. Otherwise, proceed to step (9); (9) Repeat steps (5) to (8) until the running state verification value is consistent with the preset verification reference value or the preset number of retries is reached; if the running state verification value is still inconsistent with the preset verification reference value when the preset number of retries is reached, then shut down the embedded system.

2. The active monitoring method for illegal firmware flashing in an embedded system according to claim 1, characterized in that: The specific steps for calculating the hash digest of the first boot partition of the embedded system in step (1) are as follows: remove the last 512 bytes of data from the first boot partition of the embedded system, and use the remaining data in the first boot partition to calculate the hash digest of the first boot partition.

3. The active monitoring method for illegal firmware flashing in an embedded system according to claim 1, characterized in that: In step (2), the signature data is 64 bytes long; in step (3), the verification mark is 512 bytes long, where the first 448 bytes of the verification mark are random data generated by the hardware true random number generator, and the last 64 bytes are the signature data.

4. The active monitoring method for illegal firmware flashing in an embedded system according to claim 1, characterized in that: In step (5), the first header data is 256 bytes of data in the header of the first boot partition of the embedded system, and the second header data is 256 bytes of data in the header of the second boot partition of the embedded system.

5. The active monitoring method for illegal firmware flashing in an embedded system according to claim 1, characterized in that: In step (9), there is a waiting interval between two consecutive executions of steps (5) to (8), and the duration of the waiting interval increases exponentially with the number of retries.

6. A firmware illegal flashing active detection system for embedded systems, characterized in that: The active monitoring system is used to monitor for illegal firmware flashing in the embedded system; the embedded system supports multiple external payloads. The active monitoring system is deployed on an FPGA; the active monitoring system includes a tag generation module, a running status verification module, and an active protection module. The tag generation module calculates the hash digests of the first boot partition and the second boot partition of the embedded system, respectively. It then concatenates the hash digests of the first boot partition, the second boot partition, and the SHA-256 hash digest of the embedded system's accessory identifier to obtain an aggregate digest. The tag generation module signs the aggregate digest using the Ed25519 private key to obtain signature data, and uses the signature data to form a verification tag, which is then written to the end of the first boot partition of the embedded system. The runtime status verification module monitors in real time whether the embedded system has initiated read / write requests to the external load. When it detects that the embedded system has initiated read / write requests to the external load, the runtime status verification module first checks whether the verification result register of the FPGA stores the verification operation result; the verification operation result includes verification pass and verification failure. If the FPGA's verification result register contains the verification operation result, the running status verification module controls the external load to process the read / write request initiated by the embedded system based on the stored verification operation result; otherwise, the running status verification module performs the verification operation, stores the generated verification operation result in the FPGA's verification result register, and controls the external load to process the read / write request initiated by the embedded system based on the generated verification operation result. The active protection module monitors in real time whether the verification result register of the FPGA contains the verification operation result. If the verification operation result is successful, the active protection module does not perform any operation; if the verification operation result is unsuccessful, the active protection module performs the protection operation.

7. The active monitoring system for illegal firmware flashing in an embedded system according to claim 6, characterized in that: The runtime status verification module controls the embedded system to process read and write requests initiated to the external payload based on the stored verification operation results. Specifically, when the stored verification operation result is that the verification passed, the runtime status verification module sends an allow call signal to the external payload. After receiving the allow call signal, the external payload responds normally to the read and write requests of the embedded system. When the stored verification operation result is that the verification failed, the runtime status verification module sends a reject call signal to the external payload. After receiving the reject call signal, the external payload rejects the read and write requests of the embedded system. The operation status verification module controls the embedded system to process the read and write requests of the external payload based on the generated verification operation result. Specifically, when the generated verification operation result is that the verification is passed, the operation status verification module sends an allow call signal to the external payload. After receiving the allow call signal, the external payload responds normally to the read and write requests of the embedded system. When the generated verification operation result is that the verification is failed, the operation status verification module sends a reject call signal to the external payload. After receiving the reject call signal, the external payload rejects the read and write requests of the embedded system.

8. The active monitoring system for illegal firmware flashing in an embedded system according to claim 6, characterized in that: The operation of the running status verification module is as follows: the running status verification module reads a portion of the data from the header of the first boot partition of the embedded system and defines it as the first header data; the running status verification module reads a portion of the data from the header of the second boot partition of the embedded system and defines it as the second header data; Read the runtime verification flags of the embedded system from the tail of the first boot partition of the embedded system, and define the read verification flags as runtime verification flags; Next, the runtime status verification module concatenates the first header data, the second header data, and the runtime verification flag to form consistency verification data, and calculates the MD5 digest of the consistency verification data to obtain the runtime verification value. Finally, the runtime status verification module compares the runtime verification value with the preset verification reference value. If the runtime verification value matches the preset verification reference value, the verification operation result generated by the runtime status verification module is verification passed; otherwise, the verification operation result generated by the runtime status verification module is verification failed.

9. The active monitoring system for illegal firmware flashing in an embedded system according to claim 8, characterized in that: The running status verification module reads data from the head of the first boot partition, the head of the second boot partition, and the tail of the first boot partition of the embedded system through the DMA engine configured by the PCIe interface inside the FPGA.

10. The active monitoring system for illegal firmware flashing in an embedded system according to claim 6, characterized in that: The active protection module performs the protection operation as follows: the active protection module repeatedly sends verification signals to the operation status verification module; the operation status verification module performs a verification operation once for each verification signal received, and stores the newly generated verification operation result in the FPGA's verification result register, while overwriting the original verification operation result stored in the verification result register. The active protection module stops sending verification signals when it detects that the verification operation result in the verification result register is a successful verification, or when the number of times the verification signal is sent reaches the preset sending threshold. When the number of times the active protection module sends the verification signal reaches the preset sending threshold and the verification result in the verification result register is still a verification failure, the active protection module shuts down the embedded system by disconnecting the board-level power supply. The active protection module has a waiting interval between two consecutive transmissions of verification signals, and the duration of the waiting interval increases exponentially with the number of transmissions.