Offline charging method, charging device and server
By storing the device identification code locally on the charging device and updating it online, the problems of charging verification and cost calculation when the charging device is offline are solved, ensuring the timeliness and accuracy of charging.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG XIAOJU GREEN ENERGY TECHNOLOGY CO LTD
- Filing Date
- 2024-10-24
- Publication Date
- 2026-05-01
AI Technical Summary
When the network is interrupted or the connection is unstable, the charging equipment cannot complete the charging verification in a timely manner, which affects the charging efficiency and the accuracy of the cost calculation.
The charging device locally stores the device identification code of the target device, verifies and records offline charging information through the local identification code set, and performs incremental or full synchronization updates of the identification code set when online.
It enables timely charging verification and cost calculation when charging equipment is offline, ensuring charging reliability and accurate cost settlement under unstable network conditions.
Smart Images

Figure CN121963352A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of charging technology, and more specifically, to an offline charging method, charging device, and server. Background Technology
[0002] In recent years, the development of new energy equipment (such as new energy vehicles) has been rapid. However, all charging solutions rely on the charging equipment and the charging service platform to establish a network connection for online identity verification and authorization checks. However, the stability of charging network varies significantly across different regions and network operators. When network outages or unstable network connections occur, the charging equipment and the charging service platform cannot communicate in a timely manner, which can severely impact charging. For example, the equipment may be unable to complete charging verification, leading to delayed charging. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide an offline charging method, a charging device, and a server. By storing the device identification codes of the target devices it supports locally on the charging device, the target devices to be charged can be verified based on the locally stored set of device identification codes when the charging device is offline. This enables the function of timely charging of the target devices even when the charging device is offline. At the same time, by updating the locally stored set of device identification codes when the charging device is online, the reliability of the local identification code set is further guaranteed.
[0004] In a first aspect, embodiments of the present invention provide an offline charging method applied to a charging device, the method comprising:
[0005] The device identification code of the target device is received by connecting the charging component of the charging device to the target device, wherein the target device is the device to be charged;
[0006] In response to the charging device being offline, the device identification code is compared with the local identification code set. The charging device is used to charge the target device. The local identification code set is incrementally or fully updated when the charging device is online.
[0007] In response to the fact that the device identification code is located in the local identification code set, it is determined that the target device has passed the charging verification, and the target device is charged;
[0008] Acquire and store offline charging information, including actual charging time;
[0009] Different actual charging times have corresponding fee settlement models, and the charging fee information of the target device is determined by the fee settlement model corresponding to the actual charging time.
[0010] Secondly, embodiments of the present invention provide an offline charging method applied to a server, the method comprising:
[0011] Determine the login status of the charging device, including online and offline status;
[0012] In response to the charging device being online, device identification code synchronization information is sent to the charging device to perform incremental or full synchronization updates on the local identification code set of the charging device.
[0013] The received offline charging information is verified. The offline charging information includes the actual charging time, and different actual charging times have corresponding fee settlement models.
[0014] Upon successful verification of the offline charging information, the charging fee information is determined based on the fee settlement model corresponding to the actual charging time.
[0015] Thirdly, embodiments of the present invention provide a charging device, the charging device comprising:
[0016] The information storage module is configured to store a local identification code set and offline charging information. The local identification code set includes the device identification code of at least one target device supported by the charging device. The target device is a device to be charged. The offline charging information includes charging data generated when the charging device is offline and the target device is being charged.
[0017] The charging control module is configured to receive the device identification code of the target device through the connection between the charging component of the charging device and the target device, and in response to the charging device being offline, compare the device identification code with the local identification code set, and in response to the device identification code being in the local identification code set, control the charging of the target device.
[0018] The network communication module is configured to establish a communication connection with the server;
[0019] The local identification code set is incrementally or fully updated when the charging device is online. The offline charging information includes the actual charging time. Different actual charging times have corresponding fee settlement models. The charging fee information of the target device is determined by the fee settlement model corresponding to the actual charging time.
[0020] Fourthly, embodiments of the present invention provide a server, the server comprising:
[0021] The charging equipment management module is configured to maintain the login status of the charging equipment, which includes online status and offline status.
[0022] The offline order management module is configured to receive offline charging information generated when the charging device is offline, and determine charging fee information based on the fee settlement model corresponding to the actual charging time in the offline charging information, wherein different actual charging times have corresponding fee settlement models.
[0023] The identification code management module is configured to maintain the latest identification code set and perform incremental or full synchronization updates to the local identification code set of the charging device based on the latest identification code set.
[0024] Fifthly, embodiments of the present invention provide a charging system, the charging system comprising:
[0025] At least one charging device is configured to receive a device identification code of a target device via a connection between a charging component of the charging device and a target device, and in response to being in an offline state, compare the device identification code with a local identification code set, and in response to the device identification code being in the local identification code set, control the charging of the target device, and acquire and store offline charging information, the offline charging information including the actual charging time.
[0026] The server is configured to maintain the login status of each of the charging devices and, in response to the charging device being online, send device identification code synchronization information to the corresponding charging device to perform incremental or full synchronization updates of the local identification code set of the charging device.
[0027] The server is also used to report offline charging information when the charging device is online, and to determine charging fee information based on the fee settlement model corresponding to the actual charging time in the offline charging information, wherein different actual charging times have corresponding fee settlement models.
[0028] In a sixth aspect, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the methods described in the first aspect and / or the second aspect of the present invention.
[0029] In a seventh aspect, embodiments of the present invention provide a computer program product that, when run on a computer, causes the computer to perform the methods described in the first aspect and / or the second aspect of the present invention.
[0030] The charging device of this invention, upon receiving the device identification code of a target device, compares the device identification code with a local identification code set if the charging device is offline. If the device identification code is found in the local identification code set, the device charging device is initiated, and offline charging information is acquired and stored. Thus, this invention verifies the target device to be charged based on the locally stored identification code, enabling timely charging even when the charging device is offline. Furthermore, it uses a cost stage model corresponding to the actual charging time for billing, ensuring accurate cost calculation. Simultaneously, by incrementally or fully updating the locally stored device identification code set when the charging device is online, the reliability of the local identification code set is further guaranteed. Attached Figure Description
[0031] The above and other objects, features and advantages of the present invention will become clearer from the following description of embodiments of the invention with reference to the accompanying drawings, in which:
[0032] Figure 1 This is a flowchart of an offline charging method according to an embodiment of the present invention;
[0033] Figure 2 This is a flowchart of a local identification code set update method according to an embodiment of the present invention;
[0034] Figure 3 This is a schematic diagram of a local identification code set update process according to an embodiment of the present invention;
[0035] Figure 4 This is a flowchart of another local identification code set update method according to an embodiment of the present invention;
[0036] Figure 5 This is a flowchart of an embodiment of the offline charging information storage method of the present invention;
[0037] Figure 6 This is a schematic diagram of the charging data frame downsampling process according to an embodiment of the present invention;
[0038] Figure 7 This is a flowchart of another offline charging method according to an embodiment of the present invention;
[0039] Figure 8 This is a flowchart of another local identification code set update method according to an embodiment of the present invention;
[0040] Figure 9 This is a flowchart of another local identification code set update method according to an embodiment of the present invention;
[0041] Figure 10 This is a flowchart of an offline charging information processing method according to an embodiment of the present invention;
[0042] Figure 11 This is a schematic diagram of a charging system according to an embodiment of the present invention;
[0043] Figure 12 This is a flowchart of a charging device login status maintenance method according to an embodiment of the present invention;
[0044] Figure 13 This is a flowchart of another local identification code set update method according to an embodiment of the present invention;
[0045] Figure 14 This is a flowchart of another local identification code set update method according to an embodiment of the present invention;
[0046] Figure 15 This is a schematic diagram of an offline charging device according to an embodiment of the present invention;
[0047] Figure 16 This is a schematic diagram of another offline charging device according to an embodiment of the present invention;
[0048] Figure 17 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0049] The present application is described below based on embodiments, but it is not limited to these embodiments. In the detailed description of the present application below, certain specific details are described in detail. Those skilled in the art can fully understand the present application without these details. To avoid obscuring the substance of the present application, well-known methods, processes, flows, elements, and circuits are not described in detail.
[0050] Furthermore, those skilled in the art should understand that the accompanying drawings provided herein are for illustrative purposes only and are not necessarily drawn to scale.
[0051] Unless the context explicitly requires it, words such as "including" or "contains" throughout the application should be interpreted as including rather than exclusive or exhaustive; that is, meaning "including but not limited to".
[0052] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0053] The solutions described in this specification and embodiments, if involving the processing of personal information, will be processed only under the premise of having a legal basis (such as obtaining the consent of the personal information subject, or being necessary for the performance of a contract), and will only be processed within the scope stipulated or agreed upon. A user's refusal to process personal information beyond what is necessary for basic functions will not affect the user's use of basic functions.
[0054] The device to be charged in this embodiment of the invention can be any rechargeable device, such as a vehicle, a flight device or other smart device. This embodiment of the invention mainly uses a vehicle as an example for detailed description. It should be understood that this embodiment is not limited to this.
[0055] In vehicle charging scenarios, especially for fleets of vehicles such as buses, logistics trucks, and dump trucks, there is a strong need for delivery. Vehicles must be fully charged within a specific timeframe to ensure they can perform their next task. This high-delivery requirement demands extremely high reliability from charging stations and their equipment. Ensuring that charging equipment can still fulfill charging needs even under conditions of communication anomalies or instability is crucial.
[0056] In some related technologies, vehicle charging in weak network or off-grid scenarios can be implemented through methods such as card-based authentication, pre-set authorization codes on the charging device, or Bluetooth devices. Card-based authentication relies on physical cards, which can be ID cards, IC cards, or CUP cards, and is initiated using a card reader integrated into the charging device. Pre-set authorization codes are generated in advance by a cloud server and stored on the charging device. When the device needs charging, it first interacts with the cloud to obtain the pre-set authorization code, which is then entered on the screen to initiate charging. Bluetooth-based charging involves communication between the Bluetooth device and the charging device to initiate local charging.
[0057] The technical solutions for card-swiping and Bluetooth charging require additional hardware modules in the charging equipment, such as card readers or Bluetooth modules, increasing the cost of charging stations. Card-swiping solutions are also cumbersome, requiring users to carry physical cards for start / stop operations, which also increases operating and maintenance costs. Furthermore, ID cards, lacking key-based security, are easily counterfeited, leading to the widespread use of IC cards, which further increases operating and maintenance costs. Bluetooth devices can only perform one-to-one pairing, which becomes difficult to determine order ownership in fleet scenarios where multiple users are involved. Authorization code-based solutions require preventing reuse, necessitating a usage-and-expire mechanism. To avoid exhausting authorization codes, devices need frequent, periodic updates. However, in scenarios where devices are offline for extended periods or experience frequent network outages, online maintenance of authorization codes becomes impossible, requiring manual on-site software flashing of each device via USB drive or computer in special circumstances. Therefore, embodiments of the present invention provide an offline charging method, charging device, and server. By storing the device identification codes of the target devices it supports locally on the charging device, the target devices to be charged can be verified based on the locally stored set of device identification codes when the charging device is offline. This enables the function of timely charging of the target devices even when the charging device is offline. At the same time, by updating the locally stored set of device identification codes when the charging device is online, the reliability of the local identification code set is further guaranteed.
[0058] Figure 1 This is a flowchart of an offline charging method according to an embodiment of the present invention. The offline charging method of this embodiment is applied to a charging device, which charges a target device, such as a charging pile equipped with a charging gun for charging vehicles. The target device is a device to be charged, such as a vehicle to be charged. Figure 1 As shown, the offline charging method of this invention includes the following steps:
[0059] Step S110: Receive the device identification code of the target device. The device identification code is used to uniquely identify the target device. Taking a vehicle as an example, the device identification code can be the vehicle identification number (VIN), which contains key information such as the vehicle manufacturer, vehicle model, body style and code, engine code, assembly location, and production time, and can uniquely and accurately identify the vehicle. It should be understood that this embodiment does not limit the way the device identification code is set, as long as it can uniquely identify the target device.
[0060] In one alternative implementation, the charging device includes a charging component, such as a charging gun, for charging the device. The charging device establishes a connection with the target device through the charging component to receive the target device's device identification code. Taking vehicle charging as an example, the user initiates a charging operation by inserting the charging gun (i.e., inserting the charging gun of the charging station into the vehicle's charging port). The charging station can obtain the device identification code (e.g., VIN code) of the vehicle to be charged through the BMS (Battery Management System) communication protocol.
[0061] Step S120: In response to the charging device being offline, compare the device identification code with the local identification code set. The local identification code set is updated when the charging device is online. The charging device stores the local identification code set in advance.
[0062] When the network connection of the charging device is good (i.e., not offline or in a weak network state), the charging device is usually logged in as online, meaning it maintains communication with the server to report charging information. However, due to factors such as geographical environment, weather, or communication equipment failure, the charging device may be offline or in a weak network state. In this case, the charging device's login status will switch to offline, meaning it cannot communicate with the server, the communication is weak, or the communication is intermittent. Therefore, the charging device cannot report charging information in a timely manner.
[0063] Optionally, when the charging device in this embodiment logs in, it sends a device login request to the server via the network. The server authenticates the charging device based on the device identifier in the login request. After successful authentication (e.g., the device identifier is in the device identifier set maintained by the server), the server maintains the charging device's login status as online and sends a login success message to the charging device. The charging device periodically reports heartbeat messages to the server to maintain its online status. Upon receiving the heartbeat messages reported by the charging device, the server sends a heartbeat response to the charging device and maintains the charging device's login status as online. When the charging device is online (i.e., in a state of normal communication with the server), it performs a local identifier set update and synchronization operation. If the charging device's authentication fails, the server sends a login failure message to the charging device.
[0064] In one optional implementation, upon detecting a charging operation on the target device (i.e., obtaining the target device's device identification code), in response to the charging device being online, the target device's device identification code is sent to the server. This allows the server to verify the target device's device identification code using its stored latest set of identification codes, thereby determining whether to charge the target device. Since the server stores the most accurate and up-to-date set of identification codes for each charging station, verifying the target device through the server when the charging device is online further improves charging reliability. In other optional implementations, when the charging device is online, the target device can also be verified using its local set of identification codes, improving the charging verification efficiency. Furthermore, if the target device is verified using its local set of identification codes when online, the server can further verify the target device based on the received charging data frames during subsequent charging data frame reporting, thereby improving the charging verification efficiency while ensuring charging reliability.
[0065] In one optional implementation, the charging device switches its login status from online to offline when it does not receive a heartbeat response from the server. In another optional implementation, if the charging device fails to receive a heartbeat response from the server more than a predetermined number of times within a first predetermined time period, the charging device switches its login status from online to offline. Optionally, the predetermined number of times is greater than or equal to 1. The first predetermined time period can be determined based on empirical values or the charging device's heartbeat reporting cycle. This embodiment does not limit the specific values of the first predetermined time and the predetermined number of times; these can be adjusted according to the specific application scenario.
[0066] Furthermore, if the server does not receive a heartbeat message reported by the charging device within a second predetermined time, or if the difference between the time interval of multiple received heartbeat messages and the predetermined heartbeat reporting period is greater than a predetermined value, the server maintains the login status of the charging device as offline. Optionally, the second predetermined time and predetermined value can be determined based on the heartbeat reporting period of the charging device or based on relevant empirical values; this embodiment does not impose any limitations on this.
[0067] Furthermore, in this embodiment of the invention, after receiving the device identification code of the target device, the charging device determines whether it is in an offline state. If it is in an offline state, it uses a local identification code set to verify the device identification code of the target device.
[0068] Furthermore, the local identification code set in this embodiment includes the device identification code of at least one target device supported by the charging device. In an optional implementation, since the charging stations are located in different places and the geographical range of the target devices to be charged may also be different, the server in this embodiment can determine the corresponding charging station based on the activity range pre-bound to the target device to be charged. Thus, the server can determine the target devices that each charging station needs to support and distribute the set of device identification codes of the target devices that each charging station needs to support to the charging devices under the corresponding charging station for local storage. Therefore, in this embodiment, the charging device only needs to store the device identification codes of the target devices it can support, saving storage space and reducing the computational load of subsequent charging matching verification. In another alternative implementation, since the target device's activity range is large or its power consumption is different from expectations, the range of locations where the target device needs to be charged is not fixed. Therefore, the charging device can also store the set of device identification codes of the target device supported by the charging station where it is located, the charging stations within a predetermined range around it, or the set of device identification codes of the target device supported by each charging station in its area (e.g., a city area), or the set of device identification codes of all target devices managed by the server, in order to further improve the charging reliability of the target device.
[0069] In one alternative implementation, taking vehicles as an example, when vehicles are added or removed from the fleet, the number of vehicles supported by the charging equipment within the fleet's operating range will also change accordingly. Therefore, the local identification code set of the charging equipment needs to be updated when the target equipment it supports changes, in order to improve charging reliability.
[0070] Furthermore, in this embodiment, the local identification code set of the charging device is incrementally or fully synchronized when it is online. In one optional implementation, when the server finds that the set of target devices supported by the charging station where the corresponding charging device is located has changed and the charging device is online, it sends device identification code synchronization information to each charging device in the charging station. In another optional implementation, to further improve charging reliability, when the charging device switches from offline to online, the server determines the device identification code synchronization information based on the latest identification code set corresponding to the target devices supported by the charging station where the charging device is located, and sends the device identification code synchronization information to the corresponding charging device to update the local identification code of the charging device. In other optional implementations, after the charging device switches from offline to online, it can actively request the device identification code synchronization information from the server to update its local identification code set. The device identification code synchronization information may only include identification code change information (i.e., the difference information between the latest identification code set in the server and the local identification code set), or it may include all device identification codes in the latest identification code set; this embodiment does not limit this.
[0071] Figure 2 This is a flowchart of a local identification code set update method according to an embodiment of the present invention. This embodiment incrementally updates the local identification code using identification code change information, such as... Figure 2 As shown, the local identification code set update method of this invention includes the following steps:
[0072] Step S210: Send an information synchronization request to the server. The information synchronization request includes the last synchronization update time of the local identification code set. Optionally, in this embodiment, the charging device sends an information synchronization request to the server in response to switching from an offline state to an online state. This allows the server to determine whether the latest identification code set in the server has changed relative to the identification code set corresponding to the last synchronization update time, and if a change has occurred, to determine the identification code change information. The identification code change information includes the difference between the latest identification code set in the server and the local identification code set.
[0073] Step S220: Receive the identification code change information, that is, receive the identification code change information sent by the server.
[0074] Step S230: Update the local identification code set according to the identification code change information. For example, if the latest identification code set has added identification codes compared to the identification code set corresponding to the last synchronization update time, the identification code change information includes the newly added identification codes of the target devices. The newly added identification codes in the identification code change information are added to the local identification code set to update the local identification code set. Similarly, if the latest identification code set has deleted some identification codes compared to the identification code set corresponding to the last synchronization update time, the identification code change information includes the deleted identification codes of the target devices. The required deleted identification codes in the identification code change information are deleted from the local identification code set to update the local identification code set. Further optionally, the identification code change information includes identification codes and operation identifiers for the identification codes, wherein the operation identifiers are used to identify whether the corresponding identification code is a newly added identification code or a deleted identification code.
[0075] Figure 3 This is a schematic diagram illustrating a local identification code set update process according to an embodiment of the present invention. Figure 3 As shown, assuming the synchronization update time corresponding to the local identification code set G1 currently stored locally by the charging device is t1, after receiving the information synchronization request from the charging device, the server determines the identification code change information G3 in the latest identification code set G2 according to the synchronization update time t1 in the synchronization information request. That is, the latest identification code set G2 in the server has added the device identification codes of the three target devices zzzzzz1-zzzzzz3 compared to the local identification code set G1 synchronized at time t1. After receiving the identification code change information G3, the charging device updates its local identification code set G1 according to the newly added identification code information indicated by the identification code change information G3, and obtains the updated local identification code set G4. It should be understood that... Figure 3 It is only for ease of understanding and does not represent the actual format of the sent message or the existence format of the identification code set.
[0076] Therefore, this embodiment can update the local identification code set by changing the identification code information, and the data packet sent by the server contains less data, which improves the update efficiency.
[0077] In other optional implementations, the charging device in this embodiment can also proactively request the latest identification code set from the server to update its local identification code set. For example, after switching to an online state, the charging device clears its local identification code set and sends a synchronization request to the server to obtain the latest identification code set and stores it locally, thus updating the local identification code set. As another example, after switching to an online state, the charging device sends a synchronization request to the server for the latest identification code set, and upon receiving the latest identification code set, clears its original local identification code set and stores the received latest identification code set locally as the new local identification code set.
[0078] Figure 4 This is a flowchart of another local identification code set update method according to an embodiment of the present invention. This embodiment performs a full synchronization update of the local identification codes using the latest identification code set in the server, such as... Figure 4 As shown, the local identification code set update method of this invention includes the following steps:
[0079] Step S310: In response to receiving the information clearing instruction, the local identification code set is cleared. In this embodiment, in response to detecting that the charging device has logged in again (i.e., the charging device has switched to an online state) or that the identification code set corresponding to the charging station where the charging device is located has been updated, the server sends an information clearing instruction to the corresponding charging device. The charging device, in response to receiving the information clearing instruction, clears its local identification code set.
[0080] Step S320: Send the clear execution result to the server. After clearing the local identification code set, the charging device sends the clear execution result to the server. After receiving the clear execution result from the charging device, the server sends the latest identification code set to the charging device.
[0081] In one optional implementation, if the server does not receive a response from the charging device to the information clearing command, the server can initiate a retry. If the number of retries reaches the limit and still no response is received from the charging device to the information clearing command, the server will send a message indicating that the identification code update operation has failed to the maintenance personnel, so that the maintenance personnel can perform subsequent maintenance and repair operations.
[0082] Step S330: Receive the latest identification code set sent by the server to update the local identification code set. Therefore, in this embodiment of the invention, the server can also proactively initiate the update of the charging device's local identification code set. Furthermore, by first issuing a clear instruction, the charging device clears the old local identification code set before receiving the latest set, ensuring consistency between the local identification code set stored in the charging device and the latest identification code set in the server, further improving charging reliability.
[0083] In one optional implementation, to avoid network transmission pressure and excessively long response times for charging devices caused by excessively long messages, the server in this embodiment sends the latest identification codes from the latest identification code set to the charging device in batches, and the charging device receives the latest identification codes from the latest identification code set in batches. The number of latest identification codes in each batch can be determined based on predetermined message length limits and / or device response time requirements.
[0084] In one optional implementation, after receiving an update message, the charging device sends an update response message to the server. Upon receiving the update response message, the server sends the next batch of update messages to the charging device until all the latest identification codes have been sent. The update message includes a predetermined number of the latest identification codes from the corresponding batch. In another optional implementation, the server generates at least one update message in batches based on the latest identification codes in the latest identification code set, and sends these update messages sequentially or synchronously to the charging device. After receiving all the update messages, the charging device sends an update response message to the server. Further optionally, the update message may include a batch identifier from the previous batch of latest identification code update messages, a first batch identifier from the first batch of latest identification code update messages, and a last batch identifier from the last batch of latest identification code update messages. This allows the charging device to parse each update message to confirm whether all update messages have been received and then send an update response message to the server. The update response message can be used to indicate that update message reception is complete or which batches of update messages are missing. The server can determine whether the update is complete based on the update response message or resend certain batches of update messages to ensure the integrity of the local identification code set in the charging device.
[0085] In step S130, in response to the device identification code being located in the local identification code set, it is determined that the target device has passed the charging verification, and charging is initiated for the target device. Since the device identification code in the local identification code set represents a device that can be charged by the charging device, if the device identification code of the target device is located in the local identification code set, it indicates that the target device authentication has passed, and the charging operation can be started. The charging device controls the relay to discharge to complete the charging start.
[0086] Step S140: Acquire and store offline charging information. This offline charging information includes data generated during charging, such as order information and charging process information. Further, the charging process information includes charging data frames periodically collected during the charging process. These data frames may include electrical signals related to charging, such as charging voltage, current, and battery level.
[0087] Figure 5 This is a flowchart of an embodiment of the offline charging information storage method of the present invention. Figure 5 As shown, the offline charging information storage method of this invention includes the following steps:
[0088] Step S141: Obtain the charging data frame generated by the target device during the charging process.
[0089] Step S142: Downsample the charging data frame to obtain offline charging information.
[0090] In one optional implementation, this embodiment can divide the 24 hours into time periods, for example, every 30 minutes, to facilitate data storage and downsampling of charging data frames, and also to facilitate charging fee settlement. It should be understood that this embodiment does not limit the length of each time period; it can be specifically set according to the actual application scenario.
[0091] Optionally, this embodiment can determine downsampling reference information based on the charging duration of the target device, and perform downsampling processing on the charging data frames according to the downsampling reference information. The downsampling reference information includes a downsampling frequency and / or a downsampling count. The downsampling frequency characterizes the time interval between sampling the charging data frames; a smaller time interval indicates a higher downsampling frequency. The downsampling count characterizes the number of times the charging data frame sequence is sampled using the corresponding downsampling frequency. For example, if the charging data frame sequence for a certain period is downsampled twice, and each downsampling uses a downsampling frequency f, then the initial charging data frame sequence is downsampled based on the downsampling frequency f to obtain the first sequence after the first downsampling. Then, the first sequence is downsampled again based on the downsampling frequency f to obtain the offline charging information corresponding to that period.
[0092] Furthermore, the downsampling frequency in this embodiment is negatively correlated with the total charging time of the target device; that is, the longer the total charging time of the target device, the lower the corresponding downsampling frequency, i.e., the longer the sampling time interval. The number of downsampling operations in this embodiment is positively correlated with the total charging time of the target device; that is, the longer the total charging time of the target device, the higher the number of downsampling operations. Therefore, this embodiment can minimize the amount of offline charging information stored locally without affecting charging data verification and fee settlement, saving storage space, reducing local storage pressure, and also reducing the amount of data reported after the charging device communication is restored.
[0093] In one optional implementation, the first and last frames of data in the charging data frame sequence for each time period need to be retained during downsampling to ensure that the power data at the beginning and end of the time period is not lost, thus avoiding any impact on the settlement of fees for subsequent charging orders.
[0094] In a further optional implementation, this embodiment performs downsampling on the charging data frames (excluding the first and last data frames) according to the sampling frequency corresponding to each downsampling operation. Optionally, this embodiment can number the charging data frames (excluding the first and last data frames) before each downsampling operation begins, and retain only odd-numbered or even-numbered items to implement the downsampling operation, and repeat the corresponding downsampling process until the amount of downsampled data meets the conditions or the upper limit of the number of downsampling operations is reached.
[0095] Figure 6This is a schematic diagram of the charging data frame downsampling process according to an embodiment of the present invention. This embodiment uses an example where the number of downsampling operations in this time period is n (n is greater than or equal to 1), and each sampling uses the same downsampling frequency (i.e., each downsampling retains an odd number of items). Figure 6 As shown, the initial charging data frame sequence S0 obtained during the time period is downsampled. After retaining only odd-numbered items in the first downsampling, the charging data frame sequence S1 after the first downsampling is obtained. The charging data frame sequence S1 is rearranged and numbered for the second downsampling, and only odd-numbered items are retained again to obtain the charging data frame sequence S2 after the second downsampling. The above downsampling process is repeated until the charging data frame sequence Sn after the nth sampling is obtained, which is the offline charging information corresponding to this time period.
[0096] In one optional implementation, after the charging device resumes communication, it reports offline charging information to the server, enabling the server to verify the offline charging information and settle fees based on the fee stage model corresponding to the actual charging time. In another optional implementation, this embodiment can also maintain fee settlement models for different charging times in the charging device and update them synchronously when online, so that the charging device can settle fees for charging orders in the offline charging information and report the offline charging information and the corresponding charging order fee settlement information to the server after the charging device resumes communication.
[0097] The charging device of this invention, upon receiving the device identification code of a target device, compares the device identification code with a local identification code set in response to the charging device being offline. If the device identification code is found in the local identification code set, the device charging device is initiated, and offline charging information is acquired and stored. Therefore, this invention allows the charging device to locally store the device identification codes of supported target devices. This enables verification of the target device to be charged based on the locally stored device identification code set when the charging device is offline, thus achieving the function of timely charging of the target device even when the charging device is offline. Furthermore, billing is performed using a cost stage model corresponding to the actual charging time, ensuring the accuracy of cost calculation. Simultaneously, by incrementally or fully updating the locally stored device identification code set when the charging device is online, the reliability of the local identification code set is further guaranteed.
[0098] Figure 7 This is a flowchart of another offline charging method according to an embodiment of the present invention. The offline charging method of this embodiment is applied to a server, wherein the server is a charging service platform that communicates with the charging device. Figure 7 As shown, the offline charging method of this invention includes the following steps:
[0099] Step S410: Determine the login status of the charging device. The login status of the charging device includes online status and offline status.
[0100] In this embodiment of the invention, the server maintains the login status of each charging device. Optionally, when a charging device logs in, it sends a device login request to the server via the network. The server authenticates the charging device based on the device identifier in the login request. If the authentication is successful (e.g., the device identifier is in the set of device identifiers maintained by the server), the server maintains the charging device's login status as online and sends a login success message to the charging device. The charging device periodically reports heartbeat messages to the server to maintain its online status. Upon receiving the heartbeat messages reported by the charging device, the server sends a heartbeat response to the charging device and maintains the charging device's login status as online. If the authentication of the charging device fails, the server sends a login failure message to the charging device.
[0101] Furthermore, if the server does not receive a heartbeat message reported by the charging device within a second predetermined time, or if the difference between the time interval of multiple received heartbeat messages and the predetermined heartbeat reporting period is greater than a predetermined value, the server maintains the login status of the charging device as offline. Optionally, the second predetermined time and predetermined value can be determined based on the heartbeat reporting period of the charging device or based on relevant empirical values; this embodiment does not impose any limitations on this.
[0102] In step S420, in response to the charging device being online, device identification code synchronization information is sent to the charging device to perform incremental or full synchronization updates on the local identification code set of the charging device.
[0103] In one optional implementation, the server maintains the latest identification code set corresponding to each charging station. After the latest identification code set of a corresponding charging station is updated, the server can proactively send device identification code synchronization information to each online charging device in that charging station to update the local identification code set in the charging device in a timely manner. In another optional implementation, the server can proactively send device identification code synchronization information to the charging device when the charging device switches from offline to online. In yet another optional implementation, the server in this embodiment can send device identification code synchronization information to the charging device after receiving an information synchronization request from an online charging device. The device identification code synchronization information may only include identification code change information (i.e., the difference between the latest identification code set in the server and the local identification code set), or it may include all device identification codes in the latest identification code set; this embodiment does not impose any limitations on this.
[0104] Figure 8This is a flowchart illustrating another method for updating a local identification code set according to an embodiment of the present invention. In this embodiment, the server incrementally updates the local identification code of the charging device by sending identification code change information to the charging device, such as... Figure 8 As shown, the local identification code set update method of this invention includes the following steps:
[0105] Step S510: Receive an information synchronization request. The information synchronization request includes the last synchronization update time of the charging device identifier and the local identification code set. Optionally, the information synchronization request may also include the charging device identifier or the identifier of the charging station where the charging device is located.
[0106] Step S520: Determine the identification code change information based on the last synchronization update time.
[0107] Furthermore, the server determines whether the latest set of identification codes in the server has changed relative to the set of identification codes corresponding to the last synchronization update time by using the last synchronization update time in the information synchronization request, and if a change has occurred, it determines the identification code change information. This identification code change information includes the difference between the latest set of identification codes corresponding to the charging station and the local set of identification codes corresponding to the last synchronization update time.
[0108] Furthermore, the server can determine the latest set of identification codes corresponding to the charging station where the charging device is located, or the latest set of identification codes corresponding to the charging station where the charging device is located and associated charging stations, or the full set of latest identification codes stored in the server, based on the received information synchronization request. It then determines the identification code change information based on the difference between the latest set of identification codes and the set corresponding to the last synchronization update time. The associated charging stations can be charging stations whose distance from the charging station where the charging device is located is less than a distance threshold. The full set of latest identification codes can include the device identification codes of the target device supported by all charging stations managed by the server.
[0109] Step S530: Send identification code change information to the corresponding charging device so that the charging device updates its local identification code set based on the identification code change information.
[0110] For example, if the latest set of identifiers contains new identifiers compared to the set corresponding to the last synchronization update time, the identifier change information includes the identifiers of the newly added target devices. These newly added identifiers are then added to the local identifier set to update it. Similarly, if the latest set of identifiers deletes some identifiers compared to the set corresponding to the last synchronization update time, the identifier change information includes the identifiers of the deleted target devices. These deleted identifiers are then removed from the local identifier set to update it. Optionally, the identifier change information includes identifiers and operation identifiers for those identifiers, whereby the operation identifier indicates whether the corresponding identifier is a newly added or deleted identifier.
[0111] Therefore, this embodiment can update the local identification code set by changing the identification code information, and the data packet sent by the server contains less data, which improves the update efficiency.
[0112] In other optional implementations, the charging device in this embodiment can also proactively request the latest identification code set from the server to update its local identification code set. For example, after switching to an online state, the charging device clears its local identification code set and sends a synchronization request to the server to obtain the latest identification code set and stores it locally, thus updating the local identification code set. As another example, after switching to an online state, the charging device sends a synchronization request to the server for the latest identification code set, and upon receiving the latest identification code set, clears its original local identification code set and stores the received latest identification code set locally as the new local identification code set.
[0113] Figure 9 This is a flowchart illustrating another method for updating a local identification code set according to an embodiment of the present invention. In this embodiment, the server sends the latest identification code set of the corresponding charging station to the charging device to perform a full synchronization update of the local identification code of the charging device, such as... Figure 9 As shown, the local identification code set update method of this invention includes the following steps:
[0114] Step S610: Send an information clearing command to the charging device so that the corresponding charging device clears the corresponding local identification code set.
[0115] Optionally, in response to detecting that the charging device has logged in again (i.e., the charging device has switched to online status) or that the identification code set corresponding to the charging station where the charging device is located has been updated, the server sends an information clearing command to the corresponding charging device. In response to receiving the information clearing command, the charging device clears its local identification code set.
[0116] In step S620, in response to receiving the clearing execution result, the latest identification code set is sent to the charging device so that the charging device updates its local identification code set based on the latest identification code set.
[0117] After clearing its local identification code set, the charging device sends the clearing execution result to the server. After receiving the clearing execution result from the charging device, the server sends the latest identification code set of the charging station where the charging device is located to the charging device, so that the charging device can update its local identification code set based on the latest identification code set.
[0118] In one optional implementation, if the server does not receive a response from the charging device to the information clearing command, the server can initiate a retry. If the number of retries reaches the limit and still no response is received from the charging device to the information clearing command, the server will send a message indicating that the identification code update operation has failed to the maintenance personnel, so that the maintenance personnel can perform subsequent maintenance and repair operations.
[0119] Therefore, in this embodiment of the invention, the server can also actively initiate the update of the local identification code set of the charging device, and by first issuing a message clearing instruction, the charging device clears the old local identification code set before receiving the latest identification code set, so that the local identification code set stored in the charging device is consistent with the latest identification code set in the server, further improving the charging reliability.
[0120] In other optional implementations, when the server actively initiates a local identification code update operation for the charging device, it can also determine the identification code change information based on the charging device's last synchronization update time and the latest identification code set of the charging station where the charging device is located, and then send the identification code change information to the charging device so that the charging device can update its local identification code based on the identification code change information. The server can store the last synchronization update time of each charging device, or it can actively send a synchronization update time retrieval request to the charging device when it detects a charging device logging in to obtain the last synchronization update time of that charging device; this embodiment does not impose any limitations on this.
[0121] In one optional implementation, to avoid network transmission pressure and excessively long response times for charging devices caused by excessively long messages, the server in this embodiment sends the latest identification codes from the latest identification code set to the charging devices in batches. The number of latest identification codes in each batch can be determined based on predetermined message length limits and / or device response time requirements.
[0122] In one optional implementation, after receiving an update message, the charging device sends an update response message to the server. Upon receiving the update response message, the server sends the next batch of update messages to the charging device until all the latest identification codes have been sent. The update message includes a predetermined number of the latest identification codes from the corresponding batch. In another optional implementation, the server generates at least one update message in batches based on the latest identification codes in the latest identification code set, and sends these update messages sequentially or synchronously to the charging device. After receiving all the update messages, the charging device sends an update response message to the server. Further optionally, the update message may include a batch identifier from the previous batch of latest identification code update messages, a first batch identifier from the first batch of latest identification code update messages, and a last batch identifier from the last batch of latest identification code update messages. This allows the charging device to parse each update message to confirm whether all update messages have been received and then send an update response message to the server. The update response message can be used to indicate that update message reception is complete or which batches of update messages are missing. The server can determine whether the update is complete based on the update response message or resend certain batches of update messages to ensure the integrity of the local identification code set in the charging device.
[0123] In this embodiment, after communication is restored, the charging device reports offline charging information to the server. This offline charging information includes charging data generated during the charging process for at least one charging order. Upon receiving the offline charging information, the server verifies it and, if verification is successful, settles the payment for the corresponding charging order.
[0124] Figure 10 This is a flowchart of an offline charging information processing method according to an embodiment of the present invention. Figure 10 As shown, the offline charging information processing method of this invention includes the following steps:
[0125] Step S710: Verify the received offline charging information. In one optional implementation, after receiving a message containing offline charging information reported by the charging device, the server parses the message to obtain at least one charging order corresponding to the offline charging information, as well as the device identification code and actual charging time of the target device corresponding to each charging order. Further, the server verifies the charging data and / or device identification code corresponding to each charging order. Specifically, if the latest identification code set stored in the server does not include the device identification code corresponding to the charging order, or if the identification code set stored in the server's historical actual charging time corresponding to the charging order does not include the device identification code corresponding to the charging order, it is determined that the target device should not be charged at the charging device. The server then controls the removal of the target device's device identification code from the local identification code set to update the local identification code set.
[0126] Furthermore, the verification of charging data in this embodiment includes determining whether the charging start time and / or charging end time corresponding to the offline charging information meet predetermined conditions. These predetermined conditions may include the charging start time being before the charging end time, or the time interval between the charging start time and the charging end time being greater than a predetermined time threshold.
[0127] Furthermore, the verification of charging data in this embodiment also includes: determining whether the difference between the cumulative charging power corresponding to the offline charging information and a predetermined power threshold is within a first range. The predetermined power threshold is determined based on the average cumulative charging power of historical charging orders. Since the difference in cumulative charging power for the same type of target device in a single transaction is unlikely to be too large (e.g., the difference is unlikely to be the same as the full charge value), if the cumulative charging power in a charging order is significantly greater than the predetermined power threshold, then the charging order is highly likely to be abnormal.
[0128] Furthermore, this embodiment also verifies the charging data by checking whether the difference between the cumulative charging power and the total power over different time periods is within a second range. Generally, the cumulative charging power and the sum of the power over different time periods (i.e., the total power over different time periods) of the same charging order are basically the same. If these two values differ significantly, the charging order is likely to be abnormal.
[0129] Alternatively, if any one or more of the above-mentioned charging data fails verification, it indicates that the charging order is abnormal. If the charging order is abnormal, the charging order will not be settled, and further verification can be carried out by maintenance personnel.
[0130] In step S720, in response to the successful verification of offline charging information, the charging fee information is determined based on the fee settlement model corresponding to the actual charging time in the offline charging information.
[0131] Since charging costs may vary at different times, meaning different charging times have corresponding cost settlement models, this embodiment can determine the charging cost information for a charging order based on the actual charging time corresponding to the charging order in the offline charging information. In an optional implementation, the cost F of the charging order in this embodiment is:
[0132]
[0133] Where F represents the total cost of the charging order across n charging periods, Ei represents the unit electricity cost in the i-th period, Pi represents the charging capacity in the i-th period, and Si represents the unit electricity service fee in the i-th period. Optionally, the unit electricity cost can be 1 kWh. It should be understood that the unit electricity cost can be determined based on the specific charging service, and this embodiment does not impose any restrictions on this. The different Si and Ei values in different charging periods result in different cost settlement models for different charging periods. Optionally, the cost calculation methods may differ depending on the time of day, season, weather, holidays / weekdays, activity cycles, etc., leading to different cost settlement models. It should be understood that this embodiment does not limit the specific cost settlement model. The cost settlement model for F described above is merely exemplary. Other types of cost settlement models, such as those used within a charging activity cycle (full target activity or collective accounts of the target device having related activities), can employ corresponding cost reduction methods or fixed prices, etc., which will not be listed here.
[0134] In one optional implementation, this embodiment can divide the 24 hours into time periods, for example, every 30 minutes, to facilitate data storage and downsampling of charging data frames, and also to facilitate charging fee settlement. It should be understood that this embodiment does not limit the length of each time period; it can be specifically set according to the actual application scenario.
[0135] In one optional implementation, the collective account to which the target device belongs is determined based on the device identification code of the target device, and the corresponding charging fee is deducted from the collective account based on the charging fee information. For example, when this embodiment is applied to collective accounts of bus fleets, logistics fleets, and dump truck fleets with high charging delivery frequency, the collective account usually has prepaid charging fees. Therefore, this embodiment identifies whether the target device is bound to the corresponding collective account. If the target device is in the corresponding collective account, the corresponding charging fee is deducted from that collective account.
[0136] Optionally, if the target device corresponding to the device identification code is an individual account, and if the individual account has prepaid funds, the corresponding charging fee will be deducted from that individual account. If the individual account has no prepaid funds or insufficient prepaid funds, a payment notification will be sent to the user terminal corresponding to the target device to enable the user to pay. Furthermore, before the user pays, the server can maintain a list of devices awaiting payment and distribute this list to the charging devices. When verifying the target device, the server checks whether it is on the list of devices awaiting payment. If it is, the server notifies the user that they must pay for the previous charging operation before charging. After the user pays, the server updates the list of devices awaiting payment and simultaneously updates it to the charging devices. This further protects the rights and interests of all parties.
[0137] In this embodiment of the invention, the server can send device identification code synchronization information to the charging device when the charging device is online, so as to update the local identification code set of the charging device. This allows the charging device to be offline, and the target device can be verified by comparing the device identification code of the target device with the local identification code set, so as to achieve timely charging of the target device and improve charging reliability.
[0138] Figure 11 This is a schematic diagram of a charging system according to an embodiment of the present invention. Figure 10 As shown, the charging system of this embodiment includes at least one charging device 10 and a server 20. Optionally, the at least one charging device 10 may be distributed in the same charging station or multiple different charging stations. Optionally, the charging device 10 in this embodiment may be a charging pile for charging a target device, such as a charging pile equipped with a charging gun for charging a vehicle.
[0139] In this embodiment of the invention, the charging device 10 pre-stores a local identification code set locally. The local identification code set includes the device identification code of at least one target device supported by the charging device 10.
[0140] Server 20 is used to maintain the latest set of identification codes for each charging station. That is, when a new target device registers a charging account, or when a new target device is bound to a target device collective account (such as a fleet account) or when an already bound account is unbound, server 20 updates the latest set of identification codes for each charging station stored internally, and updates the local set of identification codes for the charging devices under each charging station based on the latest set of identification codes for each charging station.
[0141] Optionally, when the charging device 10 and the server 20 are communicating normally, the charging device 10 and the server 20 maintain communication, that is, the charging device 10 is online, so that the charging device 10 can report the device identification code of the target device for online verification when charging the target device, and report charging messages and other information during the charging process, so as to settle the bill after the charging is completed.
[0142] However, due to factors such as geographical environment, weather, or communication equipment failure of the charging device 10, the charging device 10 may experience communication interruption or weak communication signal with the server 20, meaning the charging device 10 may be offline. If a charging request is received while the charging device 10 is offline, the charging device 10 is configured to receive the device identification code of the target device, compare the device identification code with a local identification code set, and, in response to the device identification code being in the local identification code set, control the charging of the target device, acquiring and storing offline charging information. Thus, the charging device 10 in this embodiment can improve the reliability of the charging device by pre-storing a local identification code set, enabling charging verification of the target device to be charged based on the local identification code when the charging device 10 is offline.
[0143] In one alternative implementation, taking vehicles as an example, when vehicles are added or removed from the fleet, the number of vehicles supported by the charging equipment 10 within the fleet's activity range will also change accordingly. Therefore, the local identification code set of the charging equipment 10 needs to be updated when the target devices it supports change, in order to improve charging reliability.
[0144] Further, in this embodiment, the local identification code set of the charging device 10 is updated when it is online. In one optional implementation, when the server 20 finds that the set of target devices supported by the charging station where the corresponding charging device 10 is located has changed and the charging device 10 is online, it sends device identification code synchronization information to each charging device 10 in the charging station. In another optional implementation, to further improve charging reliability, when the charging device 10 switches from offline to online, the server 20 determines the device identification code synchronization information based on the latest identification code set corresponding to the target devices supported by the charging station where the charging device 10 is located, and sends the device identification code synchronization information to the corresponding charging device 10 to update the local identification code set of the charging device 10. In other optional implementations, after the charging device 10 switches from offline to online, it can actively request the server 20 to obtain device identification code synchronization information to update its local identification code set. It should be understood that the update process of the local identification code of the charging device 10 is similar to... Figures 2-4 , Figures 8-9 The corresponding implementation methods are similar and will not be described in detail here.
[0145] In this embodiment, the charging device 10 periodically reports heartbeat messages to the server 20. After receiving the heartbeat messages reported by the charging device 10, the server 20 sends a heartbeat response back to the charging device 10 and maintains the login status of the charging device 10 as online.
[0146] In one optional implementation, the charging device 10 switches its login status from online to offline when it does not receive a heartbeat response from the server 20. In another optional implementation, if the number of times the charging device 10 does not receive a heartbeat response from the server 20 within a first predetermined time exceeds a predetermined number, then the charging device 10 switches its login status from online to offline. Optionally, the predetermined number of times is greater than or equal to 1. The first predetermined time can be determined based on empirical values or the heartbeat reporting cycle of the charging device 10. This embodiment does not limit the specific values of the first predetermined time and the predetermined number of times; these can be adjusted according to specific application scenarios.
[0147] Furthermore, if the server 20 does not receive a heartbeat message reported by the charging device 10 within a second predetermined time, or if the difference between the time interval of multiple received heartbeat messages and the predetermined heartbeat reporting cycle is greater than a predetermined value, the server 20 maintains the login status of the charging device 10 as offline. Optionally, the second predetermined time and the predetermined value can be determined based on the heartbeat reporting cycle of the charging device 10, or based on relevant empirical values; this embodiment does not impose any limitations on this.
[0148] In one alternative implementation, such as Figure 11 As shown, the charging device 10 includes a charging control module 11, an information storage module 12, and a network communication module 13.
[0149] The information storage module 12 is configured to store a local identification code set and offline charging information. The local identification code set includes the device identification code of at least one target device supported by the charging device, where the target device is the device to be charged. The offline charging information includes charging data generated when the charging device is offline while charging the target device. Optionally, the information storage module 12 can also store information such as the operating status and fault status of the charging device 10.
[0150] The charging control module 11 is configured to receive the device identification code of the target device. In response to the charging device being offline, it compares the device identification code with a local identification code set. If the device identification code is found in the local identification code set, it controls the charging of the target device. Further, the charging control module 11 may also include a charging device controller, indicator lights, and / or a display screen. The charging device controller controls the electrical circuits of multiple charging units (e.g., charging guns). After passing through an input circuit breaker and an AC smart meter, the three-phase AC power is converted to DC power acceptable to the battery by a rectifier module, and then connected to a fuse and the charging gun to charge the target device. The indicator lights provide status indications of "standby," "charging," and "fully charged." The display screen, as a human-machine interface, provides functions such as setting charging parameters, start / stop control operations, and displaying charging information.
[0151] The network communication module 13 is configured to establish a communication connection with the server. Optionally, the network communication module 13 can communicate with the server through a predetermined communication protocol (such as the MQTT protocol). Further, the charging device 10 maintains a communication connection with the server through the network communication module 13 using a long-connection mode. That is, all communication requests from the charging device 10 adopt a request + response method; that is, one party initiates a request, and the other party needs to respond to the request to complete the interaction of the communication request. In an optional implementation, the communication address and port of the server 20 are stored locally through the information storage module 12. It should be understood that the communication address and port of the server 20 stored locally by the charging device 10 can be modified through remote commands or by operating the local display settings to ensure the reliability of communication between the charging device 10 and the server 20.
[0152] Furthermore, the charging control module 11, information storage module 12 and network communication module 13 mentioned above can be integrated into a terminal in the charging device 10. The charging device 10 may also include a charging component electrically connected to the target device, such as a charging gun.
[0153] Furthermore, server 20 includes a charging device management module 21, an offline order management module 22, and an identification code management module 23. The charging device management module 21 is configured to maintain the login status of charging devices, including online and offline status. The offline order management module 22 is configured to receive offline charging information generated when a charging device is offline, and determine charging fees based on the actual charging time corresponding to the offline charging information. The identification code management module 23 is configured to maintain the latest identification code set and update the local identification code set of the charging devices based on the latest identification code set.
[0154] Figure 12 This is a flowchart of a charging device login status maintenance method according to an embodiment of the present invention. Figure 12 As shown, the charging device login status maintenance method of this embodiment includes the following steps:
[0155] Step S11: When the charging device 10 newly joins the network or logs back in after being offline, it sends a device login request to the server 20 through its network communication module 13. The device login request includes the identification information of the charging device 10.
[0156] In step S12, the charging device management module 21 in server 20 performs device authentication on the charging device 10, that is, verifies whether the identifier of the charging device 10 is maintained in server 20. If it is, the authentication is successful; otherwise, the authentication fails.
[0157] Step S13: After the charging device management module 21 successfully verifies the charging device 10, it sends a login success message to the charging device 10. It should be understood that if the charging device management module 21 fails to verify the charging device 10, it sends a login failure message to the charging device 10 (not shown in the figure).
[0158] In step S14, after receiving the login success message from the server 20, the network communication module 13 in the charging device 10 sends a login status switch message to the charging control module 11 so that the charging control module 11 updates the login status of the charging device 10 to the online status.
[0159] In step S15, after the charging device 10 successfully logs in, it periodically reports heartbeat messages to the server 20 through the network communication module 13 to maintain its online status.
[0160] In step S16, after receiving the heartbeat message from the charging device 10, the server 20 sends a heartbeat response back to the charging device 10 to maintain the online status of the charging device 10.
[0161] In step S17, if the network communication module 13 of the charging device 10 does not receive a heartbeat response, or if the number of times the network communication module 13 does not receive a heartbeat response from the server 20 within a first predetermined time exceeds a predetermined number, it is determined that the charging device 10 is offline.
[0162] In step S18, after determining that the charging device 10 is offline, the network communication module 13 sends an offline notification to the charging control module 11 so that the charging control module 11 updates the login status of the charging device 10 to the offline status.
[0163] In step S19, if the server 20 does not receive a heartbeat message reported by the charging device 10 within the second predetermined time, or if the difference between the time interval of the multiple heartbeat messages received and the predetermined heartbeat reporting period is greater than the predetermined value, it determines that the charging device 10 is offline and maintains the login status of the charging device 10 as offline.
[0164] In this embodiment of the invention, the charging device and the server maintain the login status of the charging device through a long connection, further ensuring communication reliability.
[0165] Figure 13 This is a flowchart of another local identification code set update method according to an embodiment of the present invention. The embodiment of the present invention describes a local identification code set update process for a charging system, as follows: Figure 13 As shown, the local identification code set update method of this invention includes the following steps:
[0166] Step S21: After the charging device 10 logs in again, it retrieves the synchronization update time of the current local identification code set (i.e., the last synchronization update time) from the information storage module 12, generates an information synchronization request and sends it to the server 20.
[0167] In step S22, after receiving the information synchronization request from the charging device 10, the server 20 obtains the corresponding latest identification code set from the identification code management module 23 based on the identifier of the charging device 10 or the identifier of the charging station where it is located, and determines the difference information between the latest identification code set and the historical identification code set corresponding to the last synchronization update time, and generates identification code change information.
[0168] For example, if the latest set of identifiers contains new identifiers compared to the set corresponding to the last synchronization update time, the identifier change information includes the identifiers of the newly added target devices. These newly added identifiers are then added to the local identifier set to update it. Similarly, if the latest set of identifiers deletes some identifiers compared to the set corresponding to the last synchronization update time, the identifier change information includes the identifiers of the deleted target devices. These deleted identifiers are then removed from the local identifier set to update it. Optionally, the identifier change information includes identifiers and operation identifiers for those identifiers, whereby the operation identifier indicates whether the corresponding identifier is a newly added or deleted identifier.
[0169] In step S23, the server 20 sends the identification code change information back to the charging device 10.
[0170] In step S24, the charging device 10 updates the local identification code set according to the identification code change information and persists the updated local identification code set in the local information storage module 12.
[0171] Therefore, this embodiment can update the local identification code set by changing the identification code information, and the data packet sent by the server contains less data, which improves the update efficiency.
[0172] In other optional implementations, the charging device in this embodiment can also proactively request the latest identification code set from the server to update its local identification code set. For example, after switching to an online state, the charging device clears its local identification code set and sends a synchronization request to the server to obtain the latest identification code set and stores it locally, thus updating the local identification code set. As another example, after switching to an online state, the charging device sends a synchronization request to the server for the latest identification code set, and upon receiving the latest identification code set, clears its original local identification code set and stores the received latest identification code set locally as the new local identification code set.
[0173] Figure 14 This is a flowchart of another local identification code set update method according to an embodiment of the present invention. The embodiment of the present invention provides another local identification code set update process for a charging system, such as... Figure 14 As shown, the local identification code set update method of this invention includes the following steps:
[0174] Step S31: The server 20 periodically traverses the list of charging devices to be synchronized, or traverses the list of charging devices to be synchronized when one or more charging devices switch to online status. It should be understood that the server 20 can synchronize and update the charging devices 10 in the charging device list. This embodiment takes the synchronization and update of one charging device 10 as an example.
[0175] In step S32, server 20 sends a message clearing command to charging device 10 in the charging device list.
[0176] In step S33, the charging device 10 responds to the received information clearing command by clearing the local identification code set in the information storage module 12.
[0177] In step S34, the charging device 10 sends the clearing execution result to the server. Optionally, if the clearing execution result indicates that the clearing is complete, the server 20 further performs a synchronization update operation of the identification code.
[0178] In one optional implementation, if the server does not receive a response from the charging device to the information clearing command, the server can initiate a retry. If the number of retries reaches the limit and still no response is received from the charging device to the information clearing command, the server will send a message indicating that the identification code update operation has failed to the maintenance personnel, so that the maintenance personnel can perform subsequent maintenance and repair operations.
[0179] In step S35, when the clearing execution result indicates that the clearing is complete, the server 20 determines the number of device identification codes in the latest identification code set corresponding to the charging device 10 to determine whether to update synchronously in batches. In this embodiment, to avoid network transmission pressure and excessive response time of the charging device due to excessively long messages, the server sends the latest identification codes in the latest identification code set to the charging device in batches, and the charging device receives the latest identification codes in the latest identification code set in batches. The number of latest identification codes in each batch can be determined according to a predetermined message length limit and / or device response time requirements.
[0180] Step S36: The server sends update messages in 20 batches. Each batch of update messages includes a predetermined number of the latest identification codes. It should be understood that the number of the latest identification codes in the last batch of update messages may be less than the predetermined number, or greater than the predetermined number but less than twice the predetermined number.
[0181] In one optional implementation, after receiving an update message, the charging device 10 sends an update response message to the server. Upon receiving the update response message, the server 20 sends the next batch of update messages to the charging device 10 until all the latest identification codes have been sent to the charging device 10. In another optional implementation, the server 20 generates at least one update message in batches based on the latest identification codes in the latest identification code set, and sends these update messages to the charging device 10 sequentially or synchronously. After receiving all the update messages, the charging device 10 sends an update response message to the server 20. Further optionally, the update message may include a batch identifier for the previous batch of latest identification code update messages, a first batch identifier for the first batch of latest identification code update messages, and a last batch identifier for the last batch of latest identification code update messages. This allows the charging device 10 to parse each update message to confirm whether all update messages have been received and to send an update response message to the server 20. The update response message can be used to indicate that update message reception is complete or that some batches of update messages are missing. Server 20 can determine that the update is complete based on the update response message or resend certain batches of update messages to ensure the integrity of the local identification code set in the charging device 10.
[0182] In step S37, when the number of the latest identification codes in the latest identification code set is less than or equal to the predetermined number, there is no need to synchronize in batches, and the server 20 sends the latest identification code set to the charging device 10.
[0183] In step S38, the charging device 10 receives batch update messages or the latest identification code set sent by the server, and persists the latest identification code in each batch update message or the latest identification code set in the information storage module 12 to update the local identification code set. Therefore, in this embodiment of the invention, the server can also proactively initiate the update of the charging device's local identification code set. Furthermore, by issuing a clear instruction beforehand, the charging device clears the old local identification code set before receiving the latest identification code set, ensuring consistency between the local identification code set stored in the charging device and the latest identification code set in the server, further improving charging reliability.
[0184] In step S39, the charging device 10 sends a synchronization update result to the server 20. For example, if the update is successful, the charging device 10 sends a synchronization update message to the server 20; if the update fails, the charging device 10 sends a synchronization update failure message to the server 20, requesting the server 20 to reissue the latest set of identification codes.
[0185] It should be understood that the charging device 10 in this embodiment of the invention can also store offline charging information in an offline state, and report the offline charging information to the server 20 after switching to an online state. Its storage process is similar to... Figures 5-6 The corresponding embodiments are similar and will not be described in detail here. Furthermore, the server 20 in this embodiment can also receive the offline charging information reported by the charging device 10 after it switches to online status, and perform operations such as verifying the offline charging information and settling the corresponding charging order fees. The specific operations are similar to... Figure 10 The corresponding implementation methods are similar and will not be described in detail here.
[0186] In the charging system of this invention, the server can send device identification code synchronization information to the charging device when the charging device is online, so as to update the local identification code set of the charging device. This allows the charging device to be offline, and the target device can be verified by comparing the device identification code of the target device with the local identification code set, so as to achieve timely charging of the target device and improve charging reliability.
[0187] Figure 15 This is a schematic diagram of an offline charging device according to an embodiment of the present invention. Figure 15As shown, the offline charging device 15 of this embodiment includes an information receiving unit 151, a verification unit 152, a charging control unit 153, and a storage control unit 154. The information receiving unit 151 is configured to receive the device identification code of the target device (the device to be charged) through a connection between the charging component of the charging device and the target device. The verification unit 152 is configured to compare the device identification code with a local identification code set in response to the charging device being offline. The charging device is used to charge the target device, and the local identification code set is incrementally or fully updated when the charging device is online. The charging control unit 153 is configured to determine that the target device has passed the charging verification and charge the target device in response to the device identification code being located in the local identification code set. The storage control unit 154 is configured to acquire and store offline charging information, including the actual charging time. Different actual charging times have corresponding fee settlement models, and the charging fee information of the target device is determined through the fee settlement model corresponding to the actual charging time.
[0188] The charging device of this invention, upon receiving the device identification code of a target device, compares the device identification code with a local identification code set in response to the charging device being offline. If the device identification code is found in the local identification code set, the device charging device is initiated, and offline charging information is acquired and stored. Therefore, this invention allows the charging device to locally store the device identification codes of supported target devices. This enables verification of the target device to be charged based on the locally stored device identification code set when the charging device is offline, thus achieving the function of timely charging of the target device even when the charging device is offline. Furthermore, billing is performed using a cost stage model corresponding to the actual charging time, ensuring the accuracy of cost calculation. Simultaneously, by incrementally or fully updating the locally stored device identification code set when the charging device is online, the reliability of the local identification code set is further guaranteed.
[0189] Figure 16 This is a schematic diagram of another offline charging device according to an embodiment of the present invention. Figure 16 As shown, the offline charging device 16 of this embodiment includes a status maintenance unit 161, a synchronization update unit 162, a data verification unit 163, and a cost determination unit 164.
[0190] The status maintenance unit 161 is configured to determine the login status of the charging device, which includes online and offline status. The synchronization update unit 162 is configured to, in response to the charging device being in an online state, send device identification code synchronization information to the charging device to perform incremental or full synchronization updates to the charging device's local identification code set. The data verification unit 163 is configured to perform data verification on received offline charging information, which includes the actual charging time, with different actual charging times having corresponding fee settlement models. The fee determination unit 164 is configured to, in response to the offline charging information verification passing, determine charging fee information based on the fee settlement model corresponding to the actual charging time.
[0191] In the charging system of this invention, the server can send device identification code synchronization information to the charging device when the device is online. This allows for incremental or full synchronization updates to the local identification code set of the charging device. Even when the charging device is offline, the server can verify the target device by comparing its device identification code with the local identification code set, ensuring timely charging and improving charging reliability. Furthermore, this embodiment uses a cost stage model corresponding to the actual charging time for billing, ensuring accurate cost calculation and avoiding disputes related to cost settlement.
[0192] Figure 17 This is a schematic diagram of an electronic device according to an embodiment of the present invention. (For example...) Figure 17As shown, the electronic device 170 is a general-purpose data processing device, which includes a general-purpose computer hardware structure, including at least a processor 171 and a memory 172. Optionally, the electronic device in this embodiment can be integrated from the charging control module, information storage module, and network communication module of the charging device 10, or from the charging device management module, offline order management module, and identification code management module of the server 20. Further, the processor 171 and the memory 172 are connected via a bus 173. The memory 172 is adapted to store instructions or programs executable by the processor 171. The processor 171 can be a standalone microprocessor, or a collection of one or more microprocessors. Thus, the processor 171 executes the instructions stored in the memory 172 to perform the method flow of the embodiment of the present invention as described above, thereby realizing data processing and control of other devices. The bus 173 connects the above-mentioned components together, and also connects the above-mentioned components to the display controller 174, the display device, and the input / output (I / O) device 175. Input / output (I / O) device 175 may be a mouse, keyboard, modem, network interface, touch input device, motion input device, printer, and other devices known in the art. Typically, input / output device 175 is connected to the system via input / output (I / O) controller 176.
[0193] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus (devices), or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0194] This application is described with reference to flowchart illustrations of methods, apparatus (devices), and computer program products according to embodiments of this application. It should be understood that each step in the flowchart can be implemented by computer program instructions.
[0195] These computer program instructions may be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including an instruction means, the implementation process of which is described in the instruction means. Figure 1 The function specified in one or more processes.
[0196] These computer program instructions may also be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, produce instructions for implementing processes. Figure 1 A device for a function specified in one or more processes.
[0197] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program for use by a computer to execute some or all of the above-described method embodiments.
[0198] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program specifying the relevant hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0199] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. An offline charging method, applied to a charging device, characterized in that, The method includes: The device identification code of the target device is received by connecting the charging component of the charging device to the target device, wherein the target device is the device to be charged; In response to the charging device being offline, the device identification code is compared with the local identification code set. The charging device is used to charge the target device. The local identification code set is incrementally or fully updated when the charging device is online. In response to the fact that the device identification code is located in the local identification code set, it is determined that the target device has passed the charging verification, and the target device is charged; Acquire and store offline charging information, including actual charging time; Different actual charging times have corresponding fee settlement models, and the charging fee information of the target device is determined by the fee settlement model corresponding to the actual charging time.
2. The method according to claim 1, characterized in that, Incremental synchronization updates to the local identification code set include: Send an information synchronization request to the server, the information synchronization request including the last synchronization update time of the local identification code set; Receive identification code change information, the identification code change information including the difference information between the latest identification code set in the server and the local identification code set; The local identification code set is updated based on the identification code change information.
3. The method according to claim 1, characterized in that, The full synchronization update of the local identification code set includes: In response to receiving an information clearing command, the local identification code set is cleared; Send the clear execution result to the server; Receive the latest set of identification codes sent by the server to update the local set of identification codes.
4. The method according to claim 3, characterized in that, The set of latest identification codes received from the server includes: The latest identification codes in the latest identification code set are received in batches, and the number of the latest identification codes in each batch is determined according to the predetermined message length limit and / or device response time requirements.
5. The method according to claim 1, characterized in that, Obtaining the offline charging information includes: Acquire the charging data frames generated by the target device during the charging process; The charging data frame is downsampled to obtain the offline charging information.
6. The method according to claim 5, characterized in that, The downsampling process for the charging data frame includes: The downsampling reference information is determined based on the charging time of the target device, and the downsampling reference information includes the downsampling frequency and / or the number of downsampling times; The charging data frame is downsampled based on the downsampling reference information.
7. The method according to claim 1, characterized in that, The method further includes: In response to the charging device switching to online status, the offline charging information is reported.
8. An offline charging method applied to a server, characterized in that, The method includes: Determine the login status of the charging device, including online and offline status; In response to the charging device being online, device identification code synchronization information is sent to the charging device to perform incremental or full synchronization updates on the local identification code set of the charging device. The received offline charging information is verified. The offline charging information includes the actual charging time, and different actual charging times have corresponding fee settlement models. Upon successful verification of the offline charging information, the charging fee information is determined based on the fee settlement model corresponding to the actual charging time.
9. The method according to claim 8, characterized in that, The step of sending device identification code synchronization information to the charging device includes: Receive an information synchronization request, the information synchronization request including the charging device identifier and the last synchronization update time of the local identification code set; The identification code change information is determined based on the last synchronization update time, and the identification code change information includes the difference information between the latest identification code set and the local identification code set corresponding to the last synchronization update time. The identification code change information is sent to the corresponding charging device to incrementally update the local identification code set of the charging device.
10. The method according to claim 8, characterized in that, The step of sending device identification code synchronization information to the charging device includes: Send an information clearing command to the charging device so that the charging device clears the corresponding local identification code set; In response to receiving the clear execution result, the latest identification code set is sent to the charging device to perform a full synchronization update of the local identification code set of the charging device.
11. The method according to claim 10, characterized in that, Sending the latest set of identification codes to the charging device includes: The latest identification codes in the latest identification code set are sent in batches, and the number of the latest identification codes in each batch is determined according to the predetermined message length limit and / or device response time requirements.
12. The method according to claim 8, characterized in that, The offline charging information includes the device identification code of the corresponding target device, and the method further includes: The collective account to which the target device belongs is determined based on the device identification code; The corresponding charging fee will be deducted from the collective account based on the charging fee information.
13. The method according to claim 8, characterized in that, The data verification of the received offline charging information includes: Determine whether the charging start time and / or charging end time corresponding to the offline charging information meet predetermined conditions; and / or Determine whether the difference between the cumulative charging power corresponding to the offline charging information and a predetermined power threshold is within a first range; and / or Whether the difference between the cumulative charging power and the total power in different time periods falls within the second range.
14. A charging device, characterized in that, The charging device includes: The information storage module is configured to store a local identification code set and offline charging information. The local identification code set includes the device identification code of at least one target device supported by the charging device. The target device is a device to be charged. The offline charging information includes charging data generated when the charging device is offline and the target device is being charged. The charging control module is configured to receive the device identification code of the target device through the connection between the charging component of the charging device and the target device, and in response to the charging device being offline, compare the device identification code with the local identification code set, and in response to the device identification code being in the local identification code set, control the charging of the target device. The network communication module is configured to establish a communication connection with the server; The local identification code set is incrementally or fully updated when the charging device is online. The offline charging information includes the actual charging time. Different actual charging times have corresponding fee settlement models. The charging fee information of the target device is determined by the fee settlement model corresponding to the actual charging time.
15. A server, characterized in that, The server includes: The charging equipment management module is configured to maintain the login status of the charging equipment, which includes online status and offline status. The offline order management module is configured to receive offline charging information generated when the charging device is offline, and determine charging fee information based on the fee settlement model corresponding to the actual charging time in the offline charging information, wherein different actual charging times have corresponding fee settlement models. The identification code management module is configured to maintain the latest identification code set and perform incremental or full synchronization updates to the local identification code set of the charging device based on the latest identification code set.
16. A charging system, characterized in that, The charging system includes: At least one charging device is configured to receive a device identification code of a target device via a connection between a charging component of the charging device and a target device, and in response to being in an offline state, compare the device identification code with a local identification code set, and in response to the device identification code being in the local identification code set, control the charging of the target device, and acquire and store offline charging information, the offline charging information including the actual charging time. The server is configured to maintain the login status of each of the charging devices and, in response to the charging device being online, send device identification code synchronization information to the corresponding charging device to perform incremental or full synchronization updates of the local identification code set of the charging device. The server is also used to report offline charging information when the charging device is online, and to determine charging fee information based on the fee settlement model corresponding to the actual charging time in the offline charging information, wherein different actual charging times have corresponding fee settlement models.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-13.
18. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1-13.