CN114995747B - Method for processing electric quantity data of charging pile controller - Google Patents

Method for processing electric quantity data of charging pile controller Download PDF

Info

Publication number
CN114995747B
CN114995747B CN202210460461.1A CN202210460461A CN114995747B CN 114995747 B CN114995747 B CN 114995747B CN 202210460461 A CN202210460461 A CN 202210460461A CN 114995747 B CN114995747 B CN 114995747B
Authority
CN
China
Prior art keywords
data
eeprom
area
electric quantity
erasing
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.)
Active
Application number
CN202210460461.1A
Other languages
Chinese (zh)
Other versions
CN114995747A (en
Inventor
杨进锋
尹姝
刘松
徐立
朱恺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Joyson Elite Nanjing New Energy Vehicle System Research Institute Co ltd
Ningbo Junsheng New Energy Automotive Technology Co ltd
Original Assignee
Joyson Elite Nanjing New Energy Vehicle System Research Institute Co ltd
Ningbo Junsheng New Energy Automotive Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Joyson Elite Nanjing New Energy Vehicle System Research Institute Co ltd, Ningbo Junsheng New Energy Automotive Technology Co ltd filed Critical Joyson Elite Nanjing New Energy Vehicle System Research Institute Co ltd
Priority to CN202210460461.1A priority Critical patent/CN114995747B/en
Publication of CN114995747A publication Critical patent/CN114995747A/en
Application granted granted Critical
Publication of CN114995747B publication Critical patent/CN114995747B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B60VEHICLES IN GENERAL
    • B60LPROPULSION OF ELECTRICALLY-PROPELLED VEHICLES; SUPPLYING ELECTRIC POWER FOR AUXILIARY EQUIPMENT OF ELECTRICALLY-PROPELLED VEHICLES; ELECTRODYNAMIC BRAKE SYSTEMS FOR VEHICLES IN GENERAL; MAGNETIC SUSPENSION OR LEVITATION FOR VEHICLES; MONITORING OPERATING VARIABLES OF ELECTRICALLY-PROPELLED VEHICLES; ELECTRIC SAFETY DEVICES FOR ELECTRICALLY-PROPELLED VEHICLES
    • B60L53/00Methods of charging batteries, specially adapted for electric vehicles; Charging stations or on-board charging equipment therefor; Exchange of energy storage elements in electric vehicles
    • B60L53/30Constructional details of charging stations
    • B60L53/31Charging columns specially adapted for electric vehicles
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B60VEHICLES IN GENERAL
    • B60LPROPULSION OF ELECTRICALLY-PROPELLED VEHICLES; SUPPLYING ELECTRIC POWER FOR AUXILIARY EQUIPMENT OF ELECTRICALLY-PROPELLED VEHICLES; ELECTRODYNAMIC BRAKE SYSTEMS FOR VEHICLES IN GENERAL; MAGNETIC SUSPENSION OR LEVITATION FOR VEHICLES; MONITORING OPERATING VARIABLES OF ELECTRICALLY-PROPELLED VEHICLES; ELECTRIC SAFETY DEVICES FOR ELECTRICALLY-PROPELLED VEHICLES
    • B60L53/00Methods of charging batteries, specially adapted for electric vehicles; Charging stations or on-board charging equipment therefor; Exchange of energy storage elements in electric vehicles
    • B60L53/60Monitoring or controlling charging stations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/60Other road transportation technologies with climate change mitigation effect
    • Y02T10/70Energy storage systems for electromobility, e.g. batteries
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/60Other road transportation technologies with climate change mitigation effect
    • Y02T10/7072Electromobility specific charging systems or methods for batteries, ultracapacitors, supercapacitors or double-layer capacitors
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T90/00Enabling technologies or technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02T90/10Technologies relating to charging of electric vehicles
    • Y02T90/12Electric charging stations
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S30/00Systems supporting specific end-user applications in the sector of transportation
    • Y04S30/10Systems supporting the interoperability of electric or hybrid vehicles
    • Y04S30/12Remote or cooperative charging

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Power Engineering (AREA)
  • Transportation (AREA)
  • Mechanical Engineering (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

The invention discloses a method for processing electric quantity data of a charging pile controller, which comprises the following steps of dividing an EEPROM into areas: the method comprises the steps that a first area with N bytes and a second area with M bytes are separated from an EEPROM matched with a charging pile controller, the N bytes in the first area are divided into P blocks, P is an integer larger than 2 and used for storing electric quantity data, the M bytes in the second area are divided into Q blocks, Q is a positive integer and used for storing verification data obtained after the electric quantity data are calculated through a first algorithm. The invention designs a special data distribution structure and a data recovery method, and reduces the risk that the electric quantity cannot be recovered due to storage errors of the charging pile controller under the extreme condition.

Description

Method for processing electric quantity data of charging pile controller
Technical Field
The invention relates to the technical field of electric automobile charging, in particular to a method for processing electric quantity data of a charging pile controller.
Background
With the development of new energy vehicles, infrastructure construction and charging pile intelligent charging technology are also in rapid development. The domestic 220V alternating current of national power system standard supplies power is used in the electric pile, but, the national grid often meets various reasons and can have a power failure, and especially appears power interruption when power consumption is high peak easily. Once power is cut off, the charging pile is powered off and stops working (charging the electric automobile). For the public stake, under the theoretical condition, before the power failure and the stop of work, the electric quantity of the charging pile can be periodically stored in an EEPROM (electrically charged erasable programmable read-only memory), and after the power supply of a power grid is recovered, the electric quantity before the power failure (or the data before the charging) can be recovered by reading the data in the EEPROM after the charging pile is electrified. But in the extreme conditions: for example, under the complicated electromagnetic condition, the charging pile encounters an abnormal power failure, and if the circuit encounters electromagnetic interference when the electric quantity data is stored in the EEPROM, the data stored in the EEPROM is erroneous, but the controller cannot read back the stored data from the EEPROM for verification and storage due to the power failure, and finally the electric quantity data stored in the EEPROM area is erroneous or the data is incompletely stored. After the power supply of the power grid is recovered, part of data needs to be read again for accumulation, at the moment, due to the fact that the EEPROM data is abnormal or incomplete, expected data cannot be recovered, charging information is lost or large difference exists, electric charge collection is seriously affected, and unnecessary disputes are brought to charging pile service providers and charging users. Therefore, it is necessary to develop a method for processing electric quantity data of a charging pile controller to solve the above problems.
Disclosure of Invention
The invention aims to provide a method for processing electric quantity data of a charging pile controller. The invention designs a special data distribution structure and a data recovery method, and reduces the risk that the electric quantity cannot be recovered due to storage errors of the charging pile controller under the limit condition.
The technical scheme of the invention is as follows: a method for processing electric quantity data of a charging pile controller comprises the following steps:
area division of the EEPROM: dividing a first area with N bytes and a second area with M bytes from an EEPROM (electrically erasable programmable read-only memory) matched with a charging pile controller, wherein the N bytes in the first area are divided into P blocks, P is an integer larger than 2 and used for storing electric quantity data, the M bytes in the second area are divided into Q blocks, and Q is a positive integer and used for storing verification data obtained after the electric quantity data are calculated through a first algorithm;
data storage: triggering 1-time EEPROM storage every time when the charging electric quantity is increased by one unit, wherein when the EEPROM storage is triggered every time, one block in the P blocks in the first area is erased and written into the total erasing and writing number of the block, the total erasing and writing number of the P blocks in the first area is used as electric quantity data, and the electric quantity data is calculated by a first algorithm to obtain check data and stored in a second area; with the continuous increase of the charging electric quantity, the P blocks in the first area are erased and written circularly block by block in sequence, real-time electric quantity data are updated, and the second area also updates the verification data synchronously;
and (3) data recovery: when the charging pile system is powered on again after being powered off, respectively reading the erasing sum of the P blocks in the first area and the verification data A stored in the second area in the EEPROM, accumulating the erasing sum of the P blocks in the first area to obtain electric quantity data, and calculating the electric quantity data through a first algorithm to obtain verification data B;
if the verification data A = the verification data B and indicates that all the data in the EEPROM are valid, writing all the valid data into the EEPROM to finish recovery;
if the check data A is not equal to the check data B and indicates that error data exists in the EEPROM, the validity judgment of the check data A is skipped, the validity of the total erasing number of the P blocks in the first area is directly judged, the total erasing number of the P blocks in the first area is arranged according to the sequence of erasing, the valid value of the total erasing number of the P blocks in the first area is obtained from the rule of data arrangement, the valid value of the check data in the second area is further obtained, all the obtained valid values are written into the EEPROM, and the recovery is completed.
In the method for processing the electric quantity data of the charging pile controller, the data recovery specifically includes the following steps:
step 1, after the charging pile system is powered off, the charging pile controller is powered on again, enters a normal working mode, firstly reads P erasing data stored in a first area in an EEPROM, assigns the P erasing data to variables EnergyData1 to EnergyDataP of the RAM respectively, assigns the number of EEPROM data reading times to 1, and enters step 2;
step 2, reading check data stored in a second area in the EEPROM, if the check data is valid, assigning the data to a variable checksunData1 of the RAM, and entering step 3; if the check data is invalid, discarding the check data and entering the step 6;
step 3, accumulating the P erasing data from EnergyData1 to EnergyDataP to obtain electric quantity data EnergyData, calculating check data checksunData2 from EnergyData according to a CRC16 algorithm, comparing the checksunData1 with the checksunData2,
if checksunData1= checksunData2, go to step 4;
if the checksunData1 is not equal to the checksunData2, entering the step 5;
step 4, accumulating the P erasing data from the Energy data1 to the Energy data to obtain electric quantity data Energy, calculating the total effective electric Energy data Energy according to the electric quantity data Energy, and entering step 7;
step 5, repeatedly reading P erasing data stored in the first area in the EEPROM, assigning a value of +1 to the number of reading times of the EEPROM data during each reading, performing step 2 and step 3 again,
if the number of times of reading the EEPROM data is less than or equal to 3 and the checksunData1= checksunData2, entering the step 4;
if the data of the EEPROM does not meet the requirement that checksunData1= checksunData2 after the data of the EEPROM is read for 3 times, entering step 6;
step 6, arranging the total erasing numbers EnergyData1 to EnergyDataP of the P blocks in the first area according to the erasing sequence, judging the effectiveness of the P data from the data arrangement rule, if error data exists, correcting the error data, and entering step 4;
and 7, writing the effective total Energy of the electric Energy data into the EEPROM after calculation, and exiting the data recovery process.
In the method for processing electric quantity data of the charging pile controller, step 6 specifically includes:
step 6.1, firstly determining the validity of EnergyData1, defining a variable value as the difference value between EnergyData1 and the data in other blocks in the first area, comparing EnergyData1 with EnergyData2,
if EnergyData1-EnergyData2 is not equal to 0 and not equal to 1, entering step 6.2;
if EnergyData1-EnergyData2=0 or =1, then go to step 6.3;
step 6.2, comparing EnergyData1 with EnergyData3, and if EnergyData1-EnergyData3 is not equal to 0 and not equal to 1, assigning EnergyData2 to EnergyData1; if EnergyData1-EnergyData3=0 or =1, assigning EnergyData1 to EnergyData2; then entering step 4;
step 6.3, based on EnergyData1-EnergyData2=0 or =1, determining that both data EnergyData1 and EnergyData2 are valid, comparing EnergyData1 with EnergyData 3-EnergyDatap one by one to define a variable flag _ change, and when the difference value =0 or 1, 1 is added to the flag _ change every 1 change of value,
if EnergyData1-EnergyData2=0, then go to step 6.3.1;
if EnergyData1-EnergyData2=1, then go to step 6.3.2;
step 6.3.1, comparing EnergyData1 with EnergyData3 to EnergyDataP one by one,
if the value is not equal to 0 and not equal to 1, the value of the block is an invalid value, 1 is subtracted from EnergyData1, then the block is assigned, and then the step 4 is executed;
if the value is 0 or 1, further judging flag _ change,
when flag _ change is more than or equal to 2, the numerical value of the block is an invalid value, 1 is subtracted from EnergyData1, then the block is assigned, and then the step 4 is carried out;
when flag _ change is less than 2, continuing to compare next data, and so on until all data are compared, if the last data are compared, the flag _ change is always less than 2, which indicates that all the data of the P blocks in the first area are valid, then entering step 4;
and 6.3.2, comparing the EnergyData2 with EnergyData3 to EnergyDataP one by one, assigning EnergyData2 to a certain block if the data of the block is not equal to EnergyData2, and entering the step 4.
In the foregoing method for processing the electric quantity data of the charging pile controller, step 7 is followed by step 8 and step 9,
step 8, continuing to wait for the arrival of the next unit electric quantity increment, triggering the operation of the EEPROM, converting the total Energy of the current electric Energy data into Energy data, calculating a check data checksunData2 at the same time, storing the check data checksunData2 into the EEPROM, and entering step 9;
step 9, after the EEPROM is operated each time, whether the written data is correct or not is read back, the check data stored in the EEPROM is read and assigned to a variable checksunData1, then the check data is compared with the checksunData2, and if the checksunData1= the checksunData2, the step 8 is entered; if the checksunData1 is not equal to the checksunData2, the write-back is required, and the read-back is performed again until the read-back data is the same as the data in the variable, and then the step 8 is performed.
In the foregoing method for processing electric quantity data of a charging pile controller, in step 3, if the electric quantity data EnergyData obtained by accumulation is 0, it is determined that no data exists in the first region P block, no operation is performed, and the process proceeds to step 8.
In the method for processing the electric quantity data of the charging pile controller, Q is an integer greater than 1, the EEPROM is erased once in a certain block in the second area and the latest check data is written in every 1 time of triggering the EEPROM for storage, and when the number of times of erasing and writing of a certain block in the second area reaches X ten thousand times, where X is greater than or equal to 50, the check data in the block is cleared and is replaced by another block for storage.
In the foregoing method for processing power data of the charging pile controller, N =40, M =32, and P = Q =16.
In the foregoing method for processing electric quantity data of a charging pile controller, in the data storage step, 0.1kW · h is used as a unit of charging electric quantity.
Compared with the prior art, the invention has the beneficial effects that: according to the invention, through a special data distribution structure and a data recovery method, the charging pile controller can read the EEPROM data and check in time after power failure and recovery, if illegal data are encountered, the read illegal data can be recovered to a numerical value (or an approximate effective value) before power failure through multi-stage calculation, and the risk that the electric quantity cannot be recovered due to storage errors under the limit condition is reduced. Meanwhile, due to the structural particularity of the area division of the EEPROM, the needed data is divided into P parts and stored in the P blocks of the first area of the EEPROM, only 1 block needs to be modified when the controller is restarted after power failure, the check data stored in the EEPROM can be read for quick recovery, even if the check data has problems, the original data can be recovered through the data relation (only 1 block has error data at most) in the P blocks of the first area of the stored electric energy data, and even if the check sector data is wrong or incomplete, the charged electric quantity data stored in the EEPROM can be recovered without depending on the check data stored in the EEPROM, so that the reliability of products is improved.
Detailed Description
The present invention is further illustrated by the following examples, which are not to be construed as limiting the invention.
Example (b): a method for processing electric quantity data of a charging pile controller comprises the following steps:
area division of the EEPROM: because the same sector of the vehicle-scale EEPROM can guarantee at least 100 ten thousand erasures without damaging the sector. Thus, for a fixed block, the data on the block can theoretically be erased and written at least 100 ten thousand times. Therefore, the present embodiment is based on 100 ten thousand erasures, and a first region of 40 bytes is separated from the EEPROM for storing the power data to be stored. The 40 bytes are divided into 16 blocks on average, each block is 2.5 bytes (20 bits) in length, and each block can represent 220 bytes of data at maximum. If the data of each block is accumulated circularly, the maximum data which can be represented by 16000000 (1600 ten thousand) after 16 blocks are accumulated is meant. According to the requirement that the charging time is 55000 hours in the life cycle of a common product on the market, if the charging pile with 22kW power is used for calculation, and if the charging pile is charged with full power at all times, the electric quantity of 1210000 (121 ten thousand) kW.h needs to be met in the whole life cycle. That is, the charging data is stored 1 time per 0.1kW · h (constant k) with a step size of 1 each time, the first region may represent 160 kW · h, and the demand (121 kW · h) in the whole life cycle of the product may be satisfied. In addition, a second area of 32 bytes is divided from the EEPROM, and the second area is divided into 16 blocks (i.e., each block is a space of 2 bytes) on average, and is used for storing a check value checksunData1 obtained by CRC16 algorithm for the electric quantity data.
Data storage: and triggering 1 time of EEPROM storage when the total Energy storage of the electric Energy data increases by 0.1 kW.h. When data EnergyData (data calculated by Energy/0.1) required to be stored in the EEPROM is 1, we write 1 in the 1 st block (EnergyCounter = 1) of the first area of the EEPROM, when data EnergyData required to be stored in the EEPROM is 2, we write 1 in the 2 nd block (EnergyCounter = 2), when data EnergyData required to be stored in the EEPROM is 3, we write 1 in the 3 rd block (EnergyCounter = 3), and so on … …, when data EnergyData required to be stored in the EEPROM is 16, we write 1 in the 16 th block (EnergyCounter = 16), when data EnergyData required to be stored in the EEPROM is 17, we write 2 in the 1 st block (EnergyCounter = 1), and … … circulates with this. Meanwhile, every 1 erasing in the first area of the EEPROM, the value calculated by the EnergyData through CRC16 is stored in the second area of the EEPROM. In order to avoid sector damage caused by frequent erasing in the second area, the same block in the second area needs to be erased 1000000 (100 ten thousand) times, and one block is replaced for storage, and meanwhile, the check data in the original block is cleared. That is, in the first area, after the number of times of erasing reaches 1000000 (100 ten thousand), that is, after 16 blocks are erased on average 6.25 ten thousand times, the data in the 1 st block in the second area is cleared, and the value calculated by CRC16 is stored in the 2 nd block in the second area; when the total number of times of erasing and writing in the first area reaches 2000000 (200 ten thousand), clearing the data in the block 2 in the second area, simultaneously storing the value calculated by CRC16 in the block 3 in the second area, and so on … …; when the total number of times of erasing in the first area reaches 15000000 (1500 ten thousand), the data of the block 15 in the second area is cleared, and the value calculated by the CRC16 is stored in the block 16 in the second area.
In conclusion, when the charging pile is increased by 0.1 kW.h, 1-time EEPROM storage is triggered. In this way, only 1 block of the 16 blocks is erased in the first area, and if an abnormal power failure occurs or other interference occurs during the power failure during data storage, the damaged area can be forcibly restored to normal data by using the power restoration method.
The electric quantity recovery method is specifically described as follows:
step 1, after the charging pile system is started (power is turned on again after power is off), the charging pile controller enters a normal working mode, first, 16 erasing data (16 erasing data reflect electric energy data) in a first area (40 bytes) stored in the EEPROM are read, and therefore, the erasing data is called as electric energy data in the following, and variables EnergyData1, energyData2, energyData3, energyData4, … … EnergyData15 and EnergyData16 are respectively given to the RAM. Meanwhile, the number of times of reading EEPROM data ReaderTime is assigned to 1 (the threshold value of the number of times of repeatedly reading EEPROM data); and continuing to step 2.
And 2, reading the CRC data of 2 bytes in the second area stored in the EEPROM. Reading the 1 st block, if the read data is 00 or FF, continuing to read the next (2 nd) block, and so on, until the 16 th block … … is read, if the read data in a certain block is not 00 or FF, assigning the data to a variable checksunData1 of the RAM, and entering step 3; if the last block (16 th block) is read, and still is 00 or FF, it is considered that there is no valid check data in the 16 blocks in the second area, and step 6 is entered, i.e. the check data is discarded, and further judgment is made directly according to the rule of the power data itself in the first area.
And step 3, accumulating the 16 data (EnergyData 1, energyData2, … …, energyData15 and EnergyData 16) to obtain EnergyData. If the EnergyData is 0, determining that no data exists in the 16 blocks in the first area, performing no operation, and entering step 8; if the engydata is not 0, the engydata is used to calculate checksunData2 (check data) according to CRC16, and the checksunData1 and the checksunData2 read from the EEPROM are compared. If the checksunData1 and the checksunData2 are equal, it indicates that all data in the EEPROM are valid, and the data recovery flow is entered, that is, step 4. If the checksunData1 is not equal to the checksunData2, that is, the data read from the EEPROM does not pass the check, the process proceeds to step 5, and the data is read again for a plurality of times, and the data is tried to be verified by the CRC check again.
And step 4, accumulating the EnergyData1, energyData2, … …, energyData15 and EnergyData16 to obtain a value, and assigning the value to EnergyData (data related to the electric energy stored in the EEPROM). Namely EnergyData = EnergyData1+ EnergyData2+ … … + EnergyData15+ EnergyData16, and the total Energy data amount Energy = EnergyData k, where k =0.1kW · h, and then goes to step 7 to operate the EEPROM.
And 5, judging and recovering the electric energy data through the check code (comparing and judging the data of the first area and the second area)
In order to avoid the situation that data is interfered by external environment (such as electromagnetism) in the process of reading the EEPROM, and the data is suddenly changed. When the EEPROM data is verified, if the data is not verified, the EEPROM is required to be read for multiple times (the threshold value of the reading times is ReaderTime, and the initial value is 0) and judged. If a certain check within 3 times (including) passes, the data is considered to be valid, and the step 4 is entered for data recovery. If none of the 3 checks passes, the EEPROM data is re-read and the calculation and check are re-performed.
And 5.1, reading the data (EnergyData 1, energyData2, … …, energyData15, energyData16 and checksunData 1) of the 17 EEPROMs again when the verification is passed within 3 times (including), namely ReaderTime is less than or equal to 3, respectively assigning the data to the variables in the RAM, and forcibly replacing the last read variables. While checksunData2 is initialized to 00 or FF, readerTime = ReaderTime +1, i.e., the number of ReaderTime assignments plus 1. And then calculating a new checksunData 2by 16 data which are re-assigned, and if the checksunData2= checksunData1, going to step 4, and calculating Energy data and Energy.
And 5.2, if ReaderTime is larger than 3, indicating that mutation or abnormity occurs in the data (electric quantity data or check value) of the EEPROM during storage. At this time, we have to abandon the CRC check method, and further judge the electric quantity data (energy data1, energy data2, … …, energy data15, and energy data 16) stored in the first region of the EEPROM by their own rule, and forcibly restore the data, and then proceed to step 6.
Step 6, judging validity of 16 electric quantity data in the EEPROM (judging from self data rule of the first area)
Since each time the EEPROM is stored only 1 block of the 16 blocks of the first area is operated on. If there is no data among the 16 data that is abnormal, the energy data1 is the largest among the 16 data (or equal to other data), and the energy data16 is the smallest (or equal to other data). Based on this (the energy data1 in 16 data is the largest, only one data has a problem, at most 2 values exist in all data, and the difference between the 2 values is 1), the erroneous data can be quickly found out through judgment, and the normal state can be recovered. Thus, through the accumulation of 16 data, the data can be restored to the data before the power failure.
The step 6 specifically comprises the following substeps:
and 6.1, determining the effectiveness of EnergyData 1. The variable value is defined as the difference between EnergyData1 and the data in the other blocks in the first region. Comparing EnergyData1 with EnergyData2, if EnergyData1-EnergyData2 is not equal to 0 and not equal to 1, indicating that EnergyData1 is possibly invalid, and entering step 6.2 to further judge the validity of EnergyData1; if EnergyData1-EnergyData2=0 or =1, go to step 6.3 for further determination.
Step 6.2, because EnergyData1-EnergyData2 ≠ 0 and ≠ 1. Comparing EnergyData1 with EnergyData3, and if EnergyData1-EnergyData3 is not equal to 0 and not equal to 1, because the uniqueness of error data indicates that the data of EnergyData1 has errors, assigning EnergyData2 to EnergyData1; if EnergyData1-EnergyData3=0 or =1, because of the uniqueness of the error data, indicating that EnergyData2 failed, energyData1 is assigned to EnergyData2. At this point, the error data has been recovered and step 4 is entered.
Step 6.3, because EnergyData1-EnergyData2=0 or =1, the data EnergyData1, energyData2 are both considered valid. Comparing EnergyData1 with EnergyData3 to EnergyData16 one by one, defining a variable flag _ change, when a difference value is =0 or 1, adding 1 to the flag _ change every time the value is changed for 1 time, and when the flag _ change is more than or equal to 2, explaining that the data is abnormal and the abnormal area needs to be recovered; if EnergyData1-EnergyData2=0, then go to step 6.3.1; if EnergyData1-EnergyData2=1, which indicates that the data has changed, step 6.3.2 is entered.
Step 6.3.1, because energy data1-energy data2=0, the data energy data1, energy data2 are both considered valid. The EnergyData1 is compared with the other values (EnergyData 3 to EnergyData 16) one by one. If the value is not equal to 0 and not equal to 1, the value of the block is an invalid value, 1 is subtracted from EnergyData1, then the block is assigned, and then the step 4 is executed;
if value is 0 or 1, flag _ change is further determined. If flag _ change is more than or equal to 2, the numerical value of the block is an invalid value, 1 is subtracted from EnergyData1, then the block is assigned, and then the step 4 is carried out; if flag _ change is less than 2, continuing the next data comparison, and so on until all data comparison is completed, if the last data comparison is completed, flag _ change is always less than 2, which indicates that no fault data exists in 16 blocks in the first area, and directly entering step 4.
Step 6.3.2, because energy data1-energy data2=1, indicates that other values (energy data3 to energy data 16) are valid if they are energy data2. Comparing the EnergyData2 with the rest data one by one, if the data is not equal to EnergyData2, the data is considered to have a problem, the EnergyData2 needs to be assigned to the block, and the step 4 is carried out.
And 7, based on the steps, verifying the data or recovering the valid data. And finally writing the effective data into an EEPROM (16 electric energy data and 2byte check area) after the effective data pass calculation, and then exiting the data recovery process. At this time, the data in the RAM and the data in the EEPROM are recovered to normal, and the controller can continue normal operation based on the numerical values; step 8 is entered.
And 8, continuously waiting for the arrival of the next electric quantity increment of 0.1 kW.h, and triggering the operation of the EEPROM. Converting the current electric quantity data Energy into Energy data, calculating a check data checksunData2, storing the check data checksunData2 into the EEPROM, and entering step 9.
And 9, reading back whether the written data is correct or not after the EEPROM is operated each time. The check data stored in the EEPROM is read and assigned to a variable checksunData1, and then compared with the checksunData 2. If checksunData1= checksunData2, proceed to step 8; if the checksunData1 ≠ checksunData2, it needs to be rewritten and read back again until the read back data is the same as the data in the variable, and then step 8 is proceeded.
The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above-mentioned examples, and all technical solutions belonging to the idea of the present invention belong to the protection scope of the present invention. It should be noted that modifications and embellishments within the scope of the invention may occur to those skilled in the art without departing from the principle of the invention, and are considered to be within the scope of the invention.

Claims (7)

1. A processing method of electric quantity data of a charging pile controller is characterized by comprising the following steps:
area division of the EEPROM: dividing a first area with N bytes and a second area with M bytes from an EEPROM (electrically erasable programmable read-only memory) matched with a charging pile controller, wherein the N bytes in the first area are divided into P blocks, P is an integer larger than 2 and used for storing electric quantity data, the M bytes in the second area are divided into Q blocks, and Q is a positive integer and used for storing verification data obtained after the electric quantity data are calculated through a first algorithm;
data storage: triggering 1-time EEPROM storage every time when the charging electric quantity is increased by one unit, wherein when the EEPROM storage is triggered every time, one block in the P blocks in the first area is erased and written into the total erasing and writing number of the block, the total erasing and writing number of the P blocks in the first area is used as electric quantity data, and the electric quantity data is calculated by a first algorithm to obtain check data and stored in a second area; with the continuous increase of the charging electric quantity, the P blocks in the first area are erased and written circularly block by block in sequence, real-time electric quantity data are updated, and the second area also updates the verification data synchronously;
and (3) data recovery: when the charging pile system is powered on again after being powered off, respectively reading the erasing sum of the P blocks in the first area and the verification data A stored in the second area in the EEPROM, accumulating the erasing sum of the P blocks in the first area to obtain electric quantity data, and calculating the electric quantity data through a first algorithm to obtain verification data B;
if the check data A = the check data B and all the data in the EEPROM are valid, writing all the valid data into the EEPROM to finish recovery;
if the check data A is not equal to the check data B and indicates that error data exist in the EEPROM, skipping validity judgment of the check data A, directly judging validity of the total erasing number of the P blocks in the first region, arranging the total erasing number of the P blocks in the first region according to the sequence of erasing, obtaining the valid value of the total erasing number of the P blocks in the first region from the rule of data arrangement, further obtaining the valid value of the check data in the second region, and writing all the obtained valid values into the EEPROM to finish recovery;
the data recovery specifically comprises the following steps:
step 1, after the charging pile system is powered off, the charging pile controller is powered on again, enters a normal working mode, firstly reads P erasing data stored in a first area in an EEPROM, assigns the P erasing data to variables EnergyData1 to EnergyDataP of the RAM respectively, assigns the number of EEPROM data reading times to 1, and enters step 2;
step 2, reading check data stored in a second area in the EEPROM, if the check data is valid, assigning the data to a variable checksunData1 of the RAM, and entering step 3; if the check data is invalid, discarding the check data and entering the step 6;
step 3, accumulating the P erasing data from EnergyData1 to EnergyDataP to obtain electric quantity data EnergyData, calculating check data checksunData2 from EnergyData according to a CRC16 algorithm, comparing the checksunData1 with the checksunData2,
if checksunData1= checksunData2, go to step 4;
if the checksunData1 is not equal to the checksunData2, entering the step 5;
step 4, accumulating the P erasing data from the Energy data1 to the Energy data to obtain electric quantity data Energy, calculating the total effective electric Energy data Energy according to the electric quantity data Energy, and entering step 7;
step 5, repeatedly reading P erasing data stored in the first area in the EEPROM, assigning a value of +1 to the number of reading times of the EEPROM data during each reading, performing step 2 and step 3 again,
if the number of times of reading the EEPROM data is less than or equal to 3 and the checksunData1= checksunData2, entering the step 4;
if the data of the EEPROM does not meet the requirement that checksunData1= checksunData2 after the data of the EEPROM is read for 3 times, entering step 6;
step 6, arranging the total erasing numbers EnergyData1 to EnergyDataP of the P blocks in the first region according to the erasing sequence, judging the effectiveness of the P data from the data arrangement rule, if the P data have error data, correcting the error data, and entering step 4;
and 7, writing the effective total Energy of the electric Energy data into the EEPROM after calculation, and exiting the data recovery process.
2. The method for processing the electric quantity data of the charging pile controller according to claim 1, wherein the step 6 specifically comprises:
step 6.1, firstly determining the validity of EnergyData1, defining a variable value as the difference value between EnergyData1 and the data in other blocks in the first area, comparing EnergyData1 with EnergyData2,
if EnergyData1-EnergyData2 is not equal to 0 and not equal to 1, entering step 6.2;
if EnergyData1-EnergyData2=0 or =1, then go to step 6.3;
step 6.2, comparing EnergyData1 with EnergyData3, and if EnergyData1-EnergyData3 is not equal to 0 and not equal to 1, assigning EnergyData2 to EnergyData1; if EnergyData1-EnergyData3=0 or =1, assigning EnergyData1 to EnergyData2; then entering step 4;
step 6.3, based on EnergyData1-EnergyData2=0 or =1, deeming that both data EnergyData1 and EnergyData2 are valid, comparing EnergyData1 with EnergyData3 to EnergyDatap one by one, defining a variable flag _ change, when the difference value =0 or 1, the flag _ change is added by 1 every time value changes 1 time,
if EnergyData1-EnergyData2=0, then go to step 6.3.1;
if EnergyData1-EnergyData2=1, then go to step 6.3.2;
step 6.3.1, comparing EnergyData1 with EnergyData3 to EnergyDataP one by one,
if the value is not equal to 0 and not equal to 1, the value of the block is an invalid value, 1 is subtracted from EnergyData1, then the block is assigned, and then the step 4 is executed;
if the value is 0 or 1, further judging flag _ change,
when flag _ change is more than or equal to 2, the value of the block is an invalid value, 1 is subtracted from EnergyData1, then the block is assigned, and then the step 4 is carried out;
when flag _ change is less than 2, continuing to compare next data, and so on until all data are compared, if the last data are compared, the flag _ change is always less than 2, which indicates that all the data of the P blocks in the first area are valid, then entering step 4;
and 6.3.2, comparing the EnergyData2 with EnergyData3 to EnergyDataP one by one, assigning EnergyData2 to a certain block if the data of the block is not equal to EnergyData2, and entering the step 4.
3. The method for processing the electric quantity data of the charging pile controller according to claim 1, wherein the method comprises the following steps: step 8 and step 9 are performed after said step 7,
step 8, continuing to wait for the arrival of the next unit electric quantity increment, triggering the operation of the EEPROM, converting the total Energy of the current electric Energy data into Energy data, calculating a check data checksunData2 at the same time, storing the check data checksunData2 into the EEPROM, and entering step 9;
step 9, after the EEPROM is operated each time, whether the written data is correct or not is read back, the check data stored in the EEPROM is read and assigned to a variable checksunData1, then the check data is compared with the checksunData2, and if the checksunData1= the checksunData2, the step 8 is entered; if the checksunData1 is not equal to the checksunData2, the write-back is required, and the read-back is performed again until the read-back data is the same as the data in the variable, and then the step 8 is performed.
4. The method for processing the electric quantity data of the charging pile controller according to claim 3, characterized by comprising the following steps: in step 3, if the accumulated electric quantity data EnergyData is 0, it is determined that no data exists in the blocks of the first area P, no operation is performed, and the process proceeds to step 8.
5. The method for processing the electric quantity data of the charging pile controller according to any one of claims 1 to 4, wherein the method comprises the following steps: and Q is an integer greater than 1, the EEPROM is triggered for 1 time, erasing is carried out in a certain block in the second area once, the latest check data is written, and when the erasing frequency of the certain block in the second area reaches X ten thousand times, wherein X is greater than or equal to 50, the check data in the block is cleared and is replaced by another block for storage.
6. The method for processing the electric quantity data of the charging pile controller according to any one of claims 1 to 4, wherein the method comprises the following steps: the N =40, M =32, P = Q =16.
7. The method for processing the electric quantity data of the charging pile controller according to any one of claims 1 to 4, wherein the method comprises the following steps: in the data storage step, 0.1 kW.h is used as a unit of charging capacity.
CN202210460461.1A 2022-04-28 2022-04-28 Method for processing electric quantity data of charging pile controller Active CN114995747B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210460461.1A CN114995747B (en) 2022-04-28 2022-04-28 Method for processing electric quantity data of charging pile controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210460461.1A CN114995747B (en) 2022-04-28 2022-04-28 Method for processing electric quantity data of charging pile controller

Publications (2)

Publication Number Publication Date
CN114995747A CN114995747A (en) 2022-09-02
CN114995747B true CN114995747B (en) 2023-03-10

Family

ID=83024613

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210460461.1A Active CN114995747B (en) 2022-04-28 2022-04-28 Method for processing electric quantity data of charging pile controller

Country Status (1)

Country Link
CN (1) CN114995747B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117273811B (en) * 2023-11-21 2024-02-09 国网浙江省电力有限公司 Enterprise power consumption prediction data processing method based on power consumption data

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106227625A (en) * 2016-09-05 2016-12-14 深圳震有科技股份有限公司 The restoration methods of a kind of flash data damaged because of power down and system
KR20200110862A (en) * 2019-03-18 2020-09-28 에스케이하이닉스 주식회사 Data Storage Device and Operation Method Thereof, Controller Using the Same
CN113895279A (en) * 2021-12-10 2022-01-07 宁波均胜新能源汽车技术有限公司 Electric energy calculation method of charging pile

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102573301B1 (en) * 2016-07-15 2023-08-31 삼성전자 주식회사 Memory System performing RAID recovery and Operating Method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106227625A (en) * 2016-09-05 2016-12-14 深圳震有科技股份有限公司 The restoration methods of a kind of flash data damaged because of power down and system
KR20200110862A (en) * 2019-03-18 2020-09-28 에스케이하이닉스 주식회사 Data Storage Device and Operation Method Thereof, Controller Using the Same
CN113895279A (en) * 2021-12-10 2022-01-07 宁波均胜新能源汽车技术有限公司 Electric energy calculation method of charging pile

Also Published As

Publication number Publication date
CN114995747A (en) 2022-09-02

Similar Documents

Publication Publication Date Title
CN114995747B (en) Method for processing electric quantity data of charging pile controller
US7137027B2 (en) Nonvolatile memory system
US7240178B2 (en) Non-volatile memory and non-volatile memory data rewriting method
US8826100B2 (en) Adjustable memory allocation based on error correction
CN101529525B (en) The probabilistic error correction of the flash memory of every unit multidigit
CN102609334B (en) Nonvolatile flash memory is wiped abnormal memory block restorative procedure and device
CN103106143B (en) Solid state storage device and logic thereof are to entity correspondence table method for building up
CN102063380B (en) Method and device for writing data in non-volatile memory
CN109254878B (en) Smart card power-down backup method and data structure based on character writing
CN102063266A (en) Nonvolatile memory controller and method for writing data to nonvolatile memory
CN104360957A (en) Method for maintaining flash memory wear leveling
CN110069360B (en) Motor controller data storage and reading method and device
CN107992268B (en) Bad block marking method and related device
CN111459708B (en) Bad block processing method and device
CN101740123B (en) Data protection method of memory
CN109947587B (en) Grouping repair code construction method for non-uniform fault protection and fault repair method
CN111966071A (en) Data classification, storage and verification method for vehicle-mounted controller
CN112416246B (en) High-resolution method for storing electric energy data
CN112582010B (en) Monotonic counter and method of operating the same
CN101366009B (en) Data processing system and a method for the operation thereof
CN112131040B (en) Wear balance management method and system for power-down backup area of smart card
CN115904256B (en) Data storage method and memory
CN117539399A (en) Electric quantity storage method for electric energy meter
CN115904244A (en) Method for storing and recovering electric energy pulse mantissas
CN114936005A (en) Inverter energy data storage method, system, device and storage medium

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
GR01 Patent grant
GR01 Patent grant