Fire pump control method and system based on fire truck liquid level data collection

By constructing a theoretical tilted liquid surface model and processing liquid level data using a random sampling consensus algorithm, combined with a fuzzy control strategy, the problem of liquid level measurement distortion in fire trucks under dynamic operating conditions was solved, thus achieving stable water supply from the fire pump and equipment safety.

CN120798762BActive Publication Date: 2026-02-24HUBEI RUILI AUTOMOBILE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510915323.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-03
Publication Date
2026-02-24
Estimated Expiration
2045-07-03

AI Technical Summary

Technical Problem

During the movement of fire trucks, traditional liquid level measurement technology can cause data distortion due to liquid sloshing, making it impossible to accurately determine the remaining liquid. This can lead to fire pumps not being able to provide early warning when the liquid is about to run out, which may cause pump cavitation damage and water supply interruption risks.

Method used

By synchronously collecting dynamic attitude data of the fire truck and data from multiple liquid level sensors, a theoretical tilted liquid surface model is constructed. An abnormal data is eliminated using a random sampling consensus algorithm, and adaptive feedforward control is performed in combination with a fuzzy control strategy to accurately calculate the true effective volume and adjust the working state of the fire pump.

Benefits of technology

It enables precise measurement of liquid level under dynamic operating conditions, ensuring stable water supply from fire pumps, avoiding the risk of air intake into the pumps, and guaranteeing the continuity of fire fighting and rescue operations and equipment safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120798762B_ABST
    Figure CN120798762B_ABST
Patent Text Reader

Abstract

The application provides a fire pump control method and system based on fire truck liquid level data collection, which comprises the following steps: firstly, synchronously collecting dynamic posture data and original liquid level data of multiple points in the tank during the driving of the fire truck. Based on the vehicle posture and the geometric model of the tank, a theoretical inclined liquid surface model is constructed in real time, and based on the model, the random sample consensus algorithm is used to eliminate abnormal data caused by liquid sloshing. The data centroid of the effective data after calculation and screening is calculated, and is coupled with the model for dynamic digital integration to accurately calculate the real effective volume of the liquid in the tank. Considering the change rate of the volume and the liquid surface stability calculated from the posture data, a fuzzy control strategy is adopted to adaptively feed forward control the fire pump. The application realizes accurate measurement of the on-board liquid volume under dynamic working conditions and intelligent control of the fire pump.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data acquisition and analysis technology, specifically relating to a fire pump control method and system based on fire truck liquid level data acquisition. Background Technology

[0002] Fire trucks, as core rescue equipment in cities and various fire scenes, rely heavily on the extinguishing agent in their onboard water or foam tanks for sustained and effective firefighting. Accurate monitoring of the remaining liquid level in these tanks is crucial for on-site commanders' decision-making and the safe operation of fire pumps during firefighting and rescue operations. Traditional liquid level measurement technologies, such as float-type, pressure-type, or single-point ultrasonic sensors, can only provide a rough reading when the fire truck is stationary and parked horizontally.

[0003] However, in reality, the environment at fire and rescue sites is complex and ever-changing. Fire trucks often need to dispense water while in motion or operate in inclined positions such as on slopes or uneven surfaces. Under these dynamic conditions, the liquid inside the tank will violently shake, surge, and tilt, causing the liquid level to change rapidly. At this time, the data output by any traditional sensor based on fixed-point measurement will become irregular, with huge errors, and may even frequently jump between full scale and zero. This severely distorted liquid level signal makes it impossible for the vehicle control system to determine the true remaining liquid level. This can easily lead to the fire pump sucking in air when the liquid is about to run out, causing cavitation damage to the pump and interruption of water supply, posing a huge risk to rescue operations and equipment safety. Summary of the Invention

[0004] This invention provides a fire pump control method and system based on fire truck liquid level data acquisition to solve the above-mentioned technical problems.

[0005] In a first aspect, the present invention provides a fire pump control method based on fire truck liquid level data acquisition, the method comprising the following steps:

[0006] Simultaneously collect dynamic attitude data of the fire truck during its movement and raw liquid level data from multiple liquid level sensors distributed inside the fire truck's tank;

[0007] Based on dynamic attitude data and combined with the tank geometry model of the fire truck tank, a theoretical tilted liquid surface model for compensating for liquid sloshing is constructed in real time.

[0008] Based on the theoretical inclined liquid surface model, the random sampling consensus algorithm is used to iteratively process the original liquid level data, identify and remove abnormal data caused by violent liquid shaking, and screen out the effective liquid level data that reflects the true liquid body.

[0009] The data centroid of the effective liquid level data is calculated, and the data centroid is coupled with the theoretical inclined liquid surface model and the tank geometric model. The true effective volume of the liquid in the fire truck tank under the current vehicle posture is calculated by dynamic digital integration calculation method.

[0010] Combining the volume change rate calculated based on the actual effective volume and the liquid level stability of the liquid inside the fire truck tank calculated from dynamic attitude data, a fuzzy control strategy is adopted to perform adaptive feedforward control on the working state of the fire truck's fire pump.

[0011] Optionally, the synchronous acquisition of dynamic attitude data during the fire truck's movement and raw liquid level data from multiple liquid level sensors distributed inside the fire truck's tank includes the following steps:

[0012] Dynamic attitude data is collected at a preset frequency by an inertial measurement unit installed at the center of gravity of the fire truck. The dynamic attitude data includes triaxial acceleration and triaxial angular velocity information.

[0013] Each sensor in the ultrasonic level sensor array, which is evenly distributed on the inner wall of the fire truck tank, independently measures the vertical distance from its own position to the liquid surface.

[0014] The vertical distances measured by all sensors are converted into three-dimensional coordinate points in the coordinate system of the fire truck tank to form the original liquid level data;

[0015] Add a synchronization timestamp to the dynamic attitude data and the original liquid level data.

[0016] Optionally, the step of constructing a theoretical tilted liquid surface model in real time to compensate for liquid sloshing based on dynamic attitude data and combined with the tank geometry model of the fire truck tank includes the following steps:

[0017] Load the tank geometry model of the fire truck from the preset storage unit;

[0018] The gravitational acceleration vector and the inertial force vector generated by the vehicle motion are extracted from the dynamic attitude data;

[0019] By vector synthesis of the gravitational acceleration vector and the inertial force vector, the final force vector characterizing the resultant force on the liquid inside the fire truck tank is obtained;

[0020] Construct a reference plane perpendicular to the final force vector within the coordinate system of the tank's geometric model;

[0021] The reference plane is used as a theoretical tilted liquid surface model to characterize the liquid surface shape that should exist in the fire truck tank when the liquid is stationary under the current vehicle posture.

[0022] Optionally, the step of using a theoretical inclined liquid surface model as a benchmark and employing a random sampling consensus algorithm to iteratively process the original liquid level data, identifying and removing abnormal data caused by violent liquid sloshing, and filtering out effective liquid level data that reflects the true body of the liquid includes the following steps:

[0023] The three-dimensional coordinate point set after the original liquid level data is converted is used as the input data points;

[0024] A minimum subset of points is randomly sampled from the input data points to fit and generate candidate liquid surfaces;

[0025] Calculate the geometric distance from all input data points to the candidate liquid surface, and count the number of inliers whose geometric distance is less than a preset error threshold;

[0026] Repeat the above sampling, fitting, and interior point statistics steps until the preset number of iterations is reached;

[0027] Among all the candidate liquid surfaces generated in the iterations, the candidate liquid surface with the most internal points is selected as the consensus liquid surface;

[0028] The set of interior points that constitute the consensus liquid level is defined as valid liquid level data, and other data points are identified as abnormal data and removed.

[0029] Optionally, the step of calculating the data centroid of the effective liquid level data and coupling the data centroid with the theoretical inclined liquid surface model and the tank geometric model, and calculating the true effective volume of the liquid in the fire truck tank under the current vehicle posture using a dynamic digital integration method includes the following steps:

[0030] The centroid of the data is obtained by calculating a weighted average of all three-dimensional coordinate points in the effective liquid level data.

[0031] In the digital space of the tank's geometric model, a final cutting plane is defined by taking the data centroid as the positioning anchor point and combining it with the attitude of the theoretical inclined liquid surface model.

[0032] The tank geometry model is discretized into a predetermined number of three-dimensional voxel elements using a voxelization method.

[0033] Traverse all 3D voxel units and determine whether the geometric center of the 3D voxel unit is located below the final cutting plane;

[0034] The actual effective volume is obtained by summing the volumes of all voxel units located below the final cutting plane.

[0035] Optionally, the step of calculating the weighted average of all three-dimensional coordinate points in the effective liquid level data to obtain the data centroid includes the following steps:

