Charging order anti-power-off access method and device

By storing the hot data structure of charging orders in FRAM, the frequent operation of Flash is reduced, which solves the problems of reduced Flash life and data loss during charging, and realizes data retention and system stability in the event of power failure.

CN115829689BActive Publication Date: 2025-11-18XIAN WANMA SMART NEW ENERGY TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211633761.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-19
Publication Date
2025-11-18
Estimated Expiration
2042-12-19

AI Technical Summary

Technical Problem

Frequent Flash operations during charging can lead to reduced lifespan and data loss, especially when the billing unit fails due to power failure.

Method used

By using a hot data structure to store data in FRAM, frequent operations on Flash are reduced. Taking advantage of the write resistance of FRAM, the data is transferred to Flash after charging is completed.

Benefits of technology

This extends the lifespan of the Flash memory, ensures that charging order data is not lost in the event of a power outage, and improves the stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115829689B_ABST
    Figure CN115829689B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of charging pile ammeter data processing technology, and discloses a charging order anti-power-off storage method and device, which comprises the following steps: a hot data structure body of a charging order is predefined; hot data, such as active order data, which is frequently rewritten, is stored in a FRAM that is resistant to writing operation; after the order end data is no longer updated and becomes cold data, the legality of the data and whether the data is tampered with are verified; and the data is batch-dumped into a Flash. The application can utilize the feature that FRAM power-off data is not lost to ensure that order data is not lost after power-off, and can greatly reduce the frequency of data erasing and writing operation of the Flash, thereby effectively prolonging the service life of the Flash.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of charging pile meter data processing technology, and in particular to a charging order anti-power failure storage method and device. Background Technology

[0002] Charging piles function similarly to gas pumps at gas stations. They can be fixed to the ground or walls and installed in public buildings (public buildings, shopping malls, public parking lots, etc.) and residential parking lots or charging stations. They can charge various models of electric vehicles according to different voltage levels. The input end of the charging pile is directly connected to the AC power grid, and the output end is equipped with a charging plug for charging electric vehicles. Charging piles generally provide two charging methods: regular charging and fast charging. Users can use a specific charging card to swipe on the human-machine interface provided by the charging pile to perform operations such as selecting the charging method, charging time, and printing cost data. The charging pile display screen can display data such as charging amount, cost, and charging time.

[0003] The billing unit of the charging station stores the order number and other key information of the charging order in Flash when the charging order begins, and refreshes the stored content such as the electricity meter data in real time during the charging process. When the charging ends, the data stored in Flash is used for settlement.

[0004] In existing technologies, the entire charging process involves real-time updates of order information, updating the corresponding order information every second. This frequent operation on the Flash memory reduces its lifespan. The Flash memory workflow involves erasing block data first, then writing data. If the billing unit loses power during charging, data loss will occur if the Flash memory is erased before data is written. In severe cases, this can damage the file system, ultimately causing the billing unit to malfunction. Summary of the Invention

[0005] The purpose of this application is to overcome the shortcomings of the prior art and provide a charging order anti-power failure access method and device.

[0006] Firstly, a method for power-loss-resistant access to charging orders is provided, including:

[0007] A predefined hot data structure for charging orders is defined, which includes the initial meter reading, real-time meter reading, meter reading difference for each time period, order start time, order current time, and verification flag.

[0008] Obtain the initial meter reading and order start time when charging begins;

[0009] The thermal data structure is updated based on the initial meter reading and the order start time, and the updated data structure is written into FRAM.

[0010] In the charging process, the real-time meter reading and the order current time are read once every n seconds, the hot data structure is updated according to the real-time meter reading and the order current time, and the updated data structure is written into the FRAM, wherein n is greater than 0;

[0011] In the charging process, the reading difference between the current meter and the starting meter is calculated once every N hours, the reading difference of each period in the hot data structure is updated according to the reading difference, and the updated data structure is written into the FRAM, wherein 0

[0012] When an unexpected interruption occurs in the charging process, the hot data structure in the FRAM is automatically updated, after power-on again, the order current time in the hot data structure is compared with the current time, if the comparison result is inconsistent, the hot data structure is uploaded to the server, so that the server performs order settlement and issues an instruction;

[0013] After the charging is completed, the verification flag is the end of charging flag, the hot data structure in the FRAM is uploaded to the server, so that the server performs order settlement, issues an order completion instruction, and archives the hot data structure into the Flash.

[0014] Further, the starting meter reading adopts a data type of double-precision floating point number, which is used to store the meter value at the beginning of charging.

[0015] Further, the real-time meter reading adopts a data type of double-precision floating point number, which is used to store the real-time meter value during charging.

[0016] Further, the reading difference of each period adopts a data type of single-precision floating point number, which is used to store the reading difference between each billing period in a step-by-step manner.

[0017] Further, the order start time adopts a format of 32-bit unix timestamp, which is used to store the start charging time, and the order current time adopts a format of 32-bit unix timestamp, which is used to store the real-time charging time.

[0018] Further, the verification flag is used to store order state information and cyclic redundancy check code, and the hot data structure is cyclically redundantly checked every time the hot data structure is updated.

[0019] Further, the order settlement includes:

[0020] Receiving the hot data structure;

[0021] Judging the legitimacy of the hot data structure by calculating the charging amount of each period;

[0022] If the hot data structure is illegal, a charging failure instruction is sent out;

[0023] If the hot data structure is legal, whether the hot data structure is tampered is checked through a cyclic redundancy check;

[0024] If the hot data structure is tampered, a charging failure instruction is sent out;

[0025] If the hot data structure is not tampered, the user is charged;

[0026] After the charging is completed, a complete charging instruction is sent out.

[0027] In a second aspect, a charging order anti-power-off access device is provided, comprising:

[0028] A predefinition module is configured to predefine a hot data structure of a charging order, wherein the hot data structure comprises a starting electric meter reading, a real-time electric meter reading, a difference value of electric meter readings of each period, an order start time, an order current time, and a check flag;

[0029] An acquisition module is configured to acquire the starting electric meter reading and the order start time when charging is started;

[0030] A first updating module is configured to update the hot data structure according to the starting electric meter reading and the order start time, and write the updated data structure into an FRAM;

[0031] A second updating module is configured to read the real-time electric meter reading and the order current time every n seconds during the charging process, update the hot data structure according to the real-time electric meter reading and the order current time, and write the updated data structure into the FRAM, wherein n is greater than 0;

[0032] A third updating module is configured to calculate the difference value of the current electric meter reading and the starting electric meter reading every N hours during the charging process, update the difference value of electric meter readings of each period in the hot data structure according to the difference value, and write the updated data structure into the FRAM, wherein 0 < N ≤ 1;

[0033] An interruption analysis processing module is configured to, when an unexpected interruption occurs during the charging process, automatically update the hot data structure in the FRAM, and after the power is restarted, compare the order current time in the hot data structure with a current time, if the comparison result is inconsistent, upload the hot data structure to a server, so that the server performs order settlement and issues an instruction;

[0034] A charging end processing module is configured to, after the charging is completed, check whether the check flag is an end charging flag, upload the hot data structure in the FRAM to the server, so that the server performs order settlement, issues an order completion instruction, and archives the hot data structure into a Flash.

[0035] In a third aspect, a computer readable storage medium is provided, the computer readable medium storing program codes for execution by a device, the program codes comprising instructions for performing the steps of the method in any one of the implementations of the first aspect.

[0036] In a fourth aspect, an electronic device is provided, the electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions, when executed by the processor, implementing the method in any one of the implementations of the first aspect.

[0037] The present application has the following beneficial effects: the present application stores frequently rewritten hot data such as active order data into FRAM which is resistant to writing operation by predefining a hot data structure body, and then batches the data into Flash when the order data is no longer updated and becomes cold data, so as to utilize the feature that data in FRAM will not be lost after power failure to ensure that order data will not be lost after power failure, and at the same time, greatly reduces the frequency of data erasing and writing operation on Flash, thereby effectively prolonging the service life of Flash. BRIEF DESCRIPTION OF DRAWINGS

[0038] The accompanying drawings, which form a part of the present application, are included to provide further understanding of the present application, and are incorporated herein for illustration only. The present application will be described and explained with additional specificity and detail through the use of the accompanying drawings in which:

[0039] The accompanying drawings, which form a part of the present application, are included to provide further understanding of the present application, and are incorporated herein for illustration only. The present application will be described and explained with additional specificity and detail through the use of the accompanying drawings in which:

[0040] Figure 1 is a flowchart of the charging order anti-power failure access method of the first embodiment of the present application;

[0041] Figure 2 is a flowchart of the server order settlement in the charging order anti-power failure access method of the first embodiment of the present application. DETAILED DESCRIPTION

