A system and method for hot upgrading the pile service program of an electric vehicle charging service platform

Through the thermal upgrade system with a four-layer architecture and polling mechanism, the service interruption problem of the charging platform during the upgrade protocol is solved, and the uninterrupted charging service upgrade is achieved, and the platform's availability and user experience are improved.

CN114629971BActive Publication Date: 2024-11-08ZHEJIANG AICHONG NETWORK TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202210178386.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-25
Publication Date
2024-11-08
Estimated Expiration
2042-02-25

AI Technical Summary

Technical Problem

When upgrading the charging pile communication protocol, the existing electric vehicle charging platform needs to restart services, resulting in interruption of charging services, affecting operation and user experience, and supporting multiple protocols increases the number of restarts and interruption risks.

Method used

The hot upgrade system adopts a four-layer architecture, which is divided into application layer, presentation layer, session layer and network layer from bottom to top through service programs. It uses protocol parser list and polling mechanism to achieve protocol matching and upgrade, avoid cross-layer calls. Dynamically load the latest version of the protocol resolver, keep the connections constantly, and upgrades without restarting.

Benefits of technology

The charging service platform has been achieved without interruption upgrade, maintaining continuous connection to piles, and charging users have no perception, improving platform availability and user experience, and reducing the risk of service interruption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114629971B_ABST
    Figure CN114629971B_ABST
Patent Text Reader

Abstract

The present invention provides a system and method for hot upgrading of a charging pile service program of an electric vehicle charging service platform. The system includes an electric vehicle charging service platform, and the electric vehicle charging service platform is connected to a plurality of charging piles through a service program. The service program includes an application layer, a presentation layer, a session layer, and a network layer from bottom to top. The presentation layer is provided with a protocol parser list, and the protocol parser list corresponds to a plurality of protocol parsers. A common calling interface is provided between adjacent layers, and cross-layer calling is prohibited; the network layer is used to realize network communication between the electric vehicle charging service platform and the charging pile; the session layer is used to receive the data stream of the opposite end and save the communication protocol information of the opposite end; the presentation layer adopts a polling method to match the protocol parser corresponding to the communication protocol information of the opposite end. The present invention keeps the connection to the pile uninterrupted, so that the platform service does not need to be restarted when upgrading, and the charging service is not interrupted when the charging service is upgraded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of hot upgrade of charging service programs, and in particular to a system and method for hot upgrade of a charging service program of an electric vehicle charging service platform. Background Art

[0002] As the proportion of new energy vehicles increases, as part of the new infrastructure, more and more businesses are involved in the design, manufacturing and operation of electric vehicle charging piles.

[0003] Referring to the China Electricity Council T / CEC 102 standard, each charging pile manufacturer customizes and develops its own communication protocol between charging piles and charging platforms. Different manufacturers have different protocols, and the communication protocols of charging piles from the same manufacturer in different years are also different.

[0004] The same charging platform service needs to connect to thousands of charging piles. In order to connect to charging piles from different manufacturers, the charging platform needs to parse various communication protocols. When one of the communication protocols is upgraded, the charging platform service often needs to be upgraded.

[0005] At present, the charging pile program connects to the backend pile service program developed by each platform by establishing a TCP direct connection or MQTT protocol. The upgrade and restart of the backend service will cause the connection between the pile and the service to be disconnected, and the charging service will be temporarily interrupted.

[0006] Charging platform operators often upgrade in the early morning and inform customers and company management in advance. However, electricity prices are relatively cheap in the early morning, and many buses and operating vehicles are still charging in the early morning. The sudden restart of the service will affect their charging. In addition, operating vehicles have high requirements for the availability of the charging service platform. Once they cannot be charged, it will affect the normal operation of the company's business.

[0007] The more charging pile communication protocols the charging platform needs to support, the more times the platform service needs to be upgraded and restarted, and the more times the restart causes charging services to be interrupted.

[0008] To improve the availability of platform services, it is necessary to avoid service interruptions caused by platform service restarts as much as possible. Summary of the invention

