Liquid volume detection method and device and computer equipment

By using the signal sending and receiving units in the liquid volume detection unit to obtain time interval and angle information, establish feature vectors and input them into the volume detection model, the accuracy of liquid volume detection in the motion state is solved, real-time and accurate Liquid volume monitoring.

CN119469316APending Publication Date: 2025-02-18CCORE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411551050.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The prior art is difficult to accurately detect the volume of liquid in a large-capacity container in a state of motion. The traditional method has a large measurement error when the container moves, which cannot meet the real-time monitoring needs.

Method used

Using the liquid volume detection unit, the time interval and angle information of the liquid volume are obtained through the signal sending unit and the signal receiving unit, the first volume characteristic vector and the second volume characteristic vector are established, and input into the preset volume detection model to perform liquid Volume prediction.

Benefits of technology

Accurate detection of liquid volume in motion is achieved, measurement error is reduced, and the volume of liquid in the container in a dynamic environment can be monitored in real time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119469316A_ABST
    Figure CN119469316A_ABST
Patent Text Reader

Abstract

The invention relates to a liquid volume detection method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: respectively acquiring time intervals from different signal transmitting units to corresponding signal receiving units to receive signals, and acquiring a rolling angle, a pitch angle and respectively corresponding angle change accelerations of the liquid level in a container according to an angle detection unit; establishing a first volume feature vector of the liquid in the container according to the plurality of time intervals; establishing a second volume feature vector of the liquid in the container according to the rolling angle and the pitch angle of the volume of the liquid in the container and the corresponding angle change accelerations; and inputting the first volume feature vector and the second volume feature vector into a preset volume detection model to obtain the volume of the liquid in the container. By adopting the method, the liquid volume detection accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, device, computer equipment, storage medium and computer program product for detecting liquid volume. Background Art

[0002] With the continuous development of automated detection, volume detection of large-capacity containers is becoming increasingly important. For example, the detection of the remaining oil in the fuel tank of a car in motion. Accurate oil monitoring is not only related to driving safety and travel convenience, but also directly affects the fuel economy and environmental friendliness of the vehicle. Traditional volume detection technologies mainly include graduated bottle observation method, photoelectric liquid level measurement method and capacitive liquid level measurement method. These methods are usually suitable for measuring the volume of liquid in a static container and cannot meet the real-time monitoring needs in motion.

[0003] In the prior art, pressure sensors are often used to minimize measurement errors caused by motion. However, during the movement of the container, the constant shaking of the liquid in the container also interferes with the reading of the pressure sensor, resulting in large measurement errors. This makes accurate volume detection in motion very complicated and difficult to meet the needs of actual use. Summary of the invention

[0004] Based on this, it is necessary to provide a liquid volume detection method, device, computer equipment, computer readable storage medium and computer program product to address the above technical problems.

[0005] In a first aspect, the present application provides a method for detecting liquid volume. The method comprises:

[0006] A liquid volume detection unit applied to a container, the liquid volume detection unit being electrically connected to a plurality of signal sending units, a plurality of signal receiving units and an angle detection unit; the signal sending unit being used to send signals to different positions of the liquid; the signal being reflected by the liquid surface to the signal receiving unit corresponding to the signal sending unit; the method comprising:

[0007] Respectively obtain the time intervals from when different signal sending units send signals to when corresponding signal receiving units receive signals, and obtain the roll angle, pitch angle and corresponding angle change acceleration of the liquid surface in the container according to the angle detection unit;

[0008] Establishing a first volume feature vector of the liquid in the container according to the plurality of time intervals;

[0009] Establishing a second volume feature vector of the liquid in the container according to the roll angle, the pitch angle and the corresponding angular change acceleration of the volume of the liquid in the container;

[0010] The first volume feature vector and the second volume feature vector are input into a preset volume detection model to obtain the volume of the liquid in the container.

[0011] In one embodiment, obtaining the volume detection model includes:

[0012] Establishing an initial volume detection model, and obtaining different sample volumes and corresponding first sample feature vectors and second sample feature vectors; wherein the initial volume detection model is designed based on a deep learning algorithm;

[0013] Inputting the first sample feature vector and the second sample feature vector into an initial volume detection model, and outputting a prediction result;

[0014] Based on the difference between the prediction result and the corresponding sample volume, the initial volume detection model is iteratively adjusted to obtain a volume detection model.

[0015] In one embodiment, obtaining different sample volumes and corresponding first sample feature vectors and second sample feature vectors includes:

[0016] Obtain the maximum liquid volume, maximum roll angle, maximum pitch angle, and maximum angular change acceleration of the container;

[0017] Using a preset volume unit parameter and the maximum liquid volume, a plurality of sample volumes are obtained;

[0018] Using a preset roll angle unit parameter and the maximum roll angle, a plurality of roll angle samples are obtained;

[0019] Using a preset pitch angle unit parameter and the maximum pitch angle, a plurality of pitch angle samples are obtained;

[0020] Using the preset angle change acceleration unit parameter and the maximum angle change acceleration, a plurality of angle change acceleration samples are obtained;

[0021] Obtaining the time intervals from when different signal sending units corresponding to different volume samples, roll angle samples, pitch angle samples, and angle change acceleration samples send signals to when corresponding signal receiving units receive signals, and obtaining a plurality of time interval samples;

[0022] Establishing a first sample feature vector corresponding to the sample volume according to the multiple time interval samples;

[0023] A second sample feature vector corresponding to the sample volume is established according to the roll angle samples, the pitch angle samples, the angle change acceleration samples and the corresponding time interval samples.