[0042] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort belong to the scope of protection of the present application.

[0043] Embodiment one

[0044] The charging order anti-power-off access method related by the embodiment one of the application comprises: predefining a hot data structure body of a charging order, wherein the hot data structure body comprises a starting electric meter reading, a real-time electric meter reading, a difference value of each period electric meter reading, an order start time, an order current time and a check flag; obtaining the starting electric meter reading and the order start time when starting charging; updating the hot data structure body according to the starting electric meter reading and the order start time, and writing the updated data structure body into an FRAM; during the charging process, reading the real-time electric meter reading and the order current time every n seconds, updating the hot data structure body according to the real-time electric meter reading and the order current time, and writing the updated data structure body into the FRAM, wherein n is greater than 0; during the charging process, calculating the reading difference value of the current electric meter and the starting electric meter every N hours, updating the difference value of each period electric meter reading in the hot data structure body according to the reading difference value, and writing the updated data structure body into the FRAM, wherein 0 < N < 1; when an unexpected interruption occurs during the charging process, the hot data structure body in the FRAM is automatically updated, after power-on again, the order current time in the hot data structure body is compared with the current time, if the comparison result is inconsistent, the hot data structure body is uploaded to a server, so that the server performs order settlement and issues an instruction; after the charging is completed, the check flag is an end charging flag, the hot data structure body in the FRAM is uploaded to the server, so that the server performs order settlement, issues an instruction of completing the order, and archives the hot data structure body into a Flash, by predefining a hot data structure body, the hot data of the active order data and the like is stored into the FRAM with a high writing endurance, after the order end data is no longer updated and becomes cold data, the cold data is batched and stored into the Flash, so that the characteristics of the FRAM that the data is not lost after power-off is used to ensure that the order data is not lost after power-off, at the same time, the frequency of the data erasing and writing operation of the Flash is greatly reduced, so that the service life of the Flash can be effectively prolonged.

[0045] Specifically, Figure 1 The flowchart of the charging order anti-power-off access method in the embodiment one of the application is shown, comprising:

[0046] S101, predefining a hot data structure body of a charging order, wherein the hot data structure body comprises a starting electric meter reading, a real-time electric meter reading, a difference value of each period electric meter reading, an order start time, an order current time and a check flag;

[0047] Specifically, the data type of the starting electric meter reading is a double-precision floating point number, occupying 64 bits, used for storing the electric meter value when starting charging;

[0048] The data type of the real-time electric meter reading is a double-precision floating point number, occupying 64 bits, used for storing the real-time electric meter value of charging;

[0049] The data type of the electric meter reading difference of each period is a single-precision floating point number. For example, taking the longest charging time of 24 hours as an example, the length of each period is half an hour, and there are 48 periods in total. Therefore, the electric meter reading difference of each period occupies 48*32 bits, which is used to store the electric meter reading difference between each billing period in a step-by-step manner, i.e., the reading difference is calculated every half hour and stored in the corresponding position. The reading difference calculated every half hour occupies 32 bits, so the data of 24 hours occupies 48*32 bits, making the storage time of the reading difference of each half hour different, and the storage position of the reading difference corresponding to each half hour is also different. In this way, there is a corresponding data record every half hour, which facilitates the server to verify the legitimacy of the data;

[0050] The order start time adopts a format of 32-bit unix timestamp, occupying 32 bits, used for storing the start charging time, and the order current time adopts a format of 32-bit unix timestamp, occupying 32 bits, used for storing the real-time charging time;

[0051] The check flag is used to store order state information and cyclic redundancy check code, occupying 32 bits, and the hot data structure body is subjected to cyclic redundancy check every time the hot data structure body is updated. It should be noted that when the working state of the charging pile changes, the order state information also changes. The order state includes: starting charging, charging, charging interruption (power failure, software crash, etc.), order exception, resetting order (order after power failure and restart), and charging completion, etc. In addition, the cyclic redundancy check is performed on the hot data structure body using the CRC algorithm to determine whether the hot data structure body has been tampered with by illegal persons. Once it is found that the data has been tampered with, the order state is modified to order exception, and relevant personnel are notified for processing.

[0052] S102, obtaining the starting electric meter reading at the start of charging and the order start time;

[0053] S103, updating the hot data structure body according to the starting electric meter reading and the order start time, and writing the updated data structure body into the FRAM;

