CN113393891A - Nonvolatile memory detection method and device and electric vehicle - Google Patents
Nonvolatile memory detection method and device and electric vehicle Download PDFInfo
- Publication number
- CN113393891A CN113393891A CN202010165142.9A CN202010165142A CN113393891A CN 113393891 A CN113393891 A CN 113393891A CN 202010165142 A CN202010165142 A CN 202010165142A CN 113393891 A CN113393891 A CN 113393891A
- Authority
- CN
- China
- Prior art keywords
- count value
- nvm
- powered
- data storage
- successful
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11C—STATIC STORES
- G11C29/00—Checking stores for correct operation ; Subsequent repair; Testing stores during standby or offline operation
- G11C29/56—External testing equipment for static stores, e.g. automatic test equipment [ATE]; Interfaces therefor
Abstract
The embodiment of the invention provides a detection method and device of a nonvolatile memory and an electric vehicle. The detection method of the nonvolatile memory comprises the following steps: acquiring a first count value and a second count value which are used for representing the data storage state of a non-volatile storage (NVM) when the NVM is powered off, wherein the initial values of the first count value and the second count value are the same, and when the data storage of the NVM is successful when the NVM is powered off, one of the first count value and the second count value is added with a preset value, and the other is unchanged; when the NVM is powered on next time, if the first count value and the second count value are the same, determining that data storage fails when the NVM is powered off; and if the first count value and the second count value are different, determining that the data storage is successful when the NVM is powered off. The method can effectively detect whether the NVM data storage is successful, and has the advantages of low cost and high efficiency.
Description
Technical Field
The invention relates to the technical field of electric automobiles, in particular to a detection method and device of a nonvolatile memory and an electric automobile.
Background
At present, a vehicle control unit of an electric vehicle stores data, and generally stores vehicle-related data in an NVM (non-volatile storage, NVM for short, and NVM will be used for replacement in the following) when the vehicle is powered off. If the NVM storage fails during power-off, the power-off process is required to be carried out, and the problem that the whole vehicle controller cannot be powered off due to the failure of NVM writing can not occur. Therefore, a problem occurs, other faults can be caused by the storage of the NVM, so that fault information is not lost after power-off, and the NVM cannot store fault information after power-off when a fault of power-off writing of the NVM occurs, so that a writing NVM fault cannot be found after the fault occurs and power-on is resumed, and at this time, read data is not data which needs to be stored when power-off is performed last time, but data which is stored when no fault exists before, and if a detection mechanism is not provided, the read NVM data cannot be found to be invalid.
Disclosure of Invention
The invention aims to provide a detection method and a detection device of a nonvolatile memory and an electric automobile. Therefore, whether the data storage is successful or not when the NVM is powered down can be detected.
In order to solve the technical problems, the technical scheme of the invention is as follows:
a method of testing a non-volatile memory, comprising the steps of:
acquiring a first count value and a second count value which are used for representing the data storage state of a non-volatile storage (NVM) when the NVM is powered off, wherein the initial values of the first count value and the second count value are the same, and when the data storage of the NVM is successful when the NVM is powered off, one of the first count value and the second count value is added with a preset value, and the other is unchanged;
when the NVM is powered on next time, if the first count value and the second count value are the same, determining that data storage fails when the NVM is powered off; and if the first count value and the second count value are different, determining that the data storage is successful when the NVM is powered off.
Further, when the data storage is successful when the NVM is powered down, adding a preset value to one of the first count value and the second count value, and leaving the other unchanged, including:
adding 1 to the first count value when the data storage is successful when the NVM is powered off, wherein the second count value is not changed; alternatively, the first and second electrodes may be,
and when the data storage is successful when the NVM is powered down, adding 1 to the second count value, and keeping the first count value unchanged.
Further, after determining that the data storage is successful when the NVM is powered off, the method for detecting the non-volatile memory further includes:
setting the first count value and the second count value to be the same.
Further, the detection method of the nonvolatile memory further comprises the steps of:
writing the same first count value and second count value to the NVM.
Further, after determining that the data storage fails when the NVM is powered off, the method for detecting a non-volatile memory further includes: and outputting fault information of data storage failure when the NVM is powered off.
In another aspect of the present invention, there is provided a nonvolatile memory sensing apparatus, including:
the acquiring module is used for acquiring a first count value and a second count value which are used for representing the data storage state of a non-volatile storage (NVM) when the NVM is powered off, wherein the initial values of the first count value and the second count value are the same, and when the data storage of the NVM is successful when the NVM is powered off, one of the first count value and the second count value is added with a preset value, and the other one is unchanged;
the processing module is used for determining that data storage fails when the NVM is powered off when the NVM is powered on next time if the first count value and the second count value are the same; and if the first count value and the second count value are different, determining that the data storage is successful when the NVM is powered off.
Further, when the data storage is successful when the NVM is powered down, adding a preset value to one of the first count value and the second count value, and leaving the other unchanged, including:
adding 1 to the first count value when the data storage is successful when the NVM is powered off, wherein the second count value is not changed; alternatively, the first and second electrodes may be,
and when the data storage is successful when the NVM is powered down, adding 1 to the second count value, and keeping the first count value unchanged.
Further, 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 is successful when the NVM is powered off.
Further, the processing module is further configured to write the same first count value and second count value to the NVM.
Further, the processing module is further configured to output failure information of data storage failure when the NVM is powered off after determining that the data storage failure when the NVM is powered off.
In another aspect of the invention, an electric vehicle is provided, which includes the detection device of the non-volatile memory as described above.
The scheme of the invention at least comprises the following beneficial effects:
according to the scheme, the first count value and the second count value in the non-volatile storage NVM are judged, so that whether data storage is successful or not when the NVM is powered off is detected, the neglected loading phenomenon of an automobile door trim panel assembly and an instrument panel assembly can be effectively prevented, the realization and integrity of functions of parts are guaranteed, and the method has the advantages of being simple in operation, easy to realize device structure, low in cost and high in detection efficiency.
Drawings
FIG. 1 is a flowchart illustrating a method for testing a non-volatile memory according to an embodiment of the present invention;
FIG. 2 is a block diagram of a device connection of a detecting apparatus of a non-volatile memory according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for detecting a non-volatile memory according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As shown in fig. 1, an embodiment of the present invention provides a method for detecting a non-volatile memory, including the following steps:
s1, acquiring a first count value and a second count value used for representing the data storage state of a non-volatile storage (NVM) when the NVM is powered off, wherein the initial values of the first count value and the second count value are the same, and when the data storage of the NVM is successful when the NVM is powered off, one of the first count value and the second count value is added with a preset value, and the other is unchanged;
s2, when the NVM is powered on next time, if the first count value and the second count value are the same, determining that data storage fails when the NVM is powered off; and if the first count value and the second count value are different, determining that the data storage is successful when the NVM is powered off.
According to the invention, the first count value and the second count value in the non-volatile storage NVM are judged, so that whether the data storage is successful when the NVM is powered off is detected, the neglected loading phenomenon of an automobile door trim panel assembly and an instrument panel assembly can be effectively prevented, the realization and the integrity of the functions of parts are ensured, and the method has the advantages of simple operation, low cost and high detection efficiency.
In specific implementation, in step S1, when the data storage is successful when the NVM is powered off, one of the first count value and the second count value is added with a preset value, and the other is unchanged, including:
adding 1 to the first count value when the data storage is successful when the NVM is powered off, wherein the second count value is not changed; alternatively, the first and second electrodes may be,
and when the data storage is successful when the NVM is powered down, adding 1 to the second count value, and keeping the first count value unchanged.
When the data storage of the NVM is successful, adding a preset value to any one of the first count value and the second count value, for example, adding 1, so that the first count value and the second count value are different, and the first count value and the second count value are convenient to compare when the NVM is powered on next time, thereby judging whether the data storage of the NVM is successful or not. According to actual needs, the first counting value can be added by 1 by self, and the second counting value is unchanged; or the second count value is added with 1, and the first count value is unchanged; or adding 1 to the first count value and adding 2 to the second count value; the first count value and the second count value may be different.
In specific implementation, after determining that the data storage is successful when the NVM is powered off, the method for detecting the nonvolatile memory further includes the steps of:
s3, setting the first count value and the second count value to be the same. And the first count value and the second count value are set to be the same, so that the device is convenient to use periodically, the detection efficiency is improved, and the detection cost is reduced.
In specific implementation, the method for detecting the nonvolatile memory further comprises the following steps:
s4, writing the same first count value and the second count value into the NVM.
And writing the same first count value and the same second count value into the NVM, so as to obtain the same first count value and the same second count value when the step S1 is repeatedly performed, thereby facilitating subsequent detection.
In specific implementation, after determining that the data storage fails when the NVM is powered off, the method for detecting the nonvolatile memory further includes:
and S5, outputting fault information of data storage failure when the NVM is powered off. The fault information of data storage failure during the power-off of the NVM is output and can be output to a terminal of a manager, so that the manager can check and process the fault information in time; or output to a TSP platform (automobile remote service provider), so that the platform can be managed and analyzed uniformly, and a reference basis is provided for technical research and development and product upgrade.
FIG. 2 is a block diagram of a device connection of a detecting apparatus of a non-volatile memory according to an embodiment of the present invention; referring to fig. 2, the detecting apparatus 20 for a non-volatile memory of the present embodiment includes:
the acquiring module is used for acquiring a first count value and a second count value which are used for representing the data storage state of a non-volatile storage (NVM) when the NVM is powered off, wherein the initial values of the first count value and the second count value are the same, and when the data storage of the NVM is successful when the NVM is powered off, one of the first count value and the second count value is added with a preset value, and the other one is unchanged;
the processing module is used for determining that data storage fails when the NVM is powered off when the NVM is powered on next time if the first count value and the second count value are the same; and if the first count value and the second count value are different, determining that the data storage is successful when the NVM is powered off.
According to the invention, the first count value and the second count value in the non-volatile storage NVM are judged, so that whether the data storage is successful when the NVM is powered off is detected, the neglected loading phenomenon of an automobile door trim panel assembly and an instrument panel assembly can be effectively prevented, the realization and integrity of the functions of parts are ensured, and the device has the advantages of easy realization of the structure, low cost and high detection efficiency.
In specific implementation, when the data storage is successful when the NVM is powered off, one of the first count value and the second count value is added with a preset value, and the other is unchanged, including:
adding 1 to the first count value when the data storage is successful when the NVM is powered off, wherein the second count value is not changed; alternatively, the first and second electrodes may be,
and when the data storage is successful when the NVM is powered down, adding 1 to the second count value, and keeping the first count value unchanged.
When the data storage of the NVM is successful, adding a preset value to any one of the first count value and the second count value, for example, adding 1, so that the first count value and the second count value are different, and the first count value and the second count value are convenient to compare when the NVM is powered on next time, thereby judging whether the data storage of the NVM is successful or not. According to actual needs, the first counting value can be added by 1 by self, and the second counting value is unchanged; or the second count value is added with 1, and the first count value is unchanged; or adding 1 to the first count value and adding 2 to the second count value; the first count value and the second count value may be different.
In specific implementation, 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 is successful when the NVM is powered off. And the first count value and the second count value are set to be the same, so that the device is convenient to use periodically, the detection efficiency is improved, and the detection cost is reduced.
In specific implementation, the processing module is further configured to write the same first count value and the same second count value into the NVM. And writing the same first count value and the same second count value into the NVM, so as to obtain the same first count value and the same second count value when the step S1 is repeatedly performed, thereby facilitating subsequent detection.
In specific implementation, the processing module is further configured to output failure information of data storage failure during power-off of the NVM after determining that data storage failure during power-off of the NVM is failed. The fault information of data storage failure during the power-off of the NVM is output and can be output (sent) to a terminal of a manager, so that the manager can check and process the fault information in time; or output (send) to TSP platform (car teleservice provider), be convenient for platform unified management, analysis, and provide reference basis for technical development, product upgrade.
An electric vehicle of the present embodiment includes the detection device of the nonvolatile memory as described in the above embodiments.
The principle of the detection method of the nonvolatile memory of the embodiment is as follows: setting two counters (calculators) in the data of the stored NVM, wherein the two counters have the same value, then performing the operation of storing the NVM once, storing the two counters with the same value into the NVM, adding 1 to the value of one Counter when the NVM is stored, and then storing the NVM. If the storage is successful, the two Counter values are different (i.e. have a difference of 1) after power-up, and if the storage fails, the two Counter values are the same (i.e. the difference is 0), so that the NVM failure condition can be found when power-off occurs.
FIG. 3 is a flowchart illustrating a method for detecting a non-volatile memory according to an embodiment of the present invention. As shown in fig. 3, a working flow of the detection method of the non-volatile memory of the present embodiment is as follows: setting two counters, wherein the values of the counters are a first count value Counter _0 and a second count value Counter _1 respectively, the initial values of the first count value and the second count value are the same, and storing the first count value and the second count value in the data of the NVM; when the vehicle control unit is powered on, acquiring a first count value Counter _0 and a second count value Counter _1 which are used for representing the data storage state when the nonvolatile storage NVM is powered off, wherein the initial values of the Counter _0 and the Counter _1 are the same, and when the data storage is successful when the NVM is powered off, adding 1 to the Counter _1, wherein the Counter _0 is unchanged; reading out Counter _0 and Counter _1 when the NVM is powered on next time, if the difference between the Counter _0 and the Counter _1 is 0 or the Counter _0 and the Counter _1 are the same, determining that the data storage fails when the NVM is powered off, and outputting fault information of the data storage failure when the NVM is powered off, so that a manager can conveniently process and analyze the fault information; if Counter _0 and Counter _1 are different, or if the value of Counter _1 minus Counter _0 is 1, it is determined that the data storage is successful when the NVM is powered down, and at this time, Counter _1 minus Counter _0 is set to be the same and stored in the NVM for the next detection.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (11)
1. A detection method of a nonvolatile memory is characterized by comprising the following steps:
acquiring a first count value and a second count value which are used for representing the data storage state of a non-volatile storage (NVM) when the NVM is powered off, wherein the initial values of the first count value and the second count value are the same, and when the data storage of the NVM is successful when the NVM is powered off, one of the first count value and the second count value is added with a preset value, and the other is unchanged;
when the NVM is powered on next time, if the first count value and the second count value are the same, determining that data storage fails when the NVM is powered off; and if the first count value and the second count value are different, determining that the data storage is successful when the NVM is powered off.
2. The method of claim 1, wherein when the data storage is successful when the NVM is powered down, one of the first count value and the second count value is added with a predetermined value, and the other is unchanged, the method comprises:
adding 1 to the first count value when the data storage is successful when the NVM is powered off, wherein the second count value is not changed; alternatively, the first and second electrodes may be,
and when the data storage is successful when the NVM is powered down, adding 1 to the second count value, and keeping the first count value unchanged.
3. The method of claim 2, wherein after determining that the data storage is successful when the NVM is powered down, the method further comprises:
setting the first count value and the second count value to be the same.
4. The method for testing a nonvolatile memory as claimed in claim 3, further comprising the steps of:
writing the same first count value and second count value to the NVM.
5. The method of claim 1, wherein after determining that the data storage fails when the NVM is powered down, the method further comprises:
and outputting fault information of data storage failure when the NVM is powered off.
6. An apparatus for testing a non-volatile memory, comprising:
the acquiring module is used for acquiring a first count value and a second count value which are used for representing the data storage state of a non-volatile storage (NVM) when the NVM is powered off, wherein the initial values of the first count value and the second count value are the same, and when the data storage of the NVM is successful when the NVM is powered off, one of the first count value and the second count value is added with a preset value, and the other one is unchanged;
the processing module is used for determining that data storage fails when the NVM is powered off when the NVM is powered on next time if the first count value and the second count value are the same; and if the first count value and the second count value are different, determining that the data storage is successful when the NVM is powered off.
7. The apparatus of claim 6, wherein when the data storage is successful when the NVM is powered down, one of the first count value and the second count value is added with a predetermined value, and the other is unchanged, the apparatus comprises:
adding 1 to the first count value when the data storage is successful when the NVM is powered off, wherein the second count value is not changed; alternatively, the first and second electrodes may be,
and when the data storage is successful when the NVM is powered down, adding 1 to the second count value, and keeping the first count value unchanged.
8. The apparatus for testing a non-volatile memory according to claim 7,
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 is successful when the NVM is powered off.
9. The apparatus of claim 8, wherein the processing module is further configured to write the same first count value and second count value to the NVM.
10. The apparatus according to claim 6, wherein the processing module is further configured to output failure information indicating that the data storage fails when the NVM is powered off after determining that the data storage fails when the NVM is powered off.
11. An electric vehicle characterized by comprising the detection device of the nonvolatile memory according to any one of claims 6 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010165142.9A CN113393891A (en) | 2020-03-11 | 2020-03-11 | Nonvolatile memory detection method and device and electric vehicle |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010165142.9A CN113393891A (en) | 2020-03-11 | 2020-03-11 | Nonvolatile memory detection method and device and electric vehicle |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113393891A true CN113393891A (en) | 2021-09-14 |
Family
ID=77615329
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010165142.9A Pending CN113393891A (en) | 2020-03-11 | 2020-03-11 | Nonvolatile memory detection method and device and electric vehicle |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113393891A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000339232A (en) * | 1999-05-31 | 2000-12-08 | Oki Data Corp | Method for writing count value into nonvolatile memory |
JP2001043201A (en) * | 1999-08-03 | 2001-02-16 | Mitsubishi Electric Corp | Multiprocessor fault detector |
US20080250221A1 (en) * | 2006-10-09 | 2008-10-09 | Holt John M | Contention detection with data consolidation |
JP2013161314A (en) * | 2012-02-07 | 2013-08-19 | Hi-Lex Corporation | Data write abnormality determination device |
CN109213690A (en) * | 2018-09-21 | 2019-01-15 | 浪潮电子信息产业股份有限公司 | A kind of method for reconstructing and relevant apparatus of L2P table |
-
2020
- 2020-03-11 CN CN202010165142.9A patent/CN113393891A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000339232A (en) * | 1999-05-31 | 2000-12-08 | Oki Data Corp | Method for writing count value into nonvolatile memory |
JP2001043201A (en) * | 1999-08-03 | 2001-02-16 | Mitsubishi Electric Corp | Multiprocessor fault detector |
US20080250221A1 (en) * | 2006-10-09 | 2008-10-09 | Holt John M | Contention detection with data consolidation |
JP2013161314A (en) * | 2012-02-07 | 2013-08-19 | Hi-Lex Corporation | Data write abnormality determination device |
CN109213690A (en) * | 2018-09-21 | 2019-01-15 | 浪潮电子信息产业股份有限公司 | A kind of method for reconstructing and relevant apparatus of L2P table |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10146604B2 (en) | Bad block detection and predictive analytics in NAND flash storage devices | |
CN1292553A (en) | Method for writing electrically-erasable programmable ROM, equipment and system | |
US8402204B2 (en) | Methods for measuring usable lifespan and replacing an in-system programming code of a memory device, and data storage system using the same | |
WO2005093762A1 (en) | Memory defect detection and self-repair technique | |
KR20130031888A (en) | Method for monitoring a data memory | |
CN112395122B (en) | Flash memory controller and method thereof | |
CN113832663B (en) | Control chip fault recording method and device and control chip fault reading method | |
CN111796965A (en) | Method and apparatus relating to improved reliability and safety of automotive electronic control units during power standby mode | |
CN113961478A (en) | Memory fault recording method and device | |
KR100836384B1 (en) | Self-diagnosis/recovery ECU in vehicle and method for operating the same | |
CN115061852B (en) | Functional board card, production system of functional board card and use method of servo system | |
CN113393891A (en) | Nonvolatile memory detection method and device and electric vehicle | |
CN113625957B (en) | Method, device and equipment for detecting hard disk faults | |
JP4950214B2 (en) | Method for detecting a power outage in a data storage device and method for restoring a data storage device | |
CN114913627A (en) | Fault data storage method and device, vehicle and computer readable storage medium | |
US8375262B2 (en) | Field programmable redundant memory for electronic devices | |
CN111324554B (en) | Management method and device of flash memory data and elevator controller | |
US20070033492A1 (en) | Method and device for monitoring an electronic circuit | |
US8019931B2 (en) | Method and control unit for operating a non-volatile memory, in particular for use in motor vehicles | |
EP3557422A1 (en) | Method for accessing code sram, and electronic device | |
CN104979017B (en) | System and method for testing and assembling memory modules | |
JP7205982B2 (en) | Memory, error recovery method for memory, and battery device containing memory | |
CN114860052B (en) | Program execution judging method, device, equipment and readable storage medium | |
JP3314719B2 (en) | Flash EEPROM and its test method | |
JP3201342B2 (en) | Electric circuit card test apparatus and test method, and recording medium recording control program for the test method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |