Liquid volume detection method and device and computer equipment

By setting up a liquid volume detection unit in the container, using the signal propagation time interval and liquid level angle information to create feature vectors, and using the trained volume detection model to perform intelligent prediction, the problem of inaccurate existing liquid volume detection methods is solved, and the problem of inaccurate liquid volume detection methods is realized. Accurate detection and real-time monitoring of liquid volumes are provided.

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

Patent Information

Application Number
CN202411551028.4
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 existing liquid volume detection methods have problems such as large errors and inaccuracy, which are difficult to meet the actual liquid volume detection needs.

Method used

By setting up a liquid volume detection unit in the container, using the signal transmission unit, the signal receiving unit and the angle detection unit, the signal propagation time interval and liquid level angle information are obtained, the characteristic vector of the liquid volume is established, and the trained volume detection model is used for Intelligent prediction.

Benefits of technology

It realizes accurate detection of liquid volume, improves the accuracy and reliability of volume measurement, can monitor the status of liquid in the container in real time, adapt to dynamic changes, and provide effective support and decision-making basis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119469315A_ABST
    Figure CN119469315A_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: acquiring a time interval from signal sending by a signal sending unit to signal receiving by a signal receiving unit, and acquiring a rolling angle, a pitch angle and a corresponding angle change acceleration of a liquid level in a container according to an angle detection unit; establishing a volume feature vector of the liquid in the container according to the time interval, the rolling angle and the pitch angle of the liquid level of the liquid in the container and the corresponding angle change acceleration; inputting the volume feature vector into a preset volume detection model to obtain the volume of the liquid in the container; wherein the volume detection model is obtained by training sample data, and the sample data comprises liquid volumes under different time intervals, roll angles, pitch angles and angle change acceleration conditions. By adopting the method, the accuracy of liquid volume detection 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 development of automation technology, the volume detection of small-capacity containers is becoming increasingly important. For example, in the detection of the volume of liquids in small containers in the assembly line. Accurate liquid volume detection is not only related to product quality control and production efficiency improvement, but also can effectively reduce material waste and reduce production costs.

[0003] Traditional volume detection methods include measurement observation method, pressure change measurement method and photoelectric liquid level measurement method. Among them, the measurement observation method relies on manual observation and is easily affected by subjective factors; the pressure change measurement method is difficult to achieve accurate measurement in an automated environment; and the photoelectric liquid level measurement method requires the deployment of multiple photoelectric sensors in actual applications, which has great limitations.

[0004] At present, many technologies use capacitive liquid level measurement, which uses the change in the inductive capacitance of the liquid to determine the liquid level. However, this method still has certain errors and is difficult to meet the actual liquid volume detection needs. Summary of the invention

[0005] 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.

[0006] In a first aspect, the present application provides a method for detecting the volume of a liquid. A liquid volume detection unit is applied to a container, the liquid volume detection unit is electrically connected to a single signal sending unit, a single signal receiving unit, and an angle detection unit; the signal sending unit is used to send a signal to a preset feature point of the liquid; the signal is reflected to the signal receiving unit through the liquid surface; the angle detection unit is used to detect the angle of the liquid surface, and the method includes:

[0007] Acquire the time interval from when the signal sending unit sends the signal to when the signal receiving unit receives the signal, and acquire 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 volume feature vector of the liquid in the container according to the time interval, the roll angle, the pitch angle and the corresponding angular change acceleration of the liquid surface in the container;

[0009] The volume feature vector is input into a preset volume detection model to obtain the volume of the liquid in the container; wherein the volume detection model is obtained by training sample data, and the sample data includes the liquid volume under different time intervals, roll angles, pitch angles and angle change acceleration conditions.

[0010] In one embodiment, the volume feature vector is input into a preset volume detection model to obtain the volume of the liquid in the container, including:

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

[0012] Obtaining predicted volumes for a plurality of consecutive time periods, and counting the frequencies of the predicted volumes;