[0054] Specifically, when starting charging, the read starting electric meter reading is written into the starting electric meter reading position of the hot data structure, the order starting charging time is written into the order starting time position of the hot data structure, and "start charging" is written into the check flag position of the hot data structure, at this time, other positions (real-time electric meter reading, each period electric meter reading difference and order current time) of the hot data structure are empty, after the starting electric meter reading and order starting time are written, the hot data structure is checked by using the CRC algorithm to determine whether the hot data structure is tampered by the criminal.

[0055] S104, in the charging process, the real-time electric meter reading and the order current time are read every n seconds, the hot data structure is updated according to the real-time electric meter reading and the order current time, and the updated data structure is written into the FRAM, wherein n is greater than 0;

[0056] Specifically, n can be 0.5, 1, 2 or 3, and here n=1 is taken as an example, that is, in the charging process, the real-time electric meter reading and the order current time are read every 1 second, the hot data structure is updated according to the real-time electric meter reading and the order current time, and the hot data structure is checked by using the CRC algorithm to determine whether the hot data structure is tampered by the criminal, and then the updated data structure is written into the FRAM.

[0057] S105, in the charging process, the reading difference between the current electric meter and the starting electric meter is calculated every N hours, the hot data structure is updated according to the reading difference, and the updated data structure is written into the FRAM, wherein 0

[0058] Specifically, N can be 0.5, 0.8 or 1, and here N=1 is taken as an example, that is, the reading difference between the current electric meter and the starting electric meter is calculated every 1 hour, so that the electric quantity deducted every hour can be calculated, and through analysis of the past charging data, a normal range of the electric quantity deducted every hour can be obtained, so that when the electric quantity deducted every hour exceeds the normal range, it can be judged that the order is abnormal (for example, it is almost impossible for a 30KW charging pile to charge 32 degrees of electricity in an hour, if the electric quantity deducted in an hour exceeds 32 degrees, it can be determined that the current order is abnormal, and a notification can be sent to the relevant personnel for processing), the hot data structure is updated according to the reading difference, and the hot data structure is checked by using the CRC algorithm to determine whether the hot data structure is tampered by the criminal, and then the updated data structure is written into the FRAM, wherein updating the data structure is a process of assigning data by address, for example, the pointer data of a structure is read, and the data is directly stored in the corresponding address by address.

[0059] S106, when an unexpected interruption occurs during the charging process, the hot data structure in the FRAM is automatically updated, after power-on, the current time in the hot data structure is compared with the current time, if the comparison result is inconsistent, the hot data structure is uploaded to the server to make the server settle the order and issue an instruction;

[0060] Specifically, when the charging pile has an unexpected interruption (power failure, software crash, etc.), the FRAM can guarantee the completion of the current write or read in the low power mode (low power mode is caused by abnormal power-off of the charging pile, which is a process of the charging pile entering power-off, but because there are some capacitors on the mainboard, the capacitor will have a discharge process after power-off, and there will be a little time to work during this time). After power-off or crash, the hot data in the FRAM will be updated, and the FRAM has the feature of not losing data after power-off. After resetting, reading the structure information in the FRAM will compare the time and find that the time is not unified, so the order state information in the hot data structure is modified to reset the order and upload to the server. After the server completes the settlement, it will issue an instruction, which includes but is not limited to continue charging instruction, charging exception instruction and charging end instruction. In this way, it can be ensured that the order will not be lost. The main function of the instruction here is to give the charging pile a subsequent processing method. If the charging is completed, the instruction is to complete the charging. If the charging can continue, the instruction is to continue the charging. If an exception occurs, the corresponding error number will be issued, and the corresponding error number will be changed, for example: "order exception: 00000C301 (error number)".

[0061] S107, after the charging is completed, the hot data structure in the FRAM is uploaded to the server to make the server settle the order, issue an instruction to complete the order, and archive the hot data structure into the Flash.

[0062] For example, please refer to Figure 2 , the order settlement includes:

[0063] S701, receiving a hot data structure;

[0064] S702, judging the legitimacy of the hot data structure by calculating the charging amount of each period;

[0065] Specifically, when judging the legitimacy of the hot data structure, by analyzing the past charging data, a normal range of subtracted power per hour can be obtained, so when the subtracted power per hour exceeds the normal range, the order exception can be judged.

[0066] S703, if the hot data structure is illegal, issuing a charging failure instruction;

[0067] S704, if the hot data structure is legal, checking whether the hot data structure is tampered through a cyclic redundancy check;

[0068] Specifically, when judging whether the hot data structure is tampered, the CRC (cyclic redundancy check) algorithm is used to check the hot data structure to determine whether the hot data structure is tampered by illegal persons.

[0069] S705, if the hot data structure is tampered, issuing a charging failure instruction;

[0070] S706, if the hot data structure is not tampered, charging the user;

[0071] S707, after the charge is completed, issuing a complete charging instruction.

[0072] The server will verify the legality of the hot data structure and whether it is tampered after receiving the hot data structure. After verification, the user will be charged, thereby ending the charging to prepare for receiving the next customer's charging request.

[0073] In addition, after receiving the hot data structure, the server can also obtain the current order state by checking the order state information stored in the flag position, so as to determine whether the current order is a normal order or a reset order after the charging pile power failure restarts.

[0074] Embodiment two

[0075] The charging order anti-power failure access device provided in the embodiment two of the application comprises:

[0076] A predefinition module is configured to predefine a hot data structure of a charging order, wherein the hot data structure comprises a starting electric meter reading, a real-time electric meter reading, a difference value of each period electric meter reading, an order start time, an order current time, and a check flag.

[0077] An acquisition module is configured to acquire the starting electric meter reading and the order start time when starting charging.

[0078] A first updating module is configured to update the hot data structure according to the starting electric meter reading and the order start time, and write the updated data structure into an FRAM.

[0079] a second updating module, configured to read real-time electric meter reading and order current time every n seconds during the charging process, update the hot data structure according to the real-time electric meter reading and the order current time, and write the updated data structure into the FRAM, wherein n is greater than 0;

[0080] a third updating module, configured to calculate the reading difference between the current electric meter and the starting electric meter every N hours during the charging process, update the electric meter reading difference of each time period in the hot data structure according to the reading difference, and write the updated data structure into the FRAM, wherein 0 < N < 1;

[0081] an interrupt analysis processing module, configured to, when an unexpected interrupt occurs during the charging process, automatically update the hot data structure in the FRAM, and after power-on again, compare the order current time in the hot data structure with the current time, and if the comparison result is inconsistent, upload the hot data structure to the server, so that the server performs order settlement and issues an order completion instruction;

[0082] a charging end processing module, configured to, after the charging is completed, verify that the flag is an end charging flag, upload the hot data structure in the FRAM to the server, so that the server performs order settlement, issues an order completion instruction, and archives the hot data structure into the Flash.

[0083] Embodiment Three

[0084] The computer readable storage medium involved in Embodiment Three of the present application stores program code for execution by a device, and the program code includes steps for executing the method in any one of the implementation manners in Embodiment One of the present application.

[0085] The computer readable storage medium can be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The computer readable storage medium can store program code, and when the program stored in the computer readable storage medium is executed by a processor, the processor is configured to execute the steps of the method in any one of the implementation manners in Embodiment One of the present application.

[0086] Embodiment Four

[0087] The electronic device involved in Embodiment Four of the present application includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, the method in any one of the implementation manners in Embodiment One of the present application is implemented.

[0088] The processor can be a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU), or one or more integrated circuits, for executing programs to implement the methods in any of the implementation manners in Embodiment One of the present application.

[0089] The processor can also be an integrated circuit electronic device with a processing capability of signals. In the implementation process, each step of the method in any of the implementation manners in Embodiment One of the present application can be completed by the integrated logic circuit of hardware in the processor or the instructions in the form of software.

[0090] The processor can also be a general-purpose processor, a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block diagram disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware code processor to execute, or be executed by a combination of hardware and software modules in the code processor. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, or other mature storage medium in the art. The storage medium is located in the memory, and the processor reads the information in the memory, and combines the hardware to complete the functions required by the units in the data processing device of the embodiments of the present application, or executes the method in any of the implementation manners in Embodiment One of the present application.

[0091] The above is only the preferred specific implementation manner of the present application; however, the protection scope of the present application is not limited to this. Any skilled person in the art can make equivalent replacements or changes to the technical range disclosed in the present application according to the technical solutions and the improved concept of the present application, which should be covered in the protection scope of the present application.

Claims