[0024] In one embodiment, the step of establishing a first volume feature vector of the liquid in the container and establishing a second volume feature vector of the liquid in the container comprises:

[0025] Using a preset normalization strategy, a plurality of the time intervals, the roll angles, the pitch angles of the liquid volume in the container, and the corresponding angular change accelerations are normalized to obtain time interval parameters, the roll angle parameters, the pitch angle parameters of the liquid volume in the container, and the corresponding angular change acceleration parameters;

[0026] Using each of the time interval parameters as each dimension of the first volume feature vector to establish the first volume feature vector;

[0027] The roll angle parameter, pitch angle parameter and corresponding angle change acceleration parameters of the volume of the liquid in the container are used as dimensions of the second volume feature vector to establish the second volume feature vector.

[0028] In one embodiment, after obtaining the time interval parameter, the roll angle parameter of the liquid volume in the container, the pitch angle parameter and the corresponding angle change acceleration parameters, the method further includes:

[0029] When the detection data parameter is greater than a preset threshold, the parameter is modified to the threshold; the detection data parameter includes a time interval parameter, a roll angle parameter of the liquid volume in the container, a pitch angle parameter and corresponding angle change acceleration parameters.

[0030] In one embodiment, inputting the first volume feature vector and the second volume feature vector into a preset volume detection model to obtain the volume of the liquid in the container includes:

[0031] Inputting the first volume feature vector and the second volume feature vector into a preset volume detection model to obtain a predicted volume of the liquid in the container;

[0032] Obtaining the predicted volume of the liquid in the container for a continuous preset time period before the current time;

[0033] According to the volume of the liquid in the container in multiple time periods, the frequency of each time period in which each predicted volume appears is counted;

[0034] According to the frequency of the time period, a target volume of the liquid in the container is determined.

[0035] In a second aspect, the present application also provides a liquid volume detection device. A liquid volume detection unit applied to a container, the liquid volume detection unit is electrically connected to a plurality of signal sending units, a plurality of signal receiving units, and an angle detection unit; the signal sending unit is used to send signals to different positions of the liquid; the signal is reflected by the liquid surface to the signal receiving unit corresponding to the signal sending unit; the device comprises:

[0036] A data detection module, used to respectively obtain the time intervals from when different signal sending units send signals to when corresponding signal receiving units receive signals, and to obtain the roll angle, pitch angle and corresponding angle change acceleration of the liquid surface in the container according to the angle detection unit;

[0037] A feature vector establishing module, used for establishing a first volume feature vector of the liquid in the container according to the plurality of time intervals;

[0038] The feature vector establishing module is further used to establish a second volume feature vector of the liquid in the container according to the roll angle, pitch angle and corresponding angular change acceleration of the volume of the liquid in the container;

[0039] The liquid volume prediction module is used to input the first volume feature vector and the second volume feature vector into a preset volume detection model to obtain the volume of the liquid in the container.

[0040] In one embodiment, the device further includes a model training module, wherein the model training module is used to:

[0041] Establishing an initial volume detection model, and obtaining different sample volumes and corresponding first sample feature vectors and second sample feature vectors; wherein the initial volume detection model is designed based on a deep learning algorithm;

[0042] Inputting the first sample feature vector and the second sample feature vector into an initial volume detection model, and outputting a prediction result;

[0043] Based on the difference between the prediction result and the corresponding sample volume, the initial volume detection model is iteratively adjusted to obtain a volume detection model.

[0044] In one embodiment, the feature vector establishment module includes:

[0045] A data acquisition submodule is used to obtain the maximum liquid volume, maximum roll angle, maximum pitch angle and maximum angle change acceleration of the container;

[0046] A sample determination submodule, used to obtain multiple sample volumes using a preset volume unit parameter and the maximum liquid volume;

[0047] The sample determination submodule is further used to obtain a plurality of roll angle samples using a preset roll angle unit parameter and the maximum roll angle;

[0048] The sample determination submodule is further used to obtain a plurality of pitch angle samples by using a preset pitch angle unit parameter and the maximum pitch angle;

[0049] The sample determination submodule is further used to obtain a plurality of angle change acceleration samples using a preset angle change acceleration unit parameter and the maximum angle change acceleration;

[0050] The sample determination submodule is further used to obtain the time intervals from when different signal sending units corresponding to different volume samples, roll angle samples, pitch angle samples, and angle change acceleration samples send signals to when corresponding signal receiving units receive signals, and obtain multiple time interval samples;

[0051] A feature vector establishing submodule, used to establish a first sample feature vector corresponding to the sample volume according to the multiple time interval samples;

[0052] The feature vector establishing submodule is further used to establish a second sample feature vector corresponding to the sample volume according to the roll angle samples, the pitch angle samples, the angle change acceleration samples and the corresponding time interval samples.

[0053] In one embodiment, the feature vector establishment module includes:

[0054] A normalization submodule, for performing normalization processing on the plurality of time intervals, the roll angle, the pitch angle of the liquid volume in the container, and the corresponding angular change accelerations by using a preset normalization strategy, to obtain time interval parameters, the roll angle parameters, the pitch angle parameters, and the corresponding angular change acceleration parameters of the liquid volume in the container;

[0055] A feature vector establishing submodule, used for establishing the first volume feature vector by taking each of the time interval parameters as each dimension of the first volume feature vector;

[0056] The feature vector establishing submodule is further used to use the roll angle parameter, pitch angle parameter and corresponding angle change acceleration parameters of the liquid volume in the container as dimensions of the second volume feature vector to establish the second volume feature vector.

[0057] In one embodiment, the normalization submodule further includes:

[0058] A data truncation unit is used to modify the parameter to a preset threshold when the detection data parameter is greater than the threshold; the detection data parameter includes a time interval parameter, a roll angle parameter of the liquid volume in the container, a pitch angle parameter and corresponding angle change acceleration parameters.

[0059] In one embodiment, the liquid volume prediction module comprises:

[0060] A predicted volume acquisition submodule, used for inputting the first volume feature vector and the second volume feature vector into a preset volume detection model to obtain a predicted volume of the liquid in the container;

[0061] The predicted volume acquisition submodule is further used to acquire the predicted volume of the liquid in the container in a continuous preset time period before the current time;

[0062] The time frequency submodule is used to count the time period frequency of each predicted volume according to the volume of the liquid in the container in multiple time periods;

[0063] The target volume determination submodule is used to determine the target volume of the liquid in the container according to the time period frequency.

[0064] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the liquid volume detection method as described in any one of the embodiments of the present disclosure is implemented.

[0065] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the liquid volume detection method as described in any one of the embodiments of the present disclosure is implemented.

[0066] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for detecting the volume of liquid as described in any one of the embodiments of the present disclosure is implemented.

[0067] The above-mentioned liquid volume detection method, device, computer equipment, storage medium and computer program product, by using a signal receiving unit and a signal sending unit, obtains the time interval between multiple signal sending units sending signals to the liquid surface and the liquid surface reflection signal to the signal receiving unit, as well as the angle information of the liquid surface in the container, respectively uses the time interval and the angle information to establish the first volume feature vector and the second volume feature vector, and outputs the first volume feature vector and the second volume feature vector to the preset volume detection model to obtain the volume of the liquid in the container. Through different signal sending units, signal receiving units and angle detection units, each time interval and the roll angle, pitch angle and the corresponding angle change acceleration can be accurately obtained, so that the first volume feature vector and the second volume feature vector can be accurately established, providing a data basis for the subsequent volume determination, and improving the accuracy of the detection of the liquid volume in the container. At the same time, by combining the signal sending and receiving and the angle detection to realize the liquid volume detection, the volume of the liquid in the container under the dynamic environment can be detected in real time, which can effectively deal with the measurement error caused by the shaking of the liquid in the container, and improve the accuracy of the liquid volume measurement. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] FIG1 is a schematic flow chart of a method for detecting liquid volume in one embodiment;

[0069] FIG2 is a diagram of a first application environment of a method for detecting liquid volume in one embodiment;

[0070] FIG3 is a diagram of a second application environment of a method for detecting liquid volume in one embodiment;

[0071] FIG4 is a schematic diagram of a flow chart of volume detection model prediction in one embodiment;

[0072] FIG5 is a schematic diagram of volume detection model data processing in one embodiment;

[0073] FIG6 is a schematic diagram of a flow chart of volume detection model training in one embodiment;

[0074] FIG7 is a schematic diagram of a first process of obtaining a sample feature vector in one embodiment;

[0075] FIG8 is a schematic diagram of a second process of obtaining a sample feature vector in one embodiment;

[0076] FIG9 is a schematic diagram of a process for determining a target volume in another embodiment;

[0077] FIG10 is a block diagram of a liquid volume detection device according to an embodiment;

[0078] FIG11 is a block diagram of a liquid volume detection device according to an embodiment of the present invention;

[0079] FIG. 12 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0080] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0081] In one embodiment, as shown in FIG1 , a method for detecting liquid volume is provided, which is applied to a liquid volume detection unit of a container, wherein the liquid volume detection unit is electrically connected to a plurality of signal sending units, a plurality of signal receiving units, and an angle detection unit; the signal sending unit is used to send signals to different positions of the liquid; the signal is reflected by the liquid surface to the signal receiving unit corresponding to the signal sending unit; this embodiment uses the method applied to a terminal as an example, and it is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0082] Step S100, respectively obtaining the time intervals from when different signal sending units send signals to when corresponding signal receiving units receive signals, and obtaining the roll angle, pitch angle and corresponding angular change acceleration of the liquid surface in the container according to the angle detection unit.

[0083] In an exemplary embodiment, the volume detection unit can be as shown in Figure 2, wherein the angle detection unit 101 detects the angle information of the liquid surface, and the signal time detection unit 102 is used to record the signal flight time; the signal sending unit 103 is used to send the signal, and the signal receiving unit 104 is used to receive the signal, the container 105, the liquid surface 106, the signal sending unit sends the signal 107, the signal 108 is generated by the liquid surface emission, the height of the container 109, and the distance 110 between the liquid surface and the top of the container, etc.

[0084] In an exemplary embodiment, the volume detection unit may be as shown in FIG. 3 , wherein 401 represents a volume detection unit, signal time detection units 403 , 404 , 405 , 406 each include a signal receiving unit and a signal sending unit, and an angle detection unit 402 is used to detect angle information of a liquid surface, etc.

[0085] In an exemplary embodiment, the signal receiving unit and the signal sending unit can be placed on the top of the container, etc., and can be used to determine the distance between the top of the container and the liquid surface according to the time of signal flight. The signal receiving unit and the signal sending unit can include a time-of-flight ranging sensor, etc.; wherein the sensor can include an infrared light transmitter and an infrared light receiver, etc., wherein the infrared light transmitter transmits infrared light to the liquid surface, and the infrared light is reflected by the liquid surface to the infrared light receiver, and the time when the infrared light transmitter transmits the signal and the time when the infrared light receiver receives the signal are recorded, thereby obtaining the signal flight time, etc.