[0013] A target volume of the liquid in the container is determined according to the frequencies of the predicted volumes.

[0014] In one embodiment, the step of obtaining the roll angle, pitch angle, and corresponding angle change acceleration of the liquid surface in the container according to the angle detection unit includes:

[0015] Acquire the change speed of each angle and the angle change acceleration according to the angle detection unit; wherein the angles include a roll angle, a pitch angle and a heading angle;

[0016] According to the changing speeds of the angles, a target roll angle and a target pitch angle are determined.

[0017] In one embodiment, determining the target roll angle and the target pitch angle according to the change speed of each angle includes:

[0018] Using a preset filtering strategy, the change speed of each angle is processed to obtain a change speed feature;

[0019] Integrating the change speed characteristic to obtain a quaternion;

[0020] According to the quaternion, a target roll angle and a target pitch angle are determined.

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

[0022] Establish an initial volume detection model and obtain different sample volumes and corresponding sample feature vectors;

[0023] Inputting the sample feature vector into the initial volume detection model and outputting the prediction result;

[0024] 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.

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

[0026] Obtaining the maximum volume, maximum roll angle, maximum pitch angle, and maximum angular change acceleration of the container;

[0027] Establishing a plurality of sample volumes according to a preset volume unit parameter and the maximum volume;

[0028] Establishing a plurality of roll angle samples according to a preset roll angle unit parameter and the maximum roll angle;

[0029] Establishing a plurality of pitch angle samples according to a preset pitch angle unit parameter and the maximum pitch angle;

[0030] Establishing a plurality of angle change acceleration samples according to a preset angle change acceleration unit parameter and the maximum angle change acceleration;

[0031] Obtaining the time interval from when the signal sending unit sends a signal to when the signal receiving unit receives the signal under different sample volumes, roll angle samples, pitch angle samples, and angle change acceleration samples, and determining it as a time interval sample;

[0032] A sample feature vector is established by using the time interval samples, roll angle samples, pitch angle samples, and angle change acceleration.

[0033] 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 single signal sending unit, a single signal receiving unit, and an angle detection unit; the signal sending unit is used to send a signal to a preset feature point of the liquid; the signal is reflected to the signal receiving unit through the liquid surface; the angle detection unit is used to detect the angle of the liquid surface, and the device includes:

[0034] A data acquisition module, used to acquire the time interval from when the signal sending unit sends a signal to when the signal receiving unit receives the signal, and to acquire the roll angle, pitch angle and corresponding angle change acceleration of the liquid surface in the container according to the angle detection unit;

[0035] A feature vector establishing module, used to establish a volume feature vector of the liquid in the container according to the time interval, the roll angle, the pitch angle and the corresponding angular change acceleration of the liquid surface in the container;

[0036] A model prediction module is used to input the volume feature vector into a preset volume detection model to obtain the volume of the liquid in the container; wherein the volume detection model is obtained by training sample data, and the sample data includes the liquid volume under different time intervals, roll angles, pitch angles and angle change acceleration conditions.

[0037] In one embodiment, the model prediction module includes:

[0038] A model prediction submodule, used for inputting the volume feature vector into a preset volume detection model to obtain a predicted volume of the liquid in the container;

[0039] A data acquisition submodule, used to acquire predicted volumes for a plurality of consecutive time periods and to count the frequencies of the predicted volumes;

[0040] The target volume determination submodule is used to determine the target volume of the liquid in the container according to the frequency of each predicted volume.

[0041] In one embodiment, the data acquisition module includes:

[0042] A data acquisition submodule, used to acquire the change speed of each angle and the angle change acceleration according to the angle detection unit; wherein the angles include a roll angle, a pitch angle and a heading angle;

[0043] The angle determination submodule is used to determine a target roll angle and a target pitch angle according to the change speed of each angle.

[0044] In one embodiment, the angle determination submodule includes:

[0045] A speed feature acquisition unit, used to process the change speed of each angle by using a preset filtering strategy to obtain a change speed feature;

[0046] A feature integration unit, used for integrating the change speed feature to obtain a quaternion;

[0047] The target angle determination unit is used to determine a target roll angle and a target pitch angle according to the quaternion.

[0048] In one embodiment, the device further comprises a model training module, which is used to:

[0049] Establish an initial volume detection model and obtain different sample volumes and corresponding sample feature vectors;

[0050] Inputting the sample feature vector into the initial volume detection model and outputting the prediction result;

[0051] 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.

[0052] In one embodiment, the model training module includes:

[0053] A data acquisition submodule, used to acquire the maximum volume, maximum roll angle, maximum pitch angle and maximum angular change acceleration of the container;

[0054] A sample establishment submodule, used to establish multiple sample volumes according to preset volume unit parameters and the maximum volume;

[0055] The sample establishment submodule is further used to establish a plurality of roll angle samples according to a preset roll angle unit parameter and the maximum roll angle;

[0056] The sample establishment submodule is further used to establish a plurality of pitch angle samples according to a preset pitch angle unit parameter and the maximum pitch angle;

[0057] The sample establishment submodule is further used to establish a plurality of angle change acceleration samples according to a preset angle change acceleration unit parameter and the maximum angle change acceleration;

[0058] The sample establishment submodule is further used to obtain the time interval from when the signal sending unit sends a signal to when the signal receiving unit receives the signal under different sample volumes, roll angle samples, pitch angle samples, and angle change acceleration samples, and determine it as a time interval sample;

[0059] The feature vector establishing submodule is used to establish a sample feature vector using the time interval samples, the roll angle samples, the pitch angle samples, and the angle change acceleration.

[0060] 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.

[0061] 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.

[0062] 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.

[0063] The above-mentioned liquid volume detection method, device, computer equipment, storage medium and computer program product obtain the time interval from the signal sending unit sending the signal to the signal receiving unit receiving the signal, as well as the roll angle, pitch angle and corresponding angular change acceleration of the liquid surface, establish a volume feature vector, and input the volume feature vector into a preset volume detection model to predict the volume of the liquid in the container. By combining the signal sending unit, the signal receiving unit and the angle detection unit, accurate detection of the liquid volume is achieved. The method establishes a feature vector of the liquid volume by analyzing the time interval and related angle parameters after the signal is reflected on the liquid surface, and uses a trained volume detection model for intelligent prediction. This not only improves the accuracy and reliability of volume measurement, but also can monitor the state of the liquid in the container in real time and adapt to dynamic changes, ultimately providing effective support and decision-making basis for liquid management, and improving the accuracy of liquid volume detection. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0065] FIG2 is a diagram showing an application environment of a method for detecting liquid volume in one embodiment;

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

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

[0068] FIG5 is a schematic diagram of a process for determining a target volume in one embodiment;

[0069] FIG6 is a schematic diagram of a first process for determining a target roll angle and a target pitch angle in one embodiment;

[0070] FIG7 is a schematic diagram of a second process for determining a target roll angle and a target pitch angle in one embodiment;

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

[0072] FIG9 is a schematic diagram of a flow chart of establishing a sample feature vector in one embodiment;

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

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

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

[0076] 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.

[0077] In one embodiment, as shown in FIG1 , a method for obtaining 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 single signal sending unit, a single signal receiving unit, and an angle detection unit; the signal sending unit is used to send a signal to a preset feature point of the liquid; the signal is reflected to the signal receiving unit by the liquid surface; the angle detection unit is used to detect the angle of the liquid surface. This embodiment uses the method applied to a terminal as an example. 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:

[0078] Step S100, obtaining the time interval from when the signal sending unit sends a signal to when the signal receiving unit receives the signal, and obtaining the roll angle, pitch angle and corresponding angle change acceleration of the liquid surface in the container according to the angle detection unit.

[0079] 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.

[0080] In an exemplary embodiment, the signal sending unit can send a signal to a characteristic point of the liquid surface, and reflect the overall liquid surface in the container through the signal of the characteristic point. Specifically, the height from the liquid surface to the top of the container can be determined through the time interval, and the height of the liquid surface can be determined using the height of the container.

[0081] 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.

[0082] 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.

[0083] Step S200, establishing a volume feature vector of the liquid in the container according to the time interval, the roll angle, the pitch angle and the corresponding angular change acceleration of the liquid surface in the container.

[0084] In an exemplary embodiment, before establishing the volume feature vector, each time interval may be preprocessed and normalized, and the processed time interval, roll angle, pitch angle, and angular change acceleration may be used as the features or dimensions of the volume feature vector to obtain the volume feature vector, etc. In another exemplary embodiment, the volume feature vector, etc. may also be established by feature combination, polynomial features, feature selection, principal component analysis, aggregate features, discretization, time series features, etc. In another exemplary embodiment, the normalization process may include dividing the obtained time interval, the roll angle, pitch angle, and the corresponding angular change acceleration of the liquid volume in the container by the corresponding maximum value, and the normalized data may be controlled to [-1, 1], etc. In another exemplary embodiment, the normalization process may include unifying the units of the data obtained from the various detections, etc.

[0085] In an exemplary embodiment, the volume feature vector may have a preset length, such as 1×6, and each dimension may correspond to a time interval, a roll angle, a pitch angle, an angle change acceleration, etc.

[0086] Step S300, inputting the volume feature vector into a preset volume detection model to obtain the volume of the liquid in the container; wherein the volume detection model is obtained by training sample data, and the sample data includes the liquid volume under different time intervals, roll angles, pitch angles and angle change acceleration conditions.

[0087] 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 FIG3, wherein the input volume feature vector may be 1×6, specifically representing the time interval, roll angle, pitch angle, and angle change acceleration, etc., and the input volume feature volume vector passes through a fully connected layer (FC1 to FC8), and finally outputs a 1×1 predicted volume, etc. Among them, the model's recognition of features and volume prediction process may be as shown in FIG4, wherein linear may represent a linear conversion, and ReLU represents an activation function; input is the input volume feature vector, and the final output is Output (1×1), which is the predicted container liquid volume, etc.

[0088] In an exemplary embodiment, 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. In an exemplary embodiment, when the parameter is greater than the preset threshold, it is considered that the data is 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, and when it is greater than 200, it can be truncated to 200, etc.

[0089] In the above-mentioned method for acquiring the volume of liquid, the time interval from when the signal sending unit sends the signal to when the signal receiving unit receives the signal, as well as the roll angle, pitch angle and corresponding angular change acceleration of the liquid surface are obtained to establish a volume feature vector, and the volume feature vector is input into a preset volume detection model to predict the volume of the liquid in the container. By combining the signal sending unit, the signal receiving unit and the angle detection unit, accurate detection of the liquid volume is achieved. This method establishes a feature vector of the liquid volume by analyzing the time interval and related angle parameters after the signal is reflected on the liquid surface, and uses a trained volume detection model for intelligent prediction. This not only improves the accuracy and reliability of volume measurement, but also can monitor the state of the liquid in the container in real time and adapt to dynamic changes, ultimately providing effective support and decision-making basis for liquid management, and improving the accuracy of liquid volume detection.

[0090] In one embodiment, as shown in FIG. 5 , the volume feature vector is input into a preset volume detection model to obtain the volume of the liquid in the container, including:

[0091] Step S301: input the volume feature vector into a preset volume detection model to obtain the predicted volume of the liquid in the container.

[0092] Step S302, obtaining predicted volumes for a plurality of consecutive time periods, and counting the frequencies of the predicted volumes.