[0036] Analyze the signal quality of each data point in the effective liquid level data. Signal quality includes signal strength and signal-to-noise ratio.

[0037] Assign a weighting coefficient that is positively correlated with signal quality to each data point;

[0038] Obtain the three-dimensional coordinates of each data point;

[0039] Multiply the three-dimensional coordinates of each data point by the corresponding weight coefficient;

[0040] The centroid of the data is obtained by summing all the weighted 3D coordinates and dividing by the sum of all weight coefficients.

[0041] Optionally, the preset error threshold is a dynamic error threshold, and the dynamic error threshold is determined by the following steps:

[0042] Real-time analysis of dynamic attitude data is performed to calculate the root mean square values ​​of the acceleration and angular velocity of the fire truck within a preset time window, and the root mean square values ​​are used as a quantitative indicator to characterize the intensity of the vehicle's motion.

[0043] The basic error value is determined based on quantitative indicators and through a preset function mapping relationship;

[0044] Set the base error value as the dynamic error threshold used to determine interior points in the random sampling consensus algorithm.

[0045] Optionally, the calculation method for the volume change rate and liquid level stability includes the following steps:

[0046] The continuously calculated true effective volume is stored as volume sequence data;

[0047] A Kalman filter is applied to the volumetric sequence data for smoothing to eliminate computational noise.

[0048] Perform a first-order difference operation on the filtered volumetric sequence data to obtain the volume change rate;

[0049] The angular velocity data from continuously acquired dynamic attitude data is stored as volumetric sequence data;

[0050] Calculate the standard deviation of the angular velocity volume sequence data within the sliding time window, and use this standard deviation as the liquid surface stability.

[0051] Optionally, the adaptive feedforward control of the fire truck's fire pump's operating state using a fuzzy control strategy, combining the volume change rate calculated based on the actual effective volume and the liquid level stability of the liquid inside the fire truck's tank calculated from dynamic attitude data, includes the following steps:

[0052] Establish fuzzy membership functions for three input variables: true effective volume, volume change rate, and liquid surface stability;

[0053] Construct a fuzzy rule library containing multiple fuzzy rules that describe the logical relationship between input variables and fire truck fire pump control commands;

[0054] The three input variables acquired in real time are fuzzified to obtain the membership degree of the input variables on their respective fuzzy subsets;

[0055] The fuzzy inference engine matches and activates the corresponding fuzzy rules in the fuzzy rule base.

[0056] The inference results of the activated fuzzy rules are defuzzified to generate control signals for adjusting the working state of the fire pump.

[0057] Secondly, the present invention also provides a fire pump control system based on fire truck liquid level data acquisition, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the fire pump control method based on fire truck liquid level data acquisition as described in the first aspect.

[0058] The beneficial effects of this invention are:

[0059] This invention fundamentally solves the global problem of severely inaccurate liquid level measurement caused by violent liquid sloshing under dynamic conditions such as driving and bumping of fire trucks. By constructing a theoretical tilted liquid surface model synchronized with the vehicle's posture in real time, and innovatively employing a random sampling consensus algorithm to intelligently clean the raw data collected from multiple points, this invention can effectively remove noise and artifacts caused by sloshing, accurately extracting effective data reflecting the true substance of the liquid. Its core advantage lies in the fact that it no longer estimates a vague liquid level height, but accurately calculates the real-time, true effective volume through the coupling of the data centroid and the tank model and dynamic digital integration, achieving a leap from one-dimensional height measurement to three-dimensional volume measurement. Based on this high-precision volume and its rate of change, and combined with the judgment of liquid surface stability, the adopted fuzzy control strategy can perform highly predictive feedforward control of the fire pump. It can adjust the pump's operating state in advance according to the actual water usage rate, and actively avoid the risk of air intake by the pump when the liquid surface is unstable, thereby maximizing the stability of water supply and the safety of the equipment itself during fire fighting and rescue. Attached Figure Description

[0060] Figure 1 This is a flowchart illustrating a fire pump control method based on fire truck liquid level data acquisition in one embodiment of this application.

[0061] Figure 2This is a flowchart illustrating the liquid level stability calculation process in one embodiment of this application. Detailed Implementation

[0062] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0063] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0064] Figure 1 This is a flowchart illustrating a fire pump control method based on fire truck liquid level data acquisition in one embodiment. It should be understood that, although... Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps. For example Figure 1 As shown, the fire pump control method based on fire truck liquid level data acquisition disclosed in this invention specifically includes the following steps:

[0065] S101. Synchronously collect dynamic attitude data of the fire truck during its movement and raw liquid level data from multiple liquid level sensors distributed inside the fire truck tank.

[0066] The system employs an inertial measurement unit (IMU) installed at the fire truck's center of gravity to continuously collect dynamic attitude data of the vehicle at a preset high frequency. This data includes acceleration and angular velocity information in three dimensions, comprehensively reflecting all motion states of the vehicle during driving, turning, braking, or bumping. Simultaneously, inside the fire truck's liquid storage tank, an array of multiple ultrasonic level sensors is uniformly deployed along the inner wall. Each sensor independently and in real-time measures the vertical distance from its position to the liquid surface below. The system then combines the distance values ​​measured by all sensors with the precise preset position of each sensor within the tank, uniformly transforming them into a three-dimensional coordinate system based on the tank, forming a series of three-dimensional coordinate point clouds representing the instantaneous liquid surface morphology—the raw liquid level data. The most crucial step is to precisely timestamp each frame of dynamic attitude data and each set of raw liquid level data, ensuring a strict temporal correspondence between the vehicle's attitude and the liquid sloshing state.

[0067] S102. Based on dynamic attitude data and combined with the tank geometry model of the fire truck tank, a theoretical tilted liquid surface model for compensating for liquid sloshing is constructed in real time.

[0068] Next, based on the vehicle dynamic attitude data collected in the previous step and combined with the pre-stored precise 3D geometric model of the fire truck tank, the system will construct a theoretical tilted liquid surface model in real time. The core function of this model is to calculate the ideal shape of the liquid surface in the tank if it were completely stationary under the combined effects of vehicle acceleration and gravity, thus providing a benchmark for subsequent filtering of actual swaying data. In specific implementation, the system first parses the constant gravitational acceleration vector generated by Earth's gravity and the inertial force vector generated by the vehicle's acceleration, deceleration, or turning motion from the dynamic attitude data. Then, it superimposes these two force vectors using a vector synthesis method to obtain a final force vector. It precisely indicates the direction of the resultant force acting on the liquid inside the container. Among other things... The final force vector, It is the gravitational acceleration vector. This represents the inertial force vector. According to the principles of fluid statics, the surface of a stationary liquid must be perpendicular to the direction of the resultant force. Therefore, the system then constructs a mathematical plane perpendicular to this final force vector within the coordinate system of the tank model. This reference plane, calculated in real time, is the theoretical inclined liquid surface model. The effect of this step is that, regardless of the movement of the fire truck, a dynamically changing, theoretically perfect liquid surface can be generated as a reference, providing a scientific basis for identifying the true liquid surface from chaotic measurement data.

[0069] S103. Based on the theoretical inclined liquid surface model, the original liquid level data is iteratively processed using a random sampling consensus algorithm to identify and remove abnormal data caused by violent liquid sloshing, and to select effective liquid level data that reflects the true main body of the liquid.

[0070] After establishing a theoretical inclined liquid surface model, a robust algorithm called random sampling consensus is used as a benchmark to iteratively process the collected raw liquid level data point cloud. The purpose of this is to accurately identify and eliminate a large number of invalid measurement points caused by violent liquid sloshing and splashing, ultimately selecting valid liquid level data that represents the true liquid body. Specifically, the algorithm uses a set of three-dimensional coordinate points converted from all raw liquid level data as input. After the algorithm starts, a minimal subset of points that can just define a plane is randomly selected from these input data points, and a candidate liquid surface is fitted based on these points. Next, the geometric distance from all input data points to this candidate liquid surface is calculated, and the number of points with a geometric distance less than a preset error threshold is counted; these points are called inliers. This process of random sampling, plane fitting, and inlier counting is repeated until a preset number of iterations is reached. During all iterations, the candidate liquid surface with the most inliers is selected as the final consensus liquid surface because it represents the true liquid surface's shape with the highest probability. Ultimately, the set of all interior points that constitute this consensus liquid level is defined as valid liquid level data, while all other points are identified as anomalous data and discarded.

[0071] S104. Calculate the data centroid of the effective liquid level data, and couple the data centroid with the theoretical inclined liquid surface model and the tank geometric model. Solve the true effective volume of the liquid in the fire truck tank under the current vehicle posture through dynamic digital integration calculation method.

[0072] After filtering out clean and valid liquid level data, the next step is to accurately calculate the true effective volume of the liquid inside the fire truck tank. This process first requires calculating the geometric center of this set of valid liquid level data, i.e., the data centroid. Then, this data centroid is coupled with the previously constructed theoretical inclined liquid surface model and the tank geometric model, and the volume is calculated using a dynamic digital integration method. Specifically, a weighted average calculation is first performed on all three-dimensional coordinate points in the valid liquid level data to obtain the data centroid. Then, in the digital space of the tank geometric model, this calculated data centroid is used as the anchor point for positioning, and combined with the tilt attitude of the theoretical inclined liquid surface model, a unique final cutting plane is defined. This cutting plane has both the correct tilt angle and the correct relative height. Next, a voxelization method is used to discretize the entire fire truck tank geometric model in digital space into a massive number of tiny three-dimensional cubic units of predetermined sizes, i.e., voxels. Finally, the system traverses each voxel unit to determine whether its geometric center point is located within the space defined by the final cutting plane. By summing the volumes of all voxel units located below the cutting plane, as shown in the formula... As shown, the actual effective volume of the liquid inside the tank under the current vehicle posture can be obtained. Where V is the total volume. Let H be the volume of a single voxel, and H be the decision function. Let be the planar position constant determined by the center of mass. It is a plane normal vector. This is the location of the voxel center.

[0073] S105. Combining the volume change rate calculated based on the actual effective volume and the liquid level stability of the liquid in the fire truck tank calculated from dynamic attitude data, a fuzzy control strategy is adopted to perform adaptive feedforward control on the working state of the fire truck's fire pump.

[0074] Based on the accurately calculated true effective volume and further analysis of vehicle dynamic attitude data, the system employs an advanced fuzzy control strategy to adaptively feedforward control the fire truck's fire pump operating status. The core of this step is to comprehensively consider multiple factors to achieve intelligent and stable adjustment of the water output. First, the system needs to calculate two key control inputs: volume change rate and liquid level stability. The volume change rate is obtained by performing a first-order difference operation on continuous true effective volume data, reflecting the current water usage rate; liquid level stability is quantified by calculating the standard deviation of angular velocity in the vehicle's dynamic attitude data over a short period, reflecting the severity of liquid sloshing. Subsequently, a fuzzy control system is established, incorporating three input variables: true effective volume, volume change rate, and liquid level stability. The system pre-defines a fuzzy rule base describing the logical relationship between the input variables and fire pump control commands. For example, when the volume is low, the volume change rate is rapid, and the liquid level is stable, the pump power should be significantly increased. During operation, the system fuzzifies the three input variables acquired in real time and matches and activates the corresponding rules in the rule base through a fuzzy inference engine. Finally, the inference results of all activated rules are defuzzified to generate a precise and smooth control signal. This signal is directly used to adjust the speed of the fire pump or the valve opening. The effect of this step is to achieve predictive and adaptive control of the fire pump, which can anticipate and adjust the water supply, avoiding the unstable or interrupted water supply pressure caused by sudden changes in liquid level or violent shaking in traditional control methods, thus ensuring the continuity and efficiency of fire fighting operations.

[0075] In one embodiment, the synchronous acquisition of dynamic attitude data during the fire truck's movement and raw liquid level data from multiple liquid level sensors distributed inside the fire truck's tank includes the following steps:

[0076] Dynamic attitude data is collected at a preset frequency by an inertial measurement unit installed at the center of gravity of the fire truck. The dynamic attitude data includes triaxial acceleration and triaxial angular velocity information.

[0077] Each sensor in the ultrasonic level sensor array, which is evenly distributed on the inner wall of the fire truck tank, independently measures the vertical distance from its own position to the liquid surface.

[0078] The vertical distances measured by all sensors are converted into three-dimensional coordinate points in the coordinate system of the fire truck tank to form the original liquid level data;

[0079] Add a synchronization timestamp to the dynamic attitude data and the original liquid level data.

[0080] In this embodiment, to accurately monitor the fire truck's motion, an integrated inertial measurement unit (IMU) needs to be securely installed at the vehicle's center of gravity. This unit encapsulates a high-precision three-axis accelerometer and a three-axis gyroscope, enabling simultaneous sensing of the vehicle's linear acceleration and rotational angular velocity in three mutually perpendicular dimensions. By continuously acquiring data at a preset, sufficiently high sampling frequency, such as 100 times per second, all subtle dynamic changes during vehicle operation can be captured, including acceleration, deceleration, turning, inclines and declines, and vibrations caused by road bumps. The acquired dynamic attitude data constitutes a set of data including three-axis acceleration vectors. With the three-axis angular velocity vector The time-series data is used. The principle behind this step is that, through the law of inertia, these sensors can convert physical motion into measurable electrical signals, thereby achieving a quantitative description of the vehicle's attitude. Installing this unit at the vehicle's center of gravity simplifies subsequent dynamic analysis to the greatest extent possible, as the data it measures represents the overall motion state of the entire vehicle body, avoiding the complex calculations of centrifugal force and torque introduced by installation positions deviating from the center of gravity.

[0081] Meanwhile, to obtain the instantaneous shape of the liquid surface inside the tank, multiple ultrasonic level sensors are uniformly and arrayed along the top or upper side walls of the fire truck's storage tank. Each sensor acts as an independent measurement node, operating based on the time-of-flight ranging method for sound waves. The sensor emits a high-frequency ultrasonic pulse directly below the liquid surface. Upon contact with the liquid surface, the sound wave is reflected, and a portion of the echo is received by the same sensor. By precisely measuring the microsecond-level time difference between emission and reception of the echo, and combining this with the known propagation speed of sound in the air or vapor medium inside the tank, the vertical distance from the sensor probe to the liquid surface can be calculated. The specific calculation method is as follows: ,in It is the vertical distance measured by the j-th sensor. It is the speed of sound of the medium inside the tank, and This is the measured round-trip flight time of the sound wave. The reason for dividing by 2 is that the measured time is the total time it takes for the sound wave to travel to and from the destination. The measurement is performed using a uniformly distributed array of sensors, rather than a single sensor, in order to capture the complex and irregular liquid surface shapes formed by the sloshing of liquids when the vehicle is in motion.

[0082] After obtaining the raw vertical distance data measured by each sensor, this one-dimensional distance information must be converted into three-dimensional coordinate points with spatial meaning for subsequent geometric analysis. This process is completed within a predefined, fixed three-dimensional coordinate system based on the fire truck tank itself. During the system initialization phase, the precise installation position coordinates of each ultrasonic sensor within the tank's coordinate system are determined. All of these are measured and stored. This position coordinate is a three-dimensional vector containing x, y, and z components. When the sensor measures its vertical distance from the liquid surface... At that time, the system assumes that the measurement point on the liquid surface is exactly below the sensor. Therefore, the three-dimensional coordinates of this liquid surface point are... The liquid level data can be obtained by performing simple geometric operations on the sensor's position coordinates and the distance it measures. For example, if the sensor is installed along the negative z-axis, the coordinates of the liquid level point are calculated by subtracting the measured distance from the sensor's z-coordinate, while the x and y coordinates remain unchanged. After all the sensor data undergoes this transformation, a series of randomly distributed three-dimensional coordinate points are formed; this set of points is called the raw liquid level data.

[0083] Finally, to ensure absolute correlation between vehicle dynamic attitude data and liquid surface morphology data, strict time synchronization of these two independently acquired data streams is essential. Whether it's a drastic change in vehicle attitude causing liquid sloshing, or the liquid sloshing reacting on the vehicle, these physical processes are highly transient. Any temporal misalignment, even at the millisecond level, can lead to incorrect causal relationship judgments, causing the entire control algorithm to fail. Synchronization is typically achieved using a high-precision central clock source. At the start of each data acquisition cycle, the system first obtains a precise current timestamp from this clock source. This timestamp is then used as a unified tag, simultaneously appended to the dynamic attitude data packet acquired from the inertial measurement unit and the raw liquid level data point set acquired and converted from all ultrasonic sensor arrays within that acquisition cycle. In this way, each frame of attitude data and each frame of liquid level point cloud data possesses the exact same temporal identifier. The final result of this step is the generation of a series of time-aligned data pairs. Each pair of data completely records the movement of the fire truck and the surface morphology of the liquid inside the tank at a precise instant, thus establishing a robust and analyzable temporal correlation between the two. This is the fundamental guarantee for the correct execution of all subsequent compensation, filtering, and control algorithms.

[0084] In one implementation, the theoretical tilting page model for compensating for liquid sloshing is constructed in real time based on dynamic attitude data and the tank geometry model of the fire truck tank, including the following steps:

[0085] Load the tank geometry model of the fire truck from the preset storage unit;

