A method and device for detecting non-volatile memory and electric vehicle

By setting two initially identical count values ​​​​in the non-volatile memory of the electric vehicle, adding a preset value when powering off and comparing it when powering on, the problem of data storage failure detection when the non-volatile memory is powered off is solved. It achieves effective fault information output and component function integrity, and has the advantages of simple operation and efficient detection.

CN113393891BActive Publication Date: 2024-09-03BEIJING ELECTRIC VEHICLE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010165142.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-11
Publication Date
2024-09-03
Estimated Expiration
2040-03-11

AI Technical Summary

Technical Problem

The data storage failure of the non-volatile memory in existing electric vehicles cannot be detected when the power is turned off, resulting in the loss of fault information. The failure to write to the non-volatile memory cannot be found after the power is turned on again, and the data read out is not the same as the next time the power is turned off. correct data at the time.

Method used

By setting two initially identical count values ​​​​in the non-volatile memory, adding a preset value (such as adding 1) to one of them when powering off, comparing the count value when powering on next time to determine whether the data storage is successful, and After successful storage, the count value is set to the same value for repeated detection. If it fails, fault information is output.

Benefits of technology

It effectively detects the success or failure of data storage when the non-volatile memory is powered off, prevents the missing installation of door interior panels and instrument panels, ensures the realization and integrity of component functions, and has simple operation and easy to implement structure. , low cost and high detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113393891B
    Figure CN113393891B
Patent Text Reader

Abstract

Embodiments of the present invention provide a method, device and electric vehicle for detecting a non-volatile memory. The method for detecting a non-volatile memory includes: obtaining a first count value and a second count value for indicating the data storage state of a non-volatile storage NVM when it is powered off, the first count value and the second count value have the same initial value, when the data storage is successful when the NVM is powered off, one of the first count value and the second count value is increased by a preset value, and the other remains unchanged; when the NVM is powered on next time, if the first count value and the second count value have the same value, it is determined that the data storage when the NVM is powered off has failed; if the first count value and the second count value have different values, it is determined that the data storage when the NVM is powered off has succeeded. The present invention can effectively detect whether the NVM data storage is successful, and has the advantages of low cost and high efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electric vehicles, and in particular to a detection method and device of a non-volatile memory and an electric vehicle. Background Art

[0002] The vehicle controller of electric vehicles now stores data. Generally, when the power is turned off, the vehicle-related data is stored in NVM (non-volatile storage, referred to as NVM, which will be replaced by NVM below). If the NVM storage fails when the power is turned off, the power-off process must still be continued. The problem of the vehicle controller being unable to power off due to the failure to write NVM cannot occur. This will cause a problem. Other faults can be stored in NVM so that the fault information is not lost after power off, but when the NVM itself fails to write to NVM after power off, the fault information cannot be stored after power off. In this way, the write NVM failure cannot be found after the power is turned on again after the fault occurs. At this time, the data read out is not the data that needs to be stored at the last power off, but the data stored when there was no fault before. If there is no detection mechanism, it will lead to the inability to find that the read NVM data is invalid. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a method and device for detecting a non-volatile memory and an electric vehicle, so as to detect whether data storage is successful when the NVM is powered off.

[0004] In order to solve the above technical problems, the technical solution of the present invention is as follows:

[0005] A method for detecting a non-volatile memory comprises the following steps:

[0006] Acquire a first count value and a second count value for indicating a data storage state when a non-volatile storage NVM is powered off, wherein the first count value and the second count value have the same initial value, and when data storage is successful when the NVM is powered off, one of the first count value and the second count value is increased by a preset value, and the other remains unchanged;

[0007] When the NVM is powered on next time, if the first count value and the second count value are the same, it is determined that data storage failed when the NVM was powered off; if the first count value and the second count value are different, it is determined that data storage succeeded when the NVM was powered off.

[0008] Further, when the data is successfully stored when the NVM is powered off, one of the first count value and the second count value is increased by a preset value, and the other remains unchanged, including:

[0009] When the data storage when the NVM is powered off is successful, the first count value is increased by 1, and the second count value remains unchanged; or,

[0010] When data storage is successful when the NVM is powered off, the second count value is increased by 1, and the first count value remains unchanged.

[0011] Further, after determining that the data storage when the NVM is powered off is successful, the detection method of the non-volatile memory further includes:

[0012] The first count value and the second count value are set to be the same.

[0013] Furthermore, the detection method of the non-volatile memory also includes the steps of:

[0014] The same first count value and second count value are written into the NVM.

[0015] Further, after determining that data storage fails when the NVM is powered off, the detection method for the non-volatile memory further includes: outputting fault information of data storage failure when the NVM is powered off.

[0016] Another aspect of the present invention provides a detection device for a non-volatile memory, comprising:

[0017] an acquisition module, used for acquiring a first count value and a second count value for indicating a data storage state when a non-volatile storage NVM is powered off, wherein the first count value and the second count value have the same initial value, and when data storage is successful when the NVM is powered off, one of the first count value and the second count value is increased by a preset value, and the other remains unchanged;

[0018] The processing module is used to determine that the data storage when the NVM is powered off fails if the first count value and the second count value are the same when the NVM is powered on next time; if the first count value and the second count value are different, determine that the data storage when the NVM is powered off is successful.

[0019] Further, when the data is successfully stored when the NVM is powered off, one of the first count value and the second count value is increased by a preset value, and the other remains unchanged, including:

[0020] When the data storage when the NVM is powered off is successful, the first count value is increased by 1, and the second count value remains unchanged; or,

[0021] When data storage is successful when the NVM is powered off, the second count value is increased by 1, and the first count value remains unchanged.

[0022] Furthermore, the processing module is further configured to set the first count value and the second count value to be the same after determining that the data storage when the NVM is powered off is successful.

[0023] Furthermore, the processing module is further configured to write the same first count value and the second count value into the NVM.

[0024] Furthermore, the processing module is further configured to output fault information of data storage failure when the NVM is powered off after determining that data storage fails when the NVM is powered off.

[0025] Another aspect of the present invention provides an electric vehicle, comprising the detection device of the non-volatile memory as described above.

[0026] The above solution of the present invention includes at least the following beneficial effects:

[0027] The above scheme of the present invention judges the first count value and the second count value in the non-volatile storage NVM, thereby detecting whether the data storage is successful when the NVM is powered off, which can effectively prevent the missing installation of the automobile door interior panel assembly and the instrument panel assembly, ensure the realization and integrity of the functions of the components, and has the advantages of simple method operation, easy implementation of the device structure, low cost and high detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 is a step diagram of a detection method for a non-volatile memory in an embodiment of the present invention;

[0029] Figure 2 A device connection block diagram of a detection device for a non-volatile memory in an embodiment of the present invention;

[0030] Figure 3 The figure is a working flow chart of a method for detecting a non-volatile memory in an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0032] like Figure 1 As shown, an embodiment of the present invention provides a method for detecting a non-volatile memory, comprising the following steps:

[0033] S1, obtaining a first count value and a second count value for indicating a data storage state when a non-volatile storage NVM is powered off, wherein the first count value and the second count value have the same initial value, and when data storage is successful when the NVM is powered off, one of the first count value and the second count value is increased by a preset value, and the other remains unchanged;

[0034] S2. When the NVM is powered on next time, if the first count value and the second count value are the same, it is determined that the data storage when the NVM is powered off has failed; if the first count value and the second count value are different, it is determined that the data storage when the NVM is powered off has succeeded.

[0035] The present invention judges the first count value and the second count value in the non-volatile storage NVM, thereby detecting whether the data storage is successful when the NVM is powered off, which can effectively prevent the missing installation of the automobile door interior panel assembly and the instrument panel assembly, ensure the realization and integrity of the component functions, and has the advantages of simple operation, low cost and high detection efficiency.

[0036] In a specific implementation, in step S1, when the data is successfully stored when the NVM is powered off, one of the first count value and the second count value is increased by a preset value, and the other remains unchanged, including:

[0037] When the data storage when the NVM is powered off is successful, the first count value is increased by 1, and the second count value remains unchanged; or,

[0038] When data storage is successful when the NVM is powered off, the second count value is increased by 1, and the first count value remains unchanged.

[0039] When the data storage is successful when the NVM is powered off, any one of the first count value and the second count value is increased by a preset value, such as 1, so that the first count value and the second count value are different, so that the first count value and the second count value can be compared when the NVM is powered on next time, so as to determine whether the data storage is successful when the NVM is powered off. This operation method is relatively convenient and easy to implement. According to actual needs, you can choose to increase the first count value by 1 and keep the second count value unchanged; or increase the second count value by 1 and keep the first count value unchanged; or increase the first count value by 1 and the second count value by 2; as long as the first count value and the second count value are different.

[0040] In a specific implementation, after determining that the data storage is successful when the NVM is powered off, the detection method of the non-volatile memory further includes the steps of:

[0041] S3. Setting the first count value and the second count value to be the same. Setting the first count value and the second count value to be the same facilitates periodic use of the device, improves detection efficiency, and reduces detection costs.

[0042] In specific implementation, the detection method of the non-volatile memory further includes the steps of:

[0043] S4. Write the same first count value and second count value into the NVM.

[0044] Writing the same first count value and the same second count value into the NVM facilitates obtaining the same first count value and the same second count value when step S1 is repeated, which facilitates subsequent detection.

[0045] In a specific implementation, after determining that data storage fails when the NVM is powered off, the detection method of the non-volatile memory further includes:

[0046] S5. Output the fault information of data storage failure when the NVM is powered off. The fault information of data storage failure when the NVM is powered off can be output to the terminal of the manager, so that the manager can check the fault information and handle it in time; or output to the TSP platform (automotive teleservice provider) to facilitate the unified management and analysis of the platform, and provide a reference for technology research and development and product upgrades.

[0047] Figure 2 FIG. 1 is a device connection block diagram of a detection device for a non-volatile memory in an embodiment of the present invention; Figure 2 , a non-volatile memory detection device 20 of this embodiment includes:

[0048] an acquisition module, used for acquiring a first count value and a second count value for indicating a data storage state when a non-volatile storage NVM is powered off, wherein the first count value and the second count value have the same initial value, and when data storage is successful when the NVM is powered off, one of the first count value and the second count value is increased by a preset value, and the other remains unchanged;

[0049] The processing module is used to determine that the data storage when the NVM is powered off fails if the first count value and the second count value are the same when the NVM is powered on next time; if the first count value and the second count value are different, determine that the data storage when the NVM is powered off is successful.

[0050] The present invention judges the first count value and the second count value in the non-volatile storage NVM, thereby detecting whether the data storage is successful when the NVM is powered off. This can effectively prevent the missing installation of the automobile door interior panel assembly and the instrument panel assembly, ensure the realization and integrity of the functions of the components, and has the advantages of easy implementation of the device structure, low cost, and high detection efficiency.

[0051] In a specific implementation, when the data is successfully stored when the NVM is powered off, one of the first count value and the second count value is increased by a preset value, and the other remains unchanged, including:

[0052] When the data storage when the NVM is powered off is successful, the first count value is increased by 1, and the second count value remains unchanged; or,

[0053] When data storage is successful when the NVM is powered off, the second count value is increased by 1, and the first count value remains unchanged.

[0054] When the data storage is successful when the NVM is powered off, any one of the first count value and the second count value is increased by a preset value, such as 1, so that the first count value and the second count value are different, so that the first count value and the second count value can be compared when the NVM is powered on next time, so as to determine whether the data storage is successful when the NVM is powered off. This operation method is relatively convenient and easy to implement. According to actual needs, you can choose to increase the first count value by 1 and keep the second count value unchanged; or increase the second count value by 1 and keep the first count value unchanged; or increase the first count value by 1 and the second count value by 2; as long as the first count value and the second count value are different.

[0055] In a specific implementation, the processing module is further used to set the first count value and the second count value to be the same after determining that the data storage when the NVM is powered off is successful. Setting the first count value and the second count value to be the same facilitates the periodic use of the device, improves detection efficiency, and reduces detection costs.

[0056] In a specific implementation, the processing module is further used to write the same first count value and the second count value into the NVM. Writing the same first count value and the second count value into the NVM facilitates obtaining the same first count value and the second count value when step S1 is repeated, which is convenient for subsequent detection.

[0057] In specific implementation, the processing module is also used to output the fault information of the data storage failure when the NVM is powered off after determining that the data storage fails when the NVM is powered off. The fault information of the data storage failure when the NVM is powered off can be output (sent) to the terminal of the manager, so that the manager can view the fault information and handle it in time; or output (sent) to the TSP platform (automotive teleservice provider) to facilitate the unified management and analysis of the platform, and provide a reference basis for technology research and development and product upgrades.

[0058] An electric vehicle of this embodiment includes the detection device of the non-volatile memory as described in the above embodiment.