[0093] In an exemplary embodiment, the plurality of continuous time periods may include a plurality of preset time periods, or a preset detection time interval may be set, and the predicted volume is detected once every certain period of time.

[0094] In an exemplary embodiment, the frequency mentioned in the prediction may include the predicted volumes of multiple time periods preset before the time period, the frequency of occurrence of each volume value, etc.

[0095] Step S303: determining the target volume of the liquid in the container according to the frequencies of the predicted volumes.

[0096] In an exemplary embodiment, the predicted volume with the highest 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 volume closest to the average is determined as the target volume.

[0097] In this embodiment, the volume feature vector is input into the preset volume detection model to obtain the predicted volume of the liquid in the container, and the predicted volumes of the previous multiple time periods and their frequencies of occurrence are analyzed to determine the target volume. The target volume of the liquid can be accurately counted, the error caused by instantaneous fluctuations can be reduced, the accuracy and reliability of data analysis can be improved, the data basis for determining the target volume can be provided, and the accuracy of the liquid volume detection in the container can be further improved.

[0098] In one embodiment, as shown in FIG6 , the step of obtaining the roll angle, pitch angle, and corresponding angle change acceleration of the liquid surface in the container according to the angle detection unit includes:

[0099] Step S101, obtaining the change speed and angle change acceleration of each angle according to the angle detection unit; wherein the angles include a roll angle, a pitch angle and a heading angle.

[0100] In an exemplary embodiment, the angle detection unit may include a three-axis attitude sensor and a three-axis accelerometer, and the three-axis angular velocity is detected by the three-axis attitude sensor, and the three-axis acceleration is detected by the three-axis accelerometer.

[0101] Step S102: determining a target roll angle and a target pitch angle according to the change speed of each angle.

[0102] In an exemplary embodiment, a quaternion can be obtained by filtering and fusing the three-axis angular velocity, and the pitch angle, roll angle, etc. can be calculated through the quaternion. In another exemplary embodiment, the roll angle and pitch angle can also be obtained through model-based methods (such as dynamic models, etc.), magnetometer-assisted estimation (such as magnetometer calibration, etc.), deep learning and machine learning (such as convolutional neural networks, reinforcement learning, etc.).

[0103] In this embodiment, the angle detection unit obtains the change speed and angle change acceleration of each angle, and determines the target roll angle and target pitch angle according to the change speed of each angle. By detecting the change speed and acceleration of each angle, the liquid surface posture can be accurately monitored and controlled, which helps to observe the change of the liquid surface in real time in the motion state, and then detect the volume of the liquid in the container in real time, thereby improving the accuracy of the liquid volume detection in the container.

[0104] In one embodiment, as shown in FIG7 , determining the target roll angle and the target pitch angle by using the change speed of each angle includes:

[0105] Step S111, using a preset filtering strategy, processing the change speed of each angle to obtain a change speed feature.

[0106] In an exemplary embodiment, the filtering strategy may include extended Kalman filtering, passive Kalman filtering, particle filtering, etc. Through filtering, smoothed and denoised angular velocity and acceleration data may be obtained, which may be further used for state estimation, etc.

[0107] Step S112, integrating the change speed characteristics to obtain a quaternion.

[0108] In an exemplary embodiment, the state of the object, namely the quaternion (quaternion), can be calculated by integrating the filtered angular velocity data, i.e., the angle change rate. The Euler angle (roll angle, pitch angle, heading angle), etc. can be calculated through the quaternion.

[0109] Step S113, determining a target roll angle and a target pitch angle according to the quaternion.

[0110] In this embodiment, the change speed of each angle is processed by a filtering strategy to obtain a change speed feature, and the change speed feature is integrated to obtain a quaternion, and the target roll angle and target pitch angle are determined by the quaternion. By using a preset filtering strategy to process the change speed, noise and interference can be effectively reduced, thereby obtaining an accurate change speed feature. The quaternion obtained by integrating these features can more accurately describe the posture change of the liquid surface, which is particularly important for detecting the volume of a container in a moving state. By more accurately determining the roll angle and pitch angle of the liquid surface based on the quaternion, reliable data support is provided for subsequent volume detection, thereby improving the accuracy of liquid volume detection in the container.

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