[0086] The gravitational acceleration vector and the inertial force vector generated by the vehicle motion are extracted from the dynamic attitude data;

[0087] By vector synthesis of the gravitational acceleration vector and the inertial force vector, the final force vector characterizing the resultant force on the liquid inside the fire truck tank is obtained;

[0088] Construct a reference plane perpendicular to the final force vector within the coordinate system of the tank's geometric model;

[0089] The reference plane is used as a theoretical tilted liquid surface model to characterize the liquid surface shape that should exist in the fire truck tank when the liquid is stationary under the current vehicle posture.

[0090] In this embodiment, a pre-made high-precision 3D geometric model of the fire truck tank is loaded into the processing system's memory from a preset storage unit. This geometric model is not a simple 3D image, but a digital twin created using computer-aided design software, possessing precise dimensions and topological relationships. It mathematically and accurately describes the shape and position of every surface, edge, and corner of the tank's internal space, and its data format is typically a standard industrial format, such as STEP or IGES, ensuring data universality and accuracy. The fundamental purpose of loading this model is to provide an absolute and invariant boundary constraint for all subsequent spatial calculations. Without this precise container model, any calculations regarding liquid volume or morphology would be meaningless. This step is equivalent to reconstructing a space completely identical to the real fire truck tank in a virtual computing environment; all subsequent virtual liquid surfaces, force vectors, and volume integrals will be performed within this digital space.

[0091] After loading the tank model, it is necessary to analyze the two core forces acting on the liquid inside the tank in real time from the synchronously acquired dynamic attitude data: one is the constant Earth's gravity, and the other is the inertial force generated by the change in the vehicle's motion state. The gravitational acceleration vector in the Earth coordinate system is a vector that is vertically downward and constant in magnitude. However, because the fire truck itself is moving and tilting, the vehicle's attitude must be tracked in real time using gyroscope data from the inertial measurement unit (IMU). Then, the gravity vector in the Earth coordinate system is transformed into a dynamic coordinate system based on the vehicle to obtain the gravitational acceleration vector in that coordinate system. Simultaneously, the accelerometer in the IMU directly measures the linear acceleration of the vehicle. According to Newton's laws, this acceleration will cause the liquid inside the tank to experience an inertial force of opposite direction and equal magnitude, which manifests as an inertial acceleration vector per unit mass. Therefore, the negative value of the vehicle's acceleration vector can be directly taken as the inertial acceleration vector, i.e. .

[0092] After successfully separating the gravitational acceleration vector and the inertial force vector, the next step is to synthesize these two vectors to obtain a final force vector. This final vector comprehensively reflects the direction and intensity of the total equivalent gravitational field experienced by the liquid inside the tank at the current instant. Its physical significance is that, for the liquid inside the accelerating fire truck tank, its effective "below" is no longer directly below the Earth in the traditional sense, but rather the direction pointed to by this synthesized vector. Mathematically, this step is a simple vector addition operation. In the vehicle's dynamic coordinate system, the gravitational acceleration vector obtained in the previous step is... and inertial acceleration vector By adding the components together, we can obtain a final resultant force acceleration vector. This synthesis process unifies the forces from two different sources into a single, equivalent force field. This step significantly simplifies the problem model, cleverly transforming a fluid problem in a dynamic environment into a fluid problem in a static environment, but within a "tilted" equivalent gravitational field. The resulting final force vector precisely defines the direction of this equivalent gravitational field, providing the sole directional basis for determining the attitude of the theoretically stationary liquid surface.

[0093] After obtaining the final force vector representing the equivalent gravitational direction, a reference plane strictly perpendicular to this vector direction can be constructed in the digital space of the tank's geometric model. According to the basic principles of fluid statics, a liquid unaffected by external forces will inevitably adjust its shape on its free surface until it is perpendicular to the direction of the resultant force vector. Therefore, this constructed reference plane precisely represents the ideal tilt of the liquid surface in the tank if it could reach a completely stationary state under the current vehicle attitude and acceleration. In three-dimensional space, the mathematical expression of a plane is determined by its normal vector and a point on the plane. In this step, the normal vector of the reference plane... We can directly take it as the unit vector in the same direction as the final force vector. Therefore, the equation of this plane can be expressed as: ,in These are the three components of the normal vector. The coordinates are the coordinates of any point on the plane, while the constant k determines the specific position or height of the plane in space. However, at this step, the value of k has not yet been determined.

[0094] The reference plane, whose attitude is determined but whose position is uncertain, constructed in the previous step, is formally defined as the theoretical tilted liquid surface model. The fundamental function of this model is to provide a powerful theoretical reference and screening standard for subsequent processing of real liquid level sensor data, which is full of noise and outliers. It characterizes the stable state that the "main body" of the liquid should macroscopically approach, regardless of how violently the liquid inside the tank shakes or splashes under the current vehicle attitude. In practical applications, this theoretical model acts as a dynamic template; its real-time changing tilt angle perfectly compensates for the overall tilting effect of the liquid surface caused by vehicle acceleration, deceleration, and turning. When a large number of chaotic real liquid level measurement point clouds are obtained in subsequent steps, the degree of conformity between these point clouds and the theoretical model can be compared to determine which points are valid main liquid level data and which points are invalid anomalies caused by local surges or splashes. The final effect of this step is to complete a key modeling process and create a dynamic and idealized liquid surface reference. This benchmark model serves as a bridge between the vehicle's dynamic state and the fluid state inside the tank, making it possible to accurately extract real liquid level information from chaotic measured data.

[0095] In one implementation, based on a theoretical inclined liquid surface model, the original liquid level data is iteratively processed using a random sampling consensus algorithm to identify and remove abnormal data caused by violent liquid sloshing, and to filter out valid liquid level data that reflects the true liquid body. This includes the following steps:

[0096] The three-dimensional coordinate point set after the original liquid level data is converted is used as the input data points;

[0097] A minimum subset of points is randomly sampled from the input data points to fit and generate candidate liquid surfaces;

[0098] Calculate the geometric distance from all input data points to the candidate liquid surface, and count the number of inliers whose geometric distance is less than a preset error threshold;

[0099] Repeat the above sampling, fitting, and interior point statistics steps until the preset number of iterations is reached;

[0100] Among all the candidate liquid surfaces generated in the iterations, the candidate liquid surface with the most internal points is selected as the consensus liquid surface;

[0101] The set of interior points that constitute the consensus liquid level is defined as valid liquid level data, and other data points are identified as abnormal data and removed.

[0102] In this embodiment, the set of three-dimensional coordinate points converted from the ultrasonic sensor ranging results in the previous stage is used as the formal input to the algorithm. This input data is not a neat plane, but a chaotic three-dimensional point cloud, which mixes a large number of points representing the real liquid surface, as well as numerous interference points caused by violent liquid shaking, splashing, surface foam, or accidental measurement errors of the sensor itself. These interference points, i.e., outliers, are the main obstacles to subsequent accurate volume calculation. Therefore, the fundamental principle of this step is to clearly define the data object to be processed, that is, to completely submit this original point cloud, which mixes real signals and noise, to the subsequent iterative filtering algorithm. The implementation of this step involves converting all the three-dimensional coordinate points... Let S be a set where each point is defined by its x, y, z coordinates. Then, throughout the dataset, points on the real liquid surface (interior points) are numerically dominant, and they follow a common geometric model in space, namely a plane. Therefore, if a very small sample is drawn completely randomly from the dataset, there is a considerable probability that all the drawn sample points are exactly interior points.

[0103] The specific implementation involves randomly selecting the minimum number of points (three non-collinear points) needed to define a plane from the input complete point cloud S, forming a minimum point subset M. Using the three-dimensional coordinates of these three points, a candidate plane C passing through these three points can be uniquely calculated using analytical geometry. This candidate plane C represents a random guess or hypothesis about the true position and orientation of the liquid surface. This random sampling process is crucial to the algorithm's robustness because it allows it to avoid the interference of outliers from the outset and directly build the model based on potential real data. After generating a candidate liquid surface, this hypothesis needs to be validated immediately, i.e., its fit with the entire original dataset needs to be evaluated. The principle behind this step is that a good candidate liquid surface should be very close to a large number of points in the dataset, while a bad candidate liquid surface will only match a few points.

[0104] The specific implementation method is to traverse each data point in the input point set S. And calculate the shortest vertical geometric distance from that point to the current candidate liquid surface C. This distance The distance from a point to a plane can be obtained using the formula... To calculate, where It is the unit normal vector of the candidate plane C, and It is a constant that determines the planar position. Then, the calculated distance... It is compared with a pre-set error threshold. If If the value is less than the error threshold, then the point is considered to be... The candidate liquid surface is compatible and is marked as an interior point. Finally, the total number of points marked as interior points in this iteration is counted. The setting of this error threshold is crucial, as it defines the model's tolerance to the data.