[0059] The principle of the detection method of the non-volatile memory of this embodiment is as follows: two counters are set in the data stored in NVM, and the values ​​of the two counters are the same. At this time, a NVM storage operation is performed, and the two counters with the same values ​​are stored in NVM. When storing NVM after power-off, the value of one of the counters is increased by 1, and then the NVM is stored. If the storage is successful, the values ​​of the two counters are different after power-on (it can also be said that there is a difference of 1), and if the storage fails, the values ​​of the two counters are the same (that is, the difference is 0), so that the situation of failure to store NVM during power-off can be discovered.

[0060] Figure 3 FIG. 1 is a flowchart of a method for detecting a non-volatile memory in an embodiment of the present invention. Figure 3 , a workflow of the detection method of the non-volatile memory of the present embodiment is: two counters are set, the values ​​of the counters are respectively a first count value Counter_0 and a second count value Counter_1, the first count value and the second count value have the same initial value, and the first count value and the second count value are stored in the data of the NVM; when the vehicle controller is powered on, the first count value Counter_0 and the second count value Counter_1 used to represent the data storage state when the non-volatile storage NVM is powered off are obtained, the initial values ​​of Counter_0 and Counter_1 are the same, and when the data storage is successful when the NVM is powered off, Counter_1 is increased by 1, and Counter_0 is not increased. When the NVM is powered on next time, Counter_0 and Counter_1 are read out. If the difference between Counter_0 and Counter_1 is 0, or Counter_0 and Counter_1 are the same, it is determined that the data storage failed when the NVM was powered off, and the fault information of the data storage failure when the NVM was powered off is output to facilitate the management personnel to process and analyze; if Counter_0 and Counter_1 are different, or in other words, if the value of Counter_1 minus Counter_0 is 1, it is determined that the data storage was successful when the NVM was powered off. At this time, Counter_1 minus Counter_0 is set to be the same and stored in the NVM for the next detection.

[0061] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for detecting a non-volatile memory, characterized in that: The following steps are involved: Acquire a first count value and a second count value for indicating a data storage state when a non-volatile storage NVM is powered off, wherein the first count value and the second count value have the same initial value, and when data storage is successful when the NVM is powered off, one of the first count value and the second count value is increased by a preset value, and the other remains unchanged; When the NVM is powered on next time, if the first count value and the second count value are the same, it is determined that the data storage when the NVM is powered off has failed; if the first count value and the second count value are different, it is determined that the data storage when the NVM is powered off has succeeded; When the data is successfully stored when the NVM is powered off, one of the first count value and the second count value is increased by a preset value, and the other remains unchanged, including: When the data storage when the NVM is powered off is successful, the first count value is increased by 1, and the second count value remains unchanged; or, When the data storage when the NVM is powered off is successful, the second count value is increased by 1, and the first count value remains unchanged; After determining that the data storage when the NVM is powered off is successful, the method further includes: The first count value and the second count value are set to be the same.

2. The method for detecting a non-volatile memory according to claim 1, wherein: Also includes the steps: The same first count value and second count value are written into the NVM.

3. The method for detecting a non-volatile memory according to claim 1, wherein: After determining that the data storage fails when the NVM is powered off, the method further includes: Outputting fault information indicating data storage failure when the NVM is powered off.

4. A detection device for a non-volatile memory, characterized in that: include: an acquisition module, used for acquiring a first count value and a second count value for indicating a data storage state when a non-volatile storage NVM is powered off, wherein the first count value and the second count value have the same initial value, and when data storage is successful when the NVM is powered off, one of the first count value and the second count value is increased by a preset value, and the other remains unchanged; A processing module is used for determining that the data storage when the NVM is powered off fails if the first count value and the second count value are the same when the NVM is powered on next time; and determining that the data storage when the NVM is powered off succeeds if the first count value and the second count value are different; When the data is successfully stored when the NVM is powered off, one of the first count value and the second count value is increased by a preset value, and the other remains unchanged, including: When the data storage when the NVM is powered off is successful, the first count value is increased by 1, and the second count value remains unchanged; or, When the data storage when the NVM is powered off is successful, the second count value is increased by 1, and the first count value remains unchanged; The processing module is further configured to set the first count value and the second count value to be the same after determining that the data storage when the NVM is powered off is successful.

5. The non-volatile memory detection device according to claim 4, characterized in that: The processing module is further configured to write the same first count value and the second count value into the NVM.

6. The non-volatile memory detection device according to claim 4, characterized in that: The processing module is further configured to output fault information of data storage failure when the NVM is powered off after determining that the data storage fails when the NVM is powered off.

7. An electric vehicle, characterized in that: A detection device comprising a non-volatile memory as claimed in any one of claims 4 to 6.