[0009] In order to improve the availability of the charging platform and enhance the charging user experience, the present invention provides a pile service program hot upgrade system and method for an electric vehicle charging service platform, which maintains an uninterrupted connection to the pile and unawareness of the charging pile and the charging user, so that the platform service does not need to be restarted during the upgrade and the charging business is not interrupted during the charging service upgrade.

[0010] In order to achieve the above objectives, the following technical solutions are proposed:

[0011] A pile service program hot upgrade system of an electric vehicle charging service platform comprises an electric vehicle charging service platform, wherein the electric vehicle charging service platform is connected to a plurality of charging piles through a service program, wherein the service program comprises an application layer, a presentation layer, a session layer and a network layer from bottom to top, wherein the presentation layer is provided with a protocol parser list, wherein the protocol parser list corresponds to a plurality of protocol parsers, a common calling interface is provided between adjacent layers, and cross-layer calling is prohibited; the network layer is used to realize network communication between the electric vehicle charging service platform and the charging pile; the session layer is used to receive a data stream from a peer end and save communication protocol information from the peer end; the presentation layer adopts a polling method to match the protocol parser corresponding to the communication protocol information of the peer end, the application layer is used to receive and apply the data stream from the peer end, and the session layer corresponding to the charging pile only saves the protocol name, and when the session layer needs to access the protocol parser, it obtains the parser object from the parser manager through the protocol name, and releases the object reference immediately after the call.

[0012] The charging access service of the present invention is responsible for communicating with the charging piles, and divides the service into four layers from bottom to top: application layer, presentation layer, session layer, and network layer. The protocol parser is located in the presentation layer. A common calling interface is designed between adjacent layers, and different layers have different implementations based on interface programming, and cross-layer calls are not allowed. After the charging service is started, the background task periodically scans the specified directory and attempts to load the parser dynamic library that implements the corresponding layer calling interface, and only saves the latest version of each communication protocol parser. During the scan, according to the unified naming rules, an attempt is made to analyze whether the protocol parser implements the common presentation layer interface. Only the dynamic library that implements the layered interface is loaded into the parser list. A charging platform access service can access thousands of charging piles, and each electric pile has a network connection, corresponding to a session layer instance, a presentation layer instance, and an application layer instance.

[0013] A method for hot upgrading a pile service program of an electric vehicle charging service platform adopts the above-mentioned hot upgrading system for a pile service program of an electric vehicle charging service platform, and comprises the following steps:

[0014] S1, after receiving the peer data stream, the session layer determines whether the peer communication protocol information is saved. If so, it obtains the protocol parser instance from the parser manager according to the protocol name and then enters S3. If not, it enters S2;

[0015] S2, using the polling method to search for the corresponding protocol parser from the protocol parser list, to determine whether the protocol parser is successfully matched, if so, then enter S3, if not, feedback matching failure;

[0016] S3, when upgrading, replace the parser manager member variable with the new protocol parser object instance without informing the session layer and application layer.

[0017] Preferably, object references are not saved in each request context, only the pile number or protocol name is saved. When objects at each layer need to be called, they are searched from the object centralized manager based on the pile number or protocol name. Each time a message is sent or processed, the reference to the parser instance is immediately released.

[0018] Preferably, the S2 specifically comprises the following steps:

[0019] The other end needs to first transmit a protocol frame to inform the current platform of the protocol information used by the charging pile;

[0020] After the protocol parser is loaded into the service program memory, when receiving the protocol header network data stream from the charging pile, the corresponding protocol parser is searched from the protocol parser list by polling method;

[0021] After receiving the protocol frame, each protocol parser compares the corresponding protocol identifier and CRC check code in the protocol header, and parses the protocol data in turn. According to the matching situation, three results are returned: acceptance, match failure, and insufficient information.

[0022] Preferably, the polling process is as follows:

[0023] If a protocol parser returns an acceptance, it means the match is successful and the search stops. Otherwise, continue to query other protocol parsers in the list.

[0024] If all parsers return a match failure, it means that the protocol is not supported, and an error is returned to the peer, and the connection is disconnected after a period of silence;

[0025] If the returned information is insufficient, it indicates that not all protocol frame data has arrived. No processing is done first, and some of the data that has arrived is cached. Wait for more network stream data to arrive, form a complete data frame, and initiate protocol polling again.

