A file protection method and system based on external power failure monitoring
By combining a hysteresis voltage comparator with vibration signals in rail transit vehicles, the file protection process is dynamically tailored, solving the problems of file damage and data loss caused by sudden power outages of the external power supply, and improving the reliability and stability of the equipment.
Patent Information
- Application Number
- CN202510955267.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-11
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-07-11
AI Technical Summary
When the external power supply of a rail transit vehicle suddenly fails, the onboard electronic equipment cannot complete a safe shutdown, resulting in loss or damage of operating system file data, affecting equipment operation and storage data integrity. Traditional fixed threshold voltage comparators cannot effectively cope with power supply interruptions caused by power supply voltage fluctuations and vibrations.
A hysteresis voltage comparator is used for dynamic threshold judgment, combined with vibration signals for joint decision-making. The energy storage control module is used to power the operating storage control module when the external power supply fails, ensuring the preservation of critical data and the safe shutdown of the operating system.
It achieves reliable file protection in the event of external power failure, prevents file system damage and storage data integrity, improves the reliability and stability of vehicle equipment circuits, and avoids misjudgment and noise interference.
Smart Images

Figure CN120469560B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of rail transportation technology, and in particular to a file protection method and system based on external power failure monitoring. Background Art
[0002] In the field of rail transit, on-board electronic equipment usually relies on the vehicle's power supply for operation. There are two situations in which on-board electronic equipment loses power: one situation is that there are a large number of electronic equipment in the vehicle and the installation locations are scattered. Usually, each device is not turned on and off separately, but all electronic equipment is turned on and off through a unified power switch; the other situation is that the vehicle suddenly loses power under certain circumstances, causing all on-board electronic equipment to suddenly shut down.
[0003] As rail transit systems become increasingly intelligent, electronic devices in vehicles are now commonly equipped with operating systems such as Windows, Linux, and QNX. If the external power supply is suddenly disconnected, the device may not have sufficient time to complete a safe shutdown, resulting in loss or corruption of operating system files and data. Operating system file data corruption has two impacts: 1. It can affect the normal operation of various vehicle devices and may even render them unrecoverable, increasing maintenance costs and impacting system stability; 2. It can compromise the integrity of data stored in electronic devices, causing loss or incompleteness of valid data.
[0004] Traditional solutions typically use a fixed-threshold voltage comparator to determine whether the external power supply voltage is below a preset power-off protection threshold. However, the complex electrical environment of a vehicle is subject to numerous transient voltage fluctuations, noise, and interference (such as engine startup surges, load switching glitches, and EMI). These interferences often cause frequent fluctuations in the external power supply voltage. Furthermore, due to the unique characteristics of the rail transit sector, trains generate continuous low-frequency vibrations during operation. Vibration-induced conditions such as capacitor pin breakage, PCB solder joint fatigue cracking, and poor connector contact can easily lead to power outages. Furthermore, high-vibration environments significantly accelerate power consumption.
[0005] Therefore, in environments with vibration and power supply voltage fluctuations, the reliability of onboard equipment circuits is low. Preventing file system corruption and maintaining the integrity of stored data in the event of an external power outage has become a key technical challenge in the design of onboard electronic equipment for rail transit. Summary of the Invention
[0006] The purpose of this application is to provide a file protection method and system based on external power failure monitoring to solve the problems described in the background technology section of this application.
[0007] To achieve the above objectives, this application provides the following technical solutions:
[0008] A first aspect of the present application provides a file protection method based on external power failure monitoring, comprising:
[0009] The external power failure monitoring module collects the voltage of the external power supply in real time and outputs the status signal of the external power supply to the energy storage control module and the operation storage control module respectively according to the collected voltage. The external power failure monitoring module includes a hysteresis voltage comparator. The hysteresis voltage comparator performs dynamic threshold judgment on the voltage of the external power supply by setting a hysteresis voltage window. The external power failure monitoring module outputs the status signal according to the judgment result of the hysteresis voltage comparator. When the status signal is a power failure signal:
[0010] The energy storage control module controls the energy storage capacitor through a discharge circuit to supply power to the operation storage control module. The operation storage control module receives a vibration signal of the vehicle sent by a vibration sensor in real time, and determines a file protection operation to be performed based on the vibration signal, wherein the file protection operation includes one or more of exiting an application, saving critical data, and shutting down an operating system.
[0011] Furthermore, the hysteresis voltage comparator is used to judge the voltage of the external power supply, and further includes:
[0012] Determine the upper threshold and the lower threshold of the hysteresis voltage comparator, and judge the voltage value of the external power supply collected in real time by the external power failure monitoring module according to the upper threshold and the lower threshold:
[0013] If the voltage value is less than or equal to the lower threshold value, it is determined that the external power supply is in a power-off state, and the hysteresis voltage comparator outputs a low level; if the voltage value is greater than or equal to the upper threshold value, it is determined that the external power supply is in a power-on state, and the hysteresis voltage comparator outputs a high level; if the voltage value is greater than the lower threshold value and less than the upper threshold value, it is determined that the external power supply is in a previous state, and the level output value of the hysteresis voltage comparator remains unchanged.
[0014] Furthermore, the method for determining the lower threshold of the hysteresis voltage comparator includes:
[0015]
[0016] in, is the lower threshold voltage of the hysteresis voltage comparator, It is the minimum voltage under normal system operation. is the safety factor, Take 1.5~2.0, is the maximum noise amplitude of the power grid.
[0017] Furthermore, the upper threshold of the hysteresis voltage comparator is determined, and the method includes:
[0018]
[0019] in, is the upper threshold voltage of the hysteresis voltage comparator, is the lower threshold voltage of the hysteresis voltage comparator; is the hysteresis voltage window, , is the peak-to-peak value of the power grid noise, which is 0.5V; is less than the rated voltage of the external power supply.
[0020] Furthermore, the energy storage control module controls the energy storage capacitor to discharge the operation storage control module through a discharge circuit, and further includes:
[0021] When the status signal received by the energy storage control module is a power-on signal, the charging circuit is controlled to charge the energy storage capacitor and the discharge circuit is controlled to be closed, wherein the charging circuit charges the energy storage capacitor by connecting to a power supply module, and the power supply module supplies power to the operation storage control module;
[0022] When the status signal received by the energy storage control module is a power-off signal, the discharge circuit is controlled to supply power to the operation storage control module through the energy storage capacitor, and the charging circuit is turned off.
[0023] Furthermore, the file protection operation to be performed according to the vibration signal includes:
[0024] When the vibration signal is a low-frequency vibration, the operation storage control module executes a file protection process of exiting the application, saving key data, and shutting down the operating system;
[0025] When the vibration signal is a medium frequency vibration, the operation storage control module executes a file protection process of saving key data and shutting down the operating system;
[0026] When the vibration signal is a high-frequency vibration, the operation storage control module executes a file protection process for saving critical data, wherein the critical data is file system metadata, and the vibration thresholds of the low-frequency vibration, the medium-frequency vibration, and the high-frequency vibration are set respectively according to the actual operating environment of the vehicle.
[0027] Furthermore, the running storage control module includes a decision unit, and the running storage control module performs a file protection operation for saving critical data, including:
[0028] The decision unit receives the power-off signal, the current voltage value of the energy storage capacitor, the vibration signal, the system load status, the data file type, and the storage medium status data sent by the external power supply power-off monitoring module, and outputs the storage priority and storage medium of each type of key data according to the received data;
[0029] The operation storage control module stores each key data according to the storage priority output by the decision unit, and stores each key data in the corresponding storage medium in sequence.
[0030] Furthermore, the storage priority is set based on a predefined priority grading rule, and the priority grading rule includes multiple levels of storage priority, and each level of storage priority corresponds to a different data type and storage medium, and the data type includes security control instructions, file system metadata, event logs, application data and cache data.
[0031] Furthermore, the decision unit outputs the storage priority and storage medium of each type of key data according to the received data, including the following steps:
[0032] Obtaining a predicted value of the remaining power supply time of the energy storage capacitor according to the current voltage value of the energy storage capacitor and the system load state;
[0033] analyzing the vibration intensity and the main frequency according to the vibration signal, evaluating the state of the storage medium based on the vibration intensity and the main frequency, and marking the state of the storage medium as an unstable state if the vibration intensity exceeds a preset threshold or the main frequency is within a resonant frequency range of the storage medium, wherein the state of the storage medium includes an unstable state and a stable state;
[0034] The predefined storage priority of each key data is adjusted based on the predicted value of the remaining power supply time and the vibration intensity, and the predefined storage medium of each key data is adjusted based on the state of the storage medium. The decision unit outputs the adjusted storage priority of each type of key data and the corresponding storage medium, and stores them separately.
[0035] A second aspect of the present application provides a file protection system based on external power failure monitoring. The method described in the first aspect of the present application is implemented based on the system described in the second aspect of the present application. The system is a multi-layer integrated structure, including:
[0036] The bottom layer includes a vibration monitoring module and an external power failure monitoring module, wherein the vibration monitoring module is connected to a vehicle outside the system, the external power failure monitoring module is connected to an external power supply of the system, and the external power failure monitoring module includes a hysteresis voltage comparator;
[0037] The middle layer includes an operation storage control module, and the operation storage control module is respectively communicated with the vibration monitoring module and the external power failure monitoring module;
[0038] The top layer includes a power supply module and an energy storage control module. The power supply module converts the external power supply of the system into the internal power supply of the system, thereby supplying power to the energy storage control module, the operation storage module, the external power supply power-off monitoring module, and the vibration monitoring module; the energy storage control module includes a charging circuit, a discharging circuit, and an energy storage capacitor. The energy storage control module is respectively communicated with the external power supply monitoring module and the operation storage control module.
[0039] The present application provides the above-mentioned file protection method based on external power failure monitoring, which can at least achieve the following technical effects:
[0040] This application sets a hysteresis voltage comparator in the external power supply power-off monitoring module to judge the voltage of the vehicle's external power supply, and makes dynamic decisions on the voltage of the external power supply through the hysteresis window, thereby solving the problems of misjudgment of the power supply power-off status and noise interference in the vehicle's power grid fluctuation environment, and realizing reliable power-off monitoring of the external power supply; on the basis of reliable power-off monitoring of the external power supply, the vehicle vibration signal is introduced for joint decision-making, and the file protection process of the file protection system is dynamically tailored, thereby realizing integrity protection of the file system and vehicle storage data in the event of a vehicle power outage. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the specific implementation methods or the description of the prior art. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0042] Figure 1 A schematic diagram of the file protection system architecture based on external power failure monitoring provided in an embodiment of the present application;
[0043] Figure 2 A schematic diagram of a decision flow of a hysteresis voltage comparator provided in an embodiment of the present application;
[0044] Figure 3 A schematic diagram of a joint decision-making process for operating a storage control module according to an embodiment of the present application;
[0045] Figure 4 A schematic diagram of a computer device provided in an embodiment of the present application;
[0046] Reference numerals: 401 , memory; 402 , processor. DETAILED DESCRIPTION
[0047] The following will clearly and completely describe the technical solutions of this application in conjunction with the embodiments. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0048] The embodiment of the present application provides a file protection method based on external power failure monitoring, dynamically determines the voltage of the external power supply through a hysteresis window, realizes reliable power failure monitoring of the external power supply, introduces vehicle vibration signals for joint decision-making, dynamically tailors the file protection process of the file protection system, and improves the reliability of the vehicle's on-board equipment circuit. The file protection method based on external power failure monitoring provided in this embodiment is based on a file protection system based on external power failure monitoring. Figure 1 The figure shows a schematic diagram of a file protection system architecture based on external power failure monitoring. The file protection system is a multi-layer integrated structure, including:
[0049] The bottom layer includes a vibration monitoring module and an external power supply power-off monitoring module. The vibration monitoring module is connected to a vehicle outside the system, and the external power supply power-off monitoring module is connected to the system's external power supply. The external power supply power-off monitoring module includes a hysteresis voltage comparator. The middle layer includes an operation and storage control module. The operation and storage control module are respectively communicated with the vibration monitoring module and the external power supply power-off monitoring module. The top layer includes a power supply module and an energy storage control module. The power supply module converts the system's external power supply into the system's internal power supply, thereby supplying power to the energy storage control module, the operation and storage module, the external power supply power-off monitoring module, and the vibration monitoring module. The energy storage control module includes a charging circuit, a discharging circuit, and an energy storage capacitor. The energy storage control module is respectively communicated with the external power supply monitoring module and the operation and storage control module.
[0050] Specifically, the file protection system based on external power failure monitoring provided in this embodiment integrates a power module, an energy storage control module, an operating storage module, an external power failure monitoring module, and a vibration monitoring module into the same embedded vehicle-mounted device. For an integrated structure, the layered layout architecture can improve space utilization and signal integrity, optimize signal flow, shorten the signal transmission path, and reduce signal transmission delay. The traditional hybrid layout has risks such as electromagnetic interference and uneven heat dissipation. The file protection system provided in this embodiment converts the external power supply into the system's internal power supply through the power module to power the internal modules, thereby avoiding dependence on external UPS devices and improving the system's compactness and reliability. UPS (Uninterruptible Power Supply) is an uninterruptible power supply that uses a built-in battery or supercapacitor to provide temporary power when the external power supply is interrupted.
[0051] Furthermore, the file protection system described in this embodiment utilizes a multi-layer PCB design and connects to the TCMS (Train Control and Management System) via an MVB (Multi-Function Vehicle Bus) or Ethernet interface. MVB is a commonly used communication bus in rail transit, connecting various devices on a train, such as the train control system and braking system. The file protection system provided in this embodiment connects to the TCMS network via the MVB interface, enabling data exchange with devices such as the train control system and braking system. It also receives commands issued by the TCMS (such as encryption policy updates) and provides feedback on execution status.
[0052] Furthermore, the power module and the energy storage control module are connected via a bidirectional DC-DC circuit, with bidirectional isolation circuitry enabling charge-discharge switching to avoid circuit redundancy. The power module's internal structure includes an EMC protection circuit, a power isolation module, and filter capacitors, which are used to convert external power into the power required by the file protection system. The power module provides isolation, completely isolating the external power supply from the system's internal power supply to protect the internal system. The power module also provides electromagnetic compatibility protection, protecting the internal system from external electromagnetic interference.
[0053] Furthermore, the charging circuit of the energy storage control module is connected to the power module. The charging circuit is used to charge the energy storage capacitor; the discharge circuit is used to control the energy storage capacitor to supply power to the operation storage control module. The energy storage control module is also used to connect to the external power failure monitoring module, and the signal of the external power failure monitoring module is triggered to achieve dynamic switching:
[0054] Charging stage: When the external power supply is powered on, the energy storage control module controls the charging circuit to charge the energy storage capacitor and actively closes the discharge circuit to avoid energy waste;
[0055] Discharge phase: When the external power supply is disconnected, the energy storage control module immediately switches to discharge mode, controlling the discharge circuit to provide temporary power to the operating storage control module while simultaneously shutting down the charging circuit to prevent reverse current. Compared to the passive power supply of traditional UPS, this application optimizes energy storage efficiency and system response speed through signal-driven active control logic, making it particularly suitable for the complex scenarios of frequent starts and stops in rail transit.
[0056] Furthermore, the external power monitoring module is connected to an external input power source and includes an external power on / off monitoring circuit, a hysteresis voltage comparator, and an output circuit. The external power off monitoring module is used to collect the voltage signal of the external input power source and dynamically determine the voltage value of the external power source through the hysteresis voltage comparator: if the external power source is determined to be in a power-off state, the module outputs a low level and sends a power-off signal and an enable signal to the energy storage control module and the operation storage control module respectively; if the external power source is determined to be in a power-on state, the module outputs a high level and sends a power-on signal and an enable signal to the energy storage control module and the operation storage control module respectively.
[0057] Furthermore, the hysteresis voltage comparator is used to judge the voltage of the external power supply and determine the upper threshold value by design constraints. , lower threshold and hysteresis voltage window , hysteresis voltage window It is used for noise immunity and realizes reliable judgment of continuous and stable changes in power supply voltage, so that it can work stably when the external power supply voltage fluctuates within the range specified by the hysteresis voltage window, avoiding frequent misjudgment of power failure. Figure 2 As shown, the judgment logic of the hysteresis voltage comparator is as follows:
[0058] When the external power supply voltage is high (higher than the upper threshold ) changes to low: Determine whether the external power supply voltage value is: If yes, keep the power on state unchanged; if the external power supply voltage value is: , then the external power supply is determined to be in power-off state, and the hysteresis voltage comparator outputs a low level;
[0059] When the external power supply voltage drops below the lower threshold ) changes to high: Determine whether the external power supply voltage value is: If yes, the power-off state remains unchanged; if the external power supply voltage value is: , it is determined that the external power supply is in the power-on state, and the hysteresis voltage comparator outputs a high level.
[0060] The hysteresis characteristic of the hysteresis voltage comparator is realized by positive feedback to ensure When the external power state is locked in the previous state, the judgment disturbance caused by noise is avoided, thereby preventing the file protection system from restarting due to misjudgment, and improving the reliability and stability of the file protection system.
[0061] Furthermore, the vibration monitoring module includes a vibration sensor installed outside the system, either on the vehicle device housing or in a stress concentration area on the PCB. The vibration sensor is used to collect vehicle vibration signals and transmit them to the main control MCU running the storage control module for dynamic tailoring of the file protection process.
[0062] Furthermore, the operation and storage control module includes a main control MCU, storage media, and peripheral circuits. The main control MCU integrates a decision-making unit, an AI-based decision-making unit, which provides the core component of the file protection system in this embodiment and is responsible for executing instructions, managing resources, coordinating tasks, controlling data flow, and storing data. The operation and storage control module is connected to the power module, energy storage control module, vibration monitoring module, and external power failure monitoring module. When the main control MCU receives an external power on signal from the external power failure monitoring module, the power module converts the external input power into the power required for the operation and storage control system, ensuring normal operation of the operation and storage control system. When the main control MCU receives an external power off signal from the external power failure monitoring module, the energy storage capacitor in the energy storage control module provides temporary power. The main control MCU also receives vibration signals from the vibration monitoring module and power on / off signals from the external power failure monitoring module.
[0063] This embodiment also provides a file protection method based on external power failure monitoring. Since the principle of solving the problem of a file protection system based on external power failure monitoring is similar to that of a file protection method based on external power failure monitoring, the implementation of a file protection method based on external power failure monitoring can refer to the implementation of a file protection system based on external power failure monitoring, and the repeated parts will not be repeated. Figure 2 As shown, a file protection method based on external power failure monitoring specifically includes the following steps:
[0064] Step S100: The external power failure monitoring module collects the voltage of the external power supply in real time, and outputs a status signal of the external power supply to the energy storage control module and the operation storage control module respectively according to the collected voltage. The external power failure monitoring module includes a hysteresis voltage comparator, which performs a dynamic threshold judgment on the voltage of the external power supply by setting a hysteresis voltage window. The external power failure monitoring module outputs the status signal according to the judgment result of the hysteresis voltage comparator. When the status signal is a power failure signal:
[0065] In step S200, the energy storage control module controls the energy storage capacitor through the discharge circuit to supply power to the operation storage control module. The operation storage control module receives the vibration signal of the vehicle sent by the vibration sensor in real time, and determines the file protection operation to be performed based on the vibration signal, wherein the file protection operation includes one or more of exiting the application, saving critical data, and shutting down the operating system.
[0066] Specifically, the method provided in this embodiment makes dynamic decisions on the voltage of the external power supply through a hysteresis window, thereby achieving reliable power-off monitoring of the external power supply, and introduces vehicle vibration signals for joint decision-making, dynamically tailoring the file protection process of the file protection system, and improving the reliability of the vehicle's on-board equipment circuit.
[0067] Furthermore, in step S100, when the status signal is a power-on signal, the energy storage control module controls the charging circuit to charge the energy storage capacitor and simultaneously turns off the discharge circuit to prevent the energy storage capacitor from discharging; and the operation storage control module provides normal power supply through the power supply module.
[0068] Further, such as Figure 2 As shown, in step S100, the hysteresis voltage comparator is used to judge the voltage of the external power supply, and the method includes:
[0069] Step S101: determining an upper threshold and a lower threshold of the hysteresis voltage comparator, and judging the voltage value of the external power supply collected in real time by the external power failure monitoring module according to the upper threshold and the lower threshold:
[0070] Step S102: If the voltage value is less than or equal to the lower threshold, it is determined that the external power supply is in a power-off state, and the hysteresis voltage comparator outputs a low level; if the voltage value is greater than or equal to the upper threshold, it is determined that the external power supply is in a power-on state, and the hysteresis voltage comparator outputs a high level; if the voltage value is greater than the lower threshold and less than the upper threshold, it is determined that the external power supply is in a previous state (current state), and the level output value of the hysteresis voltage comparator remains unchanged.
[0071] Specifically, in step S101, the lower threshold of the hysteresis voltage comparator is determined according to the following formula (1):
[0072] (1)
[0073] In formula (1), is the lower threshold voltage of the hysteresis voltage comparator, It is the minimum voltage under normal system operation. is the safety factor, Take 1.5~2.0, is the maximum noise amplitude of the power grid.
[0074] Furthermore, the upper threshold of the hysteresis voltage comparator is determined according to the following formula (2):
[0075] (2)
[0076] In formula (2), is the upper threshold voltage of the hysteresis voltage comparator, is the lower threshold voltage of the hysteresis voltage comparator; is the hysteresis voltage window, , is the peak-to-peak value of the power grid noise, which is 0.5V; is less than the rated voltage of the external power supply.
[0077] Furthermore, the hysteresis voltage comparator is different from the traditional comparator that only relies on a single fixed threshold for instantaneous judgment. It introduces the concept of dynamic decision boundary, and its judgment logic has direction perception and noise tolerance. In the design of the hysteresis voltage comparator, the rated voltage of the external power supply is (such as the 12V power supply of the rail transit system) is the benchmark reference value. and It must be set around it to meet the system stability and reliability. According to formula (1) and formula (2), the design constraints of the hysteresis voltage comparator include:
[0078] 1. , lower threshold It is the voltage point that triggers the protection action and must be higher than the system's minimum operating voltage , ensuring that when the power supply voltage drops to The file protection system triggers the protection operation in time, but will not make misjudgments due to normal voltage fluctuations;
[0079] 2. , ensuring that the file protection system can be reliably turned on when the power voltage returns to the rated value;
[0080] 3. , ensuring that the hysteresis window isolates noise and locks the state when the voltage fluctuation fluctuates within the hysteresis window to resist interference and ensure stable power supply.
[0081] Furthermore, in step S200, the energy storage control module controls the energy storage capacitor to discharge the operation storage control module through the discharge circuit, and further includes:
[0082] Step S201: When the status signal received by the energy storage control module is a power-on signal, the charging circuit is controlled to charge the energy storage capacitor and the discharge circuit is controlled to be closed, wherein the charging circuit charges the energy storage capacitor by connecting to a power supply module, and the power supply module supplies power to the operation storage control module; when the status signal received by the energy storage control module is a power-off signal, the discharge circuit is controlled to supply power to the operation storage control module through the energy storage capacitor and the charging circuit is closed.
[0083] Furthermore, in step S200, when the external power supply is in a power-off state, the running storage control module determines the file protection operation to be performed according to the vibration signal, including:
[0084] Step S202: When the vibration signal is a low-frequency vibration, the operation storage control module executes a file protection process of exiting the application, saving key data, and shutting down the operating system; when the vibration signal is a medium-frequency vibration, the operation storage control module executes a file protection process of saving key data and shutting down the operating system; when the vibration signal is a high-frequency vibration, the operation storage control module executes a file protection process of saving key data, wherein the key data is file system metadata, and the vibration thresholds of the low-frequency vibration, the medium-frequency vibration, and the high-frequency vibration are respectively set according to the actual operating environment of the vehicle.
[0085] For example, the criteria for low-frequency vibration are <2g, medium-frequency vibration are 2-5g, and high-frequency vibration are >5g. In the vibration field, particularly in vibration testing of mechanical equipment, electronic devices, vehicles, and structural components, g is used as a unit of acceleration to indicate the intensity of vibration, as it directly reflects the degree of "impact" vibration has on the equipment. It can be expressed as follows: Acceleration (g) = Displacement (mm / s) × Frequency (Hz)² / 2π.
[0086] Specifically, in this embodiment, a piezoelectric vibration sensor (such as Murata SCA1000) is used to monitor the vibration intensity of the vehicle in real time. The storage control module is operated to collect and receive data from the vibration sensor in real time. The vibration signal is involved in decision-making to achieve dynamic tailoring of the file protection process. The vibration signal does not block the power supply switching and only affects the integrity of the file protection process.
[0087] Furthermore, in step S202, the file protection operation performed by the storage control module includes:
[0088] 1. Application Exit: The master MCU safely exits the running application through system calls or control interfaces, ensuring that all application processes can be properly closed and resources released, avoiding data loss caused by unterminated processes;
[0089] 2. Saving critical data to storage: The system saves critical data (such as security control instructions, file system metadata, event logs, application data, and cached data) from memory to storage (such as HDD, FRAM, etc.), effectively preventing the loss of important data during power outages. The storage control module's AI decision-making unit dynamically adjusts the storage rules for various types of critical data.
[0090] 3. Shut down the operating system: Finally, the main control MCU executes the safe shutdown process, shutting down all services and resources of the vehicle operating system, ensuring that the operating system's file system is properly unloaded to reduce the risk of damage.
[0091] Specifically, if the vehicle is experiencing low-frequency vibration, the complete file protection process of operations 1, 2, and 3 is executed. If the vehicle is experiencing medium-frequency vibration, operation 1 is skipped and only operations 2 and 3 are executed. If the vehicle is experiencing high-frequency vibration, only operation 2 is executed. During operation 2, the AI decision-making unit running the storage control module is used to dynamically adjust the storage priority of various types of critical data and select storage media.
[0092] Furthermore, in step S202, the operation storage control module includes a decision unit, and the operation storage control module performs a file protection operation for saving key data, such as Figure 3 As shown, including:
[0093] The decision unit receives the power-off signal, the current voltage value of the energy storage capacitor, the vibration signal, the system load status, the data file type and the storage medium status data sent by the external power supply power-off monitoring module, and outputs the storage priority and storage medium of each type of key data based on the above-mentioned data received; the operation storage control module stores each type of key data respectively according to the storage priority output by the decision unit, and stores each type of key data in the corresponding storage medium in turn.
[0094] Furthermore, the storage priority is set based on a predefined priority grading rule, which is shown in Table 1 below. The priority grading rule includes multiple levels of storage priority, each level of storage priority corresponds to a different data type and storage medium, and the data type includes security control instructions, file system metadata, event logs, application data, and cached data.
[0095] Table 1: Predefined priority classification rules
[0096]
[0097] Furthermore, in step S202, the decision unit outputs the storage priority and storage medium of each type of key data according to the received data, including the following steps:
[0098] S2021. Obtain a predicted value of the remaining power supply time of the energy storage capacitor according to the current voltage value of the energy storage capacitor and the system load state;
[0099] S2022: Analyze the vibration intensity and main frequency according to the vibration signal, and evaluate the state of the storage medium based on the vibration intensity and main frequency. If the vibration intensity exceeds a preset threshold or the main frequency is within a resonant frequency range of the storage medium, mark the state of the storage medium as unstable. The state of the storage medium includes an unstable state and a stable state.
[0100] S2023. Adjust the predefined storage priority of each key data based on the remaining power supply time prediction value and the vibration intensity, and adjust the predefined storage medium of each key data based on the state of the storage medium. The decision unit outputs the adjusted storage priority of each type of key data and the corresponding storage medium, and stores them separately.
[0101] Specifically, the AI decision-making unit integrates a neural network model and performs dynamic resource scheduling optimization based on the received data. Through AI data processing, a priority queue of various key data is generated at the millisecond level, and storage media and compression rate are dynamically allocated to each data block to maximize the key data retention rate under limited energy. In step S2021, the AI decision-making unit estimates the remaining power supply time of the energy storage capacitor based on the voltage of the energy storage capacitor and the current system load. Its core algorithm is shown in Table 2 below:
[0102] Table 2: Remaining time calculation
[0103]
[0104] In step S2022, the AI decision unit analyzes the vibration signal to obtain the vibration intensity (RMS value) and dominant frequency. The RMS value of the vibration intensity is calculated from a segment of the collected time-domain acceleration signal. If the RMS value exceeds a threshold (e.g., 5g), the vibration intensity is considered excessive and may cause physical damage to the storage medium (especially mechanical hard disks) (e.g., a head scratching the platter), increase read / write error rates, or shorten the device lifespan, and is marked as "unstable." The dominant frequency is determined by performing a fast Fourier transform (FFT) on the time-domain vibration signal to convert it to the frequency domain, obtaining a power spectral density (PSD) or amplitude spectrum. The frequency spectrum is then searched for peaks with amplitudes significantly higher than those of the surrounding frequencies, identifying them as the dominant frequencies. The identified dominant frequency (or frequencies) is compared with the known resonant frequency range of the storage medium. If the dominant frequency falls within the resonant frequency range (e.g., 80-160Hz), the condition is extremely dangerous, even if the RMS value does not exceed the intensity threshold. Because the system is in a resonant state, even small excitations are significantly amplified, causing unexpectedly violent vibrations within the storage medium or its mounting structure. This can easily lead to failures (HDDs: read / write errors, seek failures, head crashes; SSDs: solder joint fatigue, loose connectors), thus marking it as "unstable." By simultaneously considering vibration intensity and dominant frequency (the two are in an OR relationship), the stability of the storage medium is assessed. If a storage medium is "unstable," its use is avoided and data is transferred to more stable media. This allows for dynamic adjustment of the pre-selected storage medium for storing critical data.
[0105] In step S2023, based on the predefined priority classification rules described in Table 1, the storage priority of each type of key data is dynamically adjusted according to the remaining time and vibration conditions, so as to maximize the protection of the most important data within a limited time. In this embodiment, the adjustment can be made according to the following rules:
[0106] If the remaining time is insufficient (e.g., the predicted remaining power time is less than 50ms), only data from P1 and P2 is saved. If the remaining time is moderate (50ms ≤ predicted remaining power time < 200ms), data from P1, P2, and P3 is saved. If the remaining time is sufficient (predicted remaining power time ≥ 200ms), all data (P1-P5) is saved. If vibration is severe (e.g., RMS > 5g), metadata (P1) is prioritized, and data requiring long write times (such as large files) is skipped. Data compression is also used to reduce the amount of data written. P1 and P2 data are preferentially written to more reliable storage media (such as FRAM). If the storage media status indicates that a partition or block device has a slow write speed, high-priority data is prevented from being written to that device.
[0107] Furthermore, the AI decision-making unit sorts the critical data to be saved from high to low priority, and within the same priority level, sorts it in ascending order of data size, generating the corresponding storage media. The main control MCU running the storage control module stores each type of critical data separately based on the output of the decision-making unit. The decision-making unit dynamically allocates storage media and compression ratios for each data block, achieving "maximum critical data retention within limited energy resources," thereby improving the accuracy and reliability of protecting critical vehicle files in the event of a power outage.
[0108] In this embodiment, a computer device is also provided, such as Figure 4 As shown, it includes a memory 401, a processor 402 and a computer program stored in the memory 401 and executable on the processor 402. When the processor 402 executes the computer program, any one of the above-mentioned file protection methods based on external power failure monitoring is implemented.
[0109] Specifically, the computer device may be a computer terminal, a server or a similar computing device.
[0110] In this embodiment, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores a computer program for executing any of the above-mentioned file protection methods based on external power failure monitoring.
[0111] Specifically, computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable storage media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0112] The embodiments of the present invention achieve the following technical effects:
[0113] 1. This application provides a hysteresis voltage comparator in the external power failure monitoring module to determine the voltage of the vehicle's external power supply. Dynamic decisions are made on the voltage of the external power supply through a hysteresis window, thereby solving the problems of misjudgment of the power failure state and noise interference in the vehicle's power grid fluctuation environment. This achieves reliable power failure monitoring of the external power supply and reduces misjudgment of the external power failure state due to power grid signal jitter.
[0114] 2. Based on reliable power failure monitoring of the external power supply, this application introduces vehicle vibration signals for joint decision-making, dynamically tailors the file protection process of the file protection system and adjusts storage priorities. This ensures the integrity and reliability of the file system and vehicle storage data in the event of a power failure, solving the problem of data storage failure caused by mechanical vibration in rail transit scenarios.
[0115] 3. This application integrates the various modules of the file protection system into the same embedded device, avoiding dependence on external UPS devices, improving system compactness and reliability. The layered layout architecture can improve space utilization and signal integrity, optimize signal flow, shorten the signal transmission path and reduce signal transmission delay.
[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A file protection method based on external power failure monitoring, characterized in that: include: The external power failure monitoring module collects the voltage of the external power supply in real time and outputs the status signal of the external power supply to the energy storage control module and the operation storage control module respectively according to the collected voltage. The external power failure monitoring module includes a hysteresis voltage comparator. The hysteresis voltage comparator performs dynamic threshold judgment on the voltage of the external power supply by setting a hysteresis voltage window. The hysteresis voltage comparator judges the voltage value of the external power supply collected in real time by the external power failure monitoring module according to the set upper and lower thresholds. according to determining the lower threshold, is the lower threshold voltage value of the hysteresis voltage comparator, It is the minimum voltage under normal system operation. is the safety factor, Take 1.5~2.0, is the maximum noise amplitude of the power grid; according to determining the upper threshold, is the upper threshold voltage value of the hysteresis voltage comparator, is the hysteresis voltage window, , is the peak-to-peak value of the power grid noise, take 0.5V, is less than the rated voltage of the external power supply; The external power failure monitoring module outputs the status signal according to the judgment result of the hysteresis voltage comparator. When the status signal is a power failure signal: The energy storage control module controls the energy storage capacitor through a discharge circuit to supply power to the operation storage control module. The operation storage control module receives a vibration signal of the vehicle sent by a vibration sensor in real time, and determines a file protection operation to be performed based on the vibration signal, wherein the file protection operation includes one or more of exiting an application, saving critical data, and shutting down an operating system.
2. The file protection method based on external power failure monitoring according to claim 1, characterized in that: The voltage value of the external power supply collected in real time by the external power failure monitoring module is judged according to the upper threshold and the lower threshold: If the voltage value is less than or equal to the lower threshold value, it is determined that the external power supply is in a power-off state, and the hysteresis voltage comparator outputs a low level; if the voltage value is greater than or equal to the upper threshold value, it is determined that the external power supply is in a power-on state, and the hysteresis voltage comparator outputs a high level; if the voltage value is greater than the lower threshold value and less than the upper threshold value, it is determined that the external power supply is in a previous state, and the level output value of the hysteresis voltage comparator remains unchanged.
3. The file protection method based on external power failure monitoring according to claim 1, characterized in that: The energy storage control module controls the energy storage capacitor to discharge the operation storage control module through a discharge circuit, and further includes: When the status signal received by the energy storage control module is a power-on signal, the charging circuit is controlled to charge the energy storage capacitor and the discharge circuit is controlled to be closed, wherein the charging circuit charges the energy storage capacitor by connecting to a power supply module, and the power supply module supplies power to the operation storage control module; When the status signal received by the energy storage control module is a power-off signal, the discharge circuit is controlled to supply power to the operation storage control module through the energy storage capacitor, and the charging circuit is turned off.
4. The file protection method based on external power failure monitoring according to claim 1, characterized in that: The file protection operation to be performed according to the vibration signal includes: When the vibration signal is a low-frequency vibration, the operation storage control module executes a file protection process of exiting the application, saving key data, and shutting down the operating system; When the vibration signal is a medium frequency vibration, the operation storage control module executes a file protection process of saving key data and shutting down the operating system; When the vibration signal is a high-frequency vibration, the operation storage control module executes a file protection process for saving critical data, wherein the critical data is file system metadata, and the vibration thresholds of the low-frequency vibration, the medium-frequency vibration, and the high-frequency vibration are set respectively according to the actual operating environment of the vehicle.
5. The file protection method based on external power failure monitoring according to claim 1, characterized in that: The running storage control module includes a decision unit, and the running storage control module performs a file protection operation for saving key data, including: The decision unit receives the power-off signal, the current voltage value of the energy storage capacitor, the vibration signal, the system load status, the data file type, and the storage medium status data sent by the external power supply power-off monitoring module, and outputs the storage priority and storage medium of each type of key data according to the received data; The operation storage control module stores each key data according to the storage priority output by the decision unit, and stores each key data in the corresponding storage medium in sequence.
6. The file protection method based on external power failure monitoring according to claim 5, characterized in that: The storage priority is set based on a predefined priority grading rule, and the priority grading rule includes multiple levels of storage priority. Each level of storage priority corresponds to a different data type and storage medium. The data type includes security control instructions, file system metadata, event logs, application data and cache data.
7. The file protection method based on external power failure monitoring according to claim 5, characterized in that: The decision unit outputs the storage priority and storage medium of each type of key data according to the received data, and the steps include: Obtaining a predicted value of the remaining power supply time of the energy storage capacitor according to the current voltage value of the energy storage capacitor and the system load state; analyzing the vibration intensity and the main frequency according to the vibration signal, evaluating the state of the storage medium based on the vibration intensity and the main frequency, and marking the state of the storage medium as an unstable state if the vibration intensity exceeds a preset threshold or the main frequency is within a resonant frequency range of the storage medium, wherein the state of the storage medium includes an unstable state and a stable state; The predefined storage priority of each key data is adjusted based on the predicted value of the remaining power supply time and the vibration intensity, and the predefined storage medium of each key data is adjusted based on the state of the storage medium. The decision unit outputs the adjusted storage priority of each type of key data and the corresponding storage medium, and stores them separately.
8. A file protection system based on external power failure monitoring, characterized in that: The method according to any one of claims 1 to 7 is implemented based on the system, which is a multi-layer integrated structure including: The bottom layer includes a vibration monitoring module and an external power failure monitoring module, wherein the vibration monitoring module is connected to a vehicle outside the system, the external power failure monitoring module is connected to an external power supply of the system, and the external power failure monitoring module includes a hysteresis voltage comparator; The middle layer includes an operation storage control module, and the operation storage control module is respectively communicated with the vibration monitoring module and the external power failure monitoring module; The top layer includes a power supply module and an energy storage control module. The power supply module converts the external power supply of the system into the internal power supply of the system, thereby supplying power to the energy storage control module, the operation and storage control module, the external power supply power-off monitoring module, and the vibration monitoring module. The energy storage control module includes a charging circuit, a discharging circuit, and an energy storage capacitor. The energy storage control module is respectively communicated with the external power supply power-off monitoring module and the operation and storage control module.
Citation Information
Patent Citations
Bus data storing method and device
CN108563403A
File system protection system based on delayed power-off circuit
CN115754444A
Protection circuit and switching power supply
CN219107048U