A self-adaptive power storage method for a vehicle-mounted charging pile
By setting up total power data and real-time charging power data arrays in the charging pile and using algorithms to adjust the stored data, the problem of limited writing times in the charging pile memory is solved, ensuring the accuracy and integrity of the power data during power outages.
Patent Information
- Application Number
- CN202210979520.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-16
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2042-08-16
AI Technical Summary
The existing charging pile memory has a limited number of write times, which makes the power data easily lost in the event of a sudden power outage, and the accuracy and integrity of the power data cannot be guaranteed, especially when public charging piles are frequently used.
A method for adaptively storing electric energy for an on-board charging pile is adopted. By setting a first total electric energy data, a second total electric energy data and a real-time charging electric energy data array in a memory, a specified algorithm is used to adjust the stored data when power is lost to ensure the accuracy and integrity of the data.
When the charging pile loses power suddenly, the accuracy of the first total power data and the second total power data is ensured by adjusting the stored data, thereby avoiding the loss of power data and achieving reliable storage of power data.
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of electric vehicle charging, in particular to an electric energy adaptive storage method of a vehicle-mounted charging pile. BACKGROUND
[0002] With the rapid popularization of new energy electric vehicles, the charging piles for electric vehicles have also developed rapidly, and various AC charging piles with different powers have appeared on the market, such as 7.2KW, 11KW and 22KW, etc., and the application scenarios of each charging pile are different, such as private charging piles and public charging piles, and the total electric energy charged each day is very different, for example, one charging pile is shared by three electric vehicles. At the same time, in order to better charge and manage the charging, the charging pile needs to record the charging electric energy data in real time to prevent the loss of electric energy data after power failure. However, the general electronic storage device has a limit on the number of read-write times, such as the memory, which generally has a read-write time of less than 100,000 times, and if it exceeds 100,000 times, the corresponding address interval may be damaged. Moreover, the design life of the charging pile is at least 8 years. If it is used for 8 years, and charged for 10 hours a day, a total of 1752000 minutes, divided by 100,000 times, it means that at most 17.52 minutes can record electric energy once. According to this interval, if the power suddenly fails, according to the 22KW power calculation, at most 6.4 degrees of electric energy data may be lost. Moreover, the charging frequency and time of different users are different, especially the basic charging time of public charging piles will exceed 10 hours, so it is necessary to consider that the total electric energy data is as accurate as possible while not storing data frequently to damage the memory storage device. Therefore, it is urgent to solve the problem of electric energy data loss of electric vehicle charging pile storage. SUMMARY
[0003] In view of the defects and shortcomings of the prior art, the electric energy adaptive storage method of the vehicle-mounted charging pile can quantitatively save the charging electric energy data and avoid data loss.
[0004] To achieve the above purpose, the present application provides the following technical scheme.
[0005] S1. When the system starts, the charging pile controller reads the electric energy data stored in the external memory. The stored related electric energy data includes the first total electric energy data, the second total electric energy data and the real-time charging electric energy data array, wherein the first total electric energy data is stored at the start of the address, the second total electric energy data is stored at the end of the address, and the storage location of the real-time charging electric energy data array is located between the first total electric energy and the second total electric energy. The real-time charging electric energy data array includes n real-time charging electric energy data quantitatively stored during the charging process. The difference between two adjacent real-time charging electric energy data among the n real-time charging electric energy data is the electric energy increase value A. The sequence numbers of the n real-time charging electric energy data range from 0 to n-1. The real-time charging electric energy data are stored in the corresponding storage addresses in sequence, and when the sequence number is greater than or equal to n, the recording is cyclically started from sequence number 0; determine whether the first total electric energy and the second total electric energy data are equal and not zero. If so, proceed to step S2; if not, proceed to step S3;
[0006] S2. Using a specified algorithm, find the maximum stored real-time charging energy data in the stored real-time charging energy array. The updated first total energy data = the first total energy data + the maximum stored real-time charging energy data / the accuracy coefficient. The updated second total energy data is equal to the updated first total energy data.
[0007] S3. Repair the total energy data based on the storage rules and related algorithms of multiple sets of real-time charging energy data. If the first total energy is greater than the second total energy, it means that the first total energy has been updated, and the first total energy is assigned to the second total energy, and then the process proceeds to step S4. If the first total energy is 0, it means that the first total energy is lost. Using the specified algorithm, find the maximum stored real-time charging energy data from the real-time charging energy array. The updated second total energy data = the second total energy data + the maximum stored real-time charging energy data / the accuracy coefficient. The updated first total energy data is equal to the updated second total energy data; then the process proceeds to step S4.
[0008] S4. The charging pile device enters the charging ready state, and the relevant tasks begin to run periodically to detect whether charging is authorized.
[0009] The beneficial effects of the present invention are as follows: the method of the present invention, by setting real-time charging power data, enables the charging pile to record the charging power through the real-time charging power data when charging. When a sudden power outage occurs, the storage situation at the time of power outage is judged and the relevant stored data is adjusted. If the power outage occurs when the first total power data is updated, the maximum value in the real-time charging power data is defined as a temporary power variable, the updated first total power variable = the second total power variable + the temporary power variable / precision coefficient, and then the updated first total power variable is assigned to the second total power variable. If the power outage occurs when the second total power data is updated, the maximum value in the real-time charging power data is defined as a temporary power variable. If power is lost when the data is being updated, the first total electric energy variable is assigned to the second total electric energy variable, so as to ensure that the first total electric energy data and the second total electric energy data can be recorded accurately; if power is lost when the real-time charging electric energy data is being recorded, the maximum value in the real-time charging electric energy data is assigned to the temporary electric energy variable, and the first total electric energy data is updated. The updated first total electric energy data = the first total electric energy data + the temporary electric energy variable / the accuracy coefficient. Finally, the updated first total electric energy data is assigned to the second total electric energy data, so that the second total electric energy is updated, so as to ensure that the first total electric energy data and the second total electric energy data can be recorded accurately.
[0010] As an improvement of the present invention, in step S1, the following steps are specifically included:
[0011] S101. Define a first total energy variable and initialize it to 0, define a second total energy variable and initialize it to 0, define a real-time charging energy data array and initialize it to 0, then proceed to step S102;
[0012] S102. The controller reads the first total energy data and the data stored in the real-time charging energy array at the corresponding address in the memory, and verifies the first total energy data and the data stored in the real-time charging energy array. In the first total energy data, each data includes six bytes, of which the first four are energy data and the last two bytes are check values. The first four bytes are then verified and calculated, and the calculated check values are compared with the read check values. If they are equal, the verification passes and the data is assigned to the first total energy variable. If they are not equal, the verification fails and the first total energy variable is set to 0. In the real-time charging energy array, starting from the first group of data, each group of data includes six bytes, of which the first four are energy data and the last two bytes are check values. The first four bytes are then verified and calculated, and the calculated check values are compared with the read check values. If they are equal, the verification passes and the data is assigned to the corresponding real-time charging energy data in the real-time charging energy array. If they are not equal, the verification fails and the corresponding real-time charging energy data in the real-time charging energy array is set to 0. After all groups of data are processed, the process proceeds to step S103.
[0013] S103. The controller reads the second total energy data stored at the corresponding address in the memory. Each data item in the second total energy data consists of six bytes, of which the first four bytes are energy data and the last two bytes are check values. The controller then performs a check calculation on the first four bytes and compares the calculated check value with the read check value. If the check passes, the data is assigned to the second total energy variable. If the two are not equal, the check fails, the second total energy variable is set to 0, and the process proceeds to step S104.
[0014] S104. Determine whether the first total energy variable and the second total energy variable are equal and not equal to 0. If so, it means that only the real-time charging energy data needs to be verified, and the maximum stored real-time charging energy data in the real-time charging energy data is found, and the process proceeds to step S2; if not, the process proceeds to step S105;
[0015] S105. Determine whether the first total electric energy variable and the second total electric energy variable are unequal. If so, proceed to step S3; otherwise, proceed to step S4.
[0016] As an improvement of the present invention, in step S2, according to a specified algorithm, the maximum stored real-time charging energy data is searched in the real-time charging energy array, and the query sequence number starts from 0. Specifically, the following steps are included:
[0017] S201. Define a temporary energy variable and initialize it to 0, then proceed to step S202;
[0018] S202. Determine whether the real-time charging energy data corresponding to the current serial number plus the energy increase value A is equal to the real-time energy data corresponding to the current serial number plus 1; if satisfied, proceed to step S203; if not satisfied, proceed to step S204;
[0019] S203. The temporary energy variable is equal to the real-time energy data corresponding to the current serial number plus 1;
[0020] S204. Determine whether the real-time charging energy data corresponding to the current serial number is 0. If so, proceed to step S205. If not, proceed to step S207.
[0021] S205. Determine whether the real-time charging energy data corresponding to the current sequence number minus 1 is equal to the sum of the real-time charging energy data corresponding to the current sequence number plus 1 plus the energy increase value A multiplied by (n-2); if the current sequence number is 0, then the sequence number corresponding to the current sequence number minus 1 is (n-1); if the current sequence number is (n-1), then the sequence number corresponding to the current sequence number plus 1 is 0; if so, proceed to step S206; if not, determine whether the current sequence number is greater than or equal to (n-1); if so, proceed to step S207; if not, increment the current sequence number by 1, continue searching, and proceed to step S202;
[0022] S206. The temporary energy variable is equal to the sum of the real-time charging energy data corresponding to the current sequence number minus 1 plus the energy increase value A, and then proceeds to step S207;
[0023] S207. Determine whether the temporary energy variable is greater than 0, and the remainder of the temporary energy variable to the energy added value A is also 0. If both conditions are met, proceed to step S208, otherwise proceed to step S4;
[0024] S208. Update the first total power and the second total power. The first total power is equal to the first total power plus the temporary power variable / accuracy coefficient. Then, assign the updated total power to the second total power, and proceed to step S209.
[0025] S209. After updating the first total power and the second total power, first write the first total power data into the corresponding address of the memory, then clear all the real-time charging power data and write them into the corresponding address of the memory, and finally write the second total power data into the corresponding address of the memory and enter step S4.
[0026] As an improvement of the present invention, in step S3, the following steps are specifically included:
[0027] S301. Define a temporary energy variable and initialize it to 0;
[0028] S302. First, determine whether the first total electric energy variable is greater than the second total electric energy variable. If so, proceed to step S303. If not, proceed to step S304.
[0029] S303. The first total electric energy variable is assigned to the second total electric energy variable, and the process proceeds to step S4;
[0030] S304. Determine whether the first total energy variable is equal to 0. If so, the process proceeds to step S305. Otherwise, the process proceeds to step S4.
[0031] S305. Find the maximum stored real-time charging energy data in the real-time charging energy array through a loop search, assign it to the temporary energy variable, and proceed to step S306;
[0032] S306. Update the first total electric energy variable, the updated first total electric energy variable = the second total electric energy variable + the temporary electric energy variable / precision factor, then write the first total electric energy variable into the corresponding memory address of the first total electric energy, clear the real-time charging electric energy array, write the real-time charging electric energy array into the corresponding memory address, then update the second total electric energy variable, the updated second total electric energy variable = the updated first total electric energy variable, and finally write the updated second total electric energy variable into the corresponding memory address of the second total electric energy data, and go to step S4.
[0033] As an improvement of the present application, in step S4, the following steps are specifically included:
[0034] S401. The charging pile controller first determines whether the current is a charging state, if it is a charging state, go to step S402, if it is not a charging state, go to step S403;
[0035] S402. When the current is a charging state, detect whether there is a cancel charging request, if there is a cancel charging request, go to step S406, if there is no cancel charging request, keep the charging state and constantly update the electric energy data;
[0036] S403. When the current is not a charging state, detect whether there is an authorized charging request, if there is an authorized charging request, go to step S404, if there is no authorized charging request, go to step S401;
[0037] S404. After receiving the authorized charging request, detect the plug-in signal, if the plug-in signal is detected, go to step S405, if the plug-in signal is not detected, go to step S401;
[0038] S405. The charging pile starts charging, and at the same time, sets the charging state to start;
[0039] S406. The charging pile stops charging, and at the same time, sets the charging state to complete.
[0040] As an improvement of the present application, the following steps are further included:
[0041] S5. The charging pile calculates and locally stores the related electric energy according to the charging state;
[0042] In step S5, the following steps are specifically included:
[0043] S501. Define the current real-time energy variable and initialize it to 0. Define the current stored energy variable and initialize it to 0. Define the read energy timer variable and initialize it to 0. The charging pile controller detects the charging status. If the charging status is starting, it proceeds to step S502; if the charging status is charging, it proceeds to step S503; if the charging status is completed, it proceeds to step S509; otherwise, it proceeds to step S6;
[0044] S502. When charging is started, the real-time energy variable is initialized to 0, the stored energy variable is initialized to 0, the energy read timer is initialized to 0, and the charging state is set to processing; then proceeds to step S6;
[0045] S503. When the charging status is in process, the time of each cycle is T, the energy reading timer is increased by 1, and the process proceeds to step S504;
[0046] S504. Determine whether the read energy timer is greater than or equal to the threshold. If so, initialize the read energy timer to 0 and proceed to step S505; if not, proceed to step S6;
[0047] S505. The charging pile controller reads the relative energy value of the energy metering chip. When the real-time energy variable is equal to the real-time energy variable plus the relative energy value of the metering chip, step S506 is entered;
[0048] S506. The temporary energy variable value is equal to the real-time energy variable minus the stored energy variable. Then determine whether the temporary energy variable value is greater than or equal to the energy increase value A. If so, proceed to step S507.
[0049] If not satisfied, go to step S6;
[0050] S507. When the secondary stored energy variable is equal to the secondary stored energy variable plus the energy increase value A, the controller writes the data corresponding to the secondary stored energy variable and the check value into the corresponding memory address, and proceeds to step S508;
[0051] S508. Determine whether the serial number corresponding to the real-time charging energy data stored in the loop plus one is greater than or equal to n. If so, the serial number corresponding to the real-time charging energy data is equal to 0, and the loop is recorded, and the process proceeds to step S6;
[0052] S509. When the charging state is complete, the first total energy variable = the second total energy variable + the temporary energy variable / the accuracy coefficient; the second total energy variable is equal to the first total energy variable, and the charging state is set to the idle state; proceed to step S510;
[0053] S510. The controller first writes the first total electric energy variable and the corresponding check value into the corresponding memory address; step S511 is entered;
[0054] S511. The controller then clears the real-time charging electric energy array and writes it into the corresponding memory address. Finally, the controller writes the second total electric energy variable and the corresponding check value into the corresponding memory address, and step S6 is entered.
[0055] S6. According to the historical charging electric energy data and the charging time, the charging electric energy storage increase value is calculated, and the electric energy increase value A is updated.
[0056] In step S6, when the system starts, the following steps are included:
[0057] S601. Read the electric energy increase value stored in the memory. If the check passes, assign the read electric energy increase value to the corresponding electric energy increase value A; if the check fails, the electric energy increase value A is equal to the default electric energy increase value, and step S602 is entered;
[0058] S602. Read the initial memory data stored in the corresponding address in the memory. If the check passes, assign the month and day of the initial memory data to the month and day variables corresponding to the initial memory data; if the check fails, the month and day variables corresponding to the initial memory data are 0; step S603 is entered;
[0059] S603. Read the final memory data stored in the corresponding address in the memory. If the check passes, assign the month and day of the final memory data to the month and day variables corresponding to the final memory data; if the check fails, the month and day variables corresponding to the final memory data are 0; step S604 is entered;
[0060] S604. End.
[0061] In step S6, each time the charging starts, the following steps are included:
[0062] S611. Determine whether the month and day variables corresponding to the initial memory data are both 0. If they are 0, step S612 is entered; if they are not 0, step S614 is entered;
[0063] S612. Determine whether the day of the current system time is less than the set value m. If it is less than the set value m, step S613 is entered; if it is greater than or equal to the set value m, step S618 is entered;
[0064] S613. Write the month, day, current total electric energy data and the corresponding check value calculated into the corresponding initial memory data address in the memory; step S618 is entered;
[0065] S614 determines whether the number of months in the current system is equal to the number of months in the initial memory. If they are not equal, the process proceeds to step S615; if they are equal, the process proceeds to step S618;
[0066] S615. Calculate the added value of electric energy using the following formula:
[0067] Charging energy storage increase value = p*(final memory total energy variable - initial memory total energy variable) / (variable corresponding to the final memory time day - variable corresponding to the initial memory time day + 1) / maximum number of charging and storing energy per day;
[0068] Among them, p is the conversion accuracy parameter of total electric energy. The specific calculation formula for the maximum number of times of charging and storing electric energy per day is as follows:
[0069] Maximum number of times to charge and store energy per day = (f / d)*n
[0070] Where f is the upper limit of the memory read and write, d is the number of days the charging pile is used, and n is the number of real-time charging energy data in the real-time charging energy data array;
[0071] Determine whether the charging electric energy storage increase value is less than the default value of the electric energy increase value A. If so, update the electric energy increase value A to the default value. If so, assign the charging electric energy storage increase value to the electric energy increase value A to update the electric energy increase value A. The controller writes the updated electric energy increase value A and the corresponding check value into the corresponding memory address; then proceed to step S616.
[0072] S616. Determine whether the number of days of the current system time is less than the set value m. If it is less than the set value m, proceed to step S617; otherwise, proceed to step S618;
[0073] S617. Then assign the month and day values of the system time to the month and day variables of the initial memory data, and then write the initial memory data of the month, day, current total energy and the corresponding check value to the final memory data address corresponding to the memory; proceed to step S618;
[0074] S618. End.
[0075] In step S6, each time charging is completed, the following steps are specifically included:
[0076] S621 determines whether the month and day corresponding to the initial memory data are all 0. If not, proceed to step S622; if 0, proceed to step S624;
[0077] S622 determines whether the current system time month and the initial memory data month are equal, if equal, proceeds to step S623; if not equal, proceeds to step S624;
[0078] S623 determines whether the number of days of the current system time is greater than or equal to the set value k. If so, the number of months, days, current total energy data and the corresponding check value of the system time are written together into the final memory data address corresponding to the memory, and then proceeds to step S624;
[0079] S624. End. DETAILED DESCRIPTION
[0080] A method for adaptively storing electric energy of a vehicle-mounted charging pile comprises the following steps:
[0081] S1. When the charging pile device system is started, the controller reads and writes the electric energy data stored in the corresponding address of the external memory. The stored related electric energy data include the first total electric energy data, the second total electric energy data and the real-time charging electric energy data array, wherein the first total electric energy data is stored at the start of the address, the second total electric energy data is stored at the end of the address, and the storage location of the real-time charging electric energy data is located between the first total electric energy and the second total electric energy. The real-time charging electric energy data array includes n real-time charging electric energy data quantitatively stored during the charging process. Whether the difference between the last real-time charging electric energy data of two adjacent real-time charging electric energy data in the n real-time charging electric energy data and the first real-time charging electric energy data is equal to the electric energy increase value A, then In this embodiment, the default value of the electric energy added value A is a constant. In this embodiment, the default value is 30,000, and the unit of the electric energy added value A is 0.01 watts * hours), that is, each time the battery is fully charged to 30,000 during the charging process, it will be recorded. The circular array has n storage addresses, and the serial numbers of the n storage addresses are from 0 to n-1. The n real-time charging electric energy data are stored in the corresponding storage addresses in sequence, and when the serial number is greater than or equal to n, the circular recording starts from serial number 0; the storage address n is 16, and the serial numbers of the 16 storage addresses are 0, 1, 2...15 respectively. After storing sixteen real-time charging electric energy data, the seventeenth data will overwrite the first data (that is, recorded at the address with serial number 0) and circular recording will be performed. Determine whether the variables of the two total electric energy data are equal. If they are equal and not zero, go to step S2; if they are not equal, go to step S3;
[0082] In step S1, the following steps are specifically included:
[0083] S101. Define the first total energy variable and initialize it to 0, define the second total energy variable and initialize it to 0, define 16 real-time charging energy variable arrays and initialize them to 0, define loop number 1 (Idx1) and initialize it to 0, then proceed to step S102;
[0084] S102. The controller reads the data corresponding to the first total energy storage address stored in the memory via IIC communication. The data consists of 6 bytes, with the first four bytes containing energy data and the last two bytes containing a CRC16 checksum. A CRC16 calculation is then performed on the first four bytes. The calculated CRC16 value is compared with the read CRC16 value. If the check passes, the four bytes are shifted in order, with the low byte first and the high byte last, to form a 32-bit data value, which is assigned to the first total energy variable. If the values are not equal, the check fails, and the first total energy variable is set to 0. The controller then reads the data stored in the real-time charging energy array stored at the corresponding address in the memory. Each data in the real-time charging energy array includes six bytes, of which the first four bytes are energy data and the last two bytes are CRC16 check values. The controller then performs a check calculation on the first four bytes and compares the calculated check value with the read check value. If they are equal, the check passes and the data is assigned to the corresponding real-time charging energy data in the real-time charging energy array. If they are not equal, the check fails and the corresponding real-time charging energy data in the real-time charging energy array is set to 0, and the process proceeds to step S103.
[0085] S103. Determine whether the cycle number 1 is less than 16. If so, proceed to step S104. If not, proceed to step S106.
[0086] S104. The controller reads the data corresponding to the storage address of the real-time charging energy array corresponding to loop number 1 (Idx1) in the memory through IIC communication. The data consists of 6 bytes, the first four of which are energy data, and the last two bytes are CRC16 check values. CRC16 calculation is then performed on the first four bytes, and the calculated CRC16 value is compared with the read CRC16 value. If the equality check passes, the four bytes are shifted and combined into 32-bit data in the order of low byte first and high byte last, and the data is assigned to the real-time charging energy data corresponding to loop number 1 (Idx1). If they are not equal, the check fails, and the real-time charging energy data corresponding to loop number 1 (Idx1) is set to 0. Proceed to step S105;
[0087] S105. Cycle number 1 is equal to cycle number 1 plus 1, Idx1 = Idx1 + 1, then go to step S103;
[0088] S106. The controller reads the data corresponding to the second total energy storage address in the memory via IIC communication. The data consists of 6 bytes, with the first four bytes containing energy data and the last two bytes containing a CRC16 checksum. A CRC16 calculation is then performed on the first four bytes. The calculated CRC16 value is compared with the read CRC16 value. If the check passes, the four bytes are shifted in order, with the low byte first and the high byte last, to form a 32-bit data value, which is assigned to the second total energy variable. If the values are not equal, the check fails, and the second total energy variable is set to 0.
[0089] Go to step S107;
[0090] S107. Determine whether the first total electric energy variable is equal to the second total electric energy variable, and whether the first total electric energy variable is not equal to 0. If so, proceed to step S108. If not, proceed to step S109.
[0091] S108. The first total energy variable and the second total energy variable are equal and not equal to 0, indicating that only 16 sets of real-time charging energy data need to be verified, and the maximum stored real-time charging energy data in the real-time charging energy data is found. The specific process proceeds to step S2;
[0092] S109. Determine whether the first total power variable and the second total power variable are unequal. If they are unequal, it means that the system has an abnormality or a power-off restart when writing the first total power or the second total power. If so, proceed to step S3. Otherwise, proceed to step S4.
[0093] S2. Using a specified algorithm, find the maximum stored real-time charging energy data in the stored real-time charging energy array. The query sequence starts at 0. The updated first total energy data = the first total energy data + the maximum stored real-time charging energy data / the accuracy coefficient. The updated second total energy data is equal to the updated first total energy data.
[0094] In step S2, the following steps are specifically included:
[0095] S201. Define loop number 2 (Idx2), loop number 3 (Idx3) and loop number 4 (Idx4), and initialize them to 0. Then define a temporary power variable and initialize it to 0. Go to step S202;
[0096] S202. Determine whether the cycle number 2 (Idx2) is less than 16. If so, proceed to step S203. If not, proceed to step S211.
[0097] S203. Cycle number 3 is equal to cycle number 2 plus 1 and then the remainder is 16.
[0098] Idx3 = (Idx2 + 1) % 16, go to step S204;
[0099] S204. Determine if the real-time charging power data corresponding to sequence number 2 (Idx2) plus the power increase value A is equal to the real-time charging power data corresponding to sequence number 3 (Idx3). If yes, go to step S205. If no, go to step S206;
[0100] S205. Determine if the real-time charging power data corresponding to sequence number 3 (Idx3) is greater than the temporary power variable. If yes, the temporary power variable is equal to the real-time charging power data corresponding to sequence number 3 (Idx3). Go to step S210.
[0101] S206. Determine if the real-time charging power data corresponding to sequence number 3 (Idx3) is equal to 0. If yes, go to step S207. If no, go to step S210.
[0102] S207. Loop sequence number 4 is equal to sequence number 2 plus 2 and then take the remainder of 16,
[0103] Idx4 = (Idx2 + 2) % 16, go to step S208;
[0104] S208. Determine if the real-time charging power data corresponding to sequence number 2 (Idx2) is equal to the real-time charging power data corresponding to sequence number 4 (Idx4) plus the product of the power increase value A and (n-2). If the current sequence number is 0, the sequence number corresponding to the current sequence number minus 1 is (n-1). If the current sequence number is (n-1), the sequence number corresponding to the current sequence number plus 1 is 0. If yes, go to step S209. If no, determine if the current sequence number is greater than or equal to (n-1). If yes, go to step S210. If no, continue to search, go to step S204.
[0105] S209. The temporary power variable is equal to the sum of the real-time charging power data corresponding to sequence number 2 (Idx2) and the power increase value A. It indicates that the power is being written to the storage data corresponding to sequence number 3 when the power is off or abnormally restarted, and it is not written completely. When starting, the memory check is not passed, it is 0. It is repaired and is the maximum power value. Go to step S211.
[0106] S210. Loop sequence number 2 is equal to sequence number 2 plus 1 (Idx2 = Idx2 + 1). Go to step S202.
[0107] S211. Determine if the temporary power variable is greater than 0 and the temporary power variable is equal to the power increase value A. If both conditions are met, go to step S212. Otherwise, go to step S4.
[0108] S212. Updated first total energy variable = first total energy variable + temporary energy variable / precision coefficient. In this embodiment, the precision coefficient is 1000. To ensure the accuracy of the temporary energy variable recording, the real-time charging energy data will be amplified 1000 times. Therefore, when calculating the temporary energy variable, it is necessary to divide the temporary energy variable by 1000. The second total energy variable is equal to the first total energy variable, and the process proceeds to step S213.
[0109] S213. Calculate the CRC16 value (two bytes) for the first total energy variable in the order of the four bytes with the low byte first and the high byte last. The controller writes the data corresponding to the total energy variable 1 and CRC16 to the memory address corresponding to the first total energy variable via IIC communication. Proceed to step S214;
[0110] S214. Loop number 2 is equal to 0 (Idx2 = 0), the temporary energy variable value is initialized to 0, the temporary energy variable is calculated in the order of the four bytes of low byte first and high byte last, the CRC16 value (two bytes), and then proceeds to step S215;
[0111] S215. Determine whether the cycle number 2 (Idx2) is less than or equal to 16. If so, proceed to step S216. If not, proceed to step S217.
[0112] S216. The controller writes the data corresponding to the temporary power variable (4 bytes) and CRC16 (2 bytes) into the memory address corresponding to loop number 2 (Idx2) through IIC communication. Loop number 2 is equal to loop number 2 plus 1 (Idx2 = Idx2 + 1), and the process proceeds to step S215.
[0113] S217. Calculate a two-byte CRC16 value for the second total energy variable in the order of the four bytes (low byte first, high byte last). The controller writes the corresponding data of the second total energy variable and the CRC16 value to the memory address corresponding to the second total energy variable via IIC communication. Proceed to step S4.
[0114] S3. Repair the total power data according to multiple groups of real-time charging energy data storage rules and related algorithms. If the first total power is greater than the second total power, it means that the first total power has been updated, and the first total power is assigned to the second total power, and then enter step S4; if the first total power is 0, it means that the first total power is lost. Through the specified algorithm, find the maximum stored real-time charging energy data from the real-time charging energy array. The updated second total power data = the second total power data + the maximum stored real-time charging energy data / precision coefficient. In this embodiment, the precision coefficient is 1000. In order to ensure the accuracy of the real-time charging energy data recording, the real-time charging energy data will be amplified 1000 times. Therefore, when calculating the real-time charging energy data, the real-time charging energy data needs to be divided by 1000. The updated first total power data is equal to the updated second total power data; then enter step S4
[0115] In step S3, the following steps are specifically included:
[0116] S301. Define a temporary energy variable and initialize it to 0;
[0117] S302. First, determine whether the first total electric energy variable is greater than the second total electric energy variable. If so, proceed to step S303. If not, proceed to step S304.
[0118] S303. The second total electric energy variable is equal to the first total electric energy variable, and the process proceeds to step S304;
[0119] S304. Determine whether the first total energy variable is equal to 0. If so, the process proceeds to step S305. Otherwise, the process proceeds to step S4.
[0120] S305 determines whether the amount of real-time charging energy data is less than a preset value. If so, proceed to step S306. If not, proceed to step S310.
[0121] S306. Cycle number 6 is equal to cycle number 5 plus 1 and then the remainder of 16.
[0122] Idx6=(Idx5+1)%16, proceed to step S307;
[0123] S307. Determine whether the difference between the largest stored real-time charging energy data and the second largest real-time charging energy data in the real-time charging energy data array is equal to the preset variable value. If so, proceed to step S308. If not, proceed to step S309.
[0124] S308. Determine whether the maximum stored real-time charging energy data is greater than the temporary energy variable. If so, assign the maximum stored real-time charging energy data to the temporary energy variable and proceed to step S309.
[0125] S309. Cycle number 5 is equal to cycle number 5 plus 1 (Idx5=Idx5+1), and the process goes to step S305;
[0126] S310. Determine whether the temporary power variable is greater than 0, and the temporary power variable is an integer multiple of the preset variable value, then proceed to step S311, otherwise proceed to step S317;
[0127] S311. The updated second total energy variable = the second total energy variable + the temporary energy / precision coefficient. The updated first total energy variable is equal to the updated second total energy variable, and the process proceeds to step S312.
[0128] S312. The controller writes the updated data corresponding to the first total energy variable into the memory address corresponding to the first total energy variable, and proceeds to step S313;
[0129] S313. Initialize the temporary energy variable value to 0 and proceed to step S314;
[0130] S314. Determine whether the loop number 5 (Idx5) is less than or equal to 16. If so, proceed to step S315. If not, proceed to step S316.
[0131] S315. The controller writes the data corresponding to the temporary energy variable (four bytes) and CRC16 (two bytes) to the memory address corresponding to loop number 5 (Idx5) via IIC communication. Loop number 5 is equal to loop number 5 plus 1 (Idx5 = Idx5 + 1), and then proceeds to step S314.
[0132] S316. Calculate the CRC16 value (two bytes) for the second total energy variable in the order of the four bytes (low byte first, high byte last). The controller writes the updated second total energy variable and the data corresponding to the CRC16 into the memory address corresponding to the second total energy variable via IIC communication, and then proceeds to step S4.
[0133] S317. The first total electric energy variable is equal to the second total electric energy variable, and the process goes to step S4.
[0134] S4. The charging pile device enters the charging ready state, and the relevant tasks begin to run periodically to detect whether charging is authorized to start;
[0135] In step S4, the following steps are specifically included:
[0136] S401. The charging pile controller first determines whether it is currently in a charging state. If it is in a charging state, it proceeds to step S402. If it is not in a charging state, it proceeds to step S403.
[0137] S402. When the current state is charging, detect whether there is a request to cancel charging. If there is a request to cancel charging, proceed to step S406. If there is no request to cancel charging, maintain the charging state and continuously update the power data.
[0138] S403 is currently in a non-charging state, and detects whether there is an authorized request for charging. If there is an authorized charging request, proceed to step S404. If there is no authorized charging request, proceed to step S401;
[0139] S404. After receiving the authorization charging request, the gun plug signal is detected. If the gun plug signal is detected, the process proceeds to step S405. If the gun plug signal is not detected, the process proceeds to step S401.
[0140] S405. The charging station starts charging. At the same time, the charging state is set to start and the process goes to step S5.
[0141] S406. The charging pile stops charging and sets the charging status to completed, and then proceeds to step S5.
[0142] S5. The charging station calculates and locally stores the relevant electrical energy based on the charging status;
[0143] In step S5, the following steps are specifically included:
[0144] S501. The charging pile controller detects the charging status. If the charging status is starting, proceed to step S502. If the charging status is charging, proceed to step S503. If the charging status is completed, proceed to step S509. Otherwise, proceed to step S6.
[0145] S502. When charging is in the start state, it is necessary to initialize the current real-time energy variable to 0, the current stored energy variable to 0, the loop number 7 (Idx7) to 0, the read energy timer to 0, and set the charging state to processing. Then proceed to step S6;
[0146] S503. When the charging state is in process, each cycle T is 20 mm, and the electric energy reading timer is incremented by 1.
[0147] Go to step S504;
[0148] S504. Determine whether the reading energy timer is greater than or equal to the 5-second threshold. If so, initialize the reading energy timer to 0 and proceed to step S505. If not, proceed to step S6;
[0149] S505. The charging pile controller reads the relative energy value of the electric energy metering chip through SPI communication, and when the next real-time energy variable is equal to the next real-time energy variable plus the relative energy value of the metering chip. Step S506 is entered;
[0150] S506. The temporary energy variable value is equal to the next real-time energy variable minus the next stored energy variable, and it is judged whether the temporary energy variable value is greater than or equal to the energy increase value A. If it is satisfied, step S507 is entered. If it is not satisfied, step S6 is entered;
[0151] S507. The next stored energy variable is equal to the next stored energy variable plus the energy increase value A, and the CRC16 value (two bytes) is calculated according to the order of four bytes with low bytes in front and high bytes at the back. The controller writes the next stored energy variable and the corresponding data of CRC16 into the memory address corresponding to the cycle number 7 (Idx7) through IIC communication. Step S508 is entered;
[0152] S508. The cycle number 7 (Idx7) is equal to the cycle number 7 (Idx7) plus 1 (Idx7 = Idx7 + 1). It is judged whether the index number of the stored energy is greater than or equal to 16. If it is satisfied, the cycle number 7 (Idx7) is equal to 0. Step S6 is entered;
[0153] S509. When the charging state is complete, the first total energy variable = the first total energy variable + the next real-time energy variable / precision coefficient; the second total energy variable is equal to the first total energy variable, and the charging state is set to the idle state. Step S5010 is entered;
[0154] S510. The CRC16 value (two bytes) is calculated according to the order of four bytes with low bytes in front and high bytes at the back. The controller writes the first total energy variable and the corresponding data of CRC16 into the memory address corresponding to the first total energy variable through IIC communication. Step S511 is entered;
[0155] S511. The next stored energy variable value is initialized to 0, the cycle number 7 (Idx7) is initialized to 0, the CRC16 value (two bytes) is calculated according to the order of four bytes with low bytes in front and high bytes at the back, and step S512 is entered;
[0156] S512. It is judged whether the cycle number 7 (Idx7) is less than 16. If it is satisfied, step S513 is entered. If it is not satisfied, step S514 is entered;
[0157] S513. The controller writes the current stored energy variable and the data corresponding to CRC16 into the memory address corresponding to loop number 7 (Idx7) through IIC communication. Loop number 7 is equal to loop number 7 (Idx7) plus 1 (Idx7 = Idx7 + 1), and then proceeds to step S512.
[0158] S514. Calculate a two-byte CRC16 value for the second total energy variable in the order of the four bytes (low byte first, high byte last). The controller writes the corresponding data of the second total energy variable and the CRC16 value to the memory address corresponding to the second total energy variable via IIC communication. The process proceeds to step S6.
[0159] S6. Calculate the added value of each charging energy storage based on historical charging energy data and charging time.
[0160] In step S6, when the system is started, the following steps are specifically included:
[0161] S601. Read the electric energy increase value stored in the memory. If the verification passes, the read electric energy increase value is assigned to the corresponding electric energy increase value A; if the verification fails, the electric energy increase value A is equal to the default electric energy increase value (30000), and enter step S602;
[0162] S602 reads the initial memory data stored in the memory corresponding to the address; if the check passes, the initial memory data months and days are assigned to the initial memory data corresponding to the number of months and days variables; if the check fails, the initial memory data corresponding to the number of months and days variables is 0; proceeds to step S603;
[0163] S603 reads the final memory data stored in the memory corresponding to the address; if the check passes, the final memory data months and days are assigned to the final memory data corresponding to the number of months and days variables; if the check fails, the final memory data corresponding to the number of months and days variables is 0; proceeds to step S604;
[0164] S604. End.
[0165] In step S6, each time charging starts, the following steps are specifically included:
[0166] S611 determines whether the initial memory data corresponding to the number of months and days variables are 0, if 0, proceed to step 2; if not 0, proceed to step S614;
[0167] S612. Determine whether the number of days of the current system time is less than the set value m. In this embodiment, the set value m is 7 days; if it is less than the set value m, proceed to step S613; if it is greater than or equal to the set value m, proceed to step S618;
[0168] S613. The system time, the number of months, days, the current total energy data and the corresponding calculated CRC check value are written together to the corresponding address of the memory; proceed to step S618;
[0169] S614 determines whether the number of months in the current system is equal to the number of months in the initial memory. If they are not equal, the process proceeds to step S615; if they are equal, the process proceeds to step S618;
[0170] S615. Calculate the added value of electric energy using the following formula:
[0171] Charging energy storage increase value = p*(final memory total energy variable - initial memory total energy variable) / (variable corresponding to the final memory time day - variable corresponding to the initial memory time day + 1) / maximum number of charging and storing energy per day;
[0172] Wherein, p is the conversion accuracy parameter of the total electric energy. In this embodiment, p=1000*100; the total electric energy kilowatts is multiplied by 1000 to convert it into watts, and then multiplied by 100 to achieve an accuracy of 0.01 watts;
[0173] The specific calculation formula for the maximum number of times of charging and storing electrical energy per day is as follows:
[0174] Maximum number of times to charge and store energy per day = (f / d)*n
[0175] Where f is the upper limit of the memory read and write, d is the number of days the charging pile is in use, and n is the number of real-time charging energy data in the real-time charging energy data array. In this embodiment, the upper limit of the memory read and write is 100,000 times, f = 10,000, the number of days the charging pile is in use is 8 years, d = 8 years * 365 = 2920; n is 16.
[0176] Determine whether the charging electric energy storage increase value is greater than or equal to the default value of the electric energy increase value A. If it is less than the electric energy increase value A, the electric energy increase value A is not updated and the electric energy increase value A remains at the default value of 30000. If it is greater than the default value of the electric energy increase value A, assign the charging electric energy storage increase value to the default value of the electric energy increase value A, and update the electric energy increase value A so that the electric energy increase value A = the charging electric energy storage increase value. Then, write the updated electric energy increase value A and the corresponding check value into the memory together; then proceed to step S616;
[0177] S616. Determine whether the number of days of the current system time is less than the set value m. If it is less than the set value m, proceed to step S617; otherwise, proceed to step S618;
[0178] S617. Then assign the month and day values of the system time to the month and day variables of the initial memory data, and then write the initial memory data of the month, day, current total energy and the corresponding check value to the final memory data address corresponding to the memory; proceed to step S618;
[0179] S618. End.
[0180] In step S6, each time charging is completed, the following steps are specifically included:
[0181] S621. Determine whether the month and day corresponding to the initial memory data are all 0. If not, proceed to step 2; if 0, proceed to step S624;
[0182] S622 determines whether the current system time month and the initial memory data month are equal, if equal, proceed to step 3; if not equal, proceed to step S624;
[0183] S623. Determine whether the number of days in the current system time is greater than or equal to the set value k. In this embodiment, the set value k is 15. If it is satisfied, the number of months and days in the system time, the current total energy data and the calculated CRC check value are written together to the final memory data address corresponding to the memory, and then proceed to step S624;
[0184] S624. End.
[0185] The method of the present invention sets real-time charging power data so that the charging pile records the charging power through the real-time charging power data when charging. When a sudden power outage occurs, the storage status at the time of power outage is judged and the relevant stored data is adjusted. If the power outage occurs when the first total power data is updated, the maximum value in the real-time charging power data is defined as a temporary power variable, and the updated first total power variable = the second total power variable + the temporary power variable / the precision coefficient. The updated first total power variable is then assigned to the second total power variable. If the power outage occurs when the second total power data is updated, the first total power variable is set to the temporary power variable. The variable is assigned to the second total electric energy variable, so as to ensure that the first total electric energy data and the second total electric energy data can be recorded accurately; if the power is cut off when the real-time charging electric energy data is recorded, the maximum value in the real-time charging electric energy data is assigned to the temporary electric energy variable, and the first total electric energy data is updated. The updated first total electric energy data = the first total electric energy data + the temporary electric energy variable / the accuracy coefficient, and finally the updated first total electric energy data is assigned to the second total electric energy data, so that the second total electric energy is updated; in addition, the electric energy added value A is updated according to the actual charging frequency and the charging power, to ensure that the electric energy added value A and the charging frequency can be adapted.
[0186] The above description is only a preferred embodiment of the present invention. Therefore, any equivalent changes or modifications made according to the structure, characteristics and principles described in the scope of the patent application of the present invention are included in the scope of the patent application of the present invention.
Claims
1. A method for adaptively storing electric energy for a vehicle-mounted charging station, characterized in that: The following steps are involved: S1. When the system starts, the charging pile controller reads the electric energy data stored in the external memory. The stored related electric energy data includes the first total electric energy data, the second total electric energy data and the real-time charging electric energy data array, wherein the first total electric energy data is stored at the start of the address, the second total electric energy data is stored at the end of the address, and the storage location of the real-time charging electric energy data array is located between the first total electric energy and the second total electric energy. The real-time charging electric energy data array includes n real-time charging electric energy data quantitatively stored during the charging process. The difference between two adjacent real-time charging electric energy data among the n real-time charging electric energy data is the electric energy increase value A. The sequence numbers of the n real-time charging electric energy data range from 0 to n-1. The real-time charging electric energy data are stored in the corresponding storage addresses in sequence, and when the sequence number is greater than or equal to n, the recording is cyclically started from sequence number 0; determine whether the first total electric energy and the second total electric energy data are equal and not zero. If so, proceed to step S2; if not, proceed to step S3; S2. Using a specified algorithm, find the maximum stored real-time charging energy data in the stored real-time charging energy array. The updated first total energy data = the first total energy data + the maximum stored real-time charging energy data / the accuracy coefficient. The updated second total energy data is equal to the updated first total energy data. S3. Repair the total energy data based on the storage rules and related algorithms of multiple sets of real-time charging energy data. If the first total energy is greater than the second total energy, it means that the first total energy has been updated, and the first total energy is assigned to the second total energy, and then the process proceeds to step S4. If the first total energy is 0, it means that the first total energy is lost. Using the specified algorithm, find the maximum stored real-time charging energy data from the real-time charging energy array. The updated second total energy data = the second total energy data + the maximum stored real-time charging energy data / the accuracy coefficient. The updated first total energy data is equal to the updated second total energy data; then the process proceeds to step S4. S4. The charging pile device enters the charging ready state, and the relevant tasks begin to run periodically to detect whether charging is authorized.
2. The method for adaptively storing electric energy of a vehicle-mounted charging pile according to claim 1, characterized in that: In step S1, the following steps are specifically included: S101. Define a first total energy variable and initialize it to 0, define a second total energy variable and initialize it to 0, define a real-time charging energy data array and initialize it to 0, then proceed to step S102; S102. The controller reads the first total energy data and the data stored in the real-time charging energy array at the corresponding address in the memory, and verifies the first total energy data and the data stored in the real-time charging energy array. In the first total energy data, each data includes six bytes, of which the first four are energy data and the last two bytes are check values. The first four bytes are then verified and calculated, and the calculated check values are compared with the read check values. If they are equal, the verification passes and the data is assigned to the first total energy variable. If they are not equal, the verification fails and the first total energy variable is set to 0. In the real-time charging energy array, starting from the first group of data, each group of data includes six bytes, of which the first four are energy data and the last two bytes are check values. The first four bytes are then verified and calculated, and the calculated check values are compared with the read check values. If they are equal, the verification passes and the data is assigned to the corresponding real-time charging energy data in the real-time charging energy array. If they are not equal, the verification fails and the corresponding real-time charging energy data in the real-time charging energy array is set to 0. After all groups of data are processed, the process proceeds to step S103. S103. The controller reads the second total energy data stored at the corresponding address in the memory. Each data item in the second total energy data consists of six bytes, of which the first four bytes are energy data and the last two bytes are check values. The controller then performs a check calculation on the first four bytes and compares the calculated check value with the read check value. If the check passes, the data is assigned to the second total energy variable. If the two are not equal, the check fails, the second total energy variable is set to 0, and the process proceeds to step S104. S104. Determine whether the first total energy variable and the second total energy variable are equal and not equal to 0. If so, it means that only the real-time charging energy data needs to be verified, and the maximum stored real-time charging energy data in the real-time charging energy data is found, and the process proceeds to step S2; if not, the process proceeds to step S105; S105. Determine whether the first total electric energy variable and the second total electric energy variable are unequal. If so, proceed to step S3; otherwise, proceed to step S4.
3. The method for adaptively storing electric energy of a vehicle-mounted charging pile according to claim 1, characterized in that: In step S2, according to a specified algorithm, the maximum stored real-time charging energy data is searched in the real-time charging energy array, and the query sequence number starts from 0. Specifically, the following steps are included: S201. Define a temporary energy variable and initialize it to 0, then proceed to step S202; S202. Determine whether the real-time charging energy data corresponding to the current serial number plus the energy increase value A is equal to the real-time energy data corresponding to the current serial number plus 1; if satisfied, proceed to step S203; if not satisfied, proceed to step S204; S203. The temporary energy variable is equal to the real-time energy data corresponding to the current serial number plus 1; S204. Determine whether the real-time charging energy data corresponding to the current serial number is 0. If so, proceed to step S205. If not, proceed to step S207. S205. Determine whether the real-time charging energy data corresponding to the current sequence number minus 1 is equal to the sum of the real-time charging energy data corresponding to the current sequence number plus 1 plus the energy increase value A multiplied by (n-2); if the current sequence number is 0, then the sequence number corresponding to the current sequence number minus 1 is (n-1); if the current sequence number is (n-1), then the sequence number corresponding to the current sequence number plus 1 is 0; if so, proceed to step S206; if not, determine whether the current sequence number is greater than or equal to (n-1); if so, proceed to step S207; if not, increment the current sequence number by 1, continue searching, and proceed to step S202; S206. The temporary energy variable is equal to the sum of the real-time charging energy data corresponding to the current sequence number minus 1 plus the energy increase value A, and then proceeds to step S207; S207. Determine whether the temporary energy variable is greater than 0, and the remainder of the temporary energy variable to the energy added value A is also 0. If both conditions are met, proceed to step S208, otherwise proceed to step S4; S208. Update the first total power and the second total power. The updated first total power = the first total power + the temporary power variable / the precision coefficient. The updated second total power is equal to the updated first total power, and then proceed to step S209. S209. After updating the first total power and the second total power, first write the first total power data into the corresponding address of the memory, then clear all the real-time charging power data and write them into the corresponding address of the memory, and finally write the second total power data into the corresponding address of the memory and enter step S4.
4. The method for adaptively storing electric energy for a vehicle-mounted charging pile according to claim 1, characterized in that: In step S3, the following steps are specifically included: S301. Define a temporary energy variable and initialize it to 0; S302. First, determine whether the first total electric energy variable is greater than the second total electric energy variable. If so, proceed to step S303. If not, proceed to step S304. S303. The first total electric energy variable is assigned to the second total electric energy variable, and the process proceeds to step S4; S304. Determine whether the first total energy variable is equal to 0. If so, the data of the first total energy variable is lost, then proceed to step S305; otherwise, proceed to step S4. S305. Find the maximum stored real-time charging energy data in the real-time charging energy array through a loop search, assign it to the temporary energy variable, and proceed to step S306; S306. Update the first total electric energy variable. The updated first total electric energy variable = the second total electric energy variable + the temporary electric energy variable / the precision coefficient. Then write the first total electric energy variable into the corresponding memory address. Then clear the real-time charging electric energy array and write it into the memory address corresponding to the real-time charging electric energy array. Then update the second total electric energy variable. The updated second total electric energy variable is equal to the updated first total electric energy variable. Finally, write the updated second total electric energy variable into the second total electric energy data into the corresponding memory address and enter step S4.
5. The method for adaptively storing electric energy of a vehicle-mounted charging pile according to claim 1, characterized in that: In step S4, the following steps are specifically included: S401. The charging pile controller first determines whether it is currently in a charging state. If it is in a charging state, it proceeds to step S402. If it is not in a charging state, it proceeds to step S403. S402. When the current state is charging, detect whether there is a request to cancel charging. If there is a request to cancel charging, proceed to step S406. If there is no request to cancel charging, maintain the charging state and continuously update the power data. S403 is currently in a non-charging state, and detects whether there is an authorized request for charging. If there is an authorized charging request, proceed to step S404. If there is no authorized charging request, proceed to step S401; S404. After receiving the authorization charging request, the gun plug signal is detected. If the gun plug signal is detected, the process proceeds to step S405. If the gun plug signal is not detected, the process proceeds to step S401. S405. The charging station starts charging and sets the charging state to start; S406. The charging station stops charging and sets the charging status to completed.
6. The method for adaptively storing electric energy of a vehicle-mounted charging pile according to claim 1, characterized in that: The following steps are also included: S5. The charging station calculates and locally stores the relevant electrical energy based on the charging status; S6. Calculate the charging energy storage increase value based on the historical charging energy data and charging time, and update the energy increase value A.
7. The method for adaptively storing electric energy for a vehicle-mounted charging pile according to claim 6, characterized in that: In step S5, the following steps are specifically included: S501. Define the current real-time energy variable and initialize it to 0. Define the current stored energy variable and initialize it to 0. Define the read energy timer variable and initialize it to 0. The charging pile controller detects the charging status. If the charging status is starting, it proceeds to step S502; if the charging status is charging, it proceeds to step S503; if the charging status is completed, it proceeds to step S509; otherwise, it proceeds to step S6; S502. When charging is started, the real-time energy variable is initialized to 0, the stored energy variable is initialized to 0, the energy read timer is initialized to 0, and the charging state is set to processing; then proceeds to step S6; S503. When the charging status is in process, the time of each cycle is T, the energy reading timer is increased by 1, and the process proceeds to step S504; S504. Determine whether the read energy timer is greater than or equal to the threshold. If so, initialize the read energy timer to 0 and proceed to step S505; if not, proceed to step S6; S505. The charging pile controller reads the relative energy value of the energy metering chip. When the real-time energy variable is equal to the real-time energy variable plus the relative energy value of the metering chip, step S506 is entered; S506. The temporary energy variable value is equal to the current real-time energy variable minus the current stored energy variable. Then determine whether the temporary energy variable value is greater than or equal to the energy increase value A. If so, proceed to step S507. If not, proceed to step S6. S507. When the secondary stored energy variable is equal to the secondary stored energy variable plus the energy increase value A, the controller writes the data corresponding to the secondary stored energy variable and the check value into the corresponding memory address, and proceeds to step S508; S508. Determine whether the serial number corresponding to the real-time charging power data stored in the loop plus one is greater than or equal to n. If so, the serial number corresponding to the real-time charging power data is equal to 0, and proceed to step S6; S509. When the charging state is complete, the first total energy variable = the first total energy variable + the current real-time energy variable / accuracy coefficient; the second total energy variable is equal to the first total energy variable, and the charging state is set to idle; proceed to step S510; S510. The controller first writes the first total power variable and the corresponding check value into the corresponding memory address; then proceeds to step S511; S511. The controller then clears the real-time charging energy array and writes it into the corresponding memory address. Finally, the controller writes the second total energy variable and the corresponding check value into the corresponding memory address and enters step S6.
8. The method for adaptively storing electric energy for a vehicle-mounted charging pile according to claim 6, characterized in that: In step S6, when the system is started, the following steps are specifically included: S601 reads the electric energy increase value stored in the memory. If the verification passes, the read electric energy increase value is assigned to the corresponding electric energy increase value A; if the verification fails, the electric energy increase value A is equal to the default electric energy increase value, and the process proceeds to step S602; S602 reads the initial memory data stored in the corresponding address in the memory. If the check passes, the number of months and days of the initial memory data is assigned to the number of months and days corresponding to the initial memory data variables; if the check fails, the number of months and days corresponding to the initial memory data variables is 0; proceeds to step S603; S603 reads the final memory data stored in the corresponding address in the memory. If the check passes, the number of months and days of the final memory data is assigned to the number of months and days corresponding to the final memory data variables; if the check fails, the number of months and days corresponding to the final memory data variables is 0; proceeds to step S604; S604. End.
9. The method for adaptively storing electric energy for a vehicle-mounted charging pile according to claim 6, characterized in that: In step S6, each time charging starts, the following steps are specifically included: S611 determines whether the initial memory data corresponding to the number of months and days variables are 0, if 0, proceed to step S612; if not 0, proceed to step S614; S612. Determine whether the number of days of the current system time is less than the set value m. If it is less than the set value m, proceed to step S613; if it is greater than or equal to the set value m, proceed to step S618; S613. The system time months, days, current total energy data and the corresponding calculated check value are written together into the memory corresponding to the initial memory data address; proceed to step S618; S614 determines whether the number of months in the current system is equal to the number of months in the initial memory. If they are not equal, the process proceeds to step S615; if they are equal, the process proceeds to step S618; S615. Calculate the added value of electric energy using the following formula: Charging energy storage increase value = p*(final memory total energy variable - initial memory total energy variable) / (variable corresponding to the final memory time day - variable corresponding to the initial memory time day + 1) / maximum number of charging and storing energy per day; Among them, p is the conversion accuracy parameter of total electric energy. The specific calculation formula for the maximum number of times of charging and storing electric energy per day is as follows: Maximum number of times to charge and store energy per day = (f / d)*n Where f is the upper limit of the memory read and write, d is the number of days the charging pile is used, and n is the number of real-time charging energy data in the real-time charging energy data array; Determine whether the charging electric energy storage increase value is less than the default value of the electric energy increase value A. If so, update the electric energy increase value A to the default value. If so, assign the charging electric energy storage increase value to the electric energy increase value A to update the electric energy increase value A. The controller writes the updated electric energy increase value A and the corresponding check value into the corresponding memory address; then proceed to step S616. S616. Determine whether the number of days of the current system time is less than the set value m. If it is less than the set value m, proceed to step S617; otherwise, proceed to step S618; S617. Then assign the month and day values of the system time to the month and day variables of the initial memory data, and then write the initial memory data of the month, day, current total energy and the corresponding check value to the final memory data address corresponding to the memory; proceed to step S618; S618. End.
10. The method for adaptively storing electric energy of a vehicle-mounted charging pile according to claim 6, characterized in that: In step S6, each time charging is completed, the following steps are specifically included: S621 determines whether the month and day corresponding to the initial memory data are all 0. If not, proceed to step S622; if 0, proceed to step S624; S622 determines whether the current system time month and the initial memory data month are equal, if equal, proceeds to step S623; if not equal, proceeds to step S624; S623 determines whether the number of days of the current system time is greater than or equal to the set value k. If so, the number of months, days, current total energy data and the corresponding check value of the system time are written together into the final memory data address corresponding to the memory, and then proceeds to step S624; S624. End.
Citation Information
Patent Citations
Account management method for electricity consumption of charging pile
CN109685993A
Electric energy metering device and method for electric automobile charging pile
CN112550029A