[0105] To ensure that a globally optimal model is found, rather than a locally good result obtained by chance, the combined steps of random sampling, fitting plane, and interior point statistics described above need to be repeated multiple times. The principle behind this step is that through numerous random trials, the probability of sampling a "golden sample" composed entirely of interior points can be greatly increased, thus making it more likely to construct the best model that truly represents the main body of the liquid surface. Specifically, a loop is established that repeats the first two steps until a preset total number of iterations is reached. Each loop generates a new candidate liquid surface and its corresponding interior point count score, and the system records the results for each iteration. The choice of this number of iterations is a trade-off between computational cost and model optimality; its value can be dynamically determined based on the estimated proportion of outliers in the data to ensure a sufficiently high probability of finding a good solution within a limited time. After completing the preset number of iterations, the final decision-making stage begins, where the optimal candidate liquid surface is selected as the consensus liquid surface from all generated candidate liquid surfaces.

[0106] The specific implementation involves iterating through and comparing all candidate liquid surfaces and their corresponding interior point scores recorded in the previous step to find the candidate liquid surface with the largest number of interior points. This candidate liquid surface with the highest support rate is officially selected as the final consensus liquid surface. It is the geometric model that achieves the greatest consensus with the original data among all random attempts. The effect of this step is to filter and determine a unique and optimal liquid surface model from numerous possibilities. This model will serve as the final benchmark for all subsequent data cleaning and calculations. The final step is to use the determined consensus liquid surface to perform final classification and cleaning of the original data.

[0107] The specific implementation involves iterating through each point in the original input point set again and calculating its vertical distance to the consensus liquid surface selected in the previous step. All points with a distance less than the error threshold are formally classified as inliers and collected into a new set, defined as the effective liquid level data. Points with a distance greater than or equal to this threshold are identified as anomalous data caused by violent liquid sloshing or sensor noise and are completely removed from the dataset. This step effectively purifies the original liquid level data, outputting a clean, reliable set of core data points that accurately reflects the liquid's morphology, providing a high-quality data foundation for subsequent accurate calculations of the liquid's centroid and true effective volume.

[0108] In one implementation, the process of calculating the centroid of the effective liquid level data and coupling the centroid with the theoretical inclined liquid surface model and the tank geometry model, and then calculating the true effective volume of the liquid inside the fire truck tank under the current vehicle posture using a dynamic digital integration method, includes the following steps:

[0109] The centroid of the data is obtained by calculating a weighted average of all three-dimensional coordinate points in the effective liquid level data.

[0110] In the digital space of the tank's geometric model, a final cutting plane is defined by taking the data centroid as the positioning anchor point and combining it with the attitude of the theoretical inclined liquid surface model.

[0111] The tank geometry model is discretized into a predetermined number of three-dimensional voxel elements using a voxelization method.

[0112] Traverse all 3D voxel units and determine whether the geometric center of the 3D voxel unit is located below the final cutting plane;

[0113] The actual effective volume is obtained by summing the volumes of all voxel units located below the final cutting plane.

[0114] In this embodiment, after selecting effective liquid level data that can represent the true body of the liquid surface, in order to find a center point that best represents the central tendency of this discrete point cloud, a weighted average calculation is needed for all effective three-dimensional coordinate points to obtain the data centroid. The principle of this step is that even among effective data points, the reliability of readings from different sensors may vary. For example, readings with higher signal strength and better signal-to-noise ratio should be given higher confidence. By using a weighted average, these high-quality data points can be given greater influence, thereby calculating a more stable and accurate center point than a simple arithmetic mean. Specifically, the implementation method is to first calculate the centroid for each point in the effective data point set. Set a weighting coefficient The weighting coefficient is positively correlated with the signal quality of the data point. Then, the three-dimensional coordinate vector of each point is multiplied by its corresponding weighting coefficient, and all these weighted vectors are summed. Finally, the sum is divided by the total weighting coefficients. The calculation formula is as follows: .in This refers to the final obtained three-dimensional coordinates of the centroid of the data.

[0115] After obtaining the centroid of the data, the next step is to define a final, unique cutting plane in the digital space of the fire truck tank's geometric model. This cutting plane will serve as the precise boundary for subsequent volume calculations. The principle behind this step is to integrate two key pieces of information: the tilt direction representing the theoretical attitude of the liquid surface, and the positioning point representing the actual height of the liquid surface. By combining these two, a final liquid surface model that conforms to both vehicle dynamics and actual measurement data can be constructed. Specifically, the normal vector is first directly inherited from the previously constructed theoretical tilted liquid surface model. The direction of this normal vector perfectly compensates for the effects of gravity and vehicle inertia, defining the correct tilt attitude of the plane. Then, the centroid calculated in the previous step is... As a positioning anchor point, the final cutting plane must pass through this point. A plane that simultaneously satisfies a specific normal vector and passes through a specific point is uniquely determined.

[0116] After defining the final cutting plane, in order to actually perform volume calculations, the complex tank geometry model, usually composed of curved surfaces, needs to be discretized. This process is called voxelization. The principle behind this step is to approximate a continuous, complex geometry that is difficult to integrate directly into a set of numerous tiny, regular cubic units (i.e., voxels) with known volumes. This transformation turns a complex analytical geometry problem into a simple, computer-processable discrete counting problem. Specifically, a bounding box is first defined that completely encloses the entire tank geometry model. Then, this bounding box is uniformly divided into a three-dimensional mesh at a preset resolution. Each small cube in the mesh is a voxel. Subsequently, all voxels are traversed, and it is determined whether the geometric center point of each voxel is located inside the original, continuous tank geometry model. Only voxels with their center points inside the model are retained; the others are discarded. The effect of this step is to transform the smooth, continuous tank model into a digital approximation composed of a massive number of tiny cubic blocks. Although it has a stepped shape, as long as the voxels are small enough, its overall shape and volume can approximate the original model with extremely high precision, which facilitates the next step of unit-by-unit judgment and accumulation.

[0117] With the voxelized tank model and the final cutting plane, we can begin to determine which voxels belong to the liquid portion. The principle behind this step is to perform a simple geometric position determination on each voxel that makes up the tank model, precisely classifying it as located below the cutting plane (representing liquid) or above it (representing air). Specifically, this involves systematically traversing all the voxel units retained from the previous step. For each voxel, the coordinates of its geometric center are obtained. Then, the position of the center point is verified using the mathematical equation of the final cutting plane. This is done by calculating the expression... The value of can be used to determine its relative relationship with the plane. This is based on the normal vector. The definition of a voxel can be predefined by a criterion. For example, if the calculated result is less than or equal to zero, the center of the voxel is determined to be below the cutting plane or exactly on the plane. All voxels that meet this condition are marked as part of the liquid volume. The effect of this step is that the digitized tank model is precisely cut, clearly dividing all the tiny voxel units into two non-overlapping sets, laying a solid foundation for the final volume summation.

[0118] Finally, the volumes of all voxel units below the cutting plane are summed to obtain the true effective volume of the liquid inside the tank under the current vehicle attitude. This step is based on the discretization of the fundamental integration concept: the overall volume equals the sum of the volumes of all its tiny components. Since the complex shape and boundary issues have been simplified to counting regular cubes in the previous steps, this calculation becomes extremely simple and efficient. Specifically, the total number of voxels determined to be below the cutting plane in the previous step is first obtained. Then, multiply this number by the predefined volume of a single voxel. The volume of a single voxel is the cube of its side length, which is determined during voxelization. The final true effective volume V can be obtained using the formula... The calculations yielded the core result of this step: a single, quantified, and highly accurate volume value. This value dynamically reflects the liquid level inside the tank and has successfully eliminated various measurement interferences caused by changes in vehicle attitude and violent liquid sloshing.

[0119] In one embodiment, the weighted average calculation of all three-dimensional coordinate points in the effective liquid level data to obtain the data centroid includes the following steps:

[0120] Analyze the signal quality of each data point in the effective liquid level data. Signal quality includes signal strength and signal-to-noise ratio.

[0121] Assign a weighting coefficient that is positively correlated with signal quality to each data point;

[0122] Obtain the three-dimensional coordinates of each data point;

[0123] Multiply the three-dimensional coordinates of each data point by the corresponding weight coefficient;

[0124] The centroid of the data is obtained by summing all the weighted 3D coordinates and dividing by the sum of all weight coefficients.