1. A method for storing and retrieving charging orders against power failure, characterized in that, include: A predefined hot data structure for charging orders is defined, which includes the initial meter reading, real-time meter reading, meter reading difference for each time period, order start time, order current time, and verification flag. Obtain the initial meter reading and order start time when charging begins; The thermal data structure is updated based on the initial meter reading and the order start time, and the updated data structure is written into FRAM. During the charging process, the real-time electricity meter reading and the current order time are read every n seconds. The hot data structure is updated based on the real-time electricity meter reading and the current order time, and the updated data structure is written into FRAM, where n is greater than 0. During the charging process, the difference between the current meter reading and the initial meter reading is calculated every N hours. Based on this difference, the meter reading differences for each time period in the thermal data structure are updated, and the updated data structure is written into FRAM. Where 0 <N≤1; When an unexpected interruption occurs during charging, the hot data structure in the FRAM is automatically updated. After power is restored, the current time of the order in the hot data structure is compared with the current time. If the comparison results are inconsistent, the hot data structure is uploaded to the server so that the server can process the order settlement and issue instructions. After charging is completed, the verification flag is set to the end of charging flag. The hot data structure in FRAM is then uploaded to the server so that the server can process the order settlement, issue the order completion instruction, and archive the hot data structure into Flash.

2. The charging order anti-power-loss storage and retrieval method according to claim 1, characterized in that, The initial meter reading uses a double-precision floating-point data type to store the meter value at the start of charging.

3. The charging order anti-power-loss access method according to claim 1, characterized in that, The real-time meter readings are stored using a double-precision floating-point data type, which stores the real-time meter values ​​for charging.

4. The charging order anti-power-loss storage and retrieval method according to claim 1, characterized in that, The data type used for the meter reading differences in each time period is single-precision floating-point number, which is used to store the meter reading differences between each billing period in a step-by-step manner.

5. The charging order anti-power-loss storage and retrieval method according to claim 1, characterized in that, The order start time uses a 32-bit Unix timestamp format to store the start charging time, and the order current time uses a 32-bit Unix timestamp format to store the real-time charging time.

6. The charging order anti-power-loss storage and retrieval method according to claim 1, characterized in that, The verification flag is used to store order status information and cyclic redundancy check codes, and the hot data structure is subjected to cyclic redundancy check every time it is updated.

7. The charging order anti-power-loss access method according to any one of claims 1-6, characterized in that, The order settlement includes: Receive thermal data structure; The validity of the thermal data structure is determined by calculating the charging amount in each time period; If the hot data structure is invalid, a charging failure command is issued; If the hot data structure is valid, then cyclic redundancy check is performed to verify whether the hot data structure has been tampered with. If the thermal data structure is tampered with, a charging failure command will be issued; If the hot data structure has not been tampered with, the user will be charged. Once the payment is deducted, a charging completion instruction will be issued.

8. A charging order anti-power-loss storage and retrieval device, characterized in that, include: The predefined module is used to predefine the thermal data structure of charging orders. The thermal data structure includes the initial meter reading, real-time meter reading, meter reading difference for each time period, order start time, order current time, and verification flag. The acquisition module is used to acquire the initial meter reading and order start time when charging is started. The first update module is used to update the thermal data structure based on the initial meter reading and the order start time, and write the updated data structure into FRAM. The second update module is used to read the real-time electricity meter reading and the current order time every n seconds during the charging process, update the thermal data structure according to the real-time electricity meter reading and the current order time, and write the updated data structure into FRAM, where n is greater than 0; The third update module is used to calculate the difference between the current meter reading and the initial meter reading every N hours during the charging process. Based on this difference, it updates the meter reading differences for each time period in the thermal data structure and writes the updated data structure into FRAM. Where 0... <N≤1; The interrupt analysis and processing module is used to automatically update the hot data structure in FRAM when an unexpected interruption occurs during charging. After power is restored, the current time of the order in the hot data structure is compared with the current time. If the comparison results are inconsistent, the hot data structure is uploaded to the server so that the server can process the order settlement and issue instructions. The charging completion processing module is used to verify the charging completion flag after charging is completed, upload the hot data structure in FRAM to the server so that the server can process the order settlement, issue the order completion instruction, and archive the hot data structure into Flash.

9. A computer-readable storage medium, characterized in that, The computer-readable medium stores program code for execution by the device, the program code including steps for performing the method as described in any one of claims 1-7.

10. An electronic device, characterized in that, The electronic device includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Intelligent hydroelectric pile system and control method thereof

    CN107274562A

  • Effective storage mode for recorder

    CN110515560A