Vehicle fuel quantity calculation method and device and electronic equipment
Through the method of segmented linear calculation and vehicle speed adjustment, the nonlinear problem of fuel resistance and remaining fuel volume is solved, the accuracy of fuel display and the reliability of cruising range calculation are improved, and the user experience is improved.
Patent Information
- Application Number
- CN202511075100.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-01
- Publication Date
- 2025-09-19
AI Technical Summary
In the existing technology, due to analog circuit errors and the diversity of fuel tank structures, the relationship between fuel resistance and remaining fuel level is nonlinear, resulting in inaccurate fuel level calculation, which affects the driver's driving experience.
A piecewise linear calculation method is used, combined with the fuel resistance value and vehicle speed parameters, to dynamically adjust the step damping of fuel quantity changes, thereby improving the accuracy of fuel display and the reliability of cruising range calculation.
By using segmented linear calculation and vehicle speed introduction methods, the accuracy of fuel display and the reliability of mileage calculation are improved, thus improving the user experience.
Smart Images

Figure CN120663740A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of fuel tank fuel level detection and automobile cockpit electronic instrument panels, and in particular to a vehicle fuel level calculation method, device and electronic equipment. Background Art
[0002] A car's fuel tank is equipped with an oil float that follows the gasoline level, causing the sliding resistor in the tank to change. The MCU chip in the electronic instrument then uses an ADC analog-to-digital converter to detect the voltage change across the sliding resistor and obtain the voltage value. Finally, after obtaining the voltage value, the MCU converts the voltage value into a resistance value based on the design of the hardware detection circuit. This resistance value is then converted into the corresponding oil level and sent to the SOC, which displays the oil level value on the instrument's electronic screen. The MCU is used as the microcontroller unit (MCU) in the car's cockpit electronic instrument, sampling the oil float's resistance value. The SOC interacts with the MCU to run the system-on-chip (SoC) that displays the instrument screen. The ADC is an analog-to-digital converter.
[0003] Large errors in analog circuits, coupled with the volatility and hysteresis of mechanical motion, cause the oil float to oscillate with large amplitudes and durations during vehicle operation. Furthermore, the diverse and irregular structure of fuel tanks prevents the ideal linear relationship between voltage, resistance, and fuel level. This further inaccurately calculates range, leading to erroneous instructions and misjudgments for the driver, severely impacting the driving experience. Summary of the Invention
[0004] The embodiments of the present application provide a vehicle fuel quantity calculation method, device, and electronic device to improve the accuracy of the calculation results and the stability of the instrument fuel value display, thereby improving the user's vehicle experience.
[0005] The embodiments of this application adopt the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a method for calculating the fuel level of a vehicle, wherein the calculation method includes:
[0007] Determine the remaining fuel level in the fuel tank based on the fuel resistance value of the fuel tank; and
[0008] Based on the piecewise linear calculation result of the remaining fuel amount and the current display result of the remaining fuel amount in the fuel tank, when the piecewise linear calculation result is less than the current display result, the current display result of the remaining fuel amount is updated based on the current vehicle speed value.
[0009] In a second aspect, an embodiment of the present application further provides a vehicle fuel quantity calculation device, wherein the calculation device includes:
[0010] a determination module, configured to determine the remaining fuel amount in the fuel tank according to the fuel resistance value of the fuel tank; and
[0011] An updating module is configured to update the currently displayed result of the remaining fuel amount based on the piecewise linear calculation result of the remaining fuel amount and the currently displayed result of the remaining fuel amount in the fuel tank, if the piecewise linear calculation result is less than the currently displayed result, based on the current vehicle speed value.
[0012] In a third aspect, an embodiment of the present application further provides an electronic device comprising: a processor; and a memory arranged to store computer-executable instructions, wherein the executable instructions, when executed, cause the processor to execute the above method; or the electronic device comprises the apparatus described in the second aspect.
[0013] At least one of the above-mentioned technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: according to the fuel resistance value of the fuel tank, the remaining fuel amount in the fuel tank is determined as the remaining fuel amount. Then, based on the piecewise linear calculation result of the remaining fuel amount and the current display result of the remaining fuel amount in the fuel tank, when the piecewise linear calculation result is less than the current display result, the current display result of the remaining fuel amount is updated based on the current vehicle speed value. The piecewise linear calculation is adopted to solve the nonlinear correspondence problem between the fuel resistance and the remaining fuel amount caused by the hardware design circuit and different fuel tank structures. At the same time, the speed parameter is introduced to dynamically adjust the step damping of the fuel amount change, thereby improving the accuracy of the fuel display and the reliability of the cruising range calculation, and improving the user's car experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0015] FIG1( a ) is a schematic diagram of the hardware architecture of a method for calculating vehicle fuel level in an embodiment of the present application;
[0016] FIG1( b ) is a schematic diagram of the vibration amplitude of the oil float during sudden braking in an embodiment of the present application;
[0017] FIG1( c ) is a schematic diagram of the vibration amplitude of the oil float when driving on a bumpy road in an embodiment of the present application;
[0018] Figure 2 Schematic diagram of the relationship between the fuel resistance value R and the remaining fuel amount F in the vehicle fuel amount calculation method in an embodiment of the present application;
[0019] Figure 3This is a flow chart of a method for calculating vehicle fuel level in an embodiment of the present application;
[0020] Figure 4 This is a schematic diagram of the implementation principle of the vehicle fuel quantity calculation method in the embodiment of the present application;
[0021] Figure 5 This is a schematic diagram of the relationship between the ADC value and the fuel resistance value of the vehicle fuel quantity calculation method in an embodiment of the present application;
[0022] Figure 6 Schematic diagram of displayed fuel level and real-time fuel level of a vehicle fuel level calculation method in an embodiment of the present application;
[0023] Figure 7 A schematic diagram of fuel endurance and fuel level trends in a method for calculating fuel level of a vehicle in an embodiment of the present application;
[0024] Figure 8 This is a structural diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0025] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0026] The current remaining fuel calculation method is based on Ohm's law: I = U / R. Then, (3.3 – V1) / R(solid) = (V1 – V2) / R. From this, the sliding resistance value of the fuel tank is derived as:
[0027] R=(V1–V2)*R(solid) / (3.3–V1)
[0028] Among them, V1 and V2 can be obtained by calculation after ADC sampling, and R(solid) is a fixed value, so the current fuel resistance value R can be calculated in real time.
[0029] The fuel resistance value is determined by the position of the fuel float, which is related to the remaining fuel level, so the remaining fuel level can be calculated from R2. Assuming the resistance value when the fuel is full is R(f), the resistance value when the fuel is empty is R(e), the current remaining fuel level is F, and the fuel tank capacity is C, then F / C = (R(f) – R2) / (R(f) – R(e)), from which the remaining fuel level in the tank can be deduced:
[0030] F=(R(f)–R2) / (R(f)–R(e))*C
[0031] Among them, R(f), R(e), and C are fixed values, and the remaining oil value F can be calculated in real time based on the R2 value.
[0032] Finally, to account for the oil float's fluctuations caused by vehicle jitter, additional filtering is required. The displayed fuel level will only be incremented if the deviation between the calculated remaining fuel level and the currently displayed fuel level reaches a certain level and persists for a certain period of time. For example, when not refueling, the currently displayed remaining fuel level is 30L, or 30,000ml. If the calculated remaining fuel level is more than 20ml lower than 30,000ml for five consecutive seconds, the currently displayed fuel level is updated to 29,980ml. As shown in Figure 1(b), the arc line represents speed, the horizontal line represents the currently displayed remaining fuel level, the jitter line represents the resistance value, and the jitter represents the fluctuation of the oil float. Figure 1(c) shows a schematic diagram of the oil float's jitter amplitude when driving on a bumpy road. The jitter line represents speed, the horizontal line represents the currently displayed remaining fuel level, the jitter line represents the resistance value, and the jitter of the jitter line represents the fluctuation of the oil float. Depending on the driving conditions, the oil float's jitter amplitude can be extremely large. From full to empty, the sliding resistance value changes by around 300 ohms. The vibration of the oil float can reach 150 ohms under extreme conditions, which is equivalent to a 60L fuel tank vibrating by 30L. The error is extremely large, so it is necessary to add anti-shake processing at the end of the fuel calculation.
[0033] After research, it was found that the existing technology has the following shortcomings:
[0034] (a) Due to errors in the analog circuit itself, the resistance value calculated by ADC sampling will fluctuate up and down, with an error of about 2 ohms. This corresponds to an error of nearly 0.5L in the calculated fuel volume.
[0035] (b) Due to the diversity of fuel tanks and their irregular structures, the relationship between resistance and remaining fuel level is not absolutely linear. Furthermore, the oil float cannot accurately indicate the oil level when it reaches the top or bottom. For example, a fuel tank may be a saddle-shaped tank. Furthermore, the oil float cannot accurately measure when the tank is nearly full or empty.
[0036] (c) To mitigate the effects of jitter, a filtering algorithm and fuel increase / decrease steps are introduced to increase damping. However, this can lead to a larger deviation between the displayed value and the actual value when fuel consumption is high. For example, in severe cases, the fuel level may be displayed as being low when it is actually depleted. The range calculated based on the displayed fuel level can mislead the user, causing the vehicle to stall due to fuel depletion, compromising driving safety.
[0037] Based on the above shortcomings, a simple piecewise linear calculation method is provided in the embodiment of the present application, which can solve the nonlinear correspondence problem between fuel resistance and remaining fuel amount caused by hardware design circuits and different fuel tank structures. At the same time, it adds smoothing processing to the fuel resistance calculation, introduces a speed parameter, and dynamically adjusts the step damping of the fuel amount change, thereby improving the precision and accuracy of fuel display and cruising range calculation.
[0038] The following describes in detail the technical solutions provided by various embodiments of the present application in conjunction with the accompanying drawings.
[0039] As shown in Figure 1(a), it is a schematic diagram of the hardware architecture of the vehicle fuel quantity calculation method in the embodiment of the present application, which mainly includes an instrument display screen, an SOC and an MCU, wherein the MCU includes an ADC sampling module for periodically collecting ADC values and outputting them to the resistance calculation module. The resistance calculation module is used to periodically calculate the resistance, perform smoothing processing, and output the resistance value to the fuel quantity calculation module. The CAN communication module is used to receive the vehicle speed signal from the CAN bus and output it to the fuel quantity calculation module. The fuel quantity calculation module is used to calculate the remaining fuel quantity in a piecewise linear manner based on the resistance value, perform anti-shake processing, and update the displayed fuel quantity in combination with the vehicle speed. The fuel quantity is sent to the SOC side through the inter-chip communication module in the SOC, and the SOC depicts the remaining fuel quantity display on the instrument screen. In addition, the remaining fuel quantity is also output to the endurance calculation module for calculating the fuel endurance mileage.
[0040] like Figure 2 The figure shows the relationship between the remaining fuel amount and the fuel resistance value. The higher the fuel resistance value, the smaller the remaining fuel amount.
[0041] The embodiment of the present application provides a method for calculating the fuel level of a vehicle. Figure 3 As shown, a flow chart of a method for calculating the fuel level of a vehicle according to an embodiment of the present application is provided. The method includes at least the following steps S310 to S320:
[0042] Step S310: determining the remaining fuel amount in the fuel tank according to the fuel resistance value of the fuel tank.
[0043] According to the fuel resistance value in the fuel tank, the remaining fuel amount in the fuel tank can be further calculated.
[0044] Preferably, the fuel resistance value may be smoothed before calculating the remaining fuel amount in the fuel tank.
[0045] Step S320, based on the piecewise linear calculation result of the remaining fuel amount and the current display result of the remaining fuel amount in the fuel tank, if the piecewise linear calculation result is less than the current display result, update the current display result of the remaining fuel amount based on the current vehicle speed value.
[0046] Since the fuel resistance value R is negatively correlated with the remaining fuel volume F, the corresponding relationship is as follows: Figure 2 For example, Figure 2 After the curve in the figure is segmented, a linear calculation is performed on each segment, which is the segmented linear calculation result of the remaining oil amount. It can be understood that the more segments there are, the higher the accuracy.
[0047] Compare the piecewise linear calculation result of the remaining fuel amount with the current display result of the remaining fuel amount in the fuel tank. If the piecewise linear calculation result is less than the current display result, the current display result of the remaining fuel amount needs to be updated and displayed based on the current vehicle speed value.
[0048] Through the above method, piecewise linear calculation is adopted to solve the nonlinear correspondence problem between fuel resistance and remaining fuel volume caused by hardware design circuit and different fuel tank structures.
[0049] Through the above method, the speed parameter is introduced to dynamically adjust the step damping of the fuel volume change, thereby improving the accuracy of the fuel display and the reliability of the cruising range calculation, and improving the user's car experience.
[0050] In addition, the present invention also provides an MCU chip. By installing the MCU chip in a fuel tank and running the vehicle fuel level calculation method described in the present invention on the MCU chip, a smart fuel tank product can be developed. For OEMs, simply by purchasing this smart fuel tank product and communicating with the fuel tank's MCU, the fuel level information can be directly displayed on the vehicle's electronic instrument panel.
[0051] Different from the related art, due to the diversity of fuel tanks, irregular tank structures, and the non-absolute linear relationship between the resistance value and the remaining fuel amount, the segmented linear calculation result of the remaining fuel amount is adopted to improve the accuracy of the result.
[0052] Unlike related technologies, this system introduces a filtering algorithm and fuel level increment and decrement steps to reduce the impact of vibration, increasing damping. However, this can lead to a greater deviation between the displayed value and the actual value when fuel consumption is high. If the result of the piecewise linear calculation is less than the current displayed value, the current displayed value of the remaining fuel level is updated based on the current vehicle speed, and the step damping of the fuel level change is dynamically adjusted, improving the accuracy of the fuel display and the reliability of the range calculation.
[0053] In one embodiment of the present application, the piecewise linear calculation result based on the remaining fuel amount and the current display result of the remaining fuel amount in the fuel tank include: based on the correlation between the fuel resistance value R and the remaining fuel amount F in the fuel tank, using segmented processing and then using linear calculation within each segment to obtain the piecewise linear calculation result of the remaining fuel amount; and obtaining the current display result of the remaining fuel amount in the fuel tank according to the fuel amount display interface.
[0054] like Figure 2 As shown, the correlation between the fuel resistance value R and the remaining fuel amount F in the fuel tank is shown. By adopting segmented processing and then performing linear calculation in each segment, a segmented linear calculation result of the remaining fuel amount can be obtained.
[0055] In one embodiment of the present application, the segmented processing based on the correlation between the fuel resistance value R and the remaining fuel amount F in the fuel tank and the linear calculation within each segment includes: establishing a segmented critical value relationship between the fuel resistance value R and the remaining fuel amount F in the fuel tank; [R 满 , F 满 ]、…[R (n-1) , F (n-1) ]、[R (n) ,F (n) ]…[R 空 , F 空 ]; According to the fuel resistance value R, the calculation result of the remaining fuel amount V is calculated after querying the segment where the fuel resistance value R is located.
[0056] The R 满 、F 满 ] refers to the segmented interval between the remaining full fuel volume and the corresponding full resistance value, [R 空 、F 空 ] refers to the segmented interval of the remaining empty oil volume and the corresponding empty resistance value, [R (n) 、F (n) ] refers to the segmented range between the remaining oil volume n and the corresponding resistance value n. Although the overall relationship between resistance and oil volume is not linear, each segment is linear or nearly linear. The corresponding segmented critical values for resistance and remaining oil volume are shown in the following table: [R full, F full], … [R(n-1), F(n-1)], [R(n), F(n)], … [R empty, F empty]. Therefore, for a given resistance value R, we can determine which segment R falls within. Assuming R falls between R(n-1) and R(n), we can find the corresponding remaining oil volume V. The formula is:
[0057] (F(n-1)–F) / (RR(n-1))=(F(n-1)–F(n)) / (R(n)–R(n-1))
[0058] Furthermore, the remaining oil volume is obtained: V = F(n-1)–(R–R(n-1))*(F(n-1)–F(n)) / (R(n)–R(n-1)), where R is the measured value, and R(n-1), R(n), F(n-1), and F(n) are fixed values. The remaining oil volume calculated linearly after segmentation is closer to the actual situation and has higher accuracy.
[0059] In one embodiment of the present application, when the piecewise linear calculation result is less than the current display result, updating the current display result of the remaining fuel amount based on the current vehicle speed value includes: when the continuously obtained piecewise linear calculation results are all less than the current display result, re-updating and displaying the current display result of the remaining fuel amount based on the current vehicle speed value.
[0060] Since damping is added to the filtering algorithm, for example, if the remaining fuel amount calculated continuously for 5 seconds is at least 20 ml lower than the currently displayed fuel amount, then the currently displayed remaining fuel amount is updated to be reduced by 20 ml, that is, the step fuel amount is 20 ml. However, in actual situations, the fuel consumption often varies depending on the road conditions. Just adjust the deviation value by a ml and the duration by n seconds to achieve the update.
[0061] If the continuously obtained piecewise linear calculation results are all less than the current display result, then re-update and display the current display result of the remaining fuel amount based on the current vehicle speed value.
[0062] It can be understood that the step fuel amount refers to the change amount when updating the fuel amount each time.
[0063] In one embodiment of the present application, re-updating the remaining fuel amount based on the current vehicle speed value includes: according to the current vehicle speed value S and the vehicle speed thresholds S (l) , S (m) , S (h) determine the corresponding step fuel amount V (min) , V (low) , V (mid) , V <统一公式格式,将车速阈值S替换为具体的阈值符号,如S1、S2、S3、S4等,使逻辑更清晰。同时,按照英文表达习惯调整语序。In one embodiment of the present application, when the piecewise linear calculation result is less than the current display result, updating the current display result of the remaining fuel amount based on the current vehicle speed value includes: when the continuously obtained piecewise linear calculation results are all less than the current display result, re-updating and displaying the current display result of the remaining fuel amount based on the current vehicle speed value.
[0060] Since damping is added to the filtering algorithm, for example, if the remaining fuel amount calculated continuously for 5 seconds is at least 20 ml lower than the currently displayed fuel amount, then the currently displayed remaining fuel amount is updated to be reduced by 20 ml, that is, the step fuel amount is 20 ml. However, in actual situations, the fuel consumption often varies depending on the road conditions. Just adjust the deviation value by a ml and the duration by n seconds to achieve the update.
[0061] If the continuously obtained piecewise linear calculation results are all less than the current display result, then re-update and display the current display result of the remaining fuel amount based on the current vehicle speed value.
[0062] It can be understood that the step fuel amount refers to the change amount when updating the fuel amount each time.
[0063] In one embodiment of the present application, re-updating the remaining fuel amount based on the current vehicle speed value includes: according to the current vehicle speed value S and vehicle speed thresholds S1, S2, S3, S4, determine the corresponding step fuel amounts V1, V2, V3, V4. Where, if the current vehicle speed value S <= S1, then the remaining fuel amount updated and displayed each time is V1; if S1 < current vehicle speed value S <= S2, then the remaining fuel amount updated and displayed each time is V2; if S2 < current vehicle speed value S <= S3, then the remaining fuel amount updated and displayed each time is V3; when S3 < S, then the remaining fuel amount updated and displayed each time is V4. V1 represents the minimum value of the step fuel amount, V2 represents the lower value of the fuel intake, V3 represents the intermediate value of the step fuel amount, and V4 represents the maximum value of the step fuel amount. (l) , S (m) 替换为 (m) , S (h) 替换为 (h) 确定对应的步进油量V 替换为determine the corresponding step fuel amount V (min) 替换为 (min) ,V 替换为,V (low) 替换为 (low) ,V 替换为,V (mid) 替换为 (mid) ,V 替换为,V (high) 替换为 (high) ;其中,如果当前车速值S<=车速阈值S 替换为; Where, if the current vehicle speed value S <= vehicle speed threshold S (l) 替换为 (l) 将车速阈值S替换为具体的阈值符号,如S1、S2、S3、S4等,使逻辑更清晰。同时,按照英文表达习惯调整语序。 In one embodiment of the present application, when the piecewise linear calculation result is less than the current display result, updating the current display result of the remaining fuel amount based on the current vehicle speed value includes: when the continuously obtained piecewise linear calculation results are all less than the current display result, re-updating and displaying the current display result of the remaining fuel amount based on the current vehicle speed value.
[0060] Since damping is added to the filtering algorithm, for example, if the remaining fuel amount calculated continuously for 5 seconds is at least 20 ml lower than the currently displayed fuel amount, then the currently displayed remaining fuel amount is updated to be reduced by 20 ml, that is, the step fuel amount is 20 ml. However, in actual situations, the fuel consumption often varies depending on the road conditions. Just adjust the deviation value by a ml and the duration by n seconds to achieve the update.
[0061] If the continuously obtained piecewise linear calculation results are all less than the current display result, then re-update and display the current display result of the remaining fuel amount based on the current vehicle speed value.
[0062] It can be understood that the step fuel amount refers to the change amount when updating the fuel amount each time.
[0063] In one embodiment of the present application, re-updating the remaining fuel amount based on the current vehicle speed value includes: according to the current vehicle speed value S and vehicle speed thresholds S1, S2, S3, S4, determine the corresponding step fuel amounts V1, V2, V3, V4. Where, if the current vehicle speed value S <= S1, then the remaining fuel amount updated and displayed each time is V1; if S1 < current vehicle speed value S <= S2, then the remaining fuel amount updated and displayed each time is V2; if S2 < current vehicle speed value S <= S3, then the remaining fuel amount updated and displayed each time is V3; when S3 < S, then the remaining fuel amount updated and displayed each time is V4. V1 represents the minimum value of the step fuel amount, V2 represents the lower value of the fuel intake, V3 represents the intermediate value of the step fuel amount, and V4 represents the maximum value of the step fuel amount. 替换为 (m) ,则每次更新并显示的剩余油量为V 替换为then the remaining fuel amount updated and displayed each time is V (low) 替换为 (low) ;如果车速阈值S 替换为If the vehicle speed threshold S <00000
[0064] By introducing a vehicle speed variable, obtaining a vehicle speed signal from the CAN network accessed by the whole vehicle, and dynamically adjusting the steps according to the vehicle speed signal, the deviation caused by the above two road conditions can be effectively avoided. For example, for vehicle speed S and a selected vehicle speed threshold S (l) 、S (m) 、S (h) ; corresponding step-by-step fuel quantity V (min) 、V (low) 、V (mid) 、V (high) :
[0065] When S <= S (l) , the remaining fuel quantity displayed each time is V (min) milliliters;
[0066] When S (l) < S <= S (m) , the remaining fuel quantity displayed each time is V (low) milliliters;
[0067] When S (m) < S <= S (h) , the remaining fuel quantity displayed each time is V (mid) milliliters;
[0068] When S (h) [[ID=E45]]< S, the remaining fuel quantity displayed each time is V (high) milliliters.
[0069] In an embodiment of the present application, in a scenario close to the actual fuel quantity value, the step-by-step fuel quantity is adjusted to a high response value; in an anti-shake scenario, the adjustment of the step-by-step fuel quantity is adjusted to a low response value.
[0070] Generally, if the step-by-step fuel quantity is set low for anti-shake, when driving at high speed, the update of the displayed fuel quantity is slow, and there will be a problem that the deviation between the displayed value and the actual value becomes larger and larger. The displayed fuel quantity is high but the actual fuel quantity is low. Therefore, for a scenario close to the actual fuel quantity value, the step-by-step fuel quantity can be adjusted to a high response value to meet the display requirements when driving at high speed. If the step-by-step fuel quantity is set high to follow the actual value, when driving on a bumpy road, the shaking amplitude is large and the fluctuation time is long, and there will be a problem of erroneously reducing the displayed fuel quantity. The displayed fuel quantity is low but the actual fuel quantity is high. Therefore, for an anti-shake scenario, the step-by-step fuel quantity can be adjusted to a low response value to meet the display requirements when shaking.
[0071] In one embodiment of the present application, determining the remaining fuel amount in the fuel tank based on the fuel resistance value of the fuel tank includes performing the following smoothing processing on the fuel resistance value of the fuel tank: periodically sampling an ADC value and converting the ADC value into a fuel resistance value; treating N fuel resistance values as a group, filtering out M medians from the N fuel resistance values, and then averaging the M medians to determine the current fuel resistance value, where N and M are natural numbers.
[0072] like Figure 4 As shown, the specific steps include:
[0073] Step S1: ADC periodically samples, for example, once every 20ms, converts the data into a voltage value, and then converts the voltage value into a resistance value according to Ohm's law.
[0074] Step S2, after collecting N effective resistance values, for example, N=10, smoothing the 10 resistance values, for example, taking the middle two values after sorting, adding the two values and dividing by 2 to obtain the average, to obtain the smoothed resistance value;
[0075] Step S3, determining the segmented interval of the resistance value according to the conversion table of resistance and remaining fuel amount, and then performing a linear calculation on the current interval to obtain the remaining fuel amount corresponding to the current resistance value;
[0076] Step S4: Compare the calculated remaining fuel level with the currently displayed remaining fuel level. For example, if the remaining fuel level is less than the currently displayed remaining fuel level by more than 25 ml for 5 consecutive seconds, update the remaining fuel level based on the vehicle speed; otherwise, do not update. For example, when updating:
[0077] If the vehicle speed is >120, the remaining fuel displayed will be reduced by 50ml;
[0078] Otherwise, if the vehicle speed is >60, the remaining fuel amount will be reduced by 40ml;
[0079] Otherwise, if the vehicle speed is >30, the remaining fuel amount displayed will be reduced by 30ml;
[0080] Otherwise, reduce the displayed remaining oil amount by 20 ml; and return to step S1.
[0081] In one embodiment of the present application, the fuel resistance value of the fuel tank includes: establishing a segmented critical value relationship between the fuel resistance value R and the ADC value: [ADC 满 , R 满 ]、…[ADC (n-1) , R (n-1) ]、[ADC (n) , R (n) ]、…[ADC 空 , R 空]; According to the ADC value, the calculation result of the fuel resistance value R is calculated after querying the segment where the ADC value is located.
[0082] like Figure 5 As shown, the corresponding relationship of the segmented critical values is shown in the following table:
[0083] [ADC full, F full], …[R(n-1), F(n-1)], [R(n), F(n)], …, [R empty, F empty]
[0084] For the ADC value obtained by sampling, query its segment, and you will get:
[0085] (RR(n-1)) / (ADC-ADC(n-1))=(R(n)–R(n-1)) / (ADC(n)–ADC(n-1))
[0086] So we can get: R = R(n-1) + (ADC-ADC(n-1)) * (R(n)-R(n-1)) / (ADC(n)-ADC(n-1)).
[0087] The piecewise linear calculation method is only used for fuel quantity calculation, but it can also be applied to the calculation of fuel resistance. Some fuel detection circuits do not have a completely linear relationship between voltage and resistance. If this method is used, the specific sampling circuit design does not need to be considered.
[0088] Because the ADC value is positively correlated with the fuel resistance, a circuit designed based on a given hardware design can measure the corresponding relationship between the ADC value and the resistance. This reduces the nonlinear error of analog circuit detection and improves accuracy. It also eliminates the need to convert the ADC value into a voltage value as required by Ohm's law, making it simple and efficient to implement.
[0089] By using the above method, the fuel resistance calculation is smoothed, reducing the detection error of the analog circuit and the fluctuation of the fuel resistance value.
[0090] like Figure 6 As shown in the figure, the trends of the displayed fuel level (remaining fuel level) a and the actual fuel level (the sampled fuel level after the oil float stops fluctuating after the vehicle stops) b in the 30% urban road section, 60% expressway section, and 10% bumpy road section are basically consistent. Figure 7 The figure shows the fuel level, collecting the fuel level and fuel endurance trends, and there is no significant deviation in the mileage trend.
[0091] The embodiment of the present application further provides a vehicle fuel quantity calculation device, wherein the calculation device includes:
[0092] a determination module, configured to determine the remaining fuel amount in the fuel tank according to the fuel resistance value of the fuel tank; and
[0093] An updating module is configured to update the currently displayed result of the remaining fuel amount based on the piecewise linear calculation result of the remaining fuel amount and the currently displayed result of the remaining fuel amount in the fuel tank, if the piecewise linear calculation result is less than the currently displayed result, based on the current vehicle speed value.
[0094] As a preference in this embodiment, the update module is further configured to:
[0095] Based on the correlation between the fuel resistance value R and the remaining fuel volume F in the fuel tank, a segmented processing is performed and a linear calculation is performed within each segment to obtain a segmented linear calculation result of the remaining fuel volume;
[0096] According to the oil level display interface, the current display result of the remaining oil level in the oil tank is obtained.
[0097] As a preference in this embodiment, the update module is further configured to:
[0098] Establishing a segmented critical value relationship between the fuel resistance value R and the remaining fuel volume F in the fuel tank;
[0099] [R 满 , F 满 ]、…[R (n-1) , F (n-1) ]、[R (n) ,F (n) ]…[R 空 , F 空 ];
[0100] Among them, the [R 满 、F 满 ] refers to the segmented interval between the remaining full fuel volume and the corresponding full resistance value, [R 空 、F 空 ] refers to the segmented interval of the remaining empty oil volume and the corresponding empty resistance value, [R (n) 、F (n) ] refers to the segmented interval of the remaining n oil volume and the corresponding n resistance value, where n is a natural number;
[0101] According to the fuel resistance value R, the segment where the fuel resistance value R is located is queried to calculate the remaining fuel amount V.
[0102] As a preference in this embodiment, the update module is further configured to:
[0103] If the continuously obtained piecewise linear calculation results are all smaller than the currently displayed result, the currently displayed result of the remaining fuel amount is updated and displayed again based on the current vehicle speed value.
[0104] As a preference in this embodiment, the update module is further configured to:
[0105] Determine the corresponding incremental fuel volume V according to the current vehicle speed value S and the vehicle speed thresholds S (l) , S (m) , S (h) ; where the V (min) , V (low) , V (mid) , V (high) ; represents the minimum value of the incremental fuel volume, the V (min) represents the lower value of the fuel injection volume, the V (low) represents the middle value of the incremental fuel volume, the V (mid) represents the maximum value of the incremental fuel volume; (high)
[0106] Among them,
[0107] If the current vehicle speed value S <= the vehicle speed threshold S (l) , then the remaining fuel volume updated and displayed each time is V (min) ;
[0108] If the vehicle speed threshold S (l) < the current vehicle speed value S <= the vehicle speed threshold S (m) , then the remaining fuel volume updated and displayed each time is V (low) ;
[0109] If the vehicle speed threshold S (m) < the current vehicle speed value S <= the vehicle speed threshold S (h) , then the remaining fuel volume updated and displayed each time is V (mid) ;
[0110] When the vehicle speed threshold S (h) < S, then the remaining fuel volume updated and displayed each time is V (high) .
[0111] As a preference in this embodiment, it further includes an xx module for:
[0112] [[ID=N fuel resistance values are taken as a group, M medians are filtered out from the N fuel resistance values, and then the M medians are averaged to determine the average value as the current fuel resistance value, where N and M are natural numbers.
[0117] As a preference in this embodiment, the fuel resistance value of the fuel tank includes:
[0118] Establish a segmented critical value relationship between the fuel resistance value R and the ADC value:
[0119] [ADC 满 , R 满 ]、…[ADC (n-1) , R (n-1) ]、[ADC (n) , R (n) ]、…[ADC 空 , R 空 ];
[0120] According to the ADC value, the fuel resistance value R is calculated after querying the segment where the ADC value is located.
[0121] Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 8 At the hardware level, the electronic device includes a processor and, optionally, an internal bus, a network interface, and memory. The memory may include internal memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for its services.
[0122] In addition, the electronic devices in the embodiments of the present application include but are not limited to controllers, domain controllers or vehicles, which are not specifically limited in this application.
[0123] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0124] The memory is used to store programs. Specifically, the program may include program code, which includes computer operating instructions. The memory may include internal memory and non-volatile memory, and provides instructions and data to the processor.
[0125] The processor reads the corresponding computer program from the non-volatile memory into the internal memory and then runs it, forming a vehicle fuel quantity calculation device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:
[0126] Determine the remaining fuel level in the fuel tank based on the fuel resistance value of the fuel tank; and
[0127] Based on the piecewise linear calculation result of the remaining fuel amount and the current display result of the remaining fuel amount in the fuel tank, when the piecewise linear calculation result is less than the current display result, the current display result of the remaining fuel amount is updated based on the current vehicle speed value.
[0128] The above application Figure 3 The method performed by the vehicle fuel level calculation device disclosed in the illustrated embodiment can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in the processor or by software instructions. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.
[0129] The electronic device may also perform Figure 3 The method executed by the vehicle fuel quantity calculation device in the vehicle fuel quantity calculation device is realized Figure 3 The functions of the illustrated embodiment will not be described in detail in the embodiments of the present application.
[0130] The embodiment of the present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by an electronic device including multiple application programs, can enable the electronic device to execute Figure 3 The method executed by the vehicle fuel quantity calculation device in the illustrated embodiment is specifically used to perform:
[0131] Determine the remaining fuel level in the fuel tank based on the fuel resistance value of the fuel tank; and
[0132] Based on the piecewise linear calculation result of the remaining fuel amount and the current display result of the remaining fuel amount in the fuel tank, when the piecewise linear calculation result is less than the current display result, the current display result of the remaining fuel amount is updated based on the current vehicle speed value.
[0133] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0134] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0135] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0136] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0137] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0138] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0139] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0140] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0141] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0142] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A method for calculating vehicle fuel quantity, wherein: The calculation method includes: Determine the remaining fuel level in the fuel tank based on the fuel resistance value of the fuel tank; and Based on the piecewise linear calculation result of the remaining fuel amount and the current display result of the remaining fuel amount in the fuel tank, when the piecewise linear calculation result is less than the current display result, the current display result of the remaining fuel amount is updated based on the current vehicle speed value.
2. The method according to claim 1, wherein: The piecewise linear calculation result based on the remaining fuel amount and the current display result of the remaining fuel amount in the fuel tank include: Based on the correlation between the fuel resistance value R and the remaining fuel volume F in the fuel tank, a segmented processing is performed and a linear calculation is performed within each segment to obtain a segmented linear calculation result of the remaining fuel volume; According to the oil level display interface, the current display result of the remaining oil level in the oil tank is obtained.
3. The method according to claim 2, wherein: The correlation between the fuel resistance value R and the remaining fuel volume F in the fuel tank is based on segmented processing and linear calculation is performed within each segment, including: Establishing a segmented critical value relationship between the fuel resistance value R and the remaining fuel volume F in the fuel tank; [R 满 ,F 满 ]、…[R (n-1) ,F (n-1) ]、[R (n) ,F (n) ]…[R 空 ,F 空 ]; Among them, the [R 满 、F 满 ] refers to the segmented interval between the remaining full fuel volume and the corresponding full resistance value, [R 空 、F 空 ] refers to the segmented interval of the remaining empty oil volume and the corresponding empty resistance value, [R (n) 、F (n) ] refers to the segmented interval of the remaining n oil volume and the corresponding n resistance value, where n is a natural number; According to the fuel resistance value R, the segment where the fuel resistance value R is located is queried to calculate the remaining fuel amount V.
4. The method according to claim 1, wherein: When the piecewise linear calculation result is less than the currently displayed result, updating the currently displayed result of the remaining fuel amount based on the current vehicle speed value includes: If the continuously obtained piecewise linear calculation results are all smaller than the currently displayed result, the currently displayed result of the remaining fuel amount is updated and displayed again based on the current vehicle speed value.
5. The method according to claim 4, wherein: Re-updating the remaining fuel amount based on the current vehicle speed value includes: According to the current vehicle speed value S and the vehicle speed threshold S (l) , S (m) , S (h) Determine the corresponding step oil volume V (min) ,V (low) ,V (mid) ,V (high) ; The V (min) Indicates the minimum value of the step oil volume, the V (low) Indicates the lower value of the oil intake, the V (mid) Indicates the middle value of the step oil volume, the V (high) Indicates the maximum amount of stepping oil; in, If the current vehicle speed value S<=vehicle speed threshold S (l) , then the remaining fuel volume updated and displayed each time is V (min) ; If the speed threshold S (l) <Current vehicle speed value S<=Vehicle speed threshold S (m) , then the remaining fuel volume updated and displayed each time is V (low) ; If the speed threshold S (m) <Current vehicle speed value S<=Vehicle speed threshold S (h) , then the remaining fuel volume updated and displayed each time is V (mid) ; When the vehicle speed threshold S (h) < S, the remaining fuel quantity updated and displayed each time is V (high) .
6. The method of claim 5, wherein: In a scenario close to the actual value of the oil quantity, the step oil quantity is adjusted to a high response value; In the anti-shake scenario, the step oil amount is adjusted to a low response value.
7. The method of claim 1, wherein: Determining the remaining fuel amount in the fuel tank based on the fuel resistance value of the fuel tank includes performing the following smoothing processing on the fuel resistance value of the fuel tank: Periodically sampling an ADC value and converting the ADC value into a fuel resistance value; N fuel resistance values are taken as a group, M medians are filtered out from the N fuel resistance values, and then the M medians are averaged to determine the average value as the current fuel resistance value, where N and M are natural numbers.
8. The method of claim 7, wherein: The fuel resistance values of the fuel tank include: Establish a segmented critical value relationship between the fuel resistance value R and the ADC value: [ADC 满 ,R 满 ]、…[ADC (n-1) ,R (n-1) ]、[ADC (n) ,R (n) ]、…[ADC 空 ,R 空 ]; According to the ADC value, the fuel resistance value R is calculated after querying the segment where the ADC value is located.
9. A vehicle fuel quantity calculation device, wherein: The computing device comprises: a determination module, configured to determine the remaining fuel amount in the fuel tank according to the fuel resistance value of the fuel tank; and An updating module is configured to update the currently displayed result of the remaining fuel amount based on the piecewise linear calculation result of the remaining fuel amount and the currently displayed result of the remaining fuel amount in the fuel tank, if the piecewise linear calculation result is less than the currently displayed result, based on the current vehicle speed value.
10. An electronic device comprising: processor; as well as A memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the method according to any one of claims 1 to 8; or, the electronic device comprises the apparatus according to claim 9.
Citation Information
Cited By
Oil quantity display method
CN121655643A