[0086] In an exemplary embodiment, the angle detection unit may include a three-axis attitude sensor and a three-axis accelerometer to respectively detect three-axis angular velocity and three-axis acceleration, etc.; the three-axis angular velocity may be filtered and fused to calculate a quaternion, and the Euler angle (pitch angle, roll angle, etc.) may be calculated through the quaternion.

[0087] In an exemplary embodiment, the different signal receivers respectively send signals to different positions of the liquid surface, and respectively measure the distances from different positions of the liquid surface to the top of the container, so that the height from the liquid surface to the top of the container is more accurate; it can be understood that when the sent signals are the same, the corresponding signal receivers can be used to distinguish different signal sources; when the sent signals are different, the same receiver can be used to obtain different signals, thereby determining different signal receivers, thereby determining time intervals, etc.

[0088] Step S200: establishing a first volume feature vector of the liquid in the container according to the multiple time intervals.

[0089] In an exemplary embodiment, before establishing the first volume feature vector, each time interval may be preprocessed and normalized, and the processed time intervals may be used as dimensions of the first volume feature vector to obtain the first volume feature vector, etc. In another exemplary embodiment, the first volume feature vector, etc. may also be established through feature combination, polynomial features, feature selection, principal component analysis, aggregate features, discretization, time series features, etc.

[0090] In an exemplary embodiment, the first volume feature vector can have a preset length, such as 1×16; in actual use, the number of signal sending units can be selected, where the number of features and other features of the vector are all 0; for example, there are 4 signal sending units, and the corresponding time information can constitute the first four elements of a 1×16-dimensional data set, and the remaining twelve positions are all 0, etc.

[0091] Step S300: establishing a second volume feature vector of the liquid in the container according to the roll angle, pitch angle and corresponding angular change acceleration of the volume of the liquid in the container.

[0092] In an exemplary embodiment, before establishing the second volume feature vector, the roll angle, pitch angle and corresponding angular change acceleration of the liquid volume in the container may be preprocessed and normalized, and the processed roll angle, pitch angle and corresponding angular change acceleration of the liquid volume in the container are used as dimensions of the second volume feature vector, thereby obtaining the second volume feature vector, etc.

[0093] In an exemplary embodiment, the second volume sample feature vector may include a roll angle, a pitch angle, and a three-axis angular acceleration, that is, five feature values.

[0094] Step S400: input the first volume feature vector and the second volume feature vector into a preset volume detection model to obtain the volume of the liquid in the container.

[0095] In an exemplary embodiment, the volume detection model may include a pre-trained deep learning model, etc. Specifically, the PyTorch deep learning framework may be used for model training. The optimizer may select a stochastic gradient descent algorithm, and the initial learning rate may be set to 0.01. The loss function may select a cross entropy function, etc., and the volume detection model may be obtained by training. For example, the liquid volume detection method may be as described in FIG4, wherein input1 may be a second volume feature vector, i.e., a roll angle, a pitch angle, and a three-axis acceleration, etc.; input2 may be a first volume feature vector, i.e., multiple time intervals. After the two inputs are input to the fully connected layers (FC1 and FC2), they are merged into a larger vector through a connection operation, and passed to subsequent fully connected layers (FC3 to FC10) to obtain the target volume, etc. Specifically, the data type obtained after each fully connected layer can be shown in Figure 5, linear can represent linear transformation, ReLU represents activation function; input1 represents the second volume feature vector, input2 represents the first volume feature vector, concatenate represents merging the first volume feature vector and the second volume feature vector together, and the final output is Output (1×1) to obtain the final volume value, etc.

[0096] In an exemplary embodiment, the first feature vector can be used to determine the distance between the top of the container and the liquid surface, and the distance between the top of the container and the liquid surface can be obtained according to the time interval of the signal flight and the signal flight speed. Therefore, in actual use, in order to reduce the pressure of the model, the distance between the top of the container and the liquid surface corresponding to each time interval can be obtained by using each time interval, and the first volume feature vector can be established by using the distance.

[0097] In an exemplary embodiment, the obtained volume value of the liquid in the container is the volume value predicted by the model, and the predicted volume value can be post-processed and then optimized and adjusted to obtain a target volume value, etc.

[0098] In the above-mentioned liquid volume detection method, by using a signal receiving unit and a signal sending unit, the time interval between the multiple signal sending units sending signals to the liquid surface and the liquid surface reflecting signals to the signal receiving unit, as well as the angle information of the liquid surface in the container are obtained, and the first volume feature vector and the second volume feature vector are established by using the time interval and the angle information respectively, and the first volume feature vector and the second volume feature vector are output to the preset volume detection model to obtain the volume of the liquid in the container. Through different signal sending units, signal receiving units and angle detection units, each time interval and the roll angle, pitch angle and the corresponding angle change acceleration can be accurately obtained, so that the first volume feature vector and the second volume feature vector can be accurately established, providing a data basis for the subsequent volume determination, and improving the accuracy of the detection of the liquid volume in the container. At the same time, by combining the signal sending and receiving and the angle detection to realize the liquid volume detection, the volume of the liquid in the container under the dynamic environment can be detected in real time, which can effectively deal with the measurement error caused by the shaking of the liquid in the container, and improve the accuracy of the liquid volume measurement.

[0099] In one embodiment, as shown in FIG6 , obtaining the volume detection model includes:

[0100] Step S401, establish an initial volume detection model, and obtain different sample volumes and corresponding first sample feature vectors and second sample feature vectors; wherein the initial volume detection model is designed based on a deep learning algorithm.

[0101] In an exemplary embodiment, the initial volume model may include a design using a PyTorch deep learning framework, etc. The different sample volumes and the corresponding first sample feature vectors and second sample feature vectors may include placing different volumes of liquid in a container, placing the container at different roll angles, pitch angles, and angle change accelerations, detecting the time interval between a signal sending unit sending a signal and a signal receiving unit receiving a signal, and establishing a table of the first sample feature vector and the second sample feature vector corresponding to the sample volume.

[0102] Step S402: input the first sample feature vector and the second sample feature vector into an initial volume detection model, and output a prediction result.

[0103] In an exemplary embodiment, when predicting the sample feature vector using the initial volume detection model, the samples may be input in batches, for example, a plurality of samples may be input in each batch, and each training process may go through a plurality of cycles.

[0104] Step S403: based on the difference between the prediction result and the corresponding sample volume, iteratively adjust the initial volume detection model to obtain a volume detection model.

[0105] In an exemplary embodiment, based on the difference between the predicted volume and the sample volume, the parameters of the initial volume detection model are iteratively adjusted; when the accuracy meets a preset threshold, the initial volume detection model is determined as the target volume detection model, etc.

[0106] In an exemplary embodiment, the calculation of the accuracy of the model may include that if the error of the predicted volume is within a preset range, the predicted volume is accurate, etc.

[0107] In this embodiment, the initial volume detection model is trained by using different sample volumes and the corresponding first sample feature vectors and second sample feature vectors, and finally a volume detection model is obtained. The process of establishing an initial volume detection model and training it through a deep learning algorithm can effectively improve the accuracy and reliability of liquid volume detection. By obtaining different sample volumes and their corresponding feature vectors, the model can learn the complex relationship between liquid volume and feature vectors. After inputting a new feature vector for prediction, iterative adjustment is performed using the difference feedback between the prediction result and the actual sample volume, so that the model is continuously optimized, thereby improving its prediction accuracy. This self-optimization capability enables the volume detection model to adapt to different environments and liquid behaviors, and improves flexibility and accuracy in practical applications, especially in liquid monitoring scenarios under dynamic and complex conditions.

[0108] In one embodiment, as shown in FIG. 7 , obtaining different sample volumes and corresponding first sample feature vectors and second sample feature vectors includes:

[0109] Step S411, obtaining the maximum liquid volume, maximum roll angle, maximum pitch angle and maximum angular change acceleration of the container.

[0110] Step S412, using the preset volume unit parameter and the maximum liquid volume to obtain multiple sample volumes.

[0111] In an exemplary embodiment, the volume unit can be obtained by performing a product process using a preset volume unit parameter and the maximum liquid volume, wherein the volume unit can include increasing a volume unit each time from a volume of zero to obtain a sample data, etc. For example, if the maximum capacity of the container is 100 and the volume unit is 10, the sample volumes are (0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100), etc. The volume unit parameter can be determined by a volume measurement error value, for example, the volume sample can be obtained by the following formula (1):

[0112] (1)

[0113] Among them, △V represents the volume unit, V represents the container volume, ε represents the allowable measurement error value (in percentage), etc.

[0114] Step S413, obtaining a plurality of roll angle samples using a preset roll angle unit parameter and the maximum roll angle.

[0115] In an exemplary embodiment, a roll angle unit may be obtained by using a preset roll angle unit parameter and a maximum roll angle to perform a product process, wherein the roll angle unit may include increasing a roll angle unit each time from a roll angle of zero to obtain a sample data, etc. For example, the roll angle sample may be obtained by the following formula (2):

[0116] (2)

[0117] Among them, △θ pitch Denotes the unit of roll angle, θ pitch represents the maximum roll angle, ε represents the allowable measurement error value, etc.

[0118] Step S414: obtaining a plurality of pitch angle samples using a preset pitch angle unit parameter and the maximum pitch angle.

[0119] In an exemplary embodiment, the pitch angle unit may be obtained by performing a product process on the preset pitch angle unit parameter and the maximum pitch angle, wherein the pitch angle unit may include increasing one pitch angle unit each time from the pitch angle being zero to obtain a sample data, etc. For example, the pitch angle sample may be obtained by the following formula (3):

[0120] (3)

[0121] Among them, △θ roll Indicates the unit of pitch angle, θ roll represents the maximum pitch angle, ε represents the allowable measurement error value, etc.

[0122] Step S415, obtaining a plurality of angle change acceleration samples using the preset angle change acceleration unit parameter and the maximum angle change acceleration.

[0123] In an exemplary embodiment, the angle change acceleration unit can be obtained by using a preset angle change acceleration unit parameter and a maximum angle change acceleration for product processing, wherein the angle change acceleration unit can include increasing one angle change acceleration unit each time from the angle change acceleration being zero to obtain a sample data, etc. For example, the angle change acceleration sample can be obtained by the following formula (4):

[0124] (4)

[0125] Among them, △ω represents the unit of angular change acceleration (radians per square meter), ω represents the maximum angular change acceleration, and ε represents the allowable measurement error value, etc.

[0126] Step S416, obtaining the time intervals from when different signal sending units corresponding to different volume samples, roll angle samples, pitch angle samples, and angle change acceleration samples send signals to when corresponding signal receiving units receive signals, and obtaining a plurality of time interval samples.

[0127] In an exemplary embodiment, each volume sample may include corresponding roll angle and pitch angle samples and angle change acceleration samples, and the corresponding volume, roll angle, pitch angle and angle change acceleration are set respectively, and the time interval is detected by using a signal sending unit and a signal receiving unit to obtain the time interval samples corresponding to the volume, roll angle, pitch angle and angle change acceleration.

[0128] Step S417: establishing a first sample feature vector corresponding to the sample volume according to the multiple time interval samples.

[0129] Step S418: establishing a second sample feature vector corresponding to the sample volume according to the roll angle samples, the pitch angle samples, the angle change acceleration samples and the corresponding time interval samples.

[0130] In this embodiment, by obtaining the maximum liquid volume, roll angle, pitch angle, and angular change acceleration of the container, and generating multiple sample volumes and feature vectors based on these data, rich training data can be provided for the liquid volume detection model. This method not only enhances the diversity of data, enabling the model to learn the complex relationship between liquid volume and dynamic state, but also improves the accuracy and adaptability of modeling, helps reduce measurement errors caused by liquid movement, and ultimately improves the prediction accuracy of the model and its reliability in practical applications.

[0131] In one embodiment, as shown in FIG8 , the step of establishing a first volume feature vector of the liquid in the container and the step of establishing a second volume feature vector of the liquid in the container include:

[0132] Step S201, using a preset normalization strategy, normalizes the multiple time intervals, the roll angle, the pitch angle of the liquid volume in the container, and the corresponding angular change acceleration parameters to obtain time interval parameters, the roll angle parameters, the pitch angle parameters of the liquid volume in the container, and the corresponding angular change acceleration parameters.

[0133] In an exemplary embodiment, the normalization process may include dividing the obtained time interval, the roll angle, the pitch angle of the liquid volume in the container, and the corresponding angular change acceleration by the corresponding maximum value, and the normalized data is controlled to be [-1, 1], etc. In another exemplary embodiment, the normalization process may include unifying the units of the data obtained from the various detections, etc.

[0134] Step S202: Using each of the time interval parameters as dimensions of a first volume feature vector to establish a first volume feature vector.

[0135] In an exemplary embodiment, when each time interval parameter is obtained, each time interval can be used as each feature or dimension of the first volume feature vector. Specifically, for example, the first volume feature vector is a 1×5 vector, and five time intervals can be five values ​​of the vector. In another exemplary embodiment, other processing can be performed on the time interval parameters, such as feature extraction, principal component analysis, etc., and the data can be stored in each dimension of the first volume feature vector.

[0136] Step S203: Using the roll angle parameter, pitch angle parameter and corresponding angle change acceleration parameters of the volume of the liquid in the container as dimensions of the second volume feature vector to establish the second volume feature vector.

[0137] In this embodiment, the time interval, roll angle, pitch angle and angle change acceleration are normalized using a preset normalization strategy, which can eliminate the dimensional differences between different features and improve the consistency and effectiveness of the feature vector. This processing method not only accelerates the training of the model, enhances the stability and robustness of the model, but also optimizes the expression ability of the features, so that the model can more effectively capture the potential patterns in the data, thereby improving the accuracy and overall performance of liquid volume detection.

[0138] In one embodiment, after obtaining the time interval parameter, the roll angle parameter of the liquid volume in the container, the pitch angle parameter and the corresponding angle change acceleration parameters, the method further includes:

[0139] When the detection data parameter is greater than a preset threshold, the parameter is modified to the threshold; the detection data parameter includes a time interval parameter, a roll angle parameter of the liquid volume in the container, a pitch angle parameter and corresponding angle change acceleration parameters.

[0140] In an exemplary embodiment, when the parameter is greater than a preset threshold, the data is considered to be greater than the maximum value and is abnormal data, and it is modified to the maximum value. For example, the maximum angle change acceleration is 200. When it is greater than 200, it can be truncated to 200, etc.

[0141] In this embodiment, when the detection data parameters exceed the preset thresholds, modifying these parameters to thresholds can effectively prevent the negative impact of abnormal values ​​on model performance and ensure the rationality and consistency of data. This processing method helps to improve the robustness of the model, reduce misjudgments and inaccuracies caused by extreme values, thereby improving the reliability and accuracy of liquid volume detection and ensuring the stable operation of the system under various operating conditions.

[0142] In one embodiment, as shown in FIG. 9 , inputting the first volume feature vector and the second volume feature vector into a preset volume detection model to obtain the volume of the liquid in the container includes:

[0143] Step S421: input the first volume feature vector and the second volume feature vector into a preset volume detection model to obtain a predicted volume of the liquid in the container.

[0144] Step S422, obtaining the predicted volume of the liquid in the container during a preset continuous time period before the current time.

[0145] In an exemplary embodiment, a time period for each predicted volume may be set, for example, the volume may be detected once every 0.5 seconds. The continuous preset time period may include continuously detecting the predicted volume for a preset time or a preset number of times.

[0146] Step S423, based on the volume of the liquid in the container in multiple time periods, counting the time period frequency of each predicted volume appearing.

[0147] In an exemplary embodiment, the time period frequency of each predicted volume may include the number of times the predicted volume appears in all time periods. For example, if there are 10 predicted volumes in a preset time period, then it is determined how many of the ten predicted volumes are the same.

[0148] Step S424: determining a target volume of the liquid in the container according to the time period frequency.

[0149] In an exemplary embodiment, the predicted volume with the highest predicted volume frequency in the time period can be selected as the target volume. If there are multiple predicted volumes with the same frequency, the average of the predicted volumes in the time period can be calculated, and the one closest to the average is determined as the target volume.

[0150] In this embodiment, the first volume feature vector and the second volume feature vector are input into a preset volume detection model to obtain the predicted volume of the liquid in the container, which can effectively improve the intelligence and automation level of volume detection. By analyzing the predicted volume and its frequency of occurrence in the previous multiple time periods, the target volume of the liquid can be more accurately counted and the error caused by instantaneous fluctuations can be reduced. This method enhances the reliability of data analysis, makes the monitoring of liquid volume more stable, and reflects the actual liquid state in a timely manner, thereby providing a scientific basis for subsequent policy implementation and improving the efficiency and safety of the overall system.

[0151] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0152] Based on the same inventive concept, the embodiment of the present application also provides a liquid volume detection device for implementing the liquid volume detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more liquid volume detection devices provided below can refer to the limitations of the liquid volume detection method above, and will not be repeated here.

[0153] In one embodiment, as shown in FIG. 10 , a liquid volume detection device 200 is provided, which is applied to a liquid volume detection unit of a container, wherein the liquid volume detection unit is electrically connected to a plurality of signal sending units, a plurality of signal receiving units and an angle detection unit; the signal sending unit is used to send signals to different positions of the liquid; the signal is reflected by the liquid surface to the signal receiving unit corresponding to the signal sending unit; the device comprises: a data detection module 201, a feature vector establishment module 202 and a liquid volume prediction module 203, the data detection module is used to respectively obtain the time interval from when different signal sending units send signals to when corresponding signal receiving units receive signals, and to obtain the roll angle, pitch angle and corresponding angle change acceleration of the liquid surface in the container according to the angle detection unit;

[0154] A feature vector establishing module, used for establishing a first volume feature vector of the liquid in the container according to the plurality of time intervals;

[0155] The feature vector establishing module is further used to establish a second volume feature vector of the liquid in the container according to the roll angle, pitch angle and corresponding angular change acceleration of the volume of the liquid in the container;

[0156] The liquid volume prediction module is used to input the first volume feature vector and the second volume feature vector into a preset volume detection model to obtain the volume of the liquid in the container.

[0157] In one embodiment, the device further includes a model training module, wherein the model training module is used to:

[0158] Establishing an initial volume detection model, and obtaining different sample volumes and corresponding first sample feature vectors and second sample feature vectors; wherein the initial volume detection model is designed based on a deep learning algorithm;

[0159] Inputting the first sample feature vector and the second sample feature vector into an initial volume detection model, and outputting a prediction result;

[0160] Based on the difference between the prediction result and the corresponding sample volume, the initial volume detection model is iteratively adjusted to obtain a volume detection model.

[0161] In one embodiment, the feature vector establishment module includes:

[0162] A data acquisition submodule is used to obtain the maximum liquid volume, maximum roll angle, maximum pitch angle and maximum angle change acceleration of the container;

[0163] A sample determination submodule, used to obtain multiple sample volumes using a preset volume unit parameter and the maximum liquid volume;

[0164] The sample determination submodule is further used to obtain a plurality of roll angle samples using a preset roll angle unit parameter and the maximum roll angle;

[0165] The sample determination submodule is further used to obtain a plurality of pitch angle samples by using a preset pitch angle unit parameter and the maximum pitch angle;

[0166] The sample determination submodule is further used to obtain a plurality of angle change acceleration samples using a preset angle change acceleration unit parameter and the maximum angle change acceleration;

[0167] The sample determination submodule is further used to obtain the time intervals from when different signal sending units corresponding to different volume samples, roll angle samples, pitch angle samples, and angle change acceleration samples send signals to when corresponding signal receiving units receive signals, and obtain multiple time interval samples;

[0168] A feature vector establishing submodule, used to establish a first sample feature vector corresponding to the sample volume according to the multiple time interval samples;

[0169] The feature vector establishing submodule is further used to establish a second sample feature vector corresponding to the sample volume according to the roll angle samples, the pitch angle samples, the angle change acceleration samples and the corresponding time interval samples.

[0170] In one embodiment, the feature vector establishment module includes:

[0171] A normalization submodule, for performing normalization processing on the plurality of time intervals, the roll angle, the pitch angle of the liquid volume in the container, and the corresponding angular change accelerations by using a preset normalization strategy, to obtain time interval parameters, the roll angle parameters, the pitch angle parameters, and the corresponding angular change acceleration parameters of the liquid volume in the container;

[0172] A feature vector establishing submodule, used for establishing the first volume feature vector by taking each of the time interval parameters as each dimension of the first volume feature vector;

[0173] The feature vector establishing submodule is further used to use the roll angle parameter, pitch angle parameter and corresponding angle change acceleration parameters of the liquid volume in the container as dimensions of the second volume feature vector to establish the second volume feature vector.

[0174] In one embodiment, the normalization submodule further includes:

[0175] A data truncation unit is used to modify the parameter to a preset threshold when the detection data parameter is greater than the threshold; the detection data parameter includes a time interval parameter, a roll angle parameter of the liquid volume in the container, a pitch angle parameter and corresponding angle change acceleration parameters.

[0176] In one embodiment, the liquid volume prediction module comprises:

[0177] A predicted volume acquisition submodule, used for inputting the first volume feature vector and the second volume feature vector into a preset volume detection model to obtain a predicted volume of the liquid in the container;

[0178] The predicted volume acquisition submodule is further used to acquire the predicted volume of the liquid in the container in a continuous preset time period before the current time;

[0179] The time frequency submodule is used to count the time period frequency of each predicted volume according to the volume of the liquid in the container in multiple time periods;

[0180] The target volume determination submodule is used to determine the target volume of the liquid in the container according to the time period frequency.

[0181] In an exemplary embodiment, the liquid volume detection device may also be as shown in FIG. 11 , specifically including a volume detection module 301 , a signal flight time detection module 302 , and an angle detection module 303 .