[0125] In this implementation, before calculating the centroid of the data, the primary task is to perform an in-depth signal quality analysis on each three-dimensional coordinate point constituting the effective liquid level data. The fundamental principle behind this step is that not all valid data points that pass the screening process have equal reliability; some sensors may produce slightly lower quality data due to instantaneous liquid surface disturbances or weak echoes. To quantify this reliability difference, two core metrics need to be examined: signal strength and signal-to-noise ratio (SNR). Signal strength directly reflects the energy of the ultrasonic echo received by the sensor; a clear and strong echo usually corresponds to a more reliable measurement. The SNR is the ratio of signal energy to background noise energy, measuring how clearly the measurement signal stands out from surrounding environmental interference. Specifically, the implementation involves analyzing the original ultrasonic echo waveform corresponding to each data point, calculating its peak amplitude as the signal strength, and calculating the ratio of the average power within the signal frequency band to the average power within the noise frequency band as the SNR.

[0126] After completing the quantitative evaluation of the signal quality of each data point, the next step is to assign a positively correlated weight coefficient to each data point based on these quality indicators. The principle behind this step is that by assigning weights, data points with higher signal quality and greater reliability can be given more weight in the subsequent average calculation, while the influence of data points with lower signal quality is reduced. This results in the final calculated centroid location being closer to the region determined by the high-reliability data. Specifically, a pre-defined function or mapping relationship is designed to combine the signal strength and signal-to-noise ratio (SNR) indicators obtained in the previous step into a single weight coefficient value.

[0127] A simple and effective implementation method is to use linear combination, i.e., weighting coefficients. .in It is the final weight coefficient of the j-th data point. and These are the signal strength and signal-to-noise ratio at that point, respectively. and These are pre-defined normal values ​​used to balance the importance of these two quality indicators. For subsequent weighted calculations, the specific spatial location information of each valid data point must be obtained. While conceptually simple, this step is crucial in the logical flow, binding the "influence" (weighting coefficients) determined in the first two steps to the "existence" (spatial coordinates) of the data point itself. Each valid liquid level data point is essentially a three-dimensional coordinate system within the fire truck tank's coordinate system, composed of x, y, and z components. This coordinate precisely indicates the exact location of a point on the liquid surface at the moment of measurement. Specifically, for each data point in the dataset that has just been assigned a weighting coefficient, the system directly reads its corresponding three-dimensional coordinates from the storage unit. To facilitate vector operations, this three-dimensional coordinate is usually represented as a position vector. The effect of this step is to complete the final data preparation work before calculating the centroid, fully representing each data point as a data pair containing two parts of information: one is the three-dimensional coordinate vector representing its spatial location, and the other is the scalar weighting coefficient representing its data quality.

[0128] After preparing the 3D coordinates and corresponding weight coefficients for each data point, the first step of the weighted average calculation can begin: multiplying the 3D coordinates of each data point by its corresponding weight coefficient. The physical meaning of this step can be understood as adjusting the contribution of each position vector in the final summation. The larger the weight coefficient of a point, the longer the magnitude of the new weighted position vector after multiplication, meaning it will have a greater influence on the final result during the summation process. Conversely, for points with small weight coefficients, their position vectors will be shortened, and their influence will be correspondingly weakened.

[0129] The specific implementation involves performing a scalar-vector multiplication operation on each point in the dataset. That is, for the j-th point, its weighted position vector is calculated as follows: This operation applies to each component of the position vector, resulting in a new vector. Finally, by summing all the weighted 3D coordinates and dividing by the sum of all weight coefficients, the final data centroid can be calculated. This step is the standard conclusion of the weighted average method, which aggregates all weighted, independent point information into a central point that represents the overall distribution trend of the point cloud. The specific implementation involves two steps: First, all the weighted position vectors calculated in the previous step are summed to obtain a total resultant vector. Then, the sum of all original weight coefficients is calculated. Finally, the resultant vector is divided by the total weights; this process is called normalization, which ensures that the final result's dimensions are still position coordinates, rather than a vector amplified by the weights and lacking actual physical meaning. The calculation formula for the entire process is as follows: .in This refers to the final centroid coordinates of the data. The effect of this step is to output a single, highly stable 3D coordinate point. This point is the geometric center of the effective liquid point cloud after comprehensively considering the data quality of each point. It provides an extremely reliable positioning anchor point for subsequently defining the final cutting plane.

[0130] In one embodiment, the preset error threshold is a dynamic error threshold, and the dynamic error threshold is determined by the following steps:

[0131] Real-time analysis of dynamic attitude data is performed to calculate the root mean square values ​​of the acceleration and angular velocity of the fire truck within a preset time window, and the root mean square values ​​are used as a quantitative indicator to characterize the intensity of the vehicle's motion.

[0132] The basic error value is determined based on quantitative indicators and through a preset function mapping relationship;

[0133] Set the base error value as the dynamic error threshold used to determine interior points in the random sampling consensus algorithm.

[0134] In this implementation, to enable the selection criteria of the random sampling consensus algorithm to dynamically adapt to different driving conditions, it is first necessary to perform real-time analysis on the synchronously collected dynamic attitude data to accurately quantify the current intensity of the fire truck's movement. The principle behind this step is that the intensity of the vehicle's movement is directly related to the amplitude of the liquid sloshing within the tank; therefore, the dispersion of the liquid level data can be indirectly predicted by analyzing the vehicle's acceleration and angular velocity data. Specifically, a fixed-length sliding time window is used, for example, continuously collecting dynamic attitude data within the last two seconds. For each set of three-axis acceleration vectors and three-axis angular velocity vectors collected within this time window, their magnitudes are calculated, i.e., the total magnitudes of acceleration and angular velocity. Then, the root mean square (RMS) values ​​of all acceleration and angular velocity magnitudes within the window are calculated. The RMS value effectively reflects the average energy or fluctuation amplitude of the data over a period of time. Finally, through a weighted sum, the RMS values ​​of acceleration and angular velocity are merged into a single quantitative index M, as shown in the formula. As shown. Among them, and These are the root mean square values ​​of acceleration and angular velocity within the time window, respectively. and It is a preset coefficient used to adjust the relative importance of the two.

[0135] After obtaining the quantitative index characterizing the intensity of vehicle motion, the next step is to determine a base error value based on this index through a pre-defined function mapping relationship. The principle behind this step is to establish a direct mathematical relationship between "motion intensity" and "data point tolerance distance." When the vehicle is moving smoothly and the quantitative index M is small, it indicates slight liquid sloshing, and data points on the actual liquid surface will cluster closely around a single plane. In this case, a smaller error value should be used to achieve a more accurate fit. Conversely, when the vehicle is violently jolted and M is large, the liquid mass will be more dispersed. A larger error value is needed to encompass these valid data points that have deviated from the ideal plane due to sloshing, avoiding misclassification as outliers. A simple and effective implementation method is to use a piecewise linear function or a smooth nonlinear function for mapping. For example, a base error value can be set. It is directly proportional to the quantitative indicator M, and upper and lower limits are set to prevent its value from becoming too large or too small. Its calculation formula can be designed as follows: .in, It is the calculated basic error value. It is a pre-calibrated scaling factor used to control the sensitivity of the error value to changes in the intensity of exercise, while It is the minimum basic error value when the vehicle is completely stationary (i.e., when M is zero).

[0136] Finally, the baseline error value calculated in the previous step is directly set as the core parameter used in the random sample consensus algorithm to determine whether a point is an inlier or an outlier, i.e., the dynamic error threshold. The principle behind this step is to apply the results of all previous analysis and calculations to the core of data filtering, enabling the algorithm's "judgment criteria" to be adjusted in real-time and automatically based on the actual driving state of the vehicle. Specifically, in each iteration of the random sample consensus algorithm, when calculating the geometric distance from all input data points to the current candidate liquid surface and determining whether it is an inlier, a fixed, pre-written threshold is no longer used. Instead, the dynamically calculated error threshold is directly invoked. In other words, the condition for a data point to be considered an inlier becomes that its distance to the candidate liquid surface must be less than the value at the current moment. Since this judgment criterion changes dynamically with the vehicle's movement state, it also changes dynamically. The ultimate effect of this step is to greatly improve the robustness and adaptability of the liquid level data filtering algorithm. Under smooth road conditions, the algorithm operates in high-precision mode; under bumpy road conditions, the algorithm automatically switches to high-tolerance mode, thereby ensuring that it can accurately identify the effective data representing the liquid body in various complex real-world working scenarios and achieve stable and reliable liquid level monitoring.

[0137] In one embodiment, the calculation of the volume change rate and liquid level stability includes the following steps:

[0138] The continuously calculated true effective volume is stored as volume sequence data;

[0139] A Kalman filter is applied to the volumetric sequence data for smoothing to eliminate computational noise.

[0140] Perform a first-order difference operation on the filtered volumetric sequence data to obtain the volume change rate;

[0141] The angular velocity data from continuously acquired dynamic attitude data is stored as volumetric sequence data;

