Automobile instrument total mileage storage method, reading method, device, equipment and medium
By partitioning and storing total mileage data and backup data in the EEPROM, the problems of read/write errors and data corruption in the total mileage storage of automotive instruments are solved, thereby improving data security and reliability.
Patent Information
- Application Number
- CN202310779544.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-28
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-06-28
AI Technical Summary
In existing technologies, the methods for storing total mileage on car dashboards are prone to read/write errors and data corruption, resulting in low data security and reliability, which cannot meet the reliability requirements of the used car market for total mileage data.
The system employs a partitioned storage method with an EEPROM data area and a backup area. The total mileage is written to the EEPROM data area every M kilometers the vehicle travels, and the total mileage is written to the EEPROM backup area each time the engine is turned off. The data is read into RAM when the instrument panel is first powered on, and the target total mileage data is obtained through a search mechanism.
It effectively prevents errors in reading and writing total mileage and data corruption, improves data security and reliability, and ensures the accuracy and integrity of total mileage data.
Smart Images

Figure CN117011961B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of vehicles, in particular to an automobile instrument total mileage storage method, an automobile instrument total mileage reading method, an automobile instrument total mileage storage device, an automobile instrument total mileage reading device, an equipment and a medium. BACKGROUND
[0002] The total mileage is a distance that records the distance traveled by a vehicle. It is a long-term memory value that accompanies the entire life cycle of the vehicle and indirectly reflects the degree of engine wear. The automobile mileage, as one of the most important parameters of the automobile use state, has an important reference function for automobile value assessment, automobile use maintenance, etc., and is a very important value for the vehicle.
[0003] With the gradual rise of the automobile second-hand market, the importance of the total mileage is further improved, and the reliability of the total mileage requirement is very high. In the entire life cycle of the vehicle, it cannot be lost, cannot be changed, and cannot be tampered with. Due to the above reasons, the storage method of the total mileage in the automobile instrument is very important. Improper total mileage storage method will cause total mileage read-write error or data damage, and the data security is not high and the reliability is low. SUMMARY
[0004] Embodiments of the present application provide an automobile instrument total mileage storage method, an automobile instrument total mileage reading method, an automobile instrument total mileage storage device, an automobile instrument total mileage reading device, an equipment and a medium, which can prevent total mileage read-write error or data damage, and improve the security and reliability of the data.
[0005] According to an aspect of the present application, an automobile instrument total mileage storage method is provided, comprising:
[0006] When the vehicle travels M kilometers each time, a target data area corresponding to the current total mileage is obtained, wherein M is a positive number;
[0007] The current total mileage is written into the target data area of the EEPROM data area;
[0008] When the vehicle is turned off each time, the current total mileage is written into the EEPROM backup area.
[0009] According to an aspect of the present application, an automobile instrument total mileage reading method is provided, comprising:
[0010] When the instrument is powered on for the first time, the total mileage data of the EEPROM data area and the EEPROM backup area are read into the RAM, wherein the EEPROM data area comprises a target data area;
[0011] The total mileage data in the RAM is searched based on a search mechanism to obtain target total mileage data.
[0012] According to another aspect of the present application, there is provided an automobile instrument total mileage storage device, comprising:
[0013] a target data area acquisition module, configured to acquire a target data area corresponding to a current total mileage when the vehicle travels M kilometers each time, wherein M is a positive number;
[0014] a data area writing module, configured to write the current total mileage into the target data area of the EEPROM data area;
[0015] a backup area writing module, configured to write the current total mileage into the EEPROM backup area each time the vehicle is turned off.
[0016] According to another aspect of the present application, there is provided an automobile instrument total mileage reading device, comprising:
[0017] a data reading module, configured to read total mileage data of a data area of an EEPROM and a backup area of the EEPROM into a RAM when the instrument is powered on for the first time, wherein the data area of the EEPROM comprises a target data area;
[0018] a target total mileage data searching module, configured to search the total mileage data in the RAM based on a search mechanism to obtain target total mileage data.
[0019] According to another aspect of the present application, there is provided an electronic device, comprising:
[0020] at least one processor; and
[0021] a memory connected to the at least one processor in communication; wherein
[0022] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the automobile instrument total mileage storage method or the automobile instrument total mileage reading method according to any one of the embodiments of the present application.
[0023] According to another aspect of the present application, there is provided a computer readable storage medium, storing computer instructions for enabling a processor to execute the automobile instrument total mileage storage method or the automobile instrument total mileage reading method according to any one of the embodiments of the present application.
[0024] The embodiment of the present application can prevent the total mileage reading and writing error or data damage, and improve the data security and reliability.
[0025] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present application, nor to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some of the embodiments of the present application, and therefore should not be regarded as limiting the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.
[0027] Figure 1 is a flow chart of a total mileage storage method for an automobile instrument in the embodiment of the present application;
[0028] Figure 2 is a total mileage storage flowchart in the embodiment of the present application;
[0029] Figure 3 is a flow chart of a total mileage reading method for an automobile instrument in the embodiment of the present application;
[0030] Figure 4 is a total mileage reading flowchart in the embodiment of the present application;
[0031] Figure 5 is a flow chart of a total mileage data searching method based on a search mechanism in the embodiment of the present application;
[0032] Figure 6 is a structure schematic diagram of a total mileage storage device for an automobile instrument in the embodiment of the present application;
[0033] Figure 7 is a structure schematic diagram of a total mileage reading device for an automobile instrument in the embodiment of the present application;
[0034] Figure 8 is a structure schematic diagram of an electronic device in the embodiment of the present application. DETAILED DESCRIPTION
[0035] In the following, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative effort should belong to the scope of the present application.
[0036] It should be noted that the terms "first", "second" and the like in the description and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to include only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.
[0037] It should be understood that before using the technical solutions disclosed in the embodiments of the present application, the type of personal information involved in the present application, the scope of use, the scene of use and the like should be informed to the user and the authorization of the user should be obtained according to relevant laws and regulations.
[0038] Embodiment one
[0039] Figure 1 A flowchart of an automobile instrument total mileage storage method provided by the embodiment of the present application, the embodiment can be applicable to the case of automobile instrument total mileage storage, the method can be executed by the automobile instrument total mileage storage device in the embodiment of the present application, and the device can be realized in the form of software and / or hardware, as shown in the figure, and the method specifically includes the following steps: Figure 1
[0040] S110, when the vehicle travels M kilometers, the target data area corresponding to the current total mileage is obtained.
[0041] Wherein, M is a positive number. For example, when M = 1, when the vehicle travels 1 kilometer, the current total mileage is written into the EEPROM data area.
[0042] Specifically, the way to obtain the target data area corresponding to the current total mileage can be: determining the target data area corresponding to the current total mileage according to the identification information of the data area corresponding to the last mileage storage and the data area list.
[0043] Specifically, when the vehicle travels M kilometers each time, the target data area corresponding to the current total mileage can be obtained in the following manner: when the vehicle travels M kilometers each time, the current total mileage is written into at least two groups of data areas of the EEPROM data area in a cycle, for example, if it is determined according to the identification information of the data area corresponding to the last mileage storage that the data area corresponding to the last mileage storage is the last data area of the data area list, the current total mileage is written into the first data area of the data area list; if it is determined according to the identification information of the data area corresponding to the last mileage storage that the data area corresponding to the last mileage storage is not the last data area of the data area list, the current total mileage is written into the next data area of the data area corresponding to the last mileage storage in the data area list.
[0044] S120, write the current total mileage into the target data area of the EEPROM data area.
[0045] The EEPROM (Electrically Erasable Programmable read only memory) is a storage chip whose data is not lost after power failure. The EEPROM includes an EEPROM data area and an EEPROM backup area. The EEPROM data area includes at least two groups of data areas, and the EEPROM backup area includes at least two groups of backup areas. For example, the EEPROM includes an EEPROM data area and an EEPROM backup area, the EEPROM data area includes six groups of data areas: Data1, Data2, Data3, Data4, Data5 and Data6, and the EEPROM backup area includes two groups of backup areas: Backup1 and Backup2.
[0046] It should be noted that, since the total mileage requires to be stored for more than 1,000,000 kilometers, the EEPROM is limited in the number of erasing and writing times, which affects the service life. In the embodiment of the application, the total mileage data area is divided into six groups of data, and the six groups of data areas of the EEPROM are erased and written once every 1KM polling, so as to reduce the number of erasing and writing times of the same address and prolong the service life of the device.
[0047] S130, when the vehicle is turned off each time, the current total mileage is written into the EEPROM backup area.
[0048] Specifically, when the vehicle is turned off each time, the current total mileage can be written into the EEPROM backup area in the following manner: if it is determined according to the identification information of the backup area corresponding to the last mileage backup that the backup area corresponding to the last mileage backup is the last backup area in the backup area list, the current total mileage is written into the first backup area in the backup area list. If it is determined according to the identification information of the backup area corresponding to the last mileage backup that the backup area corresponding to the last mileage backup is not the last backup area in the backup area list, the current total mileage is written into the next backup area of the backup area corresponding to the last mileage backup in the backup area list.
[0049] It should be noted that the manner of writing the current total mileage into the EEPROM backup area and the manner of writing the current total mileage into the EEPROM data area are similar, and both are cyclic writing.
[0050] Optionally, the EEPROM data area includes a data area list.
[0051] The target data area corresponding to the current total mileage is obtained, including:
[0052] The identification information of the data area corresponding to the last mileage storage is obtained.
[0053] If it is determined according to the identification information of the data area corresponding to the last mileage storage that the data area corresponding to the last mileage storage is the last data area in the data area list, the first data area in the data area list is determined as the target data area corresponding to the current total mileage.
[0054] If it is determined according to the identification information of the data area corresponding to the last mileage storage that the data area corresponding to the last mileage storage is not the last data area in the data area list, the next data area of the data area corresponding to the last mileage storage in the data area list is determined as the target data area corresponding to the current total mileage.
[0055] The identification information of the data area corresponding to the last mileage storage is the identification information of the data area used to store the last mileage data, for example, when the vehicle travels 5 kilometers during the travel process, the total mileage is written into the EEPROM data area Data1, and when the vehicle travels 1 kilometer more (i.e., travels 6 kilometers), the identification information of the data area corresponding to the last mileage storage is Data1.
[0056] In one specific example, the data area list is shown in Table 1.
[0057] Table 1
[0058]
[0059] If the identification information of the data area corresponding to the last mileage storage is Data1, since Data1 is not the last data area in the data area list, Data2 is determined as the target data area corresponding to the current total mileage; if the identification information of the data area corresponding to the last mileage storage is Data3, since Data3 is not the last data area in the data area list, Data4 is determined as the target data area corresponding to the current total mileage; if the identification information of the data area corresponding to the last mileage storage is Data6, since Data6 is the last data area in the data area list, Data1 is determined as the target data area corresponding to the current total mileage.
[0060] Optionally, the current total mileage is written into the EEPROM backup area each time the vehicle is turned off, comprising:
[0061] The target backup area corresponding to the current total mileage is obtained each time the vehicle is turned off.
[0062] The current total mileage is written into the target backup area of the EEPROM backup area.
[0063] Specifically, the target backup area corresponding to the current total mileage can be obtained according to the identification information of the backup area corresponding to the last mileage backup and the backup area list.
[0064] Optionally, the EEPROM backup area comprises a backup area list.
[0065] The target backup area corresponding to the current total mileage is obtained, comprising:
[0066] The identification information of the backup area corresponding to the last mileage backup is obtained.
[0067] If the backup area corresponding to the last mileage backup is determined as the last backup area in the backup area list according to the identification information of the backup area corresponding to the last mileage backup, the first backup area in the backup area list is determined as the target backup area corresponding to the current total mileage.
[0068] If the backup area corresponding to the last mileage backup is determined as not the last backup area in the backup area list according to the identification information of the backup area corresponding to the last mileage backup, the next backup area of the backup area corresponding to the last mileage backup in the backup area list is determined as the target backup area corresponding to the current total mileage.
[0069] The identifier information of the backup area corresponding to the last mileage backup is the identifier information of the backup area used to back up the last mileage data. That is, the identifier information of the backup area corresponding to the mileage backup when the vehicle was last turned off. For example, when the vehicle is turned off for the Nth time, the total mileage is written to Backup1 in the EEPROM backup area, and when the vehicle is turned off for the N+1th time, the identifier information of the backup area corresponding to the last mileage backup is Backup1.
[0070] In a specific example, the list of backup areas is shown in Table 2:
[0071] Table 2
[0072]
[0073] If the backup area identifier for the last mileage storage was Backup1, since Backup1 is not the last backup area in the backup area list, Backup2 will be determined as the target backup area for the current total mileage; if the backup area identifier for the last mileage storage was Backup2, since Backup2 is the last backup area in the backup area list, Backup1 will be determined as the target backup area for the current total mileage.
[0074] In a specific example, such as Figure 2 As shown, the system obtains the vehicle status. If the vehicle is off, it obtains the backup area position. If the backup area position J is greater than 2, it reassigns the backup area position J to 1 and writes the current total mileage to the Jth backup area. If the backup area position J is less than or equal to 2, it writes the current total mileage to the Jth backup area. If the vehicle is not off, it checks if the total mileage has increased by 1 km. If it has increased by 1 km, it checks if the data area position I is greater than 6. If the data area position I is greater than 6, it reassigns I to 1 and writes the current total mileage to the Ith data area. If the data area position I is less than or equal to 6, it writes the current total mileage to the Ith data area.
[0075] It should be noted that existing mileage backup technologies typically involve adding an ECU for backup, directly taking the maximum value between two values as the correct total mileage. This total mileage data is frequently communicated over the network, making it susceptible to tampering and resulting in low security. In this invention, total mileage storage is divided into a data area and a backup area. For every kilometer increase in mileage, six sets of data are stored in the data area in rotation. When the engine is turned off, data is stored in the backup area. The backup area experiences fewer operations, minimizing the probability of errors and improving data security and reliability.
[0076] In addition, the embodiment of the present application divides the backup area, and uses the backup area to recover when the data area is wrong, thereby avoiding data loss and improving the security and reliability of the total mileage data. The technical scheme of the embodiment writes the current total mileage into the EEPROM data area every M kilometers during vehicle driving, wherein M is a positive number; and writes the current total mileage into the EEPROM backup area every time the vehicle is turned off, thereby preventing total mileage read / write errors or data damage, and improving the security and reliability of the data.
[0077] Embodiment two
[0078] Figure 3 A flowchart of an automobile instrument total mileage reading method provided by the embodiment of the present application, the embodiment can be applied to the automobile instrument total mileage reading, and the method can be executed by the automobile instrument total mileage reading device in the embodiment of the present application. The device can be realized in the form of software and / or hardware, as shown in the figure, and the method specifically includes the following steps. Figure 3
[0079] S310, when the instrument is powered on for the first time, reading the total mileage data in the EEPROM data area and the EEPROM backup area into the RAM, wherein the EEPROM data area includes a target data area.
[0080] The EEPROM data area includes at least two groups of data areas, and the EEPROM backup area includes at least two groups of backup areas.
[0081] It should be noted that after the total mileage is stored according to the total mileage storage method provided in the above embodiment, the total mileage can be read according to the total mileage reading method provided in the embodiment of the present application.
[0082] Specifically, when the instrument is powered on for the first time, the data in the at least two groups of data areas of the EEPROM and the at least two groups of backup areas of the EEPROM are read into the RAM.
[0083] In a specific example, when the mileage runs to 335582 kilometers, the total mileage stored in the EEPROM is shown in Table 3:
[0084] Table 3
[0085]
[0086] S320, searching the total mileage data in the RAM based on a search mechanism to obtain target total mileage data.
[0087] Specifically, the searching of the total mileage data in the RAM based on the searching mechanism can be performed in the following manner: the total mileage data in the RAM is checked based on the checking mechanism, and the target total mileage data is searched from the checked data.
[0088] In a specific example, as shown in Figure 4 When the meter is powered on for the first time, the 8 groups of data in the external EEPROM are read into the RAM, that is, the 6 groups of data in the data area of the EEPROM and the 2 groups of data in the backup area of the EEPROM are all read into the RAM, and the RAM includes Data1, Data2, Data3, Data4, Data5, Data6, Backup1 and Backup2. When the meter is woken up, the 8 groups of data in the RAM are checked, and the searching mechanism is started to find the correct total mileage value odo from the 8 groups of data. When the total mileage increases by 1 km, the data in the data area of the EEPROM needs to be written, that is, Data1, Data2, Data3, Data4, Data5, Data6, Data1…… are written in a cycle; and when the meter is turned off, the data in the backup area of the EEPROM needs to be written, that is, Backup1, Backup2, Backup1…… are written in a cycle. Therefore, the data area stores the latest 6 km of mileage data, and the backup area stores the mileage data at the last two times of turning off the meter.
[0089] Optionally, the searching of the total mileage data in the RAM based on the searching mechanism to obtain the target total mileage data comprises:
[0090] acquiring the number of total mileage data in the data area of the RAM that passes the checking;
[0091] if the number of total mileage data in the data area of the RAM that passes the checking is greater than or equal to the first value, and the total mileage data that passes the checking satisfies the first condition, the target total mileage is determined according to the total mileage data in the data area of the RAM that passes the checking;
[0092] if the number of total mileage data in the data area of the RAM that passes the checking is less than the first value, or the number of total mileage data in the data area of the RAM that passes the checking is greater than or equal to the first value, and the total mileage data that passes the checking does not satisfy the first condition, the target total mileage is determined according to the total mileage data in the backup area of the RAM that passes the checking.
[0093] Specifically, the method for obtaining the number of total mileage data that passes the check in the data area of the RAM can be: since the total mileage data includes parity check data, low L-bit data of total mileage, crc8 check data and high H-bit data of total mileage, the low L-bit data of the total mileage data is subjected to parity check according to the parity check data; the high H-bit data of the total mileage data is subjected to crc8 check according to the crc8 check data; and the data that passes the parity check and the crc8 check is determined as the total mileage data that passes the check.
[0094] The first value can be a preset value, for example, the first value can be equal to 3.
[0095] The first condition includes: the maximum total mileage in the total mileage data that passes the check is greater than or equal to the sum of the average total mileage of the total mileage data that passes the check and the first value, and the minimum total mileage in the total mileage data that passes the check is less than or equal to the sum of the average total mileage of the total mileage data that passes the check and the first value.
[0096] Specifically, the method for determining the target total mileage according to the total mileage data that passes the check in the data area of the RAM can be: determining the maximum total mileage in the total mileage data that passes the check in the data area of the RAM as the target total mileage.
[0097] Specifically, the method for determining the target total mileage according to the total mileage data that passes the check in the backup area of the RAM can be: determining the maximum total mileage in the total mileage data that passes the check in the backup area of the RAM as the target total mileage.
[0098] Optionally, the first condition includes:
[0099] The maximum total mileage in the total mileage data that passes the check is greater than or equal to the sum of the average total mileage of the total mileage data that passes the check and the first value, and the minimum total mileage in the total mileage data that passes the check is less than or equal to the sum of the average total mileage of the total mileage data that passes the check and the first value.
[0100] The average total mileage of the total mileage data that passes the check is the average value obtained by excluding the maximum total mileage and the minimum total mileage in the total mileage data that passes the check.
[0101] Optionally, the method for determining the target total mileage according to the total mileage data that passes the check in the data area of the RAM includes:
[0102] The maximum total mileage in the total mileage data that passes the check in the data area of the RAM is determined as the target total mileage.
[0103] Specifically, if the number of the total mileage data that passes the check in the data area of the RAM is greater than or equal to the first value, and the total mileage data that passes the check satisfies the first condition, the maximum total mileage in the total mileage data that passes the check in the data area of the RAM is determined as the target total mileage.
[0104] Optionally, the target total mileage is determined according to the total mileage data that passes the check in the backup area of the RAM, and the method comprises the following steps of:
[0105] If the number of the total mileage data that passes the check in the backup area of the RAM is greater than or equal to the second value, the maximum total mileage in the total mileage data that passes the check in the backup area of the RAM is determined as the target total mileage.
[0106] The second value can be a preset value, for example, the second value can be equal to 1. The target total mileage is the correct total mileage.
[0107] Specifically, if the number of the total mileage data that passes the check in the backup area of the RAM is greater than or equal to the second value, the maximum total mileage in the total mileage data that passes the check in the backup area of the RAM is determined as the target total mileage. The method can be as follows: the number of the total mileage data that passes the check in the backup area of the RAM is obtained, if the number of the total mileage data that passes the check in the backup area of the RAM is greater than or equal to the second value, the maximum total mileage in the total mileage data that passes the check in the backup area of the RAM is determined as the target total mileage, if the number of the total mileage data that passes the check in the backup area of the RAM is less than the second value, there is no correct total mileage, and an error message is displayed.
[0108] In a specific example, if the total mileage data verification passes, it is determined that the total mileage data is not corrupted. The number of corrupt total mileage data in the RAM data area is obtained. If the number of corrupt total mileage data in the RAM data area is greater than or equal to a first value (e.g., 3), the maximum ODO value (ODO value is the total mileage, determined based on the low L bits and high H bits of the total mileage data), minimum ODO value, and average ODO value (the average value after removing the maximum and minimum ODO values) among the corrupt data in the RAM data area are obtained. If the maximum ODO value is less than or equal to the average ODO value and the first value, the process is as follows: If the minimum ODO value is greater than or equal to the sum of the average ODO value and the first value, then the maximum ODO value among the undamaged data in the EEPROM data area is determined as the target ODO value; if the maximum ODO value is greater than the sum of the average ODO value and the first value, or if the minimum ODO value is less than the sum of the average ODO value and the first value, then the number of undamaged data in the EEPROM backup area is obtained; if the number of undamaged data in the EEPROM backup area is greater than or equal to the second value (e.g., it could be 1), then the maximum ODO value among the undamaged data in the EEPROM backup area is obtained; and the maximum ODO value among the undamaged data in the EEPROM backup area is determined as the target ODO value.
[0109] In another specific example, such as Figure 5 As shown, when the instrument is powered on for the first time, the total mileage data of the EEPROM data area and the EEPROM backup area is read into the RAM. The 6 sets of data in the data area of RAM are verified, and the number of verified total mileage data goodcnt is obtained. If goodcnt≥3, the data area is determined to be reliable. The maximum value MaxOdo and the minimum value MinOdo among the goodcnt total mileage data are obtained. The maximum value MaxOdo and the minimum value MinOdo are removed, and the average value avgOdo is calculated. If MaxOdo≤avgOdo+3 and MinOdo≥avgOdo+3, the maximum value MaxOdo is taken as the correct Odo value, which is the target total mileage.
[0110] If goodcnt≥3 and MaxOdo>avgOdo+3, then the two sets of data in the backup area of RAM are verified, and the total number of verified mileage data backup_goodcnt is obtained. If backup_goodcnt≥1, then the maximum value among backup_goodcnt total mileage data backup_MaxOdo is taken as the correct Odo value, which is the target total mileage.
[0111] If goodcnt is greater than or equal to 3 and MinOdo is less than avgOdo+3, then two groups of data in the backup area in the RAM are checked, and the total mileage data quantity backup_goodcnt that passes the check is obtained. If backup_goodcnt is greater than or equal to 1, then the maximum value backup_MaxOdo of the backup_goodcnt total mileage data is taken as the correct Odo value, that is, the target total mileage. If goodcnt is less than 3, then two groups of data in the backup area in the RAM are checked, and the total mileage data quantity backup_goodcnt that passes the check is obtained. If backup_goodcnt is greater than or equal to 1, then the maximum value backup_MaxOdo of the backup_goodcnt total mileage data is taken as the correct Odo value, that is, the target total mileage.
[0112] Optionally, the total mileage data includes parity check data, low L-bit data of the total mileage, crc8 check data, and high H-bit data of the total mileage.
[0113] Before obtaining the total mileage data quantity that passes the check in the data area of the RAM, the method further includes:
[0114] Parity checking is performed on the low L-bit data of the total mileage data according to the parity check data.
[0115] crc8 checking is performed on the high H-bit data of the total mileage data according to the crc8 check data.
[0116] Data that passes the parity check and the crc8 check is determined as the total mileage data that passes the check.
[0117] In one specific example, each group of data has 4 bytes, including parity, data OdoValueL, CRC check, and data OdoValueH, as shown in Table 4.
[0118] Table 4
[0119]
[0120] The parity is used to perform parity checking on the data OdoValueL. The data OdoValueL is low 4-bit data of the total mileage data. The CRC performs crc8 checking on the data OdoValueH. The data OdoValueH is high 16-bit data of the total mileage data. After each group of data passes the parity check and the crc8 check, the ODO value odo_value of this group is obtained as odo_value = OdoValueH*16 + OdoValueL.
[0121] It should be noted that, since the total mileage requirement can store more than 1000000KM, most of the prior art uses CRC16 to check the correctness of the mileage, CRC16 has 65536 results, and cannot cover the check of 1000000KM data, and there is a probability that although the data is tampered with, the check still passes. The embodiment of the application adopts the method of using parity check for the low 4 bits of the total mileage data and the method of using CRC check for the high 16 bits, and performs double verification, which is more reliable.
[0122] In addition, since the total mileage requirement can store more than 1000000KM, the total mileage needs to use a check result of CRC24 or above to correspond to 1000000KM of data, and the use of CRC24 or above occupies more EEPROM and RAM space, and the CRC24 or above check method takes time and is low in efficiency. The embodiment of the application adopts the mechanism of CRC8+parity+data sequence search comparison, which can effectively reduce the occupied memory space, improve the running efficiency, and ensure the reliability of data access.
[0123] Optionally, before the maximum total mileage in the total mileage data that passes the check in the backup area of the RAM is determined as the target total mileage, the method further includes:
[0124] According to the parity check data, the low L-bit data of the total mileage data is subjected to parity check;
[0125] According to the crc8 check data, the high H-bit data of the total mileage data is subjected to crc8 check.
[0126] The data that passes the parity check and the crc8 check is determined as the total mileage data that passes the check.
[0127] It should be noted that, whether the total mileage data in the data area or the total mileage data in the backup area, each group of data includes 4 bytes, which are: parity check data, low L-bit data of the total mileage, crc8 check data and high H-bit data of the total mileage. And the total mileage data is checked based on the parity check data and the crc8 check data.
[0128] The embodiment of the application finds the appropriate ODO value by searching the verified data, reduces the probability of ODO value error, and when the appropriate ODO value cannot be found in the data area, the total mileage data in the backup area is used as the ODO value. The safety and reliability of the data are improved.
[0129] Embodiment three
[0130] Figure 6A structure diagram of an automobile instrument total mileage storage device is provided in the embodiment of the present application. The embodiment can be applied to the case of automobile instrument total mileage storage. The device can be realized in the form of software and / or hardware. The device can be integrated in any device providing the function of automobile instrument total mileage storage, such as an automobile instrument total mileage storage device as shown in the figure. Figure 6 As shown in the figure, the automobile instrument total mileage storage device specifically comprises a target data area acquisition module 610, a data area writing module 620 and a backup area writing module 630.
[0131] The target data area acquisition module is configured to acquire a target data area corresponding to the current total mileage when the vehicle travels M kilometers each time, where M is a positive number.
[0132] The data area writing module is configured to write the current total mileage into the target data area of the EEPROM data area.
[0133] The backup area writing module is configured to write the current total mileage into the EEPROM backup area each time the vehicle is turned off.
[0134] The above product can execute the method provided in any embodiment of the present application, and has the corresponding function modules and beneficial effects of the execution method.
[0135] Embodiment Four
[0136] Figure 7 A structure diagram of an automobile instrument total mileage reading device is provided in the embodiment of the present application. The embodiment can be applied to the case of automobile instrument total mileage reading. The device can be realized in the form of software and / or hardware. The device can be integrated in any device providing the function of automobile instrument total mileage reading, such as an automobile instrument total mileage reading device as shown in the figure. Figure 7 As shown in the figure, the automobile instrument total mileage reading device specifically comprises a data reading module 710 and a target total mileage data searching module 720.
[0137] The data reading module is configured to read the total mileage data of the EEPROM data area and the EEPROM backup area into the RAM when the instrument is powered on for the first time, where the EEPROM data area comprises a target data area.
[0138] The target total mileage data searching module is configured to search the total mileage data in the RAM based on a search mechanism to obtain target total mileage data.
[0139] The above product can execute the method provided in any embodiment of the present application, and has the corresponding function modules and beneficial effects of the execution method.
[0140] Embodiment Five
[0141] Figure 8A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0142] like Figure 8 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0143] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0144] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as a method for storing total mileage on a vehicle's instrument panel, or a method for reading total mileage from a vehicle's instrument panel.
[0145] In some embodiments, the vehicle odometer storage method, or the vehicle odometer reading method can be implemented as a computer program tangibly embodied in a computer readable storage medium, e.g., storage unit 18. In some embodiments, parts or all of the computer program can be loaded and / or installed onto electronic device 10 via, e.g., ROM 12 and / or communication unit 19. When the computer program is loaded onto RAM 13 and executed by processor 11, one or more steps of the vehicle odometer storage method, or the vehicle odometer reading method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the vehicle odometer storage method, or the vehicle odometer reading method by other means, e.g., with firmware.
[0146] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, specially designed application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0147] Computer programs implementing methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program running on the processor implements the functions / operations specified in the flowcharts and / or the block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as part of a standalone software package, or entirely on a remote machine or server.
[0148] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0149] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0150] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), blockchain network, and the Internet.
[0151] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
[0152] It should be understood that the various forms of flow shown above can be reordered, added to, or have steps deleted. For example, the steps described in the present application can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which are not limited herein.
[0153] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for reading the total mileage of a car instrument panel, characterized in that, include: When the instrument is powered on for the first time, the total mileage data of the EEPROM data area and the EEPROM backup area is read into the RAM. The EEPROM data area includes: target data area; The total mileage data in RAM is searched using a search mechanism to obtain the target total mileage; The total mileage data in RAM is searched using a search mechanism to obtain the target total mileage, including: Obtain the total number of verified mileage data in the data area of the RAM; If the total number of verified mileage data in the RAM data area is greater than or equal to the first value, and the total number of verified mileage data satisfies the first condition, then the target total mileage is determined based on the total number of verified mileage data in the RAM data area. If the number of verified data in the RAM data area is less than the first value, or if the number of verified total mileage data in the RAM data area is greater than or equal to the first value, and the verified total mileage data does not meet the first condition, then the target total mileage is determined based on the verified total mileage data in the RAM backup area. The first condition includes: The maximum total mileage in the verified total mileage data is greater than or equal to the sum of the average total mileage and the first value of the verified total mileage data, and the minimum total mileage in the verified total mileage data is less than or equal to the sum of the average total mileage and the first value of the verified total mileage data.
2. The method according to claim 1, characterized in that, Determining the target total mileage based on the verified total mileage data in the RAM data area includes: The maximum total mileage among the verified total mileage data in the RAM's data area is determined as the target total mileage.
3. The method according to claim 1, characterized in that, The target total mileage is determined based on the verified total mileage data in the backup area of the RAM, including: If the number of verified total mileage data in the backup area of RAM is greater than or equal to the second value, then the maximum total mileage among the verified total mileage data in the backup area of RAM is determined as the target total mileage.
4. The method according to claim 1, characterized in that, The total mileage data includes: parity check data, the low L-bit data of the total mileage, CRC8 check data, and the high H-bit data of the total mileage; Before obtaining the total number of verified mileage data in the data area of the RAM, the process also includes: Perform parity check on the low L bits of the total mileage data based on the parity check data; Perform CRC8 verification on the high H bits of the total mileage data based on the CRC8 verification data; Data that passes both parity and CRC8 checks are identified as the total mileage data that has passed verification.
5. The method according to claim 1, characterized in that, Also includes: When the vehicle travels M kilometers, the target data area corresponding to the current total mileage is obtained, where M is a positive number; Write the current total mileage to the target data area of the EEPROM data area; Each time the vehicle is turned off, the current total mileage is written to the EEPROM backup area.
6. The method according to claim 5, characterized in that, The EEPROM data area includes a list of data areas; Obtain the target data area corresponding to the current total mileage, including: Retrieve the identifier information of the data area corresponding to the last mileage storage; If the data area corresponding to the previous mileage storage is determined to be the last data area in the data area list based on the identification information of the data area corresponding to the previous mileage storage, then the first data area in the data area list is determined as the target data area corresponding to the current total mileage. If the last data area in the non-data area list corresponding to the previous mileage storage is determined based on the identification information of the data area corresponding to the previous mileage storage, then the next data area in the data area list corresponding to the previous mileage storage is determined as the target data area corresponding to the current total mileage.
7. The method according to claim 5, characterized in that, Each time the vehicle is turned off, the current total mileage is written to the EEPROM backup area, including: Each time the vehicle is turned off, the target backup area corresponding to the current total mileage is obtained; Write the current total mileage to the target backup area of the EEPROM backup area.
8. The method according to claim 7, characterized in that, The EEPROM backup area includes a list of backup areas; Retrieve the target backup area corresponding to the current total mileage, including: Retrieve the identifier information of the backup area corresponding to the last mileage backup; If the backup area corresponding to the previous mileage backup is determined to be the last backup area in the backup area list based on the identification information of the backup area corresponding to the previous mileage backup, then the first backup area in the backup area list is determined as the target backup area corresponding to the current total mileage. If the last backup area in the list of non-backup areas corresponding to the previous mileage backup is determined based on the identification information of the backup area corresponding to the previous mileage storage, then the next backup area in the backup area list corresponding to the previous mileage backup is determined as the target backup area corresponding to the current total mileage.
9. A vehicle instrument total mileage reading device, characterized in that, include: The data reading module is used to read the total mileage data from the data area and the backup area of the EEPROM into the RAM when the instrument is powered on for the first time. The data area of the EEPROM includes: the target data area; The target total mileage data search module is used to search for the total mileage data in RAM based on a search mechanism to obtain the target total mileage data; The target total mileage data search module is specifically used for: Obtain the total number of verified mileage data in the data area of the RAM; If the total number of verified mileage data in the RAM data area is greater than or equal to the first value, and the total number of verified mileage data satisfies the first condition, then the target total mileage is determined based on the total number of verified mileage data in the RAM data area. If the number of verified data in the RAM data area is less than the first value, or if the number of verified total mileage data in the RAM data area is greater than or equal to the first value, and the verified total mileage data does not meet the first condition, then the target total mileage is determined based on the verified total mileage data in the RAM backup area. The first condition includes: The maximum total mileage in the verified total mileage data is greater than or equal to the sum of the average total mileage and the first value of the verified total mileage data, and the minimum total mileage in the verified total mileage data is less than or equal to the sum of the average total mileage and the first value of the verified total mileage data.
10. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the vehicle instrument total mileage reading method according to any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the method for reading the total mileage of an automotive instrument panel as described in any one of claims 1-8.
Citation Information
Patent Citations
Method for calculating vehicle travel mileage
CN101149273A
Mileage information storage method and system for vehicle instrument
CN112380059A