Off-line and power-down order processing method and device of AC charging pile, and electronic equipment
By triggering the data storage coroutine in the AC charging pile system and storing the order information as offline records, the problem of order information loss during network interruption or power outage is solved, and the completeness and accuracy of the data are achieved.
Patent Information
- Application Number
- CN202510150525.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-06-17
AI Technical Summary
The existing AC charging pile system cannot report order information and charging data in a timely manner when the network is interrupted or powered off, resulting in users being unable to charge normally or order information is lost.
The data saving coroutine is triggered when the charging pile is offline or powered off, query the order being charged in the database, and store the current value in the offline folder every first preset time as an offline record. After the charging pile is online, an offline record will be uploaded every second preset time.
Ensure that in the event of network interruption or limited Internet access environment, order information and charging data can be stored in advance, and then submitted to the platform after it is online, ensuring the integrity and accuracy of the data and avoiding the loss of order information.
Smart Images

Figure CN120163534A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric vehicle charging, and in particular, to a method, device and electronic device for processing offline and power-off orders of an AC charging pile. Background Art
[0002] In the existing AC charging pile system, when the network is interrupted or a power outage occurs, order information and charging data cannot be reported to the platform in a timely manner, resulting in users being unable to charge normally or order information being lost. Summary of the Invention
[0003] To solve the existing technical problems, embodiments of the present invention provide a method, device, electronic device and computer-readable storage medium for processing offline and power-off orders of an AC charging pile.
[0004] In a first aspect, embodiments of the present invention provide a method for processing offline and power-off orders of an AC charging pile, including: triggering a data saving coroutine in the case of the charging pile being offline or powered off; querying the database for orders being charged and determining whether the order is single-phase or three-phase; storing the current value in an offline folder as an offline record every first preset time, where the format of the offline record is a lightweight data exchange format; and uploading one of the offline records every second preset time in the case of the charging pile being online.
[0005] Optionally, the method further includes: a User Datagram Protocol (UDP) coroutine; the UDP coroutine is used to save status information to a status notification file.
[0006] Optionally, the status information at least includes: a status change parameter and an error code change parameter.
[0007] Optionally, uploading one of the offline records every second preset time includes: traversing the offline folder and uploading the offline record corresponding to the order number in descending order of the order number.
[0008] Optionally, after uploading one of the offline records every second preset time, the method further includes: determining whether there are unsynchronized orders in the offline folder; if so, continuing to upload one of the offline records every second preset time and deleting the uploaded offline records in the offline folder.
[0009] Optionally, the method further includes: if the internal data records in a single charging order file in the offline folder are full, deleting the historical data with the earliest creation time in the internal data records of the charging order file; if the internal data records in the offline folder are full, deleting the offline record corresponding to the charging order with the earliest creation time in the offline folder.
[0010] In a second aspect, an embodiment of the present invention further provides an off-line and power-off order processing device for an AC charging pile, including: a startup module, an order query module, a data storage module, and a data upload module; the startup module is used to trigger a data storage coroutine when the charging pile is off-line or powered off; the order query module is used to query the database for the orders being charged and determine whether the order is single-phase or three-phase; the data storage module is used to store the current value in an off-line folder as an off-line record every first preset time, and the format of the off-line record is a lightweight data exchange format; the data upload module is used to upload one off-line record every second preset time when the charging pile goes online.
[0011] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, the memory stores a computer program, the processor executes the computer program stored in the memory, and when the computer program is executed by the processor, it implements the off-line and power-off order processing method for the AC charging pile described in the first aspect above.
[0012] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the off-line and power-off order processing method for the AC charging pile described in the first aspect above.
[0013] In a fifth aspect, the present application further provides a computer program product, including a computer program, which when executed, can implement the off-line and power-off order processing method for the AC charging pile described in the first aspect or any possible design manner of the first aspect.
[0014] The off-line and power-off order processing method, device, electronic device, and computer-readable storage medium for the AC charging pile provided by the embodiments of the present invention can pre-store order information and charging data in the case of network interruption or limited Internet access environment, and then report them to the platform after going online, ensuring the integrity and accuracy of the data and avoiding the loss of order information. Moreover, for data storage, the order information is saved in the form of a local file, and the file content is stored in json format, which is convenient for subsequent upload and processing. After the network is restored, the off-line records can be uploaded at a certain time interval to ensure the timeliness and integrity of the data. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the following will describe the drawings required to be used in the embodiments of the present invention or the background technology.
[0016] Figure 1 The flowchart of an off-line and power-off order processing method for an AC charging pile provided by an embodiment of the present invention is shown;
[0017] Figure 2 Shows a detailed process schematic diagram of an embodiment of the present invention in practical applications;
[0018] Figure 3 Shows a specific process schematic diagram describing how the system performs different operations according to different conditions when processing offline files;
[0019] Figure 4 Shows a specific process schematic diagram describing the processing logic of a charging pile under different startup methods, including remote startup and local startup, as well as different processing flows in online and offline states;
[0020] Figure 5 Shows a structural schematic diagram of an offline and power-off order processing device for an AC charging pile provided by an embodiment of the present invention;
[0021] Figure 6 Shows a structural schematic diagram of an electronic device for executing an offline and power-off order processing method for an AC charging pile provided by an embodiment of the present invention. Detailed implementation manners
[0022] The embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.
[0023] Figure 1 Shows a flowchart of an offline and power-off order processing method for an AC charging pile provided by an embodiment of the present invention. As Figure 1 shown, the method includes the following steps 101-104.
[0024] Step 101: Trigger a data saving coroutine when the charging pile is offline or powered off.
[0025] As Figure 2 shown, Figure 2 Shows a detailed process schematic diagram of an embodiment of the present invention in practical applications. When the charging pile is offline or disconnected, a data saving coroutine is automatically triggered, that is, the process of offline saving of order data is entered.
[0026] Step 102: Query the database for orders that are being charged and determine whether the order is single-phase or three-phase.
[0027] Specifically, during the data saving process, it is possible to automatically query in the database of the charging pile system whether there is currently an order being charged. If so, it is determined whether the order is a single-phase charging order or a three-phase charging order.
[0028] Step 103: Store the current value in the offline folder as an offline record every first preset time, and the format of the offline record is a lightweight data interchange format.
[0029] Among them, the first preset time can be any time interval preset in advance. According to actual applications, the first preset time can be set to 60 seconds, that is, every 60 seconds, the current value (i.e., MeterValue) is automatically stored in the offline folder. It can be understood that this offline folder is located in the database. As Figure 2 shown, after determining whether the current charging order is single-phase or three-phase based on the above step 102, the single-phase MeterValue can be stored in the corresponding offline folder, and the three-phase MeterValue can also be stored in the corresponding offline folder as an offline record (such as start.metervalue.stop). It should be noted that the embodiment of the present invention adopts a lightweight data exchange format (i.e., json) as the format for storing offline records, which is convenient for subsequent uploading and processing.
[0030] For example, create a new offline file named with the local order number in the home / offlinedata directory and store the file content in json format.
[0031] Step 104: When the charging pile is online, upload an offline record every second preset time.
[0032] As Figure 2 shown, when the charging pile system is offline or disconnected, in addition to automatically triggering the data saving coroutine, a reconnection coroutine also needs to be started. As the name implies, the reconnection coroutine is a program for reconnection. If the charging pile is in an online state through the reconnection coroutine, the embodiment of the present invention needs to upload an offline record previously saved during the offline or power-off period every second preset time. Among them, based on actual usage, the second preset time can be set to 2 seconds, that is, upload an offline record every 2 seconds, so as to ensure that users can still charge normally in the case of offline or power-off, and supplement and report the order information to the platform after the network is restored.
[0033] Through the method for processing offline and power-off orders of the AC charging pile provided by the embodiment of the present invention, in the case of network interruption or limited Internet access environment, order information and charging data can be pre-stored and then reported to the platform after going online, ensuring the integrity and accuracy of the data and avoiding the loss of order information. Moreover, for data storage, the order information is saved in the form of local files, and the file content is stored in json format, which is convenient for subsequent uploading and processing. After the network is restored, the offline records can be uploaded at a certain time interval to ensure the timeliness and integrity of the data.
[0034] Optionally, as Figure 2As shown, the method further includes: a User Datagram Protocol coroutine, i.e., a UDP coroutine. In the embodiment of the present invention, by automatically starting the User Datagram Protocol coroutine in the case of offline or power-off, the status information of the order being charged can be saved to a status notification file, such as status_notifications.json. Optionally, the above status information at least includes: a status change parameter and an error code change parameter.
[0035] Optionally, step 104 "upload an offline record every second preset time" may include the following steps A.
[0036] Step A: Traverse the offline folder, and upload the offline records corresponding to the order numbers in descending order of the order numbers.
[0037] For multiple offline files existing in the offline folder, when it is necessary to upload offline records, the offline files corresponding to the order ids stored in the database can be traversed according to the order numbers (such as id numbers). For example, if there are two offline files with order ids 34 and 35 at this time, that is, metervalue34.json and metervalue35.json exist in home / offlinedata. Since the order with a larger id is the order closest to the current time, then, the offline file corresponding to order number 35 can be synchronized first, and then the offline file corresponding to order number 34 can be synchronized until all unsynchronized orders are processed. During the process of processing a single order, ensure that all information of start, metervalue, and stop is transmitted. If the transmission is not completed due to network disconnection, then continue the transmission after going online until all orders are transmitted.
[0038] Optionally, as Figure 2 shown, after step 104 "upload an offline record every second preset time" above, the method further includes the following steps B.
[0039] Step B: Determine whether there are unsynchronized orders in the offline folder; if so, continue to upload an offline record (such as start.metervalue.stop) every second preset time (such as 2 seconds), and delete the uploaded offline records in the offline folder. It should be noted that this step B can be set as a loop step, by repeatedly determining whether there are unsynchronized orders in the offline folder, executing the subsequent offline record upload steps, or ending the process.
[0040] In addition, if the network is restored and then disconnected again during the upload process, or a certain offline record upload fails, it remains in the offline folder. New offline records continue to be added later, and continue to be uploaded in sequence (in reverse order) after the network is restored.
[0041] Optionally, the method may further include the following step C.
[0042] Step C: If the internal data record in a single charging order file in the offline folder is full, delete the historical data with the earliest creation time in the internal data record of the charging order file; if the internal data record in the offline folder is full, delete the offline record corresponding to the charging order with the earliest creation time in the offline folder (such as offlinedata).
[0043] For example, the number of offline records that can be stored in the offline folder can be set to 500. After exceeding 500, the file with the farthest historical time, that is, the historical data with the earliest creation time, can be deleted.
[0044] In addition, as Figure 3 shown, the embodiment of the present invention also provides a specific flowchart to describe how the system performs different operations according to different conditions when processing offline files. This process mainly involves the check of transaction ID, order number, order synchronization status, and order status, and performs corresponding supplementary reporting operations according to different conditions. The specific process is as follows:
[0045] 1. Check whether the offline file exists: If the offline file does not exist, the process ends.
[0046] 2. Check whether the transaction ID and order number exist: If transactionID == 0 || CheckOrderNumberExists transactionID == false, the process ends. Among them, the TransactionId field: represents the order number responded by the platform after the charging pile synchronizes with the platform when the charging starts. CheckOrderNumberExists means: check whether the order number exists.
[0047] 3. Check the order synchronization status: If OrderSync == 0, the process ends. Among them, the OrderSync field is 1: represents that all information of this order has been synchronized to the platform. The OrderSync field is 0: represents that it has not been fully synchronized.
[0048] 4. Check if the transaction ID is 0: If TransactionId != 0, then check OrderStatus: If OrderStatus == 1, start the offline and online charging completion, report the supplementary start, and then start the offline and online charging completion, report the supplementary stop. Among them, the OrderStatus field represents that regardless of whether the pile is connected to the network, the local order charging is completed. If TransactionId == 0, then check OrderStatus: If OrderStatus == 1, start the offline and online charging in progress, report the supplementary start, and then start the offline and online charging in progress, report the power and status. If OrderStatus != 1, start the offline and online charging in progress, report the supplementary start, and then start the offline and online charging in progress, report the supplementary stop.
[0049] In addition, as Figure 4 shown, the embodiments of the present invention also provide specific flowcharts to describe the processing logic of the charging pile under different startup modes, including remote startup and local startup, as well as different processing flows in online and offline states. The specific process includes:
[0050] 1. Select the charging method: The user selects the charging method, which is divided into remote startup and local startup.
[0051] 2. Remote startup: Call RemoteStart (remote startup). If the charging pile is in the offline state: The platform responds with reject (reject), and the process ends. If the charging pile is in the online state: The platform responds with accept (accept), the charging pile terminal uploads Authorize (authorization), the platform responds with reject (reject), and the process ends; the platform responds with accept (accept). Start charging: The charging pile terminal sends StartTransaction.
[0052] 2. Local startup: The user selects plug-and-charge ("PLUG"), Bluetooth startup ("BLE"), charging point card swiping startup ("XXXX"), reservation charging ("PLAN" when starting). If the charging pile is in the offline state: Locally save Authorize (authorization), the charging pile starts directly, and locally save StartTransaction. If the charging pile is in the online state: Upload the locally saved offline data, that is, the charging pile terminal uploads Authorize (authorization), the platform responds with reject (reject), and the process ends; the platform responds with accept (accept), start charging: The charging pile terminal sends StartTransaction.
[0053] It can be understood that both remote startup and local startup involve the judgment of the online and offline states of the charging pile. In the online state, multiple responses and confirmations (accept) from the platform are required to start charging. In the offline state, the authorization information is locally saved and the data is uploaded after the charging pile goes online. When starting charging, the charging pile sends StartTransaction.
[0054] The above text has described in detail the method for processing offline and power-off orders of the AC charging pile provided by the embodiments of the present invention. This method can also be implemented by a corresponding device. Next, the device for processing offline and power-off orders of the AC charging pile provided by the embodiments of the present invention will be described in detail.
[0055] Figure 5 The structural schematic diagram of a device for processing offline and power-off orders of an AC charging pile provided by an embodiment of the present invention is shown. As Figure 5 shown, the device for processing offline and power-off orders of the AC charging pile includes a processor. The processor includes: a startup module 51, an order query module 52, a data saving module 53, and a data uploading module 54;
[0056] The startup module 51 is used to trigger a data saving coroutine when the charging pile is offline or powered off.
[0057] The order query module 52 is used to query the database for the orders that are being charged and determine whether the orders are single-phase or three-phase.
[0058] The data saving module 53 is used to store the current value into an offline folder as an offline record every first preset time, and the format of the offline record is a lightweight data exchange format.
[0059] The data uploading module 54 is used to upload one of the offline records every second preset time when the charging pile goes online.
[0060] Optionally, the device further includes: a User Datagram Protocol coroutine module; the User Datagram Protocol coroutine module is used to save the status information to a status notification file.
[0061] Optionally, the status information at least includes: a status change parameter and an error code change parameter.
[0062] Optionally, the data uploading module 54 includes: a traversing unit.
[0063] The traversing unit is used to traverse the offline folder and upload the offline records corresponding to the order numbers in descending order of the order numbers.
[0064] Optionally, the device further includes: an uploading module.
[0065] The uploading module is used to determine whether there are unsynchronized orders in the offline folder; if so, continue to upload one offline record every second preset time, and delete the uploaded offline records in the offline folder.
[0066] Optionally, the device further includes: a deletion module.
[0067] The deletion module is used to, if the internal data records in a single charging order file in the offline folder are full, delete the historical data with the earliest creation time in the internal data records of the charging order file; if the internal data records in the offline folder are full, delete the offline records corresponding to the charging order with the earliest creation time in the offline folder.
[0068] The device provided by the embodiment of the present invention can pre-store order information and charging data in the case of network interruption or limited Internet access environment, and then report them to the platform after going online, ensuring the integrity and accuracy of the data and avoiding the loss of order information. Moreover, for data storage, the order information is saved in the form of a local file, and the file content is stored in json format, which is convenient for subsequent uploading and processing. After the network is restored, the offline records can be uploaded at a certain time interval to ensure the timeliness and integrity of the data.
[0069] It should be noted that when the offline and power-off order processing device of the AC charging pile provided in the above embodiment realizes the corresponding functions, only the above-mentioned division of each functional module is used as an example. In actual application, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the offline and power-off order processing device of the AC charging pile provided in the above embodiment and the embodiment of the offline and power-off order processing method of the AC charging pile belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0070] According to one aspect of the present application, the embodiment of the present invention further provides a computer program product, which includes a computer program, and the computer program includes program codes for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part. When the computer program is executed by the processor, it executes the offline and power-off order processing method of the AC charging pile provided by the embodiment of the present application.
[0071] In addition, an embodiment of the present invention further provides an electronic device, including a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor. The transceiver, the memory, and the processor are respectively connected through the bus. When the computer program is executed by the processor, it implements each process of the above-mentioned embodiment of the method for processing offline and power-off orders of the AC charging pile, and can achieve the same technical effects. To avoid repetition, details are not described herein again.
[0072] Specifically, referring to Figure 6 As shown in the figure, the electronic device includes a bus 1110, a processor 1120, a transceiver 1130, a bus interface 1140, a memory 1150, and a user interface 1160.
[0073] In an embodiment of the present invention, the electronic device further includes: a computer program stored in the memory 1150 and executable on the processor 1120. When the computer program is executed by the processor 1120, it implements each process of the above-mentioned embodiment of the method for processing offline and power-off orders of the AC charging pile.
[0074] The transceiver 1130 is configured to receive and send data under the control of the processor 1120.
[0075] In an embodiment of the present invention, the bus architecture (represented by the bus 1110), the bus 1110 may include any number of interconnected buses and bridges. The bus 1110 connects various circuits including one or more processors represented by the processor 1120 and the memory represented by the memory 1150 together.
[0076] The bus 1110 represents one or more of any of several types of bus structures, including a memory bus and a memory controller, a peripheral bus, an Accelerate Graphical Port (AGP), a processor, or a local bus using any bus structure in various bus architectures. By way of example and not limitation, such architectures include: Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA), Peripheral Component Interconnect (PCI) bus.
[0077] The processor 1120 can be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method embodiments can be completed by the integrated logic circuit in the hardware of the processor or instructions in the form of software. The above-mentioned processor includes: general-purpose processor, central processing unit (CPU), network processor (NP), digital signal processor (DSP), application specific integrated circuit (ASIC), field programmable gate array (FPGA), complex programmable logic device (CPLD), programmable logic array (PLA), microcontroller unit (MCU), or other programmable logic devices, discrete gates, transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. For example, the processor can be a single-core processor or a multi-core processor, and the processor can be integrated on a single chip or located on multiple different chips.
[0078] The processor 1120 can be a microprocessor or any conventional processor. The method steps disclosed in combination with the embodiments of the present invention can be directly executed and completed by the hardware decoding processor, or executed and completed by a combination of the hardware and software modules in the decoding processor. The software module can be located in a readable storage medium well known in the art, such as random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), registers, etc. The readable storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above method.
[0079] The bus 1110 can also connect together various other circuits, such as peripheral devices, voltage regulators, or power management circuits. The bus interface 1140 provides an interface between the bus 1110 and the transceiver 1130, which are all well known in the art. Therefore, the embodiments of the present invention will not describe them further.
[0080] The transceiver 1130 can be a single component or multiple components, such as multiple receivers and transmitters, providing units for communicating with various other devices over a transmission medium. For example, the transceiver 1130 receives external data from other devices, and the transceiver 1130 is used to send the data processed by the processor 1120 to other devices. Depending on the nature of the computer system, a user interface 1160 may also be provided, such as: a touch screen, a physical keyboard, a display, a mouse, speakers, a microphone, a trackball, a joystick, a stylus.
[0081] It should be understood that in the embodiments of the present invention, the memory 1150 may further include memories remotely located relative to the processor 1120, and these remotely located memories can be connected to the server through a network. One or more parts of the above networks can be an ad hoc network, an intranet, an extranet, a virtual private network (VPN), a local area network (LAN), a wireless local area network (WLAN), a wide area network (WAN), a wireless wide area network (WWAN), a metropolitan area network (MAN), the Internet, a public switched telephone network (PSTN), a plain old telephone service network (POTS), a cellular telephone network, a wireless network, a Wi-Fi network, and a combination of two or more of the above networks. For example, the cellular telephone network and the wireless network can be a Global System for Mobile Communications (GSM) system, a Code Division Multiple Access (CDMA) system, a Worldwide Interoperability for Microwave Access (WiMAX) system, a General Packet Radio Service (GPRS) system, a Wideband Code Division Multiple Access (WCDMA) system, a Long Term Evolution (LTE) system, an LTE Frequency Division Duplex (FDD) system, an LTE Time Division Duplex (TDD) system, an Advanced Long Term Evolution (LTE-A) system, a Universal Mobile Telecommunications System (UMTS) system, an Enhance Mobile Broadband (eMBB) system, a massive Machine Type of Communication (mMTC) system, an UltraReliable Low Latency Communications (uRLLC) system, etc.
[0082] It should be understood that the memory 1150 in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory includes: Read-Only Memory (ROM), Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), or Flash Memory.
[0083] The volatile memory includes: Random Access Memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as: Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 1150 of the electronic device described in the embodiments of the present invention includes but is not limited to the above and any other suitable types of memory.
[0084] In the embodiments of the present invention, the memory 1150 stores the following elements of the operating system 1151 and the application program 1152: executable modules, data structures, or subsets thereof, or extended sets thereof.
[0085] Specifically, the operating system 1151 includes various system programs, such as: framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application program 1152 includes various application programs, such as: Media Player, Browser, for implementing various application services. The program for implementing the method of the embodiments of the present invention may be included in the application program 1152. The application program 1152 includes: applets, objects, components, logics, data structures, and other computer system executable instructions for performing specific tasks or implementing specific abstract data types.
[0086] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements each process of the above-described embodiment of the method for processing offline and power-off orders of the AC charging pile, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0087] A computer-readable storage medium includes: permanent and non-permanent, removable and non-removable media, which are tangible devices that can retain and store instructions for use by an instruction execution device. A computer-readable storage medium includes: electronic storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, and any suitable combination of the above. A computer-readable storage medium includes: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), non-volatile random access memory (NVRAM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tape storage, magnetic tape disk storage or other magnetic storage devices, memory sticks, mechanical encoding devices (such as punched cards or raised structures in grooves on which instructions are recorded), or any other non-transmission medium that can be used to store information accessible by a computing device. As defined in the embodiments of the present invention, a computer-readable storage medium does not include transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagated through a waveguide or other transmission medium (such as light pulses passing through an optical fiber cable), or electrical signals transmitted through wires.
[0088] In several embodiments provided in the present application, it should be understood that the disclosed devices, electronic devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Additionally, the displayed or discussed couplings or direct couplings or communication connections to each other can be indirect couplings or communication connections through some interfaces, devices, or units, and can also be in electrical, mechanical, or other forms of connection.
[0089] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units. They can be located in one position or distributed to multiple network units. Some or all of the units can be selected according to actual needs to solve the problems to be solved by the solution of the embodiments of the present invention.
[0090] In addition, in each embodiment of the present invention, each functional unit may be integrated into a processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit.
[0091] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (including a personal computer, a server, a data center or other network devices) to execute all or part of the steps of the methods described in the embodiments of the present invention. And the above-mentioned storage medium includes various media that can store program codes as listed above.
[0092] In the description of the embodiments of the present invention, those skilled in the art should know that the embodiments of the present invention can be implemented as a method, a device, an electronic device and a computer-readable storage medium. Therefore, the embodiments of the present invention can be specifically implemented in the following forms: completely hardware, completely software (including firmware, resident software, microcode, etc.), and a combination of hardware and software. In addition, in some embodiments, the embodiments of the present invention can also be implemented in the form of a computer program product in one or more computer-readable storage media, and the computer-readable storage medium contains computer program code.
[0093] The above-mentioned computer-readable storage media may adopt any combination of one or more computer-readable storage media. Computer-readable storage media include: electrical, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or components, or any combination of the above. More specific examples of computer-readable storage media include: portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROMs), flash memories, optical fibers, compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any combination of the above. In the embodiments of the present invention, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, device or component.
[0094] The computer program code included in the above computer-readable storage medium can be transmitted by any suitable medium, including: wireless, wire, optical fiber cable, radio frequency (RF), or any suitable combination of the above.
[0095] The computer program code for performing the operations of the embodiments of the present invention can be written in assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, status setting data, integrated circuit configuration data, or in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as C language or similar programming languages. The computer program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, and entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including: local area network (LAN) or wide area network (WAN), and can also be connected to an external computer.
[0096] The embodiments of the present invention describe the provided methods, devices, and electronic devices through flowcharts and / or block diagrams.
[0097] It should be understood that each block of the flowchart and / or block diagram, and the combinations of blocks in the flowchart and / or block diagram, can be implemented by computer-readable program instructions. These computer-readable program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine. These computer-readable program instructions, when executed by a computer or other programmable data processing device, produce a device that implements the functions / operations specified in the blocks of the flowchart and / or block diagram.
[0098] These computer-readable program instructions can also be stored in a computer-readable storage medium that enables a computer or other programmable data processing device to work in a specific manner. In this way, the instructions stored in the computer-readable storage medium produce an instruction device product that includes the instructions for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.
[0099] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices, causing a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other devices to generate a computer-implemented process, so that the instructions executed on the computer or other programmable data processing apparatus can provide a process for realizing the functions / operations specified in the blocks of the flowchart and / or block diagram.
[0100] As described above, the above are only specific embodiments of the embodiments of the present invention, but the protection scope of the embodiments of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the embodiments of the present invention can easily think of changes or substitutions, which should all be covered within the protection scope of the embodiments of the present invention. Therefore, the protection scope of the embodiments of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for processing offline and power-off orders of AC charging piles, characterized in that: include: When the charging pile is offline or powered off, the data saving coroutine is triggered; The database queries the order being charged and determines whether the order is single-phase or three-phase; storing the current value in an offline folder as an offline record at a first preset time interval, wherein the format of the offline record is a lightweight data exchange format; When the charging pile is online, one offline record is uploaded every second preset time.
2. The method according to claim 1, characterized in that Also includes: User Datagram Protocol coroutine; the User Datagram Protocol coroutine is used to save the status information to the status notification file.
3. The method according to claim 2, characterized in that The state information at least includes: a state change parameter and an error code change parameter.
4. The method according to claim 1, characterized in that: The step of uploading one offline record every second preset time period includes: The offline folder is traversed, and the offline records corresponding to the order numbers are uploaded in descending order of order numbers.
5. The method according to claim 1, characterized in that After uploading one offline record every second preset time, the method further includes: Determine whether there is an unsynchronized order in the offline folder; if so, continue to upload one offline record every second preset time, and delete the uploaded offline records in the offline folder.
6. The method according to claim 1, characterized in that Also includes: If the internal data records of a single charging order file in the offline folder are full, delete the historical data with the earliest creation time in the internal data records of the charging order file; If the data records in the offline folder are full, delete the offline record corresponding to the charging order with the earliest creation time in the offline folder.
7. An offline and power-off order processing device for an AC charging pile, characterized in that: include: Startup module, order query module, data saving module and data upload module; The startup module is used to trigger the data saving coroutine when the charging pile is offline or powered off; The order query module is used to query the database for the order being charged and determine whether the order is single-phase or three-phase; The data saving module is used to store the current value into the offline folder as an offline record every first preset time, and the format of the offline record is a lightweight data exchange format; The data uploading module is used to upload one of the offline records every second preset time when the charging pile is online.
8. An electronic device comprising a processor and a memory, wherein the memory stores a computer program, characterized in that: The processor executes the computer program stored in the memory to implement the steps in the offline and power-off order processing method for the AC charging pile according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, the steps in the method for processing offline and power-off orders for AC charging piles according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that It comprises a computer program, which, when executed, implements the steps in the offline and power-off order processing method for an AC charging pile as claimed in any one of claims 1 to 6.