[0026] Preferably, there is only one parser object for each protocol, and the lifecycle of all protocol parser objects is uniformly managed by a globally unique parser manager, which is conducive to unified upgrades.

[0027] The beneficial effects of the present invention are: maintaining an uninterrupted connection to the charging pile, without the charging pile and the charging user being aware of it, and being able to achieve the goal that the platform service does not need to be restarted during an upgrade, and the charging business is not interrupted during the charging service upgrade. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 is a polling schematic diagram of an embodiment;

[0029] Figure 2 Schematic diagram of the system architecture of the embodiment. DETAILED DESCRIPTION

[0030] Example:

[0031] The present embodiment proposes a pile service program hot upgrade system of an electric vehicle charging service platform, including an electric vehicle charging service platform, wherein the electric vehicle charging service platform is connected to a plurality of charging piles through a service program, wherein the service program includes an application layer, a presentation layer, a session layer and a network layer from bottom to top, wherein the presentation layer is provided with a protocol parser list, wherein the protocol parser list corresponds to a plurality of protocol parsers, and a common calling interface is provided between adjacent layers, and cross-layer calling is prohibited; the network layer is used to realize network communication between the electric vehicle charging service platform and the charging pile; the session layer is used to receive the data stream of the opposite end and save the communication protocol information of the opposite end; the presentation layer adopts a polling method to match the protocol parser corresponding to the communication protocol information of the opposite end, the application layer is used to receive and apply the data stream of the opposite end, and the session layer corresponding to the charging pile only saves the protocol name, and when the session layer needs to access the protocol parser, it obtains the parser object from the parser manager through the protocol name, and releases the object reference immediately after the call. The present embodiment also proposes a method for hot upgrading a charging pile service program of an electric vehicle charging service platform, which adopts the above-mentioned hot upgrading system for a charging pile service program of an electric vehicle charging service platform, and includes the following steps: S1, after the session layer receives the data stream from the other end, it determines whether the communication protocol information of the other end is saved. If so, it obtains the protocol parser instance from the parser manager according to the protocol name, and then enters S3, if not, it enters S2; S2, uses a polling method to search for the corresponding protocol parser from the protocol parser list, and determines whether the protocol parser is successfully matched. If so, it enters S3, and if not, it feedbacks that the matching fails; S3, when upgrading, replaces the parser manager member variable with the new protocol parser object instance, without informing the session layer and the application layer.

[0032] The specific implementation method of this embodiment refers to Figure 1 and Figure 2 The platform's electric pile access service external interconnection is divided into two parts:

[0033] 1) For the Internet of Things, the Netty network framework is used to connect directly to the charging piles via TCP. The same service program can connect to up to 20,000 charging piles.

[0034] 2) The Internet part receives various requests such as charging start and stop, charging progress query, etc. through the Java Spring framework; at the same time, through the message queue middleware such as RabbitMQ, it sends messages such as charging pile asynchronous response and charging real-time data reporting to other microservices.

[0035] Netty Channel encapsulates the network layer. Each charging pile has a long connection, corresponding to a Channel instance. Messages are sent and received through the Channel instance to communicate with the charging pile network.

[0036] refer to Figure 2 Far right:

[0037] EpNettySession, PresentationProxy, and AppUpdateHandlerImpl correspond to the session layer, presentation layer, and application layer respectively, and hold each other for cross-layer calls.

[0038] Create a Channel, EpNettySession, PresentationProxy, and AppUpdateHandlerImpl object for each charging pile. In order to facilitate hot upgrades, the presentation layer applies the proxy mode, and designs PresentationProxy as a request proxy, which does not hold the protocol parser EpPresentation object. As a proxy, PresentationProxy also implements the interface of the presentation layer, but it is only responsible for obtaining the corresponding protocol parser and forwarding requests, and does not actually implement the business logic related to the presentation layer.

[0039] The same charging pile protocol has multiple charging piles. The same EpPresentation instance needs to reference different context objects for different piles, so PresentationContext is designed to encapsulate the charging pile request context.

[0040] When EpPresentation wants to send a message to a specified charging pile, it obtains the request context such as the session layer, application layer object or charging pile number related to the charging pile through PresentationContext. The introduction of PresentationContext makes it possible for multiple charging piles to dynamically depend on each other instead of holding a protocol parser.

[0041] The connection is intermittent, and the Channel corresponding to the connection is dynamic and ephemeral, but the session layer is relatively stable, and the session will only be released when the pile is continuously disconnected. Therefore, the life cycle of the Channel instance is inconsistent with the EpNettySession, and they are not designed to have a strong dependency on each other. Both the Channel and the session layer record the pile ID, and use EpSessionAdmin to establish a dynamic dependency. When calling each other, they find the corresponding object instance through the pile ID.

[0042] EpSessionAdmin is a container for Channel and Session. It uses the stub ID as the key and saves Channel and Session objects in a key-value pair. When the connection is made and the stub ID of the other end is parsed according to the protocol, the corresponding Channel and Session are saved. When the connection is disconnected, the Channel is removed. When the session times out after a period of disconnection, the Session corresponding to the stub is removed.

[0043] To achieve hot upgrade, the protocol parsing part that is easy to change is encapsulated in a subclass, and the subclass implements the ProtocolImpl abstract class. PresentationLoader periodically scans the specified Jar package directory and loads various ProtocolImpl implementation classes. The subclass inherits from ProtocolImpl, implements the query interface for the protocol name and version, implements the protocol matching check interface, etc. PresentationLoader only retains the latest version of the parser for each protocol.

[0044] Each Channel stores the protocol name and peer ID. For a newly created Channel, there is no protocol and peer ID information. At this time, you need to wait for the protocol frame sent by the peer to arrive. After the Channel receives the network stream data, it polls each ProtocolImpl instance in PresentationLoader. The ProtocolImpl instance tries to define the protocol according to each protocol. First, it determines whether the protocol identifier is consistent, and then divides the entire protocol frame according to the length field. If the frame has a CRC check, calculate whether the frame data is correct based on the CRC. If there is no check information, you need to wait for the subsequent frame data to arrive and compare the protocol identifier again.

[0045] When hot upgrading a Jar package with the same protocol, you need to use polling to search for classes to replace the classes with the same name that were previously loaded into memory. Java loads classes from the parent ClassLoader by default, so when the jar package is upgraded, the classes with the same package name and class name have been loaded into memory, and by default, there is no way to replace the old with the new. Therefore, when implementing, you need to customize the loadClass method of URLClassLoader, so that the classes in the newly upgraded jar package are not loaded from the parent loader, but the Java classes are loaded from the upgraded jar.

[0046] After constructing the network layer, session layer, and presentation layer instances corresponding to the stub in the layered model, the application layer instance is then bound. The application layer instance is created and initialized by the upper layer. PresentationLoader provides a registration method for the application layer to register a callback function. After the protocol parser is successfully loaded and the stub ID is parsed, the presentation layer obtains the application layer instance through this callback and holds each other.

[0047] from Figure 2 As you can see, the life cycle of the protocol parser is managed by the globally unique management class instance PresentationLoader. Other classes are dynamic dependencies and will search for the protocol parser based on the protocol name when needed. When loading a new version of the protocol parser, PresentationLoader replaces the protocol parser and the upgrade can be completed without notifying other layer instances.

[0048] When the message is passed from bottom to top layer by layer, each Channel object in the network layer saves the pile ID parsed according to the protocol frame. After receiving the message, the corresponding session layer object can be obtained by accessing EpSessionAdmin through the pile ID. Because EPNettySession and PresentationProxy hold each other, and PresentationProxy and AppUpdateHandlerImpl hold each other. The network layer calls the session layer, and after the session layer processes, it calls the presentation layer, and after the presentation layer processes, it calls the application layer.

[0049] With the charging pile ID as the primary key, the application layer saves the corresponding application layer instance of each pile. When notifying the pile to start or stop charging or querying the real-time charging status of the pile, the AppUpdateHandlerImpl instance is obtained from the EpCommClientService according to the pile ID, and the request is processed by each layer from top to bottom before reaching the charging pile.

Claims