[0142] Calculate the standard deviation of the angular velocity volume sequence data within the sliding time window, and use this standard deviation as the liquid surface stability.

[0143] In this embodiment, to perform feedforward control of the fire truck's water pump, it is first necessary to organize the continuously calculated true effective volume into a data structure that reflects its dynamic changing trend. The principle behind this step is that a single, isolated volume reading can only reflect the stock at a particular instant and cannot reveal the rate of consumption or replenishment. Only by arranging these instantaneous values ​​in chronological order to form a time series can subsequent trend analysis and rate of change calculation be possible. Specifically, whenever the system calculates a new true effective volume value... When a new data item is added, it is stored along with its corresponding timestamp into a fixed-length first-in-first-out (FIFO) queue. When the queue is full, the oldest data item in the queue is discarded as soon as the newest data is added. In this way, the system always maintains a volumetric sequence of data containing the most recent historical information.

[0144] After obtaining the original volume sequence data, a Kalman filter is applied to it to obtain a smooth curve that truly reflects the main trend of volume change. The principle behind this step is that even after multiple geometric filtering processes, the final calculated volume sequence inevitably contains high-frequency computational noise introduced by model approximation, calculation errors, or minor vibrations. Directly differentiating this noisy sequence yields an extremely unstable and meaningless rate of change. The Kalman filter is an optimal recursive data processing algorithm that can estimate the true state of the system in a noisy environment through continuous prediction and correction. Specifically, a simple state-space model is established to describe the volume change, and the newly calculated volume value at each time step is input as the observation value into the filter. The filter combines the optimal estimate from the previous time step with the current observation value to provide a more reliable smoothed volume estimate for the current time step. .

[0145] After smoothing the volume sequence data, a first-order difference operation can be performed to accurately obtain the rate of change of liquid volume. This step utilizes the definition of the derivative in calculus, where the rate of change is the derivative of the state quantity with respect to time. In a discrete time series, the derivative can be approximated by the difference between two adjacent data points. Since a very smooth volume curve has already been obtained through a Kalman filter, the difference operation now yields a stable and meaningful rate of change value, directly reflecting the current rate of consumption of fire-fighting water or the rate at which water is being added to the tank. Specifically, the filtered volume value at the current moment is taken. Compared with the filtered volume value of the previous time step Subtract the two and then divide by the time interval between the two measurements. The calculation formula is as follows: .in, This is the obtained rate of change of volume.

[0146] To obtain another crucial control parameter, namely liquid surface stability, the angular velocity information from continuously acquired dynamic attitude data needs to be stored as a time series. The principle behind this step is that the primary factors causing severe sloshing of the liquid inside the tank are rapid turns, U-turns, or lateral swaying on uneven surfaces by the vehicle; these movements are dynamically manifested as significant angular velocities. Therefore, by analyzing the changes in angular velocity data, the stable state of the liquid surface can be inferred very effectively and indirectly. Specifically, for the three-axis angular velocity vectors continuously acquired from the inertial measurement unit, the total magnitude of the angular velocity at each moment, i.e., the modulus of the angular velocity vector, is first calculated. Then, these modulus values ​​are stored in chronological order within a fixed-length sliding time window or a first-in-first-out queue. The effect of this step is to construct a historical data record reflecting the recent intensity of the fire truck's rotational motion; this angular velocity series captures all the key dynamic information that could lead to liquid sloshing.

[0147] Finally, by calculating the standard deviation of the angular velocity sequence within the sliding time window, a quantitative index characterizing the stability of the liquid surface can be obtained. The principle behind this step is that standard deviation is a statistical measure of the dispersion or volatility of a set of data. If the vehicle is moving smoothly or stationary, its angular velocity will be small and change gradually, and the standard deviation of the angular velocity sequence will be close to zero, corresponding to a stable liquid surface. Conversely, if the vehicle frequently and violently turns or sways in a short period, its angular velocity value will fluctuate violently, causing its standard deviation to become large, corresponding to a very unstable, violently shaking liquid surface. Specifically, the standard deviation of the angular velocity sequence data stored in the previous step is calculated over the entire sliding time window. This standard deviation is directly defined as the liquid surface stability index. The effect of this step is to output another core dynamic control parameter, which uses a single value to accurately quantify the intensity of the current sloshing of the liquid in the tank, providing a crucial decision input for the fuzzy control system to comprehensively consider safety and stability when adjusting the water pump's operating state.

[0148] In one embodiment, combining the volume change rate calculated based on the actual effective volume and the liquid level stability of the liquid inside the fire truck tank calculated from dynamic attitude data, an adaptive feedforward control of the fire truck's fire pump operating state using a fuzzy control strategy includes the following steps:

[0149] Establish fuzzy membership functions for three input variables: true effective volume, volume change rate, and liquid surface stability;

[0150] Construct a fuzzy rule library containing multiple fuzzy rules that describe the logical relationship between input variables and fire truck fire pump control commands;

[0151] The three input variables acquired in real time are fuzzified to obtain the membership degree of the input variables on their respective fuzzy subsets;

[0152] The fuzzy inference engine matches and activates the corresponding fuzzy rules in the fuzzy rule base.

[0153] The inference results of the activated fuzzy rules are defuzzified to generate control signals for adjusting the working state of the fire pump.

[0154] In this implementation, to construct an intelligent control system capable of mimicking human expert decision-making, the first step is to establish fuzzy membership functions for the system's three input variables: actual effective volume, volume change rate, and liquid level stability. The principle behind this step is to transform precise, black-and-white numerical measurements into qualitative descriptions with fuzzy boundaries that conform to human language habits. For example, for actual effective volume, humans wouldn't perceive a fundamental difference between 49.9% and 50.1%, but would categorize both as "medium." The membership function is the mathematical tool used to define this degree of "belonging." Specifically, several fuzzy subsets are defined for each input variable, such as dividing "actual effective volume" into five subsets: {empty, low, medium, high, full}. Then, a membership function is designed for each subset. This function is typically triangular or trapezoidal, with the horizontal axis representing the range of the input variable and the vertical axis representing the membership degree, ranging from 0 to 1. A specific input value can simultaneously possess non-zero membership degrees on multiple fuzzy subsets, which is the core of fuzzy logic. Next, a fuzzy rule base needs to be constructed; this is the core and soul of the entire fuzzy control system, containing multiple fuzzy rules describing the logical relationship between input variables and the final fire pump control commands. The principle behind this step is to encapsulate and express the experience and intuitive judgment of seasoned fire operators through a series of simple IF-THEN statements. Compared to attempting to establish a complex, unified mathematical control equation, this rule-based approach is more flexible, intuitive, and easier to modify and extend.

[0155] The specific implementation involves domain experts formulating rules. Each rule maps a combination of three fuzzy states of input variables to a fuzzy state of an output variable. For example, a rule might be: IF the true effective volume is "low" AND the volume change rate is "rapidly decreasing" AND the liquid level stability is "stable" THEN the fire pump control should "significantly increase". The entire rule base will contain dozens of such rules, striving to cover all possible combinations of operating conditions, thereby ensuring that the system can respond reasonably under any circumstances. The effect of this step is to create a complete, computer-executable "expert operating manual," transforming unstructured human experience into a structured knowledge base that can be used for automated reasoning. After the fuzzy membership functions and rule base are established, the system can enter the real-time operation phase. In this phase, the three precise input variables acquired in real time first need to be fuzzified. The principle of this step is to use the membership functions established in the first step to convert the currently measured specific values ​​into their membership degrees on various fuzzy subsets. This is a crucial process of mapping information from the precise world to the fuzzy world.

[0156] The specific implementation method is as follows: after receiving the precise values ​​of the current effective volume, volume change rate, and liquid level stability, the system substitutes these three values ​​into their respective membership functions for calculation. For example, if the current effective volume is 65%, the system will consult its membership function and may find that its membership degree for "medium" is 0.4, for "high" it is 0.6, and for other subsets it is 0. The calculation process of its membership degree can be represented as follows: , represents the membership degree of the precise input value x on the fuzzy subset A.

[0157] After obtaining the fuzzy membership degrees of all input variables, the fuzzy inference engine begins its work, its task being to match and activate the corresponding rules in the fuzzy rule base. This step simulates the human logical reasoning process, that is, inferring the corresponding "conclusion" based on the current "premise" conditions. The inference engine evaluates each rule in the rule base one by one. For the IF premise part of each rule, if it consists of multiple conditions connected by AND, then the "trigger strength" or "activation degree" of this rule is usually taken as the minimum value of the membership degrees of all premise conditions. This process ensures that the conclusion of the rule can only be activated when all premise conditions are satisfied to a certain extent. Then, this calculated activation degree is used to modify the output fuzzy set corresponding to the THEN conclusion part of the rule. A common method is to "prune" the membership function of the output fuzzy set (e.g., "significantly increase") in height, so that its highest point does not exceed the calculated activation degree. The effect of this step is that, based on the current real-time input, all relevant rules are filtered from the entire rule base, and a series of activated fuzzy output conclusions with different weights are generated according to the degree to which their premises are satisfied.