[0182] Each module in the above-mentioned liquid volume detection device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0183] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG12. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store liquid volume data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for detecting liquid volume is implemented.

[0184] Those skilled in the art will understand that the structure shown in FIG. 12 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0185] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0186] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0187] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0188] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for detecting liquid volume, characterized in that: A liquid volume detection unit applied to a container, wherein the liquid volume detection unit is electrically connected to a plurality of signal sending units, a plurality of signal receiving units, and an angle detection unit; the signal sending unit is used to send signals to different positions of the liquid; The signal is reflected by the liquid surface to a signal receiving unit corresponding to the signal sending unit; the method comprises: Respectively obtain the time intervals from when different signal sending units send signals to when corresponding signal receiving units receive signals, and obtain the roll angle, pitch angle and corresponding angle change acceleration of the liquid surface in the container according to the angle detection unit; Establishing a first volume feature vector of the liquid in the container according to the plurality of time intervals; Establishing a second volume feature vector of the liquid in the container according to the roll angle, the pitch angle and the corresponding angular change acceleration of the volume of the liquid in the container; The first volume feature vector and the second volume feature vector are input into a preset volume detection model to obtain the volume of the liquid in the container.

2. The method according to claim 1, characterized in that Acquiring the volume detection model includes: Establishing an initial volume detection model, and obtaining different sample volumes and corresponding first sample feature vectors and second sample feature vectors; wherein the initial volume detection model is designed based on a deep learning algorithm; Inputting the first sample feature vector and the second sample feature vector into an initial volume detection model, and outputting a prediction result; Based on the difference between the prediction result and the corresponding sample volume, the initial volume detection model is iteratively adjusted to obtain a volume detection model.

3. The method according to claim 2, characterized in that The obtaining of different sample volumes and corresponding first sample feature vectors and second sample feature vectors includes: Obtain the maximum liquid volume, maximum roll angle, maximum pitch angle, and maximum angular change acceleration of the container; Using a preset volume unit parameter and the maximum liquid volume, a plurality of sample volumes are obtained; Using a preset roll angle unit parameter and the maximum roll angle, a plurality of roll angle samples are obtained; Using a preset pitch angle unit parameter and the maximum pitch angle, a plurality of pitch angle samples are obtained; Using the preset angle change acceleration unit parameter and the maximum angle change acceleration, a plurality of angle change acceleration samples are obtained; Obtaining the time intervals from when different signal sending units corresponding to different volume samples, roll angle samples, pitch angle samples, and angle change acceleration samples send signals to when corresponding signal receiving units receive signals, and obtaining a plurality of time interval samples; Establishing a first sample feature vector corresponding to the sample volume according to the multiple time interval samples; A second sample feature vector corresponding to the sample volume is established according to the roll angle samples, the pitch angle samples, the angle change acceleration samples and the corresponding time interval samples.

4. The method according to claim 1, characterized in that: The step of establishing a first volume feature vector of the liquid in the container and establishing a second volume feature vector of the liquid in the container comprises: Using a preset normalization strategy, a plurality of the time intervals, the roll angles, the pitch angles of the liquid volume in the container, and the corresponding angular change accelerations are normalized to obtain time interval parameters, the roll angle parameters, the pitch angle parameters of the liquid volume in the container, and the corresponding angular change acceleration parameters; Using each of the time interval parameters as each dimension of the first volume feature vector to establish the first volume feature vector; The roll angle parameter, pitch angle parameter and corresponding angle change acceleration parameters of the volume of the liquid in the container are used as dimensions of the second volume feature vector to establish the second volume feature vector.

5. The method according to claim 4, characterized in that After obtaining the time interval parameter, the roll angle parameter of the liquid volume in the container, the pitch angle parameter and the corresponding angle change acceleration parameters, the method further includes: When the detection data parameter is greater than a preset threshold, the parameter is modified to the threshold; the detection data parameter includes a time interval parameter, a roll angle parameter of the liquid volume in the container, a pitch angle parameter and corresponding angle change acceleration parameters.

6. The method according to claim 1, characterized in that The step of inputting the first volume feature vector and the second volume feature vector into a preset volume detection model to obtain the volume of the liquid in the container includes: Inputting the first volume feature vector and the second volume feature vector into a preset volume detection model to obtain a predicted volume of the liquid in the container; Obtaining the predicted volume of the liquid in the container for a continuous preset time period before the current time; According to the volume of the liquid in the container in multiple time periods, the frequency of each time period in which each predicted volume appears is counted; According to the frequency of the time period, a target volume of the liquid in the container is determined.

7. A liquid volume detection device, characterized in that: A liquid volume detection unit applied to a container, wherein the liquid volume detection unit is electrically connected to a plurality of signal sending units, a plurality of signal receiving units, and an angle detection unit; the signal sending unit is used to send signals to different positions of the liquid; The signal is reflected by the liquid surface to a signal receiving unit corresponding to the signal sending unit; the device comprises: A data detection module, used to respectively obtain the time intervals from when different signal sending units send signals to when corresponding signal receiving units receive signals, and to obtain the roll angle, pitch angle and corresponding angle change acceleration of the liquid surface in the container according to the angle detection unit; A feature vector establishing module, used for establishing a first volume feature vector of the liquid in the container according to the plurality of time intervals; The feature vector establishing module is further used to establish a second volume feature vector of the liquid in the container according to the roll angle, pitch angle and corresponding angular change acceleration of the volume of the liquid in the container; The liquid volume prediction module is used to input the first volume feature vector and the second volume feature vector into a preset volume detection model to obtain the volume of the liquid in the container.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.