1. A method for hot upgrading a pile service program of an electric vehicle charging service platform, characterized in that: The following steps are involved: S1, after receiving the peer data stream, the session layer determines whether the peer communication protocol information is saved. If so, it obtains the protocol parser instance from the parser manager according to the protocol name and then enters S3. If not, it enters S2; S2, using the polling method to search for the corresponding protocol parser from the protocol parser list, to determine whether the protocol parser is successfully matched, if so, then enter S3, if not, feedback matching failure; S3, when upgrading, replace the parser manager member variable with the new protocol parser object instance without informing the session layer and application layer; The hot upgrade process is as follows: the Channel and session layers record the stub ID, establish dynamic dependencies with the help of EpSessionAdmin, and find the corresponding object instance through the stub ID; encapsulate the easily changeable protocol parsing part in a subclass, and the subclass implements the ProtocolImpl abstract class; customize the loadClass method of URLClassLoader to load the Java class from the upgraded jar package for the classes in the newly upgraded jar package.

2. According to the method for hot upgrading the pile service program of the electric vehicle charging service platform described in claim 1, the object reference is not saved in each request context environment, only the pile number or protocol name is saved, and when the objects of each layer need to be called, they are searched from the object centralized manager according to the pile number or protocol name, and the reference to the parser instance is released immediately after each message is sent or processed.

3. According to the method for hot upgrading the pile service program of the electric vehicle charging service platform of claim 1, the S2 specifically comprises the following steps: The other end needs to first transmit a protocol frame to inform the current platform of the protocol information used by the charging pile; After the protocol parser is loaded into the service program memory, when receiving the protocol header network data stream from the charging pile, the corresponding protocol parser is searched from the protocol parser list by polling method; After receiving the protocol frame, each protocol parser compares the corresponding protocol identifier and CRC check code in the protocol header, and parses the protocol data in turn. According to the matching situation, three results are returned: acceptance, match failure, and insufficient information.

4. According to the method for hot upgrading the pile service program of the electric vehicle charging service platform of claim 3, the polling process is as follows: If a protocol parser returns an acceptance, it means the match is successful and the search stops. Otherwise, it continues to query other protocol parsers in the list. If all parsers return a match failure, it means that the protocol is not supported, and an error is returned to the peer, and the connection is disconnected after a period of silence; If the returned information is insufficient, it indicates that not all protocol frame data has arrived. No processing is done first, and some of the data that has arrived is cached. Wait for more network stream data to arrive, form a complete data frame, and initiate protocol polling again.

5. According to the method for hot upgrading the pile service program of the electric vehicle charging service platform of claim 1, each protocol has only one parser object, and the life cycle of all protocol parser objects is uniformly managed by a globally unique parser manager.

6. A pile service program hot upgrade system for an electric vehicle charging service platform, using the pile service program hot upgrade method for an electric vehicle charging service platform as claimed in claim 1, characterized in that: It includes an electric vehicle charging service platform, which is connected to a plurality of charging piles through a service program. The service program includes an application layer, a presentation layer, a session layer and a network layer from bottom to top. The presentation layer is provided with a protocol parser list, and the protocol parser list corresponds to a plurality of protocol parsers. A common calling interface is provided between adjacent layers, and cross-layer calling is prohibited; the network layer is used to realize network communication between the electric vehicle charging service platform and the charging piles; the session layer is used to receive the data stream of the opposite end and save the communication protocol information of the opposite end; the presentation layer adopts a polling method to match the protocol parser corresponding to the communication protocol information of the opposite end, the application layer is used to receive and apply the data stream of the opposite end, and the session layer corresponding to the charging pile only saves the protocol name. When the session layer needs to access the protocol parser, it obtains the parser object from the parser manager through the protocol name, and releases the object reference immediately after the call.

Citation Information

Patent Citations

  • Shop purchase-sell-stock management system and shop purchase-sell-stock management method

    CN103186842A

  • Hot upgrading method and device for server program

    CN105677433A

  • Video safety monitoring equipment, video safety auditing system, deployment structure of video safety auditing system and video safety auditing method

    CN106850285A

  • New energy automobile charging pile communication method based on cloud platform

    CN110370976A

  • A direct connection charging pile non-perception pile service program gray release method

    CN112463204A