[0158] Finally, the inference results of all activated rules are defuzzified to generate a single, precise control signal that can be used to adjust the operating status of the fire pump. The principle behind this step is that the result of fuzzy inference is a set of modified fuzzy conclusions representing various possible outputs. This fuzzy, distributed set of suggestions must be synthesized into a clear and unique execution command. The most commonly used defuzzification method is the centroid method. Specifically, all activated, clipped output fuzzy sets are first superimposed to form a single, potentially irregularly shaped aggregated fuzzy set. Then, the abscissa position of the geometric centroid (or center of mass) of this aggregated shape is calculated. The formula for calculating the centroid is... Where z is the value of the output control quantity. It is the membership degree of the aggregated fuzzy set at point z, while It is the final calculated precise control value.

[0159] The present invention also discloses a fire pump control system based on fire truck liquid level data acquisition, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the fire pump control method based on fire truck liquid level data acquisition as described in any of the above embodiments.

[0160] The processor can be a central processing unit (CPU). Of course, depending on the actual use, it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc., and this application does not limit it.

[0161] The memory can be an internal storage unit of a computer device, such as a hard disk or RAM, or an external storage device, such as a plug-in hard disk, smart memory card (SMC), secure digital card (SD), or flash memory card (FC) provided on the computer device. Furthermore, the memory can be a combination of internal storage units and external storage devices of a computer device. The memory is used to store computer programs and other programs and data required by the computer device. The memory can also be used to temporarily store data that has been output or will be output. This application does not limit this.

[0162] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of protection of this application is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of one or more embodiments of this application as described above, which are not provided in detail for the sake of brevity.

[0163] One or more embodiments in this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of this application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments in this application should be included within the protection scope of this application.

Claims

1. A fire pump control method based on fire truck liquid level data acquisition, characterized in that, Includes the following steps: Simultaneously collect dynamic attitude data of the fire truck during its movement and raw liquid level data from multiple liquid level sensors distributed inside the fire truck's tank; Load the tank geometry model of the fire truck from the preset storage unit; The gravitational acceleration vector and the inertial force vector generated by the vehicle motion are extracted from the dynamic attitude data; By vector synthesis of the gravitational acceleration vector and the inertial force vector, the final force vector characterizing the resultant force on the liquid inside the fire truck tank is obtained; Construct a reference plane perpendicular to the final force vector within the coordinate system of the tank's geometric model; The reference plane is used as a theoretical inclined liquid surface model to characterize the liquid surface shape that should exist in the fire truck tank when the liquid is stationary under the current vehicle posture. Based on the theoretical inclined liquid surface model, the random sampling consensus algorithm is used to iteratively process the original liquid level data, identify and remove abnormal data caused by violent liquid shaking, and screen out the effective liquid level data that reflects the true liquid body. The centroid of the data is obtained by calculating a weighted average of all three-dimensional coordinate points in the effective liquid level data. In the digital space of the tank's geometric model, a final cutting plane is defined by taking the data centroid as the positioning anchor point and combining it with the attitude of the theoretical inclined liquid surface model. The tank geometry model is discretized into a predetermined number of three-dimensional voxel elements using a voxelization method. Traverse all 3D voxel units and determine whether the geometric center of the 3D voxel unit is located below the final cutting plane; The actual effective volume is obtained by summing the volumes of all voxel units located below the final cutting plane; Combining the volume change rate calculated based on the actual effective volume and the liquid level stability of the liquid inside the fire truck tank calculated from dynamic attitude data, a fuzzy control strategy is adopted to perform adaptive feedforward control on the working state of the fire truck's fire pump.

2. The fire pump control method based on fire truck liquid level data acquisition according to claim 1, characterized in that, The process of synchronously acquiring dynamic attitude data of the fire truck during its movement and raw liquid level data from multiple liquid level sensors distributed inside the fire truck's tank includes the following steps: Dynamic attitude data is collected at a preset frequency by an inertial measurement unit installed at the center of gravity of the fire truck. The dynamic attitude data includes triaxial acceleration and triaxial angular velocity information. Each sensor in the ultrasonic level sensor array, which is evenly distributed on the inner wall of the fire truck tank, independently measures the vertical distance from its own position to the liquid surface. The vertical distances measured by all sensors are converted into three-dimensional coordinate points in the coordinate system of the fire truck tank to form the original liquid level data; Add a synchronization timestamp to the dynamic attitude data and the original liquid level data.

3. The fire pump control method based on fire truck liquid level data acquisition according to claim 2, characterized in that, The process of using a theoretical inclined liquid surface model as a benchmark and employing a random sampling consensus algorithm to iteratively process the original liquid level data, identifying and eliminating abnormal data caused by violent liquid sloshing, and filtering out valid liquid level data that reflects the true liquid volume includes the following steps: The three-dimensional coordinate point set after the original liquid level data is converted is used as the input data points; A minimum subset of points is randomly sampled from the input data points to fit and generate candidate liquid surfaces; Calculate the geometric distance from all input data points to the candidate liquid surface, and count the number of inliers whose geometric distance is less than a preset error threshold; Repeat the above sampling, fitting, and interior point statistics steps until the preset number of iterations is reached; Among all the candidate liquid surfaces generated in the iterations, the candidate liquid surface with the most internal points is selected as the consensus liquid surface; The set of interior points that constitute the consensus liquid level is defined as valid liquid level data, and other data points are identified as abnormal data and removed.

4. The fire pump control method based on fire truck liquid level data acquisition according to claim 1, characterized in that, The step of calculating the weighted average of all three-dimensional coordinate points in the effective liquid level data to obtain the data centroid includes the following steps: Analyze the signal quality of each data point in the effective liquid level data. Signal quality includes signal strength and signal-to-noise ratio. Assign a weighting coefficient that is positively correlated with signal quality to each data point; Obtain the three-dimensional coordinates of each data point; Multiply the three-dimensional coordinates of each data point by the corresponding weight coefficient; The centroid of the data is obtained by summing all the weighted 3D coordinates and dividing by the sum of all weight coefficients.

5. The fire pump control method based on fire truck liquid level data acquisition according to claim 3, characterized in that, The preset error threshold is a dynamic error threshold, and the determination of the dynamic error threshold includes the following steps: Real-time analysis of dynamic attitude data is performed to calculate the root mean square values ​​of the acceleration and angular velocity of the fire truck within a preset time window, and the root mean square values ​​are used as a quantitative indicator to characterize the intensity of the vehicle's motion. The basic error value is determined based on quantitative indicators and through a preset function mapping relationship; Set the base error value as the dynamic error threshold used to determine interior points in the random sampling consensus algorithm.

6. The fire pump control method based on fire truck liquid level data acquisition according to claim 1, characterized in that, The calculation method for the volume change rate and liquid level stability includes the following steps: The continuously calculated true effective volume is stored as volume sequence data; A Kalman filter is applied to the volumetric sequence data for smoothing to eliminate computational noise. Perform a first-order difference operation on the filtered volumetric sequence data to obtain the volume change rate; The angular velocity data from continuously acquired dynamic attitude data is stored as volumetric sequence data; Calculate the standard deviation of the angular velocity volume sequence data within the sliding time window, and use this standard deviation as the liquid surface stability.

7. The fire pump control method based on fire truck liquid level data acquisition according to claim 6, characterized in that, The adaptive feedforward control of the fire truck's fire pump's operating state using a fuzzy control strategy, combining the volume change rate calculated based on the actual effective volume and the liquid level stability of the liquid inside the fire truck's tank calculated from dynamic attitude data, includes the following steps: Establish fuzzy membership functions for three input variables: true effective volume, volume change rate, and liquid surface stability; Construct a fuzzy rule library containing multiple fuzzy rules that describe the logical relationship between input variables and fire truck fire pump control commands; The three input variables acquired in real time are fuzzified to obtain the membership degree of the input variables on their respective fuzzy subsets; The fuzzy inference engine matches and activates the corresponding fuzzy rules in the fuzzy rule base. The inference results of the activated fuzzy rules are defuzzified to generate control signals for adjusting the working state of the fire pump.

8. A fire pump control system based on fire truck liquid level data acquisition, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the fire pump control method based on fire truck liquid level data acquisition as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for measuring liquid level in liquid tank and engineering machinery

    CN113324614A

  • Fire fighting truck liquid level data acquisition, display and control system

    CN114602099A