[0112] Step S311: establish an initial volume detection model, and obtain different sample volumes and corresponding sample feature vectors.

[0113] In an exemplary embodiment, the initial volume model may be designed using a PyTorch deep learning framework, etc. The sample feature vector may be determined by setting the volume of the liquid in the container and the roll angle, pitch angle, and angular change acceleration, thereby determining the time interval in the sample feature vector, etc.

[0114] Step S312: input the sample feature vector into the initial volume detection model and output the prediction result.

[0115] 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.

[0116] Step S313: 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.

[0117] 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, and when the accuracy of the initial volume detection model meets a preset threshold, the initial volume detection model is determined as the target volume detection model, etc. The accuracy of the predicted volume includes that when the error between the predicted volume and the sample volume is within a preset range, the predicted volume is considered accurate, etc.

[0118] In this embodiment, the process of establishing an initial volume detection model and obtaining different sample volumes and their feature vectors can achieve efficient and accurate detection of the object volume. By inputting the sample feature vector into the model and outputting the prediction result, the performance of the model can be quickly evaluated and compared with the actual volume to identify the deviation of the model. Based on this differential feedback, by iteratively adjusting the model parameters, the volume detection model can be continuously optimized to improve its prediction accuracy and robustness. This method not only improves the detection accuracy, but also enhances the adaptability of the model in different application scenarios, providing strong technical support for automated detection.

[0119] In one embodiment, as shown in FIG9 , obtaining different sample volumes and corresponding sample feature vectors includes:

[0120] Step S321, obtaining the maximum volume, maximum roll angle, maximum pitch angle and maximum angular change acceleration of the container.

[0121] Step S322: establishing a plurality of sample volumes according to a preset volume unit parameter and the maximum volume.

[0122] 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):

[0123] (1)

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

[0125] Step S323: establishing a plurality of roll angle samples according to a preset roll angle unit parameter and the maximum roll angle.

[0126] 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):

[0127] (2)

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

[0129] Step S324: establishing a plurality of pitch angle samples according to a preset pitch angle unit parameter and the maximum pitch angle.

[0130] 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):

[0131] (3)

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

[0133] Step S325 , establishing a plurality of angle change acceleration samples according to the preset angle change acceleration unit parameter and the maximum angle change acceleration.

[0134] 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):

[0135] (4)

[0136] 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.

[0137] Step S326, obtaining the time interval from when the signal sending unit sends a signal to when the signal receiving unit receives the signal under different sample volumes, roll angle samples, pitch angle samples, and angle change acceleration samples, and determining it as the time interval sample.

[0138] 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.

[0139] Step S327, using the time interval samples, roll angle samples, pitch angle samples, and angle change acceleration, a sample feature vector is established.

[0140] In this embodiment, by obtaining the maximum volume, maximum roll angle, maximum pitch angle and maximum angular change acceleration of the container, and establishing corresponding samples based on these parameters, a comprehensive set of sample feature vectors can be effectively constructed. This process can not only systematically organize and quantify the dynamic characteristics of the container, but also provide a reliable data basis for subsequent signal transmission and reception. By analyzing the time interval samples under different samples, we can deeply understand the response characteristics of the container under various states, thereby optimizing the efficiency and accuracy of signal transmission. This method helps to improve the overall performance of the system, provides strong support for real-time monitoring and control, and ensures effective state assessment and decision-making in complex environments.

[0141] 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.

[0142] 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.

[0143] In one embodiment, as shown in FIG. 10 , a liquid volume detection device 100 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 single signal sending unit, a single signal receiving unit, and an angle detection unit; the signal sending unit is used to send a signal to a preset feature point of the liquid; the signal is reflected to the signal receiving unit through the liquid surface; the angle detection unit is used to detect the angle of the liquid surface, and the device includes: a data acquisition module 201, a feature vector establishment module 202, and a model prediction module 203, wherein:

[0144] A data acquisition module, used to acquire the time interval from when the signal sending unit sends a signal to when the signal receiving unit receives the signal, and to acquire the roll angle, pitch angle and corresponding angle change acceleration of the liquid surface in the container according to the angle detection unit;

[0145] A feature vector establishing module, used to establish a volume feature vector of the liquid in the container according to the time interval, the roll angle, the pitch angle and the corresponding angular change acceleration of the liquid surface in the container;

[0146] A model prediction module is used to input the volume feature vector into a preset volume detection model to obtain the volume of the liquid in the container; wherein the volume detection model is obtained by training sample data, and the sample data includes the liquid volume under different time intervals, roll angles, pitch angles and angle change acceleration conditions.

[0147] In one embodiment, the model prediction module includes:

[0148] A model prediction submodule, used for inputting the volume feature vector into a preset volume detection model to obtain a predicted volume of the liquid in the container;

[0149] A data acquisition submodule, used to acquire predicted volumes for a plurality of consecutive time periods and to count the frequencies of the predicted volumes;

[0150] The target volume determination submodule is used to determine the target volume of the liquid in the container according to the frequency of each predicted volume.

[0151] In one embodiment, the data acquisition module includes:

[0152] A data acquisition submodule, used to acquire the change speed of each angle and the angle change acceleration according to the angle detection unit; wherein the angles include a roll angle, a pitch angle and a heading angle;

[0153] The angle determination submodule is used to determine a target roll angle and a target pitch angle according to the change speed of each angle.

[0154] In one embodiment, the angle determination submodule includes:

[0155] A speed feature acquisition unit, used to process the change speed of each angle by using a preset filtering strategy to obtain a change speed feature;

[0156] A feature integration unit, used for integrating the change speed feature to obtain a quaternion;

[0157] The target angle determination unit is used to determine a target roll angle and a target pitch angle according to the quaternion.

[0158] In one embodiment, the device further comprises a model training module, which is used to:

[0159] Establish an initial volume detection model and obtain different sample volumes and corresponding sample feature vectors;

[0160] Inputting the sample feature vector into the initial volume detection model and outputting the prediction result;

[0161] 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.

[0162] In one embodiment, the model training module includes:

[0163] A data acquisition submodule, used to acquire the maximum volume, maximum roll angle, maximum pitch angle and maximum angular change acceleration of the container;

[0164] A sample establishment submodule, used to establish multiple sample volumes according to preset volume unit parameters and the maximum volume;

[0165] The sample establishment submodule is further used to establish a plurality of roll angle samples according to a preset roll angle unit parameter and the maximum roll angle;

[0166] The sample establishment submodule is further used to establish a plurality of pitch angle samples according to a preset pitch angle unit parameter and the maximum pitch angle;

[0167] The sample establishment submodule is further used to establish a plurality of angle change acceleration samples according to a preset angle change acceleration unit parameter and the maximum angle change acceleration;

[0168] The sample establishment submodule is further used to obtain the time interval from when the signal sending unit sends a signal to when the signal receiving unit receives the signal under different sample volumes, roll angle samples, pitch angle samples, and angle change acceleration samples, and determine it as a time interval sample;

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

[0170] 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 .

[0171] 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.

[0172] 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 in a container. 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.

[0173] 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.

[0174] 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.

[0175] 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.

[0176] The technical features of the above embodiments may be arbitrarily combined. 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.

