A charging order time and electric energy statistical method of a vehicle-mounted charging pile
By statistically analyzing charging time and energy consumption in stages and using network time to calibrate the system time, the problem of inaccurate time and energy data for charging piles after power outages has been solved, ensuring the accuracy of charging data and the reliability of the system.
Patent Information
- Application Number
- CN202410162506.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-05
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2044-02-05
AI Technical Summary
When the power grid fails, the charging station's system time is interrupted, resulting in inaccurate charging order time and power data. Furthermore, frequent writes to the EEPROM damage the system, and existing technologies cannot effectively solve this problem.
By statistically analyzing charging time and energy in stages, total time and energy are calculated, and the system time is calibrated using network time to avoid data loss. In addition, frequent writing to EEPROM is avoided during power outages, and multiple authorization methods are used to ensure data accuracy.
Ensuring the accuracy of charging order times and power data prevents system crashes and improves the reliability and security of charging data.
Smart Images

Figure CN118144624B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automotive electronics technology, and in particular to a method for calculating charging order time and energy consumption of on-board charging piles. Background Technology
[0002] In 2023, China became the world's largest automobile exporter, experiencing explosive growth in new energy vehicles, which in turn led to a surge in the demand for smart charging stations. However, many charging station technologies are not yet mature, particularly the application of new technologies such as smartphone app control for smart charging stations. There are no unified standards in the market, with each manufacturer defining its own approach, leading to numerous problems for users. Among the most common user complaints are issues with charging orders, such as incorrect start and end times, or even the end time being earlier than the start time. Additionally, the charging power may be too low or too high, affecting charging fees.
[0003] One major issue is that charging stations typically use the national power grid, which is frequently affected by power outages, leading to lost or incomplete order information data. Furthermore, charging stations generally use an MCU with a built-in RTC clock; when the system loses power, the system time is interrupted, and network synchronization is required after power is restored. This power outage causes problems with charging time during the order process. For example, if the system time uses the default time after power is restored but network connection is unavailable, the end time will be significantly shorter than the start time. Additionally, to prevent the loss of total charging energy data, it is necessary to frequently write the total energy data to the EEPROM. However, excessive writing can damage the FLASH memory, causing serious system crashes at the charging station. Summary of the Invention
[0004] To address the aforementioned shortcomings, this invention proposes a method for calculating the charging order time and energy of on-board charging piles when time synchronization is required. This method involves statistically analyzing the charging time of each stage and summing the total charging time, accumulating the energy of each stage to obtain the charging energy of the current order, and thus obtaining accurate start time, end time, and total charging energy for the order. This avoids errors in the start time, end time, and charging energy data of the charging pile.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for calculating charging order time and energy consumption of an on-board charging pile, wherein the order management status includes order start, order processing, and order completion. The order management mode includes an order idle mode and an order processing mode, comprising the following steps:
[0006] S1: Set the order management mode to order idle mode;
[0007] S2: Enter order processing mode. The order status is divided into three cases: order status start, order status in process, and order status complete. When the order status is order status start, proceed to step S3. When the order status is order status in process, proceed to step S4. When the order status is order status complete, proceed to step S5.
[0008] S3: When the order status is "Order Start", obtain the authorization method and verify it. Then, set the order start information. Increment the order serial number variable of the current order start information structure by 1 until the order serial number variable of the current order start information structure is greater than the maximum order serial number. Then, the order serial number variable of the current order start information structure is equal to 1. Write the start information of the current order to the corresponding start order address in EEPROM. Set the current order start information reporting status to 0, set the current order charging energy to 0, set the temporary charging time to 0, set the charging stage sequence number to 0, set the stage charging time statistics list sequence number to 0, and set the order status to "Order Processing".
[0009] S4: When the order status is "Processing", it is necessary to manage the order charging time statistics list information. The order charging time statistics list information includes a total charging time list for each charging stage and a charging time statistics list for each stage. The number of total charging time lists for each charging stage can be configured to be several. The structure members of each stage charging time statistics list include a charging stage, a charging time array, and an order sequence number array. The order sequence number is the last digit of the current order serial number. The number of both arrays is the same and several can be configured. The following steps are included:
[0010] S4.1: Each charging stage is configured with a charging calibration energy. When the current order charging energy is greater than or equal to the expected energy, the time required to charge this calibration energy is recorded. The expected energy of the order is calculated based on the current order stage number, the time list number, and the calibration energy value of each stage corresponding to the current order stage number.
[0011] S4.2: If the current order start information reporting status is 0 and the charging pile is connected to the server, and the system time source of the current order start information structure is not the network time source, then time synchronization is required, and proceed to step S4.3.
[0012] S4.3: Calculate the total charging time for the current stage based on the current order stage number and the time list number. Add the total time of each stage before the current stage to calculate the total charging time for the current order. The start time of the order start information = the current system time (i.e., network time) - the total charging time for the current order.
[0013] S4.4: Set the system time source for the order start information to the network time source, and then rewrite the start time and system time source of the order start information into the corresponding address in the EEPROM;
[0014] S5: When the order status is "Order Completed," and the "Order Continued Request for Authorized Charging" status is 1, calculate the total charging time for the current stage based on the current order stage number and time list number. Add the total time of each stage before the current stage to calculate the total charging time for the current order. The end time of the order end information = the start time of the order start information + the total charging time of the current order. Calculate the charging energy value for the current order based on the current order stage number, time list number, and the calibrated energy value corresponding to the current order stage number. If the "Order Continued Request for Authorized Charging" status is not 1, obtain the system time and system time source and assign them to the corresponding variables in the current order end information structure. The total energy of the current order end information = the charging energy of the current order + the total energy of the current order start information. Write the end information of the current order to the corresponding end order address in the EEPROM, and the current order ends.
[0015] Compared with the prior art, the advantages of the present invention are as follows:
[0016] When the system time source of the current order start information structure is not the network time source, the total charging time for the current order is obtained by statistically analyzing the charging time of each stage, reading the charging time of each stage, and summing the times of each stage. The start time of the order start information can be obtained by subtracting the current system time (i.e., network time) from the total charging time of the current order. The system time source of the order start information is then set to the network time source, and the system time source and the calculated start time of the order start information are rewritten into the corresponding address in the EEPROM to calibrate the time. The end time of the current order end information is obtained by adding the start time of the order start information to the total charging time of the current order, and the charging energy of each stage is added to obtain the charging energy of the current order. This avoids incorrect start time, end time, and charging energy data, thus improving information accuracy.
[0017] As an improvement, the order management status also includes an invalid order status, and the order management mode also includes an order initialization mode and an order verification mode. Step S1 specifically includes the following sub-steps:
[0018] S1.1: When the charging pile device starts, it enters the order initialization mode. When the charging pile MCU controller starts, it reads the data stored in the EEPROM corresponding to the address where the current order information is stored, obtains the order start information corresponding to the current order data address, assigns the corresponding data to the order start information variable corresponding to the current order data structure, obtains the order end information corresponding to the current order data address, assigns the corresponding data to the order end information variable corresponding to the current order data structure, and then enters the order verification mode, proceeding to step S1.2.
[0019] S1.2: Determine the relationship between the order serial number of the current order start information and the order serial number of the previous order end information. If the order serial number variable of the current order start information is equal to 0, set the current order status to invalid. If the order serial number variable of the current order start information is equal to the order serial number variable of the current order end information, set the current order status to completed. If the order serial number variable of the current order start information is equal to the remainder of the order serial number variable of the current order end information plus 1 and then modulo the maximum serial number, set the current order status to processing. Otherwise, set the current order status to invalid and proceed to step S1.3.
[0020] S1.3: Determine the current order status. If the current order status is invalid, proceed to step S1.4. If the current order status is processing, proceed to step S1.5. If the current order status is completed, proceed to step S1.8.
[0021] S1.4: Query the latest serial number in the historical order list data, starting from 0 and going up to the maximum number of local historical orders. Find the maximum value of the order serial number. If the serial number of the order with serial number 0 is 1, and the serial number of the last order is the maximum value of the serial number, then continue querying. Under this condition, do not consider the order serial number being greater than the maximum number of local historical orders. Compare and find the maximum value of the order serial number. The maximum value of the order serial number is the latest order serial number. At the same time, set the current order serial number to be equal to the latest serial number in the historical order list data. Set the status of the latest historical serial number query to complete and proceed to step S1.8.
[0022] S1.5: Initialize the power-down reset flag to 0, then read the MCU's reset register. If the reset register status indicates power-down reset, proceed to step S1.6; otherwise, proceed to step S1.7.
[0023] S1.6: This indicates that the charging pile system has restarted after a power outage. Set the power outage restart flag to 1 and proceed to step S1.7.
[0024] S1.7: Set the order to continue requesting authorized charging status to 1, then proceed to step S1.8;
[0025] S1.8: Set the mode to order idle mode.
[0026] Compared to existing patents that check the reset source when the order verification is in progress and then confirm the state before power failure to determine whether charging is required, this patent does not require writing data when power failure because it may damage the EEPROM. Instead, it trusts the charging information. If the order is not completed, it continues to request authorized charging. If the order status is invalid, it restores the latest order serial number from the historical order records.
[0027] As an improvement, step S2 specifically includes the following sub-steps:
[0028] S2.1: If the order continues to request authorized charging status 1, proceed to step S2.2; otherwise, proceed to step S2.3.
[0029] S2.2: Detect whether the charging pile is in plug-in state, i.e., whether the charging pile and the electric vehicle are connected. If plug-in state is detected within 3-7 seconds, set the mode to order processing mode, set the order status to order processing, set the order continue request for authorized charging status to 0, control the charging pile to start charging, and proceed to step S4. If plug-in state is not detected within 3-7 seconds, set the mode to order processing mode, set the order status to order completed, and proceed to step S5.
[0030] S2.3: Detect whether the charging pile has been requested for authorization. If there is an authorization request, set the mode to order processing mode, set the order status to order status start, and proceed to step S3.
[0031] By checking the connection status between the charging station and the electric vehicle, the safety and reliability of recharging after a power outage are improved.
[0032] As an improvement, step S3 includes the following steps before writing the start information of the current order to the start order address corresponding to the EEPROM:
[0033] S3.1: Obtain the authorization method and verify it. If the verification passes, the order authorization method in the current order start information structure is the corresponding request authorization method; otherwise, the order authorization method is the invalid order authorization method.
[0034] S3.2: Obtain the system time and assign it to the start time variable of the current order start information structure. Then obtain the system time source and assign it to the system time source variable of the current order start information structure.
[0035] S3.3: Obtain the total energy. The low-order total energy data of the current order start information is equal to the low-order total energy data of the previous order end information, and the high-order total energy data of the current order start information is equal to the high-order total energy data of the previous order end information.
[0036] Charging will continue even if the order is not completed. To ensure charging safety, the charging gun needs to be confirmed as connected within 5 seconds before the charging station starts charging the electric vehicle. The charging station is then activated to begin charging. The total energy of the charging station is managed through order information, which is superior to other solutions where order information and energy information are managed independently.
[0037] As an improvement, step S4.2 specifically includes the following sub-steps:
[0038] S4.2.1: Determine if the current order start information reporting status is 0. If it is 0, proceed to step S4.2.2; otherwise, proceed to step S5.
[0039] S4.2.2: If the charging pile is not connected to the server, proceed directly to step S4.4. If the charging pile is connected to the server and the system time source of the current order start information structure is the network time source, report the current order start information to the server directly, set the current order start information reporting status to 1, and proceed to step S4.4. If the charging pile is connected to the server and the system time source of the current order start information structure is not the network time source, time synchronization is required, and proceed to step S4.3.
[0040] Step S4.3 specifically includes the following sub-steps:
[0041] S4.3.1: Assign the charging stage value in the reading stage charging time statistics list structure to the current stage sequence number value, and set the reading sequence number to 0;
[0042] S4.3.2: Read the value in the order number array of the stage charging time statistics list corresponding to the serial number. Then the total charging time of the current order = the total charging time of the current order + the value in the charging time array of the stage charging time statistics list corresponding to the serial number. Then add 1 to the serial number and continue reading until the maximum value of the array is reached. If the order number value is not equal to the last digit of the current order serial number, the calculation will also end. The result is the total charging time of this charging stage.
[0043] S4.3.3: Set the read sequence number to 0. If the read sequence number is less than the current stage sequence number, then the total charging time of the current order = the total charging time of the current order + the value in the list array of total charging time of the charging stage corresponding to the read sequence number. Then increment the read sequence number by 1 and continue reading until the read sequence number is equal to the current stage value sequence number. Then the calculation ends. Finally, the total charging time of the current order = the total charging time of the current order + the temporary charging time. At this time, the total charging time of the current order is the final total time.
[0044] S4.3.4: Calculate the start time of the order. The start time of the order start information = the current system time (i.e., network time) - the total charging time of the current order. Set the system time source of the order start information to the network time source, and then rewrite the start time of the order start information and the system time source into the corresponding address in the EEPROM. Proceed to step S4.4.
[0045] Step S4.4 specifically includes the following sub-steps:
[0046] S4.4.1: During a periodic task, the relative energy value calculated by the metering chip is read at fixed intervals, and the temporary charging time is equal to the temporary charging time plus the fixed interval time.
[0047] S4.4.2: To prevent metering chip failure, determine whether the read relative energy value is greater than a certain multiple of the rated energy during the reading interval. If the condition is met, the read relative energy value is equal to a certain multiple of the rated energy during the reading interval, and the charging energy of the current order is equal to the charging energy of the current order plus the read relative energy value.
[0048] S4.4.3: Determine whether the charging energy of the current order is greater than or equal to the expected energy value. The energy values of the charging calibration energy array are arranged from largest to smallest. If the condition is met, proceed to step S4.4.4; otherwise, proceed to step S4.4.5.
[0049] S4.4.4: If the stage charging time statistics list number is 0, set the charging stage value in the stage charging time statistics list structure to the charging stage number. At the same time, save this charging stage value to the corresponding list address in EEPROM. Write the temporary charging time and the last digit of the current order serial number to the corresponding address of the stage charging time statistics list number in the charging time array and the order serial number array in the stage charging time statistics list, respectively. At the same time, save these two values to the corresponding list address in EEPROM. Increment the stage charging time statistics list number by 1 and set the temporary charging time to 0. If the stage charging time statistics list number is greater than or equal to the number of stages charging time statistics lists, sum the data of the current stage charging time statistics list. The result is the total stage charging time. Write the total stage charging time to the total time list array corresponding to the charging stage number. At the same time, save this total stage charging time to the corresponding total time list array address in EEPROM. Set the stage charging time statistics list number to 0, increment the charging stage number by 1, and proceed to step S4.4.5.
[0050] S4.4.5: If the user authorizes the cancellation of charging and the charging station stops charging, then set the current order status to "order completed" and proceed to step S5.
[0051] Because battery power can be high in the initial charging stage and decreases after reaching 80%, a charging calibration energy is configured for each charging stage based on this characteristic. The energy values in the charging calibration energy array are used in descending order. When charging reaches this calibration energy, the time required to charge this calibration energy is recorded. This method rationally utilizes the segmented calibration energy parameter based on the characteristics of electric vehicle batteries. While recording the order charging time, it can also statistically analyze the charging energy of the current order. Even in the event of system failure or external power interruption, the order charging time and energy data can be recovered to the greatest extent possible, ensuring the rationality of order time and energy data and solving the order charging problem in the market. Furthermore, when the time source of the order start information is not a network time source, once a network time is obtained during the charging process, the start time of the order start information can be corrected based on the total charging time, ensuring the accuracy of the start time.
[0052] As an improvement, step S5 specifically includes the following sub-steps:
[0053] S5.1: Obtain the cancellation authorization method and verify it. If the verification passes, the cancellation authorization method of the current order end information structure is the corresponding request authorization method. Otherwise, the cancellation authorization method is the invalid cancellation authorization method. If the order continues to request authorization and the charging status is 1, proceed to step S5.2. Otherwise, proceed to step S5.3.
[0054] S5.2: Calculate the total charging time and current order charging energy for this order, specifically including the following steps:
[0055] S5.2.1: Assign the charging stage value from the charging time statistics list structure to the current stage number value, set the reading sequence number to 0, read the value from the order number array in the charging time statistics list corresponding to the sequence number. If the order number value is equal to the last digit of the current order serial number, then the total charging time of the current order = the total charging time of the current order + the value from the charging time array in the charging time statistics list corresponding to the sequence number. Then increment the reading sequence number by 1 and continue reading until the maximum value of the array is reached. If the order number value is not equal to the last digit of the current order serial number, end the calculation and obtain the total charging time of this charging stage.
[0056] S5.2.2: Set the read sequence number to 0. If the read sequence number is less than the current stage sequence number value, then the total charging time of the current order = the total charging time of the current order + the value in the list array of total charging time of the charging stage corresponding to the read sequence number. Then increment the read sequence number by 1 and continue reading until the read sequence number is equal to the current stage sequence number value, then end the calculation. At this time, the total charging time of the current order is the final total time.
[0057] S5.2.3: Calculate the order's end time. The end time of the order end information = the start time of the order start information + the total charging time of the current order. The system time source of the order end information is equal to the system time source of the order start information. Proceed to step S5.2.4.
[0058] S5.2.4: Calculate the charging energy of the current order, read the charging stage value from the charging time statistics list structure and assign it to the current stage number value, and set the reading sequence number to 0;
[0059] S5.2.5: Read the value in the order sequence number array of the stage charging time statistics list corresponding to the sequence number. If the order sequence number value is equal to the last digit of the current order serial number, read the sequence number and increment it by 1. The query ends when the order sequence number value is not equal to the last digit of the current order serial number or when the read sequence number is greater than or equal to the maximum number of arrays. The current order charging energy = read sequence number * value corresponding to the current stage sequence number in the charging stage calibration energy array.
[0060] S5.2.6: Continue calculating the total energy of the previous stages. Set the read sequence number to 0. If the read sequence number is less than the current stage sequence number, then the current order charging energy = current order charging energy + maximum number of items in the time list array * the value corresponding to the read sequence number in the charging stage calibrated energy array. Then increment the read sequence number by 1 and continue reading until the read sequence number equals the current stage sequence number. Then end the calculation. At this time, the current order charging energy is the final order charging total energy.
[0061] S5.3: Obtain the system time and assign it to the end time variable of the current order end information structure. Then obtain the system time source and assign it to the system time source variable of the current order end information structure. Proceed to step S5.4.
[0062] S5.4: The total energy at the start and end of the order consists of 5 bytes, with 4 bytes of low-order total energy and 1 byte of high-order total energy. The low-order total energy data at the end of the order is equal to the low-order total energy data at the start of the order plus the current order charging energy. Then, it is determined whether the low-order total energy data at the end of the order is greater than or equal to 1,000,000,000 (0x3B9ACA00 in hexadecimal). If it is satisfied, the high-order total energy data at the end of the order is equal to the high-order total energy data at the end of the order plus 1, and the low-order total energy data at the end of the order is equal to the low-order total energy data at the end of the order minus 1,000,000,000. Proceed to step S5.5.
[0063] S5.5: If the charging pile is not connected to the server, proceed directly to step S5.7; if the charging pile is connected to the server, proceed to step S5.6.
[0064] S5.6: Determine if the current order start information reporting status is 0. If it is 0, report the current order start information to the server, set the current order start information reporting status to 1, and then report the current order end information to the server. Proceed to step S5.7.
[0065] S5.7: Write the end information of the current order to the corresponding end order address in the EEPROM, and then store the start and end information of the current order into the historical order list data information. The sequence number written into the historical order list is equal to the current order serial number modulo the maximum number of historical orders, and the current order ends.
[0066] Since the charging pile and electric vehicle are not connected after the system restart, the order end time and total energy at the end can be recovered by the total time list and charging time statistics list of the stage stored in the EEPROM. At the same time, to ensure that the total energy data does not overflow within the life cycle, 5 bytes are used to store the total energy, and the corresponding calculation method is given.
[0067] As an improvement, the order authorization methods mainly include RFID card swipe authorization, Bluetooth APP authorization, network remote authorization, periodic timed authorization, single timed authorization, Bluetooth plug-and-charge authorization, and authentication-free authorization. The order termination methods mainly include authorization cancellation due to serious fault, authorization cancellation upon entering emergency stop mode, authorization cancellation upon removing the gun, authorization cancellation by RFID card swipe, authorization cancellation by network remote authorization, authorization cancellation by Bluetooth APP, authorization cancellation by button, single timed authorization cancellation, and periodic timed authorization cancellation. Multiple authorization and cancellation methods are provided to facilitate user operation.
[0068] As an improvement, the order start information includes the order serial number, start time, system time source, start energy, and order authorization method. The order exception information includes the exception interruption time and exception interruption reason. The order end information includes the order serial number, end time, system time source, end energy, and order end method. This information makes it easy to calculate the charging time and charging energy of the current order. When an order exception occurs, reading the exception reason can facilitate the maintenance of the charging pile.
[0069] As an improvement, assuming the charging stage number is i with an initial value of 0, the time statistics list number is j with an initial value of 0, and the maximum number of the time statistics list is n, the expected electrical energy = charging calibration electrical energy array [0]*n + ... + charging calibration electrical energy array [i-1]*n + charging calibration electrical energy array [i]*(j+1). When i is 0, the expected electrical energy = charging calibration electrical energy array [i]*(j+1). The expected electrical energy is obtained by the cumulative calculation method. Attached Figure Description
[0070] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0071] Figure 1 Here is the flowchart for step S1;
[0072] Figure 2 Here is the flowchart for step S2;
[0073] Figure 3 Here is the flowchart for step S3;
[0074] Figure 4 Here is the flowchart for step S4;
[0075] Figure 5 This is the flowchart for step S5. Detailed Implementation
[0076] In this invention, it should be understood that the following description, in conjunction with the accompanying drawings and embodiments, further illustrates the invention, but should not be construed as limiting the invention.
[0077] like Figure 1As shown, a method for calculating charging order time and energy consumption of an on-board charging pile, step S1 specifically includes the following sub-steps:
[0078] S1.1: When the charging pile device starts, it enters the order initialization mode. When the charging pile MCU controller starts, it reads the data stored in the EEPROM corresponding to the address where the current order information is stored, obtains the order start information corresponding to the current order data address, assigns the corresponding data to the order start information variable corresponding to the current order data structure, obtains the order end information corresponding to the current order data address, assigns the corresponding data to the order end information variable corresponding to the current order data structure, and then enters the order verification mode, proceeding to step S1.2.
[0079] S1.2: Determine the relationship between the order serial number of the current order start information and the order serial number of the previous order end information. If the order serial number variable of the current order start information is equal to 0, set the current order status to invalid. If the order serial number variable of the current order start information is equal to the order serial number variable of the current order end information, set the current order status to completed. If the order serial number variable of the current order start information is equal to the remainder of the order serial number variable of the current order end information plus 1 and then modulo the maximum serial number, set the current order status to processing. Otherwise, set the current order status to invalid and proceed to step S1.3.
[0080] S1.3: Determine the current order status. If the current order status is invalid, proceed to step S1.4. If the current order status is processing, proceed to step S1.5. If the current order status is completed, proceed to step S1.8.
[0081] S1.4: Query the latest serial number in the historical order list data, starting from 0 and going up to the maximum number of local historical orders. Find the maximum value of the order serial number. If the serial number of the order with serial number 0 is 1, and the serial number of the last order is the maximum value of the serial number, then continue querying. Under this condition, do not consider the order serial number being greater than the maximum number of local historical orders. Compare and find the maximum value of the order serial number. The maximum value of the order serial number is the latest order serial number. At the same time, set the current order serial number to be equal to the latest serial number in the historical order list data. Set the status of the latest historical serial number query to complete and proceed to step S1.8.
[0082] S1.5: Initialize the power-down reset flag to 0, then read the MCU's reset register. If the reset register status indicates power-down reset, proceed to step S1.6; otherwise, proceed to step S1.7.
[0083] S1.6: This indicates that the charging pile system has restarted after a power outage. Set the power outage restart flag to 1 and proceed to step S1.7.
[0084] S1.7: Set the order to continue requesting authorized charging status to 1, then proceed to step S1.8;
[0085] S1.8: Set the mode to order idle mode.
[0086] After entering the order idle mode, proceed to step S2.
[0087] like Figure 2 As shown, a method for calculating charging order time and energy consumption of an on-board charging pile, step S2 specifically includes the following sub-steps:
[0088] S2.1: If the order continues to request authorized charging status 1, proceed to step S2.2; otherwise, proceed to step S2.3.
[0089] S2.2: Detect whether the charging pile is in plug-in state, i.e., whether the charging pile and the electric vehicle are connected. If plug-in state is detected within 3-7 seconds, set the mode to order processing mode, set the order status to order processing, set the order continue request for authorized charging status to 0, control the charging pile to start charging, and proceed to step S4. If plug-in state is not detected within 3-7 seconds, set the mode to order processing mode, set the order status to order completed, and proceed to step S5.
[0090] S2.3: Detect whether the charging pile has been requested for authorization. If there is an authorization request, set the mode to order processing mode, set the order status to order status start, and proceed to step S3.
[0091] like Figure 3 As shown, a method for calculating charging order time and energy consumption of an on-board charging pile, step S3 specifically includes the following sub-steps:
[0092] S3.1: Obtain the authorization method and verify it. If the verification passes, the order authorization method in the current order start information structure is the corresponding request authorization method; otherwise, the order authorization method is the invalid order authorization method.
[0093] S3.2: Obtain the system time and assign it to the start time variable of the current order start information structure. Then obtain the system time source and assign it to the system time source variable of the current order start information structure.
[0094] S3.3: Obtain the total power. The low-order total power data of the current order start information is equal to the low-order total power data of the previous order end information, and the high-order total power data of the current order start information is equal to the high-order total power data of the previous order end information.
[0095] S3.4: Increment the order serial number variable of the current order start information structure by 1, and then check whether the order serial number variable of the order start information structure is greater than the maximum order serial number. If it is satisfied, the order serial number variable of the current order start information structure is equal to 1. Preferably, in order to facilitate the query of historical order records, the maximum order serial number is generally an integer multiple of the number of local historical orders. At the same time, to ensure the uniqueness of the order, the maximum order serial number is large enough. For example, if the number of local historical orders is 1000, the maximum order serial number is configured as 0xFDE8 (65000). In this way, as long as the current order serial number is known, the position of the current order serial number in the historical order list can be found by taking the remainder of the current order serial number with respect to the maximum number of historical order records. Since the platform server requires the order serial number to be unique and cannot be repeated, when the server receives the order information reported by the charging pile, it will add the year to the front of the reported current order serial number. The server's order serial number string is "year.order serial number", such as "2023.60000".
[0096] S3.5: Write the start information of the current order into the start order address corresponding to the EEPROM, set the current order start information reporting status to 0, set the current order charging energy to 0, set the temporary charging time to 0, set the charging stage number to 0, set the stage charging time statistics list number to 0, set the order status to "order status in progress", and proceed to step S4.
[0097] like Figure 4 As shown, a method for calculating charging order time and energy consumption of an on-board charging pile, step S4 specifically includes the following sub-steps:
[0098] S4.1: Each charging stage is configured with a charging calibration energy. When the current order charging energy is greater than or equal to the expected energy, the time required to charge this calibration energy is recorded. The expected energy of the order is calculated based on the current order stage number, the time list number, and the calibration energy value of each stage corresponding to the current order stage number.
[0099] S4.2: Determine if the current order start information reporting status is 0. If it is 0, proceed to step S4.3; otherwise, set the current order status to order status completed and proceed to step S5.
[0100] S4.3: If the charging pile is not connected to the server, proceed directly to step S4.5. If the charging pile is connected to the server and the system time source of the current order start information structure is the network time source, report the current order start information to the server directly, set the current order start information reporting status to 1, and proceed to step S4.5. If the charging pile is connected to the server and the system time source of the current order start information structure is not the network time source, time synchronization is required, and proceed to step S4.4.
[0101] S4.4: Calculate the total charging time for the current order;
[0102] S4.4.1: Assign the charging stage value in the reading stage charging time statistics list structure to the current stage sequence number value, and set the reading sequence number to 0;
[0103] S4.4.2: Read the value in the order number array of the stage charging time statistics list corresponding to the sequence number. If the order number value is equal to the last digit of the current order serial number, then the total charging time of the current order = the total charging time of the current order + the value in the charging time array of the stage charging time statistics list corresponding to the sequence number. Then add 1 to the read sequence number and continue reading until the maximum value of the array is reached. If the order number value is not equal to the last digit of the current order serial number, the calculation also ends. The result is the total charging time of this charging stage.
[0104] S4.4.3: Set the read sequence number to 0. If the read sequence number is less than the current stage sequence number, then the total charging time of the current order = the total charging time of the current order + the value in the list array of total charging time of the charging stage corresponding to the read sequence number. Then increment the read sequence number by 1 and continue reading until the read sequence number is equal to the current stage value sequence number. Then the calculation ends. Finally, the total charging time of the current order = the total charging time of the current order + the temporary charging time. At this time, the total charging time of the current order is the final total time.
[0105] S4.4.4: Calculate the start time of the order. The start time of the order start information = the current system time (i.e., network time) - the total charging time of the current order. Set the system time source of the order start information to the network time source, and then rewrite the start time of the order start information and the system time source into the corresponding address in the EEPROM. Proceed to step S4.5.
[0106] S4.5: In the periodic task, the relative energy value calculated by the metering chip is read at a fixed interval. At the same time, the temporary charging time is equal to the temporary charging time plus the fixed interval. Preferably, the fixed interval is 5 seconds, then the temporary charging time is equal to the temporary charging time plus 5 seconds.
[0107] S4.6: To prevent metering chip failure, determine whether the read relative energy value is greater than a certain multiple of the rated energy of the reading interval. If it is satisfied, the read relative energy value is equal to a certain multiple of the rated energy of the reading interval. The charging energy of the current order is equal to the charging energy of the current order plus the read relative energy value. Preferably, the certain multiple is 3 times. If the charging power is 7200W per hour, then it is 2W per second. If the reading interval is 5 seconds, then it charges 10W within 5 seconds. Therefore, 3 times the rated energy of the reading interval is 30W.
[0108] S4.7: Determine whether the charging energy of the current order is greater than or equal to the expected energy value. The energy levels of the charging calibration energy array are sorted from largest to smallest. If the condition is met, proceed to step S4.8; otherwise, proceed to step S4.9.
[0109] S4.8: If the stage charging time statistics list number is 0, set the charging stage value in the stage charging time statistics list structure to the charging stage number. At the same time, save this charging stage value to the corresponding list address in EEPROM. Write the temporary charging time and the last digit of the current order serial number to the corresponding address of the stage charging time statistics list number in the charging time array and the order serial number array in the stage charging time statistics list, respectively. At the same time, save these two values to the corresponding list address in EEPROM. Increment the stage charging time statistics list number by 1 and set the temporary charging time to 0. If the stage charging time statistics list number is greater than or equal to the number of stages charging time statistics lists, sum the data of the current stage charging time statistics list. The result is the total stage charging time. Write the total stage charging time to the total time list array corresponding to the charging stage number. At the same time, save this total stage charging time to the corresponding total time list array address in EEPROM. Set the stage charging time statistics list number to 0, increment the charging stage number by 1, and proceed to step S4.9.
[0110] S4.9: If the user authorizes the cancellation of charging and the charging station stops charging, then set the current order status to "order completed" and proceed to step S5.
[0111] like Figure 5 As shown, a method for calculating charging order time and energy consumption of an on-board charging pile, step S5 specifically includes the following sub-steps:
[0112] S5.1: Obtain the cancellation authorization method and verify it. If the verification passes, the cancellation authorization method of the current order end information structure is the corresponding request authorization method. Otherwise, the cancellation authorization method is the invalid cancellation authorization method. If the order continues to request authorization and the charging status is 1, proceed to step S5.2. Otherwise, proceed to step S5.3.
[0113] S5.2: Calculate the total charging time and current order charging energy for this order, specifically including the following steps:
[0114] S5.2.1: Assign the charging stage value from the charging time statistics list structure to the current stage number value, set the reading sequence number to 0, read the value from the order number array in the charging time statistics list corresponding to the sequence number. If the order number value is equal to the last digit of the current order serial number, then the total charging time of the current order = the total charging time of the current order + the value from the charging time array in the charging time statistics list corresponding to the sequence number. Then increment the reading sequence number by 1 and continue reading until the maximum value of the array is reached. If the order number value is not equal to the last digit of the current order serial number, end the calculation and obtain the total charging time of this charging stage.
[0115] S5.2.2: Set the read sequence number to 0. If the read sequence number is less than the current stage sequence number value, then the total charging time of the current order = the total charging time of the current order + the value in the list array of total charging time of the charging stage corresponding to the read sequence number. Then increment the read sequence number by 1 and continue reading until the read sequence number is equal to the current stage sequence number value, then end the calculation. At this time, the total charging time of the current order is the final total time.
[0116] S5.2.3: Calculate the order's end time. The end time of the order end information = the start time of the order start information + the total charging time of the current order. The system time source of the order end information is equal to the system time source of the order start information. Proceed to step S5.2.4.
[0117] S5.2.4: Calculate the charging energy of the current order, read the charging stage value from the charging time statistics list structure and assign it to the current stage number value, and set the reading sequence number to 0;
[0118] S5.2.5: Read the value in the order sequence number array of the stage charging time statistics list corresponding to the sequence number. If the order sequence number value is equal to the last digit of the current order serial number, read the sequence number and increment it by 1. The query ends when the order sequence number value is not equal to the last digit of the current order serial number or when the read sequence number is greater than or equal to the maximum number of arrays. The current order charging energy = read sequence number * value corresponding to the current stage sequence number in the charging stage calibration energy array.
[0119] S5.2.6: Continue calculating the total energy of the previous stages. Set the read sequence number to 0. If the read sequence number is less than the current stage sequence number, then the current order charging energy = current order charging energy + maximum number of items in the time list array * the value corresponding to the read sequence number in the charging stage calibrated energy array. Then increment the read sequence number by 1 and continue reading until the read sequence number equals the current stage sequence number. Then end the calculation. At this time, the current order charging energy is the final order charging total energy.
[0120] S5.3: Obtain the system time and assign it to the end time variable of the current order end information structure. Then obtain the system time source and assign it to the system time source variable of the current order end information structure. Proceed to step S5.4.
[0121] S5.4: The total energy at the start and end of the order consists of 5 bytes, with 4 bytes of low-order total energy and 1 byte of high-order total energy. The low-order total energy data at the end of the order is equal to the low-order total energy data at the start of the order plus the current order charging energy. Then, it is determined whether the low-order total energy data at the end of the order is greater than or equal to 1,000,000,000 (0x3B9ACA00 in hexadecimal). If it is satisfied, the high-order total energy data at the end of the order is equal to the high-order total energy data at the end of the order plus 1, and the low-order total energy data at the end of the order is equal to the low-order total energy data at the end of the order minus 1,000,000,000. Proceed to step S5.5.
[0122] Assume the charging stage number is i, with an initial value of 0, and the time statistics list number is j, also with an initial value of 0. The maximum number of charging stages is 6, the maximum number of items in the time statistics list is 20, and the charging calibration energy array is {2°, 1°, 1°, 0.5°, 0.5°, 0.5°}. The following formula is used for calculation:
[0123] Expected electrical energy = Charging calibration electrical energy array [0]*20 + ... + Charging calibration electrical energy array [i-1]*20 + Charging calibration electrical energy array [i]*(j+1);
[0124] It should be noted that when i is 0, the expected electrical energy = the charging calibration electrical energy array [i] * (j + 1);
[0125] Current order charging energy = charging calibration energy array [0]*20 + ... + charging calibration energy array [i-1]*20 + charging calibration energy array [i]*(j);
[0126] It should be noted that when i is 0, the expected power is equal to the charging calibration power array [i]*(j). If charging is interrupted, the order will end directly, and the total charging power needs to be calculated based on this.
[0127] Total charging time = Total phase time list array [0] + ... + Total phase time list array [i-1] + Phase charging time array [0] + ... + Phase charging time array [j-1] + Temporary charging time;
[0128] It should be noted that when i is 0, the total charging time = stage charging time array [0] + ... + stage charging time array [j-1] + temporary charging time;
[0129] S5.5: If the charging pile is not connected to the server, proceed directly to step S5.7; if the charging pile is connected to the server, proceed to step S5.6.
[0130] S5.6: Determine if the current order start information reporting status is 0. If it is 0, report the current order start information to the server, set the current order start information reporting status to 1, and then report the current order end information to the server. Proceed to step S5.7.
[0131] S5.7: Write the end information of the current order to the corresponding end order address in the EEPROM, and then store the start and end information of the current order into the historical order list data information. The sequence number written into the historical order list is equal to the current order serial number modulo the maximum number of historical orders, and the current order ends.
[0132] The present invention has been described above by way of example with reference to the accompanying drawings. Obviously, the specific implementation of the present invention is not limited to the above-described manner. Any non-substantial improvements made using the technical solution of the present invention, or the direct application of the concept and technical solution of the present invention to other occasions without modification, are all within the protection scope of the present invention.
Claims
1. A method for calculating charging order time and energy consumption of an on-board charging pile, characterized in that: Order management status includes order status start, order status in progress, and order status completed. Order management modes include order idle mode and order processing mode, and include the following steps: S1: Set the order management mode to order idle mode; S2: Enter order processing mode. The order status is divided into three cases: order status start, order status in process, and order status complete. When the order status is order status start, proceed to step S3. When the order status is order status in process, proceed to step S4. When the order status is order status complete, proceed to step S5. S3: When the order status is "Order Start", obtain the authorization method and verify it. Then, set the order start information. Increment the order serial number variable of the current order start information structure by 1 until the order serial number variable of the current order start information structure is greater than the maximum order serial number. Then, the order serial number variable of the current order start information structure is equal to 1. Write the start information of the current order to the corresponding start order address in EEPROM. Set the current order start information reporting status to 0, set the current order charging energy to 0, set the temporary charging time to 0, set the charging stage sequence number to 0, set the stage charging time statistics list sequence number to 0, and set the order status to "Order Processing". S4: When the order status is "Processing", it is necessary to manage the order charging time statistics list information. The order charging time statistics list information includes a total charging time list for each charging stage and a charging time statistics list for each stage. The number of total charging time lists for each charging stage is configured to be several. The structure members of each stage charging time statistics list include a charging stage, a charging time array, and an order sequence number array. The order sequence number is the last digit of the current order serial number. The two arrays have the same number and are configured to have several. The following steps are included: S4.1: Each charging stage is configured with a charging calibration energy. When the current order charging energy is greater than or equal to the expected energy, the time required to charge this calibration energy is recorded. The expected energy of the order is calculated based on the current order stage number, the time list number, and the calibration energy value of each stage corresponding to the current order stage number. S4.2: If the current order start information reporting status is 0 and the charging pile is connected to the server, and the system time source of the current order start information structure is not the network time source, then time synchronization is required, and proceed to step S4.
3. S4.3: Calculate the total charging time for the current stage based on the current order stage number and the time list number. Add the total time of each stage before the current stage to calculate the total charging time for the current order. The start time of the order start information = the current system time (i.e., network time) - the total charging time for the current order. S4.4: Set the system time source for the order start information to the network time source, and then rewrite the start time and system time source of the order start information into the corresponding address in the EEPROM; S5: When the order status is "order completed", if the order continues to request authorized charging status is 1, calculate the total charging time of the current stage based on the current order stage number and time list number, and add the total time of each stage before the current stage to calculate the total charging time of the current order. The end time of the order end information = the start time of the order start information + the total charging time of the current order. Calculate the charging energy value of the current order based on the current order stage number, time list number, and the calibrated energy value corresponding to the current order stage number. If the order continues to request authorized charging status is not 1, obtain the system time and system time source and assign them to the corresponding variables in the current order end information structure. The total energy of the current order end information = the charging energy of the current order + the total energy of the current order start information. Write the end information of the current order to the corresponding end order address in the EEPROM, and the current order ends. Step S3, before writing the start information of the current order to the start order address corresponding to the EEPROM, includes the following steps: S3.1: Obtain the authorization method and verify it. If the verification passes, the order authorization method in the current order start information structure is the corresponding request authorization method; otherwise, the order authorization method is the invalid order authorization method. S3.2: Obtain the system time and assign it to the start time variable of the current order start information structure. Then obtain the system time source and assign it to the system time source variable of the current order start information structure. S3.3: Obtain the total power. The low-order total power data of the current order start information is equal to the low-order total power data of the previous order end information, and the high-order total power data of the current order start information is equal to the high-order total power data of the previous order end information. Step S4.2 specifically includes the following sub-steps: S4.2.1: Determine if the current order start information reporting status is 0. If it is 0, proceed to step S4.2.2; otherwise, proceed to step S5. S4.2.2: If the charging pile is not connected to the server, proceed directly to step S4.
4. If the charging pile is connected to the server and the system time source of the current order start information structure is the network time source, report the current order start information to the server directly, set the current order start information reporting status to 1, and proceed to step S4.
4. If the charging pile is connected to the server and the system time source of the current order start information structure is not the network time source, time synchronization is required, and proceed to step S4.
3. Step S4.3 specifically includes the following sub-steps: S4.3.1: Assign the charging stage value in the reading stage charging time statistics list structure to the current stage sequence number value, and set the reading sequence number to 0; S4.3.2: Read the value in the order number array of the stage charging time statistics list corresponding to the sequence number. If the order number value is equal to the last digit of the current order serial number, then the total charging time of the current order = the total charging time of the current order + the value in the charging time array of the stage charging time statistics list corresponding to the sequence number. Then add 1 to the read sequence number and continue reading until the maximum value of the array is reached. If the order number value is not equal to the last digit of the current order serial number, the calculation also ends. The result is the total charging time of this charging stage. S4.3.3: Set the read sequence number to 0. If the read sequence number is less than the current stage sequence number, then the total charging time of the current order = the total charging time of the current order + the value in the list array of total charging time of the charging stage corresponding to the read sequence number. Then increment the read sequence number by 1 and continue reading until the read sequence number is equal to the current stage value sequence number. Then the calculation ends. Finally, the total charging time of the current order = the total charging time of the current order + the temporary charging time. At this time, the total charging time of the current order is the final total time. S4.3.4: Calculate the start time of the order. The start time of the order start information = the current system time (i.e., network time) - the total charging time of the current order. Set the system time source of the order start information to the network time source, and then rewrite the start time of the order start information and the system time source into the corresponding address in the EEPROM. Proceed to step S4.
4. Step S4.4 specifically includes the following sub-steps: S4.4.1: During a periodic task, the relative energy value calculated by the metering chip is read at fixed intervals, and the temporary charging time is equal to the temporary charging time plus the fixed interval time. S4.4.2: To prevent metering chip failure, determine whether the read relative energy value is greater than a certain multiple of the rated energy during the reading interval. If the condition is met, the read relative energy value is equal to a certain multiple of the rated energy during the reading interval, and the charging energy of the current order is equal to the charging energy of the current order plus the read relative energy value. S4.4.3: Determine whether the charging energy of the current order is greater than or equal to the expected energy value. The energy values of the charging calibration energy array are sorted from largest to smallest. If the condition is met, proceed to step S4.4.4; otherwise, proceed to step S4.4.
5. S4.4.4: If the stage charging time statistics list number is 0, set the charging stage value in the stage charging time statistics list structure to the charging stage number. At the same time, save this charging stage value to the corresponding list address in EEPROM. Write the temporary charging time and the last digit of the current order serial number to the corresponding address of the stage charging time statistics list number in the charging time array and the order serial number array in the stage charging time statistics list, respectively. At the same time, save these two values to the corresponding list address in EEPROM. Increment the stage charging time statistics list number by 1 and set the temporary charging time to 0. If the stage charging time statistics list number is greater than or equal to the number of stages charging time statistics lists, sum the data of the current stage charging time statistics list. The result is the total stage charging time. Write the total stage charging time to the total time list array corresponding to the charging stage number. At the same time, save this total stage charging time to the corresponding total time list array address in EEPROM. Set the stage charging time statistics list number to 0, increment the charging stage number by 1, and proceed to step S4.4.
5. S4.4.5: If the user authorizes the cancellation of charging and the charging station stops charging, then set the current order status to "order completed" and proceed to step S5; Step S5 specifically includes the following sub-steps: S5.1: Obtain the cancellation authorization method and verify it. If the verification passes, the cancellation authorization method of the current order end information structure is the corresponding request authorization method. Otherwise, the cancellation authorization method is the invalid cancellation authorization method. If the order continues to request authorization and the charging status is 1, proceed to step S5.
2. Otherwise, proceed to step S5.
3. S5.2: Calculate the total charging time and current order charging energy for this order, specifically including the following steps: S5.2.1: Assign the charging stage value from the charging time statistics list structure to the current stage number value, set the reading sequence number to 0, and read the value from the order number array in the charging time statistics list corresponding to the sequence number. If the order number value is equal to the last digit of the current order serial number, then the total charging time of the current order = the total charging time of the current order + the value from the charging time array in the charging time statistics list corresponding to the sequence number. Then increment the reading sequence number by 1 and continue reading until the maximum value of the array is reached. If the order number value is not equal to the last digit of the current order serial number, end the calculation and obtain the total charging time of this charging stage. S5.2.2: Set the read sequence number to 0. If the read sequence number is less than the current stage sequence number value, then the total charging time of the current order = the total charging time of the current order + the value in the list array of total charging time of the charging stage corresponding to the read sequence number. Then increment the read sequence number by 1 and continue reading until the read sequence number is equal to the current stage sequence number value, then end the calculation. At this time, the total charging time of the current order is the final total time. S5.2.3: Calculate the order's end time. The end time of the order end information = the start time of the order start information + the total charging time of the current order. The system time source of the order end information is equal to the system time source of the order start information. Proceed to step S5.2.
4. S5.2.4: Calculate the charging energy of the current order, read the charging stage value from the charging time statistics list structure and assign it to the current stage number value, and set the reading sequence number to 0; S5.2.5: Read the value in the order sequence number array of the stage charging time statistics list corresponding to the sequence number. If the order sequence number value is equal to the last digit of the current order serial number, read the sequence number and increment it by 1. The query ends when the order sequence number value is not equal to the last digit of the current order serial number or when the read sequence number is greater than or equal to the maximum number of arrays. The current order charging energy = read sequence number * value corresponding to the current stage sequence number in the charging stage calibration energy array. S5.2.6: Continue calculating the total energy of the previous stages. Set the read sequence number to 0. If the read sequence number is less than the current stage sequence number, then the current order charging energy = current order charging energy + maximum number of items in the time list array * the value corresponding to the read sequence number in the charging stage calibrated energy array. Then increment the read sequence number by 1 and continue reading until the read sequence number equals the current stage sequence number. Then end the calculation. At this time, the current order charging energy is the final order charging total energy. S5.3: Obtain the system time and assign it to the end time variable of the current order end information structure. Then obtain the system time source and assign it to the system time source variable of the current order end information structure. Proceed to step S5.
4. S5.4: The total energy at the start and end of the order consists of 5 bytes, with 4 bytes of low-order total energy and 1 byte of high-order total energy. The low-order total energy data at the end of the order is equal to the low-order total energy data at the start of the order plus the current order charging energy. Then, it is determined whether the low-order total energy data at the end of the order is greater than or equal to 1,000,000,000 (0x3B9ACA00 in hexadecimal). If it is satisfied, the high-order total energy data at the end of the order is equal to the high-order total energy data at the end of the order plus 1, and the low-order total energy data at the end of the order is equal to the low-order total energy data at the end of the order minus 1,000,000,000. Proceed to step S5.
5. S5.5: If the charging pile is not connected to the server, proceed directly to step S5.7; if the charging pile is connected to the server, proceed to step S5.
6. S5.6: Determine if the current order start information reporting status is 0. If it is 0, report the current order start information to the server, set the current order start information reporting status to 1, and then report the current order end information to the server. Proceed to step S5.
7. S5.7: Write the end information of the current order to the corresponding end order address in the EEPROM, and then store the start and end information of the current order into the historical order list data information. The sequence number written into the historical order list is equal to the current order serial number modulo the maximum number of historical orders, and the current order ends.
2. The method for calculating charging order time and energy consumption of an on-board charging pile according to claim 1, characterized in that: The order management status also includes an invalid order status, and the order management mode also includes an order initialization mode and an order verification mode. Step S1 specifically includes the following sub-steps: S1.1: When the charging pile device starts, it enters the order initialization mode. When the charging pile MCU controller starts, it reads the data stored in the EEPROM corresponding to the address where the current order information is stored, obtains the order start information corresponding to the current order data address, assigns the corresponding data to the order start information variable corresponding to the current order data structure, obtains the order end information corresponding to the current order data address, assigns the corresponding data to the order end information variable corresponding to the current order data structure, and then enters the order verification mode, proceeding to step S1.
2. S1.2: Determine the relationship between the order serial number of the current order start information and the order serial number of the previous order end information. If the order serial number variable of the current order start information is equal to 0, set the current order status to invalid. If the order serial number variable of the current order start information is equal to the order serial number variable of the current order end information, set the current order status to completed. If the order serial number variable of the current order start information is equal to the remainder of the order serial number variable of the current order end information plus 1 and then modulo the maximum serial number, set the current order status to processing. Otherwise, set the current order status to invalid and proceed to step S1.
3. S1.3: Determine the current order status. If the current order status is invalid, proceed to step S1.
4. If the current order status is processing, proceed to step S1.
5. If the current order status is completed, proceed to step S1.
8. S1.4: Query the latest serial number in the historical order list data, starting from 0 and going up to the maximum number of local historical orders. Find the maximum value of the order serial number. If the serial number of the order with serial number 0 is 1, and the serial number of the last order is the maximum value of the serial number, then continue querying. Under this condition, do not consider the order serial number being greater than the maximum number of local historical orders. Compare and find the maximum value of the order serial number. The maximum value of the order serial number is the latest order serial number. At the same time, set the current order serial number to be equal to the latest serial number in the historical order list data. Set the status of the latest historical serial number query to complete and proceed to step S1.
8. S1.5: Initialize the power-down reset flag to 0, then read the MCU's reset register. If the reset register status indicates power-down reset, proceed to step S1.6; otherwise, proceed to step S1.
7. S1.6: This indicates that the charging pile system has restarted after a power outage. Set the power outage restart flag to 1 and proceed to step S1.
7. S1.7: Set the order to continue requesting authorized charging status to 1, then proceed to step S1.8; S1.8: Set the mode to order idle mode.
3. The method for calculating charging order time and energy consumption of an on-board charging pile according to claim 1, characterized in that: Step S2 specifically includes the following sub-steps: S2.1: If the order continues to request authorized charging status 1, proceed to step S2.2; otherwise, proceed to step S2.
3. S2.2: Detect whether the charging pile is in plug-in state, i.e., whether the charging pile and the electric vehicle are connected. If plug-in state is detected within 3-7 seconds, set the mode to order processing mode, set the order status to order processing, set the order continue request for authorized charging status to 0, control the charging pile to start charging, and proceed to step S4. If plug-in state is not detected within 3-7 seconds, set the mode to order processing mode, set the order status to order completed, and proceed to step S5. S2.3: Detect whether the charging pile has been requested for authorization. If there is an authorization request, set the mode to order processing mode, set the order status to order status start, and proceed to step S3.
4. The method for calculating charging order time and energy consumption of an on-board charging pile according to claim 1, characterized in that: The order authorization methods mainly include RFID card swipe authorization, Bluetooth APP authorization, network remote authorization, periodic timed authorization, single timed authorization, Bluetooth plug-and-charge authorization, and authentication-free authorization. The order termination methods mainly include authorization cancellation due to serious fault, authorization cancellation upon entering emergency stop mode, authorization cancellation upon removing the gun, authorization cancellation by RFID card swipe, authorization cancellation by network remote authorization, authorization cancellation by Bluetooth APP, authorization cancellation by button, authorization cancellation by single timed authorization, and authorization cancellation by periodic timed authorization.
5. The method for calculating charging order time and energy consumption of an on-board charging pile according to claim 1, characterized in that: The order start information includes the order serial number, start time, system time source, start energy, and order authorization method. The order end information includes the order serial number, end time, system time source, end energy, and order end method.
6. The method for calculating charging order time and energy consumption of an on-board charging pile according to claim 1, characterized in that: Assuming the charging stage number is i, with an initial value of 0, the time statistics list number is j, with an initial value of 0, and the maximum number of the time statistics list is n, the expected energy = charging calibration energy array [0]*n + … + charging calibration energy array [i-1]*n + charging calibration energy array [i]*(j+1). When i is 0, the expected energy = charging calibration energy array [i]*(j+1).
Citation Information
Patent Citations
Intelligent charging pile peak-hour-avoiding charging method and intelligent charging pile system
CN110126665A
Intelligent charging method of charging pile and intelligent charging pile system
CN113162152A
