Dynamic liquid volume measurement method and device, computer equipment and storage medium
Through the liquid level measurement system combined with capacitive induction material and motion detection module, the unstable problem of liquid capacity measurement in the motion state of the liquid container is solved, and accurate liquid capacity measurement is achieved.
Patent Information
- Application Number
- CN202411454351.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art is difficult to accurately measure the liquid capacity in the state of moving liquid containers, and fluctuations in the liquid level lead to unstable or failure of the measurement results.
The liquid level measurement system is adopted, including the liquid level detection module, the motion detection module and the main control module, and the liquid level changes are detected through capacitive induction materials, and the pre-trained liquid capacity measurement model is inputted in combination with the triaxial angular velocity, pitch angle and roll angle. Calculate the liquid capacity.
Accurate liquid capacity measurement in the motion state of the liquid container is achieved, and measurement instability caused by liquid level fluctuations is avoided. It is suitable for detection containers of any shape and size.
Smart Images

Figure CN119437360A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of liquid level measurement technology, and in particular to a method, device, computer equipment, and storage medium for measuring dynamic liquid capacity. Background Art
[0002] With the development of technology and the diversification of application scenarios, the demand for being able to accurately measure the volume of liquids in motion is increasing. At present, in the prior art, the methods for measuring the volume of liquids in containers mainly include the graduated bottle observation method, the pressure change measurement method, the photoelectric liquid level measurement method, and the capacitive liquid level measurement method. Most existing measurement methods can only measure when the liquid is in a static state. Once the container is in motion, the fluctuation of the liquid level will cause the measurement result to be unstable or even invalid, and it is impossible to test the liquid volume in the container in motion. Summary of the invention
[0003] Based on this, it is necessary to provide a dynamic liquid capacity measurement method, device, computer equipment, and storage medium to address the above technical problems.
[0004] In a first aspect, the present application provides a method for measuring dynamic liquid capacity. A main control module applied to a liquid level measurement system, the liquid level measurement system includes a detection container and a detection circuit, the detection circuit includes a liquid level detection module, a motion detection module and a main control module, the liquid level detection module is connected to the detection container via a capacitive sensing material, and the method includes:
[0005] receiving a liquid level level sent by the liquid level detection module, wherein the liquid level level is obtained by converting a capacitance value of a capacitive sensing material on a detection container received by the liquid level detection module;
[0006] Receiving the three-axis angular velocity, pitch angle and roll angle sent by the motion detection module, wherein the pitch angle and roll angle are obtained based on the three-axis acceleration processing by the digital motion processing module inside the motion detection module;
[0007] The liquid level, the three-axis angular velocity, the pitch angle and the roll angle are input into a pre-trained liquid capacity measurement model to obtain the liquid capacity in the detection container.
[0008] In one embodiment, the liquid level is calculated by:
[0009] Acquire a first capacitance value detected by a first capacitance detection channel and a second capacitance value detected by a second capacitance detection channel of the liquid level detection module;
[0010] Acquire a first zero-liquid-level capacitance value and a first full-liquid-level capacitance value of a pre-calibrated first capacitance detection channel, and a second zero-liquid-level capacitance value and a second full-liquid-level capacitance value of a pre-calibrated second capacitance detection channel;
[0011] The liquid level level is obtained based on the first capacitance value, the second capacitance value, the first zero liquid level capacitance value, the first full liquid level capacitance value, the second zero liquid level capacitance value, and the second full liquid level capacitance value.
[0012] In one embodiment, before inputting the liquid level, the three-axis angular velocity, the pitch angle and the roll angle into a pre-trained liquid capacity measurement model, the method includes:
[0013] Normalizing the pitch angle and the roll angle based on the preset angle sampling ranges of the pitch angle and the roll angle to obtain normalized angle values;
[0014] Normalizing the three-axis angular velocity based on the preset speed sampling values of the three-axis angular velocity to obtain normalized angular velocity values;
[0015] The liquid level level is subjected to binary processing to obtain a processed liquid level level.
[0016] In one embodiment, obtaining the liquid capacity in the detection container includes:
[0017] Set the window length to L, where L is a natural number greater than or equal to 1;
[0018] The currently outputted liquid volume and the previous (L-1) liquid volume are obtained as a window, and multiple windows are obtained based on a preset step size;
[0019] The liquid capacity ranked first in the plurality of windows is used as the liquid capacity in the current detection container.
[0020] In one embodiment, the training process of the liquid capacity measurement model includes:
[0021] The liquid capacity measurement model is based on a multi-layer perceptron algorithm and is trained using pre-constructed training samples;
[0022] Normalizing the three-axis angular velocity, pitch angle, roll angle, and liquid level level at different inclination angles at different liquid levels in the training samples to obtain normalized sample data;
[0023] The multi-layer perceptron algorithm is trained according to the normalized sample data to obtain the liquid capacity measurement model.
[0024] In one of the embodiments, the window size is set based on the liquid flow rate.
[0025] In a second aspect, the present application further provides a dynamic liquid capacity measuring device, which is applied to a main control module of a liquid level measurement system, wherein the liquid level measurement system includes a detection container and a detection circuit, wherein the detection circuit includes a liquid level detection module, a motion detection module and a main control module, wherein the liquid level detection module is connected to the detection container via a capacitive sensing material, and wherein the device includes:
[0026] A first receiving module, used for receiving the liquid level level sent by the liquid level detection module, wherein the liquid level level is obtained by converting the capacitance value of the capacitive sensing material on the detection container received by the liquid level detection module;
[0027] A second receiving module is used to receive the three-axis angular velocity, pitch angle and roll angle sent by the motion detection module, wherein the pitch angle and roll angle are obtained based on the three-axis acceleration processed by the digital motion processing module inside the motion detection module;
[0028] The measuring module is used to input the liquid level, the three-axis angular velocity, the pitch angle and the roll angle into a pre-trained liquid capacity measurement model to obtain the liquid capacity in the detection container.
[0029] In a third aspect, the present disclosure 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 steps of the dynamic liquid capacity measurement method are implemented.
[0030] In a fourth aspect, the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the dynamic liquid capacity measurement method when executed by a processor.
[0031] In a fifth aspect, the present disclosure further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the dynamic liquid capacity measurement method are implemented.
[0032] The above-mentioned dynamic liquid capacity measurement method has at least the following beneficial effects:
[0033] The embodiment scheme provided by the present disclosure is a liquid level measurement system including a detection container and a detection circuit. The liquid level detection module is connected to the detection container via a capacitive sensing material. The liquid level detection module calculates the height of the liquid level by detecting the change in the capacitance value of the capacitive sensing material. Direct contact with the liquid is not required, so non-contact detection is achieved. Moreover, detection containers of any shape and size can be detected to accurately measure the capacity of the liquid.
[0034] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0036] FIG1 is a structural diagram of a liquid container measuring device in one embodiment;
[0037] Figure 2 A schematic diagram of a flow chart of a method for measuring dynamic liquid capacity in one embodiment;
[0038] Figure 3 is a schematic diagram of a liquid level detection module in one embodiment;
[0039] Figure 4 is a schematic diagram of a motion detection module in one embodiment;
[0040] Figure 5 is a schematic diagram of a detection circuit in one embodiment;
[0041] Figure 6 A schematic diagram of a liquid capacity measurement model in one embodiment;
[0042] Figure 7 is a structural block diagram of a dynamic liquid capacity measuring device in one embodiment;
[0043] FIG8 is a diagram showing the internal structure of a computer device in one embodiment;
[0044] FIG. 9 is a diagram showing the internal structure of a server in an embodiment. DETAILED DESCRIPTION
[0045] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0046] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described here can be implemented in an order other than those illustrated or described here. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are only examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims. The terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, product or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such process, method, product or device. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or device including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any specific order.
[0047] The embodiment of the present disclosure provides a dynamic liquid capacity measurement method, which can be applied in the application environment shown in FIG1. FIG1 is a structural diagram of a liquid container measurement device in an embodiment, including a detection container 102 and a detection circuit 104. The detection circuit includes a liquid level detection module, a motion detection module and a main control module. The liquid level detection module is connected to the detection container 102 through a capacitive sensing material 106. The detection circuit 104 is usually connected to the capacitive sensing material 106 using a wire 108 with good conductivity, such as a copper wire or other suitable conductive material. The detection container 102 is a container for containing the liquid to be measured, which is usually made of insulating materials, such as plastic, glass or other non-metallic materials to ensure that the container does not interfere with the capacitance measurement. It can be a container of various shapes and sizes. The capacitive sensing material 106 is used to detect liquid level changes. When the liquid contacts or approaches the sensing capacitive material, its capacitance value will change. In an embodiment of the present disclosure, copper foil can be used as the capacitive sensing material. Copper foil has good conductivity and is suitable for making capacitive sensors. Copper foil can be attached to the inner wall or outer wall of the container to improve detection accuracy and sensitivity.
[0048] In some embodiments of the present disclosure, Figure 2 As shown, a dynamic liquid capacity measurement method is provided. In a specific embodiment, the method may include the following steps:
[0049] S202: Receive a liquid level level sent by the liquid level detection module, where the liquid level level is obtained by converting a capacitance value of a capacitive sensing material on a detection container received by the liquid level detection module.
[0050] Figure 3 This is a schematic diagram of a liquid level detection module in an embodiment. The liquid level detection module can use the TM611AWLCOR chip, which is a multi-channel capacitive sensor chip. Among them, VDD is connected to a 3.3V power supply, and GND is grounded; SDA and SCL are used for I2C communication with the main control module, SCL is the I2C clock input port, and SDA is the I2C data input and output port; SEN is used as a sensitivity capacitor interface, and an external capacitor of 5pf-100pf is connected. The smaller the capacitance value, the higher the sampling count value. This device uses 15pf, and then grounded; VREG is used as an internal reference source output, connected to a 4.7nf capacitor for grounding; CX0 and CX1 are sensing pins, with a series resistor of 3KΩ, connected to copper foil to read the sensing capacitance value, and other pins can be left empty.
[0051] Copper foil is attached to the inner or outer wall of the detection container as a capacitive sensing material. When liquid contacts or approaches the copper foil, the capacitance value of the copper foil will change. The TM611AWLCOR chip is used to read the capacitance value through the CX0 and CX1 pins and convert it into a liquid level. The liquid level detection module communicates with the main control module through the SDA and SCL pins through I2C. The liquid level detection module sends the calculated liquid level to the main control module through the I2C bus. The main control module receives the liquid level data from the liquid level detection module through the I2C interface and stores the received liquid level data in the memory for subsequent processing.
[0052] S204: receiving the three-axis angular velocity, pitch angle and roll angle sent by the motion detection module, wherein the pitch angle and roll angle are obtained based on the three-axis acceleration processed by the digital motion processing module inside the motion detection module.
[0053] Figure 4 This is a schematic diagram of a motion detection module in an embodiment. The motion detection module can use an MPU6050 chip, including a 3-axis MEMS gyroscope and a 3-axis MEMS accelerometer, and has a built-in digital motion processing module. VDD is connected to a 3.3V power supply, and GND is connected to ground; SDA and SCL are used for I2C communication with the main control module, SCL is the I2C clock input port, and SDA is the I2C data input and output port; CPOUT charge pump capacitor interface is connected to a 2200pf capacitor grounded; FSYNC frame synchronization digital input interface is grounded; REGOUT calibration filter capacitor interface is connected to a 0.1uf capacitor grounded; VLOGIC digital I / O power supply voltage is connected to VCC; CLKIN external clock input is grounded; AD0 is grounded by default.
[0054] The three-axis gyroscope is used to calculate the three-axis angular velocity, that is, the rotation rate of the container around the three axes of X, Y, and Z. The three-axis accelerometer is used to calculate the three-axis acceleration, that is, the acceleration of the container in the three directions of X, Y, and Z. The digital motion processing module filters and fuses the sensor data to reduce the noise in the sensor data and provide more accurate attitude estimation. The three-axis acceleration is processed to obtain the quaternion, and the Euler angle is calculated based on the quaternion to obtain the pitch angle and roll angle.
[0055] S206: Input the liquid level, the three-axis angular velocity, the pitch angle and the roll angle into a pre-trained liquid capacity measurement model to obtain the liquid capacity in the detection container.
[0056] Figure 5 The main control module can use the CCR4x series chip, which has low power consumption and low cost, and has a built-in communication interface that supports multiple communication protocols, such as I2C, SPI, UART, etc. It also has a built-in neural network inference engine NPU for data calculation.
[0057] In one embodiment of the present disclosure, the CCR4x main control chip actively obtains the three-axis acceleration, roll angle and pitch angle data of the MPU6050 through I2C communication, and the CCR4x main control chip actively obtains the liquid level data of the TM611AWLCOR through I2C communication, and obtains the liquid capacity in the detection container by inputting it into a pre-trained liquid capacity measurement model.
[0058] In the above-mentioned dynamic liquid capacity measurement method, the liquid level measurement system includes a detection container and a detection circuit. The liquid level detection module is connected to the detection container through a capacitive sensing material. The liquid level detection module calculates the height of the liquid level by detecting the change in the capacitance value of the capacitive sensing material. It does not require direct contact with the liquid, thereby realizing non-contact detection. Moreover, it can detect detection containers of any shape and size and accurately measure the capacity of the liquid.
[0059] In some embodiments of the present disclosure, the liquid level is calculated by:
[0060] Acquire a first capacitance value detected by a first capacitance detection channel and a second capacitance value detected by a second capacitance detection channel of the liquid level detection module;
[0061] Acquire a first zero-liquid-level capacitance value and a first full-liquid-level capacitance value of a pre-calibrated first capacitance detection channel, and a second zero-liquid-level capacitance value and a second full-liquid-level capacitance value of a pre-calibrated second capacitance detection channel;
[0062] The liquid level level is obtained based on the first capacitance value, the second capacitance value, the first zero liquid level capacitance value, the first full liquid level capacitance value, the second zero liquid level capacitance value, and the second full liquid level capacitance value.
[0063] First, the liquid level threshold is calibrated, which may include the first capacitance detection channel CX0 and the second capacitance detection channel CX1 in this embodiment. Setting of the threshold of the first capacitance detection channel CX0: When the container is completely empty, record the capacitance value of CX0 as the first zero liquid level capacitance value TH0Z; when the container is completely filled with liquid, record the capacitance value of CX0 as the first full liquid level capacitance value TH0F. Setting of the threshold of the second capacitance detection channel CX1: When the container is completely empty, record the capacitance value of CX1 as the second zero liquid level capacitance value TH1E; when the container is completely filled with liquid, record the capacitance value of CX1 as the second full liquid level capacitance value TH1F. When the liquid in the container contacts or approaches the copper foil, the capacitance values of CX0 and CX1 will change, and the TM611AWLCOR chip detects the capacitance value changes of CX0 and CX1. The current liquid level can be determined by the pre-calibrated thresholds TH0Z, TH0F, TH1E and TH1F. The empty level is 0 and the full level is 255.
[0064] Calculation of CX0 level: Level CX0 = (TH0F-TH0Z) / (TH0-TH0Z)×255, CX1 level: Level CX1 = (TH1F-TH1E) / (TH1-TH1E)×255, where TH0 and TH1 are the current capacitance values of CX0 and CX1 respectively. The average of these two levels can be used to get the final result.
[0065] In some embodiments of the present disclosure, before inputting the liquid level, the three-axis angular velocity, the pitch angle and the roll angle into a pre-trained liquid capacity measurement model, the method includes:
[0066] Normalizing the pitch angle and the roll angle based on the preset angle sampling ranges of the pitch angle and the roll angle to obtain normalized angle values;
[0067] Normalizing the three-axis angular velocity based on the preset speed sampling values of the three-axis angular velocity to obtain normalized angular velocity values;
[0068] The liquid level level is subjected to binary processing to obtain a processed liquid level level.
[0069] The sampling range of pitch angle and roll angle is ±90°, so the normalization of pitch angle and roll angle is divided by 90 to make the range [-1, 1]; the sampling range of three-axis angular velocity is 2000 radians / second, but in actual applications, the three-axis angular velocity generally does not exceed 200 radians / second. In order to make the multi-layer perceptron better feel the change of angular velocity, the angular velocity value is first truncated, and the value greater than 200 is truncated to 200, and then normalized and divided by 200 to make the range [-1, 1]. The truncation process can remove abnormal values beyond the normal range and reduce the impact of noise on the model; the range of liquid level is 0-255. Since the liquid level needs a more refined representation, the liquid level is converted into an eight-bit binary representation. For example, the eight-bit binary representation of 0 is 00000000, and the eight-bit binary representation of 255 is 11111111. Taking 0-255ml as an example, the output is also converted into eight-bit binary for representation. Normalization can unify data of different scales into the same range, which helps to improve the convergence speed and accuracy of the model.
[0070] In some embodiments of the present disclosure, obtaining the liquid capacity in the detection container includes:
[0071] Set the window length to L, where L is a natural number greater than or equal to 1;
[0072] The currently outputted liquid volume and the previous (L-1) liquid volume are obtained as a window, and multiple windows are obtained based on a preset step size;
[0073] The liquid capacity ranked first in the plurality of windows is used as the liquid capacity in the current detection container.
[0074] Since there is a certain amount of noise in the sensor output value during the motion state, a sliding window can be used to take the most of the method to remove the influence of outliers. In one embodiment of the present disclosure, a window with a window length of L and a step length of 1 is set. When the detection algorithm continuously outputs the predicted capacity value, the current output and the previous L-1 outputs are taken as a window, and the number of each capacity value is counted. The one with the largest number is the current capacity, which can ensure that the liquid capacity maintains a reasonable change when it changes gradually.
[0075] In some embodiments of the present disclosure, the window size is set based on the liquid flow rate.
[0076] The window length setting can be determined according to the flow rate of the container liquid. If the flow rate is large, the window length can be set smaller to improve sensitivity. If the flow rate is small, the window length can be set larger to maintain stability.
[0077] In some embodiments of the present disclosure, the training process of the liquid capacity measurement model includes:
[0078] The liquid capacity measurement model is based on a multi-layer perceptron algorithm and is trained using pre-constructed training samples;
[0079] Normalizing the three-axis angular velocity, pitch angle, roll angle, and liquid level level at different inclination angles at different liquid levels in the training samples to obtain normalized sample data;
[0080] The multi-layer perceptron algorithm is trained according to the normalized sample data to obtain the liquid capacity measurement model.
[0081] The multi-layer perceptron (MLP) algorithm can be used as a capacity prediction algorithm. It is a neural network composed of fully connected layers with at least one hidden layer, and the output of each hidden layer is transformed by an activation function. Compared with manual feature extraction, using a multi-layer perceptron to automatically extract features will achieve better results. Compared with traditional algorithms, such as table lookup or least squares method, the use of a multi-layer perceptron algorithm can reduce the error of the final capacity prediction value from ±20% to within ±10%, so this method is used. For the modeling of this prediction model, the input is one-dimensional data, the output is also one-bit data, and there is a certain nonlinear relationship between the input and output. The training sample can collect data at different tilt angles at intervals of 10ml, and collect the pitch angle, roll angle, three-axis angular velocity and liquid level at different angles under the current liquid level. The liquid capacity measurement model is trained based on the multi-layer perceptron algorithm, and the deep model operators used are Linear linear layer, ReLU, and Sigmod non-activated layer. Figure 6 Schematic diagram of the framework of a liquid capacity measurement model in one embodiment.
[0082] Table 1 is the detailed table of the capacity detection algorithm. There are two input data. The first set of data is five sets of data of the pitch angle, roll angle and three-axis angular velocity of the gyroscope normalized by preprocessing. The second set of data is eight sets of data represented by eight-bit binary of the liquid level level. The output is the capacity value predicted by the model.
[0083] Table 1. Capacity detection algorithm details
[0084]
[0085] 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.
[0086] Based on the same inventive concept, the embodiment of the present disclosure also provides a dynamic liquid capacity measuring device for implementing the above-mentioned dynamic liquid capacity measuring method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the embodiment of the dynamic liquid capacity measuring device provided below can refer to the limitations of the dynamic liquid capacity measuring method above, and will not be repeated here.
[0087] The device may include a system (including a distributed system), software (application), module, component, server, client, etc. that uses the method described in the embodiments of this specification and is combined with necessary implementation hardware. Based on the same innovative concept, the device in one or more embodiments provided in the embodiments of the present disclosure is as described in the following embodiments. Since the implementation scheme and method of the device to solve the problem are similar, the implementation of the specific device in the embodiments of this specification can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0088] In one embodiment, Figure 7 As shown, a dynamic liquid capacity measuring device 700 is provided, and the device may be the aforementioned server, or a module, component, device, unit, etc. integrated in the server. A main control module applied to a liquid level measurement system, the liquid level measurement system includes a detection container and a detection circuit, the detection circuit includes a liquid level detection module, a motion detection module and a main control module, the liquid level detection module is connected to the detection container through a capacitive sensing material, and the device 700 may include:
[0089] A first receiving module 702 is used to receive the liquid level level sent by the liquid level detection module, where the liquid level level is obtained by converting the capacitance value of the capacitive sensing material on the detection container received by the liquid level detection module;
[0090] A second receiving module 704 is used to receive the three-axis angular velocity, pitch angle and roll angle sent by the motion detection module, where the pitch angle and roll angle are obtained based on the three-axis acceleration processed by the digital motion processing module inside the motion detection module;
[0091] The measurement module 706 is used to input the liquid level, the three-axis angular velocity, the pitch angle and the roll angle into a pre-trained liquid capacity measurement model to obtain the liquid capacity in the detection container.
[0092] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0093] Each module in the above-mentioned dynamic liquid volume measurement 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.
[0094] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG8 . The computer device includes a processor, a memory, and a network interface connected via a system bus. 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 capacity. The network 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 dynamic liquid capacity measurement method is implemented.
[0095] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG9. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected via a system bus. Among them, 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 and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a dynamic liquid capacity measurement method is implemented. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, a trackball or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0096] Those skilled in the art will understand that the structures shown in FIG. 8 and FIG. 9 are merely block diagrams of partial structures related to the scheme of the present disclosure, and do not constitute a limitation on the computer device to which the scheme of the present disclosure is applied. The specific computer device may include more or fewer components than those shown in the figures, or combine certain components, or have a different arrangement of components.
[0097] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in any embodiment of the present disclosure is implemented.
[0098] In one embodiment, a computer program product is provided, including a computer program, which implements the method described in any embodiment of the present disclosure when executed by a processor.
[0099] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method 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 by the present disclosure 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 by the present disclosure 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 by the present disclosure may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc., but are not limited to this.
[0100] 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.
[0101] The above-described embodiments only express several implementation methods of the present disclosure, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out 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 disclosure, and these all belong to the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the attached claims.
Claims
1. A method for measuring dynamic liquid capacity, characterized in that: A main control module applied to a liquid level measurement system, the liquid level measurement system comprises a detection container and a detection circuit, the detection circuit comprises a liquid level detection module, a motion detection module and a main control module, the liquid level detection module is connected to the detection container via a capacitive sensing material, the method comprises: receiving a liquid level level sent by the liquid level detection module, wherein the liquid level level is obtained by converting a capacitance value of a capacitive sensing material on a detection container received by the liquid level detection module; Receiving the three-axis angular velocity, pitch angle and roll angle sent by the motion detection module, wherein the pitch angle and roll angle are obtained based on the three-axis acceleration processing by the digital motion processing module inside the motion detection module; The liquid level, the three-axis angular velocity, the pitch angle and the roll angle are input into a pre-trained liquid capacity measurement model to obtain the liquid capacity in the detection container.
2. The method according to claim 1, characterized in that The calculation method of the liquid level level includes: Acquire a first capacitance value detected by a first capacitance detection channel and a second capacitance value detected by a second capacitance detection channel of the liquid level detection module; Acquire a first zero-liquid-level capacitance value and a first full-liquid-level capacitance value of a pre-calibrated first capacitance detection channel, and a second zero-liquid-level capacitance value and a second full-liquid-level capacitance value of a pre-calibrated second capacitance detection channel; The liquid level level is obtained based on the first capacitance value, the second capacitance value, the first zero liquid level capacitance value, the first full liquid level capacitance value, the second zero liquid level capacitance value, and the second full liquid level capacitance value.
3. The method according to claim 1, characterized in that Before inputting the liquid level, the three-axis angular velocity, the pitch angle and the roll angle into a pre-trained liquid capacity measurement model, the method includes: Normalizing the pitch angle and the roll angle based on the preset angle sampling ranges of the pitch angle and the roll angle to obtain normalized angle values; Normalizing the three-axis angular velocity based on the preset speed sampling values of the three-axis angular velocity to obtain normalized angular velocity values; The liquid level level is subjected to binary processing to obtain a processed liquid level level.
4. The method according to claim 1, characterized in that: The obtaining of the liquid capacity in the detection container comprises: Set the window length to L, where L is a natural number greater than or equal to 1; The currently outputted liquid volume and the previous (L-1) liquid volume are obtained as a window, and multiple windows are obtained based on a preset step size; The liquid capacity ranked first in the plurality of windows is used as the liquid capacity in the current detection container.
5. The method according to claim 1, characterized in that The training process of the liquid capacity measurement model includes: The liquid capacity measurement model is based on a multi-layer perceptron algorithm and is trained using pre-constructed training samples; Normalizing the three-axis angular velocity, pitch angle, roll angle, and liquid level level at different inclination angles at different liquid levels in the training samples to obtain normalized sample data; The multi-layer perceptron algorithm is trained according to the normalized sample data to obtain the liquid capacity measurement model.
6. The method according to claim 4, characterized in that The window size is set based on the liquid flow rate.
7. A dynamic liquid capacity measuring device, characterized in that: A main control module applied to a liquid level measurement system, the liquid level measurement system includes a detection container and a detection circuit, the detection circuit includes a liquid level detection module, a motion detection module and a main control module, the liquid level detection module is connected to the detection container through a capacitive sensing material, and the device includes: A first receiving module, used for receiving the liquid level level sent by the liquid level detection module, wherein the liquid level level is obtained by converting the capacitance value of the capacitive sensing material on the detection container received by the liquid level detection module; A second receiving module is used to receive the three-axis angular velocity, pitch angle and roll angle sent by the motion detection module, wherein the pitch angle and roll angle are obtained based on the three-axis acceleration processed by the digital motion processing module inside the motion detection module; The measuring module is used to input the liquid level, the three-axis angular velocity, the pitch angle and the roll angle into a pre-trained liquid capacity measurement model to obtain the liquid capacity in the detection 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.