[0177] 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 understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations 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, the liquid volume detection unit being electrically connected to a single signal sending unit, a single signal receiving unit, and an angle detection unit; the signal sending unit being used to send a signal to a preset characteristic point of the liquid; the signal being reflected to the signal receiving unit through the liquid surface; The angle detection unit is used to detect the angle of the liquid surface, and the method includes: Acquire the time interval from when the signal sending unit sends the signal to when the signal receiving unit receives the signal, and acquire 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 volume feature vector of the liquid in the container according to the time interval, the roll angle, the pitch angle and the corresponding angular change acceleration of the liquid surface in the container; The volume feature vector is input into a preset volume detection model to obtain the volume of the liquid in the container; wherein the volume detection model is obtained by training sample data, and the sample data includes the liquid volume under different time intervals, roll angles, pitch angles and angle change acceleration conditions.

2. The method according to claim 1, characterized in that Inputting the volume feature vector into a preset volume detection model to obtain the volume of the liquid in the container includes: Inputting the volume feature vector into a preset volume detection model to obtain a predicted volume of the liquid in the container; Obtaining predicted volumes for a plurality of consecutive time periods, and counting the frequencies of the predicted volumes; A target volume of the liquid in the container is determined according to the frequencies of the predicted volumes.

3. The method according to claim 1, characterized in that The step of obtaining the roll angle, pitch angle, and corresponding angle change acceleration of the liquid surface in the container according to the angle detection unit includes: Acquire the change speed of each angle and the angle change acceleration according to the angle detection unit; wherein the angles include a roll angle, a pitch angle and a heading angle; According to the changing speed of each angle, a target roll angle and a target pitch angle are determined.

4. The method according to claim 3, characterized in that Determining the target roll angle and the target pitch angle according to the change speed of each angle includes: Using a preset filtering strategy, the change speed of each angle is processed to obtain a change speed feature; Integrating the change speed characteristic to obtain a quaternion; According to the quaternion, a target roll angle and a target pitch angle are determined.

5. The method according to claim 1, characterized in that Acquiring the volume detection model includes: Establish an initial volume detection model and obtain different sample volumes and corresponding sample feature vectors; Inputting the sample feature vector into the initial volume detection model and outputting the 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.

6. The method according to claim 5, characterized in that The obtaining of different sample volumes and corresponding sample feature vectors includes: Obtaining the maximum volume, maximum roll angle, maximum pitch angle, and maximum angular change acceleration of the container; Establishing a plurality of sample volumes according to a preset volume unit parameter and the maximum volume; Establishing a plurality of roll angle samples according to a preset roll angle unit parameter and the maximum roll angle; Establishing a plurality of pitch angle samples according to a preset pitch angle unit parameter and the maximum pitch angle; Establishing a plurality of angle change acceleration samples according to a preset angle change acceleration unit parameter and the maximum angle change acceleration; Obtaining the time interval from when the signal sending unit sends a signal to when the signal receiving unit receives the signal under different sample volumes, roll angle samples, pitch angle samples, and angle change acceleration samples, and determining it as a time interval sample; A sample feature vector is established by using the time interval samples, roll angle samples, pitch angle samples, and angle change acceleration.

7. A liquid volume detection device, characterized in that: A liquid volume detection unit applied to a container, the liquid volume detection unit being electrically connected to a single signal sending unit, a single signal receiving unit, and an angle detection unit; the signal sending unit being used to send a signal to a preset characteristic point of the liquid; the signal being reflected to the signal receiving unit through the liquid surface; The angle detection unit is used to detect the angle of the liquid surface, and the device comprises: A data acquisition module, used to acquire the time interval from when the signal sending unit sends a signal to when the signal receiving unit receives the signal, and to acquire 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 to establish a volume feature vector of the liquid in the container according to the time interval, the roll angle, the pitch angle and the corresponding angular change acceleration of the liquid surface in the container; A model prediction module is used to input the volume feature vector into a preset volume detection model to obtain the volume of the liquid in the container; wherein the volume detection model is obtained by training sample data, and the sample data includes the liquid volume under different time intervals, roll angles, pitch angles and angle change acceleration conditions.

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.