A vehicle, a charging pile, a server, a charging and discharging system, a method, a medium and a program product

By using a random code generated by a cloud server for seamless authentication between the vehicle and the charging station, the problem of complex user operation and low security in existing technologies is solved, enabling plug-and-charge and seamless charging, thus improving user experience and security.

CN123169729APending Publication Date: 2026-11-27BYD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610267618.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-05
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In existing technologies, authentication is performed by swiping cards or scanning codes when charging vehicles, which increases the complexity of user operations and wastes time. In addition, the security is low and the devices are easily cracked and stolen.

Method used

The system uses a random code generated by a cloud server to authenticate the vehicle and the charging station. The random code is exchanged between the vehicle and the charging station to confirm the identity, enabling seamless charging, reducing user operation steps and improving security.

Benefits of technology

It achieves seamless charging, shortens charging interaction time, improves user experience and safety, and ensures plug-and-charge and instant authentication during the charging process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123169729A_ABST
    Figure CN123169729A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of vehicles, and provides a vehicle, a charging pile, a server, a charging and discharging system, a method, a medium and a program product. The vehicle provided by the application comprises a first cloud interface, the first cloud interface is configured to receive a first random code from a cloud server, the first random code is a random string output by the cloud server and used for authentication between the vehicle and the charging pile; and a charging and discharging interface, the charging and discharging interface is configured to output a second random code to the charging pile in response to connection between the vehicle and the charging pile, the second random code is a random string output by the vehicle and used for authentication between the vehicle and the charging pile.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle technology, and in particular to a vehicle, charging pile, server, charging and discharging system, method, medium and program product. Background Technology

[0002] In related technologies, after a user plugs in the charging gun, they need to initiate charging authentication by swiping a card or scanning a code. This not only increases the complexity of the user's operation but also wastes the user's time. Currently, mainstream car manufacturers or charging station companies obtain the Vehicle Identification Number (VIN) or an encrypted VIN for identification through the provisions of vehicle charging and discharging standards or fixed keys. This method has poor confidentiality, is easily cracked and stolen, and has low security. Summary of the Invention

[0003] This application aims to solve the problems in related technologies and proposes a vehicle, charging pile, server, charging and discharging system, method, medium and program product.

[0004] The first aspect of this application provides a vehicle, including:

[0005] The first cloud interface is configured to receive a first random code from the cloud server. The first random code is a random string output by the cloud server for authentication between the vehicle and the charging pile.

[0006] The charging and discharging interface is configured to output a second random code to the charging station in response to the connection between the vehicle and the charging station. The second random code is a random string output by the vehicle for authentication between the vehicle and the charging station.

[0007] A second aspect of this application provides a charging pile, comprising:

[0008] The first vehicle interface is configured to receive a second random code from the vehicle.

[0009] The second cloud interface is connected to the first vehicle interface; the second cloud interface is configured to output a third random code to the cloud server, and / or the second cloud interface is configured to receive a first random code from the cloud server.

[0010] The first random code is a random string output by the cloud server for authentication between the vehicle and the charging station; the second random code is a random string output by the vehicle for authentication between the vehicle and the charging station; and the third random code is a random string output by the charging station for authentication between the vehicle and the charging station.

[0011] A third aspect of this application provides a cloud server, comprising:

[0012] The third controller is configured to generate a first random code, which is a random string output by the cloud server for authentication between the vehicle and the charging pile.

[0013] The second vehicle interface is connected to the third controller and is configured to output a first random code to the vehicle.

[0014] The charging pile interface is connected to the third controller. The charging pile interface is configured to receive a third random code from the charging pile, which is a random string output by the charging pile for authentication between the vehicle and the charging pile; and / or, the charging pile interface is configured to output a first random code to the charging pile.

[0015] A fourth aspect of this application provides a charging and discharging system, comprising: a vehicle as described, and / or a charging pile as described, and / or a cloud server as described.

[0016] The fifth aspect of this application provides a charging and discharging system, comprising:

[0017] The cloud server is configured to generate a first random code, which is a random string output by the cloud server used for authentication between the vehicle and the charging station.

[0018] The vehicle is connected to a cloud server and is configured to receive a first random code and output a second random code to the charging station; the second random code is a random string output by the vehicle for authentication between the vehicle and the charging station.

[0019] The charging station is connected to a cloud server and is configured to receive a second random code.

[0020] The charging pile is configured to output a third random code to the cloud server. The third random code is a random string output by the charging pile for authentication between the vehicle and the charging pile. The cloud server is configured to perform authentication between the vehicle and the charging pile based on the first random code and the third random code. And / or, the charging pile is configured to receive the first random code from the cloud server and perform authentication between the vehicle and the charging pile based on the first random code and the second random code.

[0021] The sixth aspect of this application provides a charging and discharging method for use in a vehicle, the charging and discharging method comprising:

[0022] In response to the connection between the vehicle and the charging station, authentication is performed. The authentication includes the vehicle outputting a second random code to the charging station. The second random code is a random string output by the vehicle for authentication between the vehicle and the charging station.

[0023] Based on the authentication results, the energy transfer between the vehicle and the charging station is controlled.

[0024] The seventh aspect of this application provides a charging and discharging method for use in charging piles, the charging and discharging method comprising:

[0025] In response to the second random code from the vehicle, a third random code is output to the cloud server, and the authentication result of the cloud server is awaited. The third random code is a random string output by the charging pile for authentication between the vehicle and the charging pile; and / or, in response to the matching relationship between the second random code and the first random code, the authentication result is obtained. The first random code is a random string output by the cloud server for authentication between the vehicle and the charging pile.

[0026] Based on the authentication results, control the energy transfer between the vehicle and the charging station;

[0027] The second random code is a random string output by the vehicle used for authentication between the vehicle and the charging station.

[0028] The eighth aspect of this application provides a charging and discharging method applied to a cloud server, the charging and discharging method comprising:

[0029] Generate a first random code and output the first random code to the vehicle. The first random code is a random string output by the cloud server for authentication between the vehicle and the charging pile.

[0030] In response to the third random code from the charging pile, based on the matching relationship between the third random code and the first random code, the authentication result is obtained, and the authentication result is output to the charging pile. The third random code is a random string output by the charging pile for authentication between the vehicle and the charging pile; and / or, the first random code is output to the charging pile.

[0031] The ninth aspect of this application provides a charging and discharging method applied to a charging and discharging system, the charging and discharging system including a cloud server, a vehicle, and a charging pile, the charging and discharging method including:

[0032] The cloud server generates a first random code, which is a random string output by the cloud server used for authentication between the vehicle and the charging station;

[0033] The cloud server outputs a first random code to the vehicle. The vehicle receives the first random code and, in response to the connection between the vehicle and the charging pile, outputs a second random code to the charging pile. The charging pile, in response to receiving the second random code, outputs a third random code. The cloud server, based on the matching relationship between the third random code and the first random code, obtains the authentication result and outputs the authentication result to the charging pile. The charging pile, based on the authentication result, controls the energy transfer between the vehicle and the charging pile; and / or, the cloud server outputs the first random code to the charging pile. The charging pile, in response to receiving the second random code, obtains the authentication result based on the matching relationship between the second random code and the first random code, and controls the energy transfer between the vehicle and the charging pile based on the authentication result.

[0034] The second random code is a random string output by the vehicle for authentication between the vehicle and the charging station; the third random code is a random string output by the charging station for authentication between the vehicle and the charging station.

[0035] The tenth aspect of this application provides a charging and discharging method applied to a charging and discharging system, the charging and discharging system including a vehicle and a charging pile, the charging and discharging method including:

[0036] The charging station's vehicle plug is inserted into the vehicle's socket.

[0037] The charging station confirms the vehicle interface connection, and / or the vehicle confirms the vehicle interface connection; confirming the vehicle interface connection means determining whether the vehicle plug and the vehicle socket are connected.

[0038] The charging station and the vehicle interact with basic parameters and perform parameter matching.

[0039] After the parameters are successfully matched, authentication is performed. Authentication is the process of the vehicle and the charging pile exchanging data through a random string to confirm the vehicle's permission to use the charging pile.

[0040] If the authentication result is valid, control the energy transfer between the vehicle and the charging station.

[0041] The eleventh aspect of this application provides a computer-readable storage medium storing computer instructions that, when executed on a processor, cause the processor to perform: steps performed by a vehicle in the described charging and discharging method; and / or steps performed by a charging pile in the described charging and discharging method; and / or steps performed by a cloud server in the described charging and discharging method; and / or steps performed by a cloud charging and discharging system in the described charging and discharging method.

[0042] The twelfth aspect of this application provides a computer program product comprising a computer program that, when run on a computer, causes the computer to perform: steps performed by a vehicle in the described charging and discharging method; and / or steps performed by a charging pile in the described charging and discharging method; and / or steps performed by a cloud server in the described charging and discharging method; and / or steps performed by a charging and discharging system in the described charging and discharging method.

[0043] In summary, this application can achieve at least the following technical effects:

[0044] The vehicle in this application is configured to receive a first random code from a server for authentication between the vehicle and the charging pile via a first cloud interface; in response to the connection between the vehicle and the charging pile, it outputs a second random code to the charging pile via a first charging interface to confirm the identity between the vehicle and the charging pile; thus, after the vehicle is connected to the charging pile, the vehicle outputs the first and second random codes from the server to the charging pile to confirm the identity between the vehicle and the charging pile. By using an encryption scheme for the random codes and placing authentication in the cloud, the user operation steps are reduced, the charging interaction time is shortened, the user experience is improved, the security is increased, and seamless charging is achieved, realizing a true plug-and-charge function. Attached Figure Description

[0045] Figure 1 This is a schematic diagram of the vehicle in Embodiment 1 of this application;

[0046] Figure 2 This is a schematic diagram of the charging pile in Embodiment 2 of this application;

[0047] Figure 3 This is a schematic diagram of the cloud server in Embodiment 3 of this application;

[0048] Figure 4 This is a schematic diagram of the operation of the second controller in Embodiment 2 of this application;

[0049] Figure 5 This is a schematic diagram of the cloud-dominated mode in Embodiment 5 of this application;

[0050] Figure 6 This is a schematic diagram of the pile-end dominant mode in Embodiment 5 of this application. Figure 1 ;

[0051] Figure 7 This is a schematic diagram of the pile-end dominant mode in Embodiment 5 of this application. Figure 2 ;

[0052] Figure 8 This is a flowchart of the charging and discharging method in Embodiment Six of this application;

[0053] Figure 9 This is the flowchart of the charging and discharging method in Embodiment 7 of this application. Figure 1 ;

[0054] Figure 10 This is the flowchart of the charging and discharging method in Embodiment 7 of this application. Figure 2 ;

[0055] Figure 11 This is the flowchart of the charging and discharging method in Embodiment 8 of this application. Figure 1 ;

[0056] Figure 12 This is the flowchart of the charging and discharging method in Embodiment 8 of this application. Figure 2 ;

[0057] Figure 13 This is the flowchart of the charging and discharging method in Embodiment Nine of this application. Figure 1 ;

[0058] Figure 14 This is the flowchart of the charging and discharging method in Embodiment Nine of this application. Figure 2 . Detailed Implementation

[0059] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0060] In the description of this application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicating the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.

[0061] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0062] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "joining," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components, unless otherwise expressly limited. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0063] In this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "on top of," and "over" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.

[0064] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0065] An interface is a generalized specification that defines interaction rules. An interface refers to a circuit or device that facilitates data exchange between a device and an external device, responsible for coordinating differences in speed, timing, and format. In network communication, an interface can be a physical connection point (such as a network interface card) or a software contract (such as an API), defining the interaction rules between devices or components. Typically, interfaces encompass both physical and abstract connections, can exist in various systems (hardware and software), and can be used to define interaction rules.

[0066] Example 1:

[0067] Embodiment 1 of this application provides a vehicle, including:

[0068] The first cloud interface is configured to receive a first random code from the cloud server. The first random code is a random string output by the cloud server for authentication between the vehicle and the charging pile.

[0069] The charging and discharging interface is configured to output a second random code to the charging station in response to the connection between the vehicle and the charging station. The second random code is a random string output by the vehicle for authentication between the vehicle and the charging station.

[0070] like Figure 1 As shown, the system is configured to receive a first random code from the server for authentication between the vehicle and the charging pile via the first cloud interface; in response to the connection between the vehicle and the charging pile, the system outputs a second random code to the charging pile via the first charging interface to confirm the identity between the vehicle and the charging pile; thus, after the vehicle and the charging pile are connected, the vehicle outputs the first and second random codes from the server to the charging pile to confirm the identity between the vehicle and the charging pile. By using an encryption scheme for the random codes, authentication is placed in the cloud, reducing user operation steps, shortening charging interaction time, improving user experience, increasing security, and achieving seamless charging. This realizes true plug-and-charge and seamless authentication functions, eliminating cumbersome processes, providing better confidentiality, and greatly shortening charging interaction time.

[0071] The cloud server generates a series of regular or irregular initial random codes, such as arbitrary byte counts, fully random numbers, or numbers with a certain degree of logical randomness. This significantly improves security and reduces the risk of theft and hacking. The cloud server can generate the initial random code based on information such as the vehicle's VIN code, battery status, account balance, historical charging behavior, or current timestamp, ensuring that each vehicle's random code is unique and uncopyable. This code is then sent to the vehicle's first cloud interface via an encrypted channel. The initial random code is a one-time, short-lived, and unpredictable encrypted random number. It possesses randomness and real-time capability, offering good security. An algorithm key can also be added to the initial random code for further encryption, such as initial encryption and final decryption by the cloud server. Authentication between the vehicle and the charging station is known as vehicle-charging station authentication.

[0072] The vehicle can receive a first random code from the cloud server in real time. After the vehicle is connected to the charging pile, the charging and discharging interface is connected to the first cloud interface. The charging and discharging interface promptly outputs a second random code to the charging pile for authentication between the vehicle and the charging pile, which is highly efficient.

[0073] After the vehicle connects to the charging pile, the physical connection of the first cloud interface can trigger the charging and discharging wake-up mechanism. After the cloud server responds, the first cloud interface receives the first random code from the cloud server, and then the charging and discharging interface outputs the second random code to the charging pile for authentication between the vehicle and the charging pile. This can save the computing space of the cloud server, improve the computing efficiency of the cloud server, and also save internal storage space.

[0074] The content of the second random code can be the same as that of the first random code, the difference being the sending end. That is, the first random code is sent by the cloud server, while the second random code is sent by the vehicle. The content of the second random code can also differ from that of the first random code. For example, the second random code can be an encrypted version of the first random code, i.e., the second random code is the result of an XOR operation between the hash value of the first random code and the vehicle's current SOC value. This design ensures that even if an attacker intercepts the second random code, they cannot reverse-engineer the first random code. It also binds to the vehicle's real-time status to prevent attacks. Alternatively, the second random code can be a combination of the first random code and information such as the vehicle's current parameters and functional requirement codes. This process is completed immediately after plugging in the charging gun, synchronized with the charging handshake protocol, achieving seamless interaction of "plugging in for authentication, authentication for charging," completely eliminating the risk of leakage of fixed keys or pre-installed certificates in vehicle charging and discharging standards, and significantly improving authentication security. Through real-time updated random codes + cloud server authentication / charging pile authentication, no user scanning is required, achieving synchronization of authentication and charging processes, balancing time and efficiency.

[0075] In some alternative implementations, the vehicle further includes a first controller connected to a charging / discharging interface and a first cloud interface: the first controller is configured to control the charging / discharging interface to output a second random code to the charging pile in response to a connection signal between the vehicle and the charging pile.

[0076] The first controller can be an embedded real-time processor integrated into the vehicle's main control unit, and its firmware is pre-configured with a four-stage state machine of "gun insertion detection - random code acquisition - code value encapsulation - transmission trigger".

[0077] After the vehicle receives the first random code, or the first controller writes the first random code into the secure storage area, after the vehicle's charging and discharging interface detects the connection between the vehicle and the charging pile, the first controller encapsulates the first random code to obtain the second random code and sends the second random code to the charging pile; or, the first controller immediately encapsulates the first random code to obtain the second random code and sends the second random code to the charging pile.

[0078] When the charging / discharging interface detects a voltage change in the CC1 / CC2 pins, the first controller immediately activates the cellular / 5G communication module of the first cloud interface and initiates an authentication request to the cloud server. Upon receiving the first random code, the first controller performs a hash + XOR operation to generate a second random code. This second random code is then sent to the charging / discharging interface's communication protocol stack via the CAN FD bus, or sent separately to the charging pile before sending a "handshake request" to the charging pile; alternatively, the second random code is inserted as an extension field into the "handshake request" message during the charging handshake phase before being sent to the charging pile. This process requires no user intervention and is entirely triggered by hardware signals, achieving zero-interactive authentication, significantly reducing charging start-up latency, and improving the user experience.

[0079] After the user plugs in the charging gun, a second random code containing the first random code is immediately sent to the charging pile for authentication via the charging and discharging interface. At the same time, in order to improve the user experience, it runs in parallel with the relevant charging process, which not only increases security through the first random code, but also achieves seamless charging.

[0080] In some alternative implementations, the first controller is configured to initiate communication interaction between the charging station and the vehicle in response to a connection signal between the vehicle and the charging station.

[0081] After the vehicle connects to the charging station, the charging / discharging interface outputs a second random code to the charging station, and communication between the charging station and the vehicle begins (e.g., the vehicle sends a handshake protocol to the charging station). This synchronizes authentication and the charging process, shortens charging interaction time, improves charging efficiency, and enhances the user experience. It achieves true plug-and-charge, seamless authentication, eliminating cumbersome processes, providing better security, and significantly reducing charging interaction time.

[0082] In some alternative implementations, the first controller is configured to control the first cloud interface to output a random code update request to the cloud server in response to a wake-up signal, wherein the wake-up signal is a request message for updating the first random code.

[0083] Wake-up signals include, but are not limited to: the user starting the vehicle charging / discharging mode (including vehicle-charging station authentication) via voice, screen, gesture, or mobile phone reservation; the vehicle not receiving the updated first random code sent by the cloud server after the preset wake-up time period; the vehicle not completing authentication after the preset charging time (e.g., 5s~10min) after entering the charging state; the vehicle's battery temperature rising abnormally (e.g., greater than 55℃) or abnormal communication retry detected (e.g., more than 3 times).

[0084] When a user initiates the vehicle's charging / discharging mode via voice, screen, gesture, or mobile phone reservation, the cloud server does not need to send the first random code to the vehicle in real time (within a preset time period). Instead, before charging or discharging, the user informs the vehicle through various vehicle-machine interaction methods that "charging / discharging will begin in a short time." The vehicle's first controller responds to the user's wake-up signal and sends a random code update request to the cloud server through the first cloud interface. The cloud server responds to the random code update request from the vehicle, updates the first random code, and then promptly sends the updated first random code to the vehicle for authentication between the vehicle and the charging station.

[0085] When the first controller detects any of the above wake-up signals, it immediately sends a random signal to the cloud server through the first cloud interface. code The update request, specifically the random code update request, can carry the vehicle's VIN, current timestamp, and the last successful authentication time. After the cloud server verifies the request's legitimacy, it immediately generates a new first random code and sends it to the vehicle via an encrypted channel, simultaneously notifying the charging station to update synchronously. This mechanism supports dynamic key rotation, meaning that even if an attacker intercepts the old random code within a very short time, it cannot be used for subsequent charging, effectively preventing man-in-the-middle attacks and key reuse attacks. This feature is particularly suitable for high-concurrency scenarios at public charging stations, avoiding random code conflicts or cache pollution caused by multiple vehicles plugging in simultaneously.

[0086] In some alternative implementations, the vehicle also includes a memory connected to a first cloud interface and a charging / discharging interface, and the memory is configured to store a first random code.

[0087] The memory can be an embedded secure storage unit with anti-tampering and anti-side-channel attack capabilities. The first random code can be stored in a dedicated secure area of ​​the memory in the form of encrypted ciphertext, and is only temporarily decrypted in memory when the first controller executes the authentication process, thereby improving the security of the first random code storage.

[0088] The memory supports an automatic erasure mechanism: if authentication fails three times consecutively (the cloud server and / or charging station determine the authentication result as invalid), or a physical disassembly signal is detected (such as triggered by the casing opening sensor), all security keys in the memory are immediately erased, entering a "security lock" state, or remote unlocking via the official application is required. This design ensures that even if the vehicle is stolen or illegally disassembled, attackers cannot extract the identity credentials, greatly enhancing the system's resistance to physical attacks.

[0089] In some alternative implementations, the first controller is configured to: within a preset request time after the charging / discharging interface outputs the second random code, if energy transfer between the vehicle and the charging pile has not been initiated, control the vehicle to issue an authentication failure message.

[0090] After the vehicle sends a second random code to the charging station within a preset time (e.g., 2 seconds to 5 minutes), if energy transfer between the vehicle and the charging station does not commence (e.g., the vehicle does not receive power from the charging station (the station charges the vehicle), or the vehicle does not receive a power supply request from the charging station (the vehicle supplies power to the grid), the vehicle will send an authentication failure message to the user or cloud server through various human-machine interaction methods such as voice, text, and lights. This informs the user and the cloud server, improving the user experience. The cloud server can record relevant information for troubleshooting or adjusting subsequent algorithms, such as adjusting the preset time period to improve authentication security.

[0091] In some alternative implementations, the first controller is configured to: in response to receiving the first random code through the first cloud interface, the vehicle sends a confirmation message to the cloud server to confirm that the vehicle has received the first random code.

[0092] This ensures that the first random code sent by the cloud server to the vehicle is always received by the vehicle, improving the accuracy and security of seamless authentication.

[0093] Example 2:

[0094] Embodiment 2 of this application provides a charging pile, including:

[0095] The first vehicle interface is configured to receive a second random code from the vehicle.

[0096] The second cloud interface is connected to the first vehicle interface; the second cloud interface is configured to output a third random code to the cloud server, and / or the second cloud interface is configured to receive a first random code from the cloud server.

[0097] The first random code is a random string output by the cloud server for authentication between the vehicle and the charging station; the second random code is a random string output by the vehicle for authentication between the vehicle and the charging station; and the third random code is a random string output by the charging station for authentication between the vehicle and the charging station.

[0098] like Figure 2As shown, the first vehicle interface of the charging pile is a standard charging and discharging interface that can integrate a high-speed communication channel to receive the second random code sent by the vehicle. The second cloud interface can adopt a dual-mode communication design: supporting dual-channel redundancy of cellular network and Ethernet to ensure that it can still maintain a connection with the cloud server in a weak network environment. When the charging pile detects the vehicle plug (the connection between the vehicle and the charging pile), it first collects the second random code through the first vehicle interface, and at the same time determines whether it has received the first random code from the cloud server. If the first random code has been received from the cloud server, the charging pile performs a local comparison process; if the first random code has not been received from the cloud server, the charging pile actively sends a third random code to the cloud server; the charging pile waits for the vehicle-charging pile authentication result from the cloud server, and responds with charging based on the vehicle-charging pile authentication result.

[0099] The cloud server performs vehicle-charging station authentication based on a first random code it generates and a third random code it receives from the cloud server. The content of the third random code can be the same as the first random code, the difference being the sending end; that is, the first random code is sent by the cloud server, and the third random code is sent by the charging station. The content of the third random code can also differ from the first random code. For example, the third random code can be obtained by combining the charging station's identification number, the current timestamp, and the content of the second random code. In this case, the cloud server can use the third random code to infer the vehicle's identity, thereby further improving security.

[0100] When the cloud server adopts the "vehicle → charging pile → cloud" vehicle-charging-pile authentication mode, the charging pile sends a combination of a second and a third random code to the cloud. The cloud server verifies whether the second and third random codes match, thus achieving dual authentication and preventing single-point forgery. This architecture supports multiple authentication modes coexisting, is compatible with older charging piles and newer systems, and improves system compatibility and evolution capabilities.

[0101] The cloud server transmits information between the first vehicle interface and the vehicle's charging / discharging interface, such as transmitting a second random code used for authentication between the vehicle and the charging pile. The connection between the first vehicle interface and the charging / discharging interface can be wired or wireless.

[0102] In some alternative implementations, the charging station also includes a second controller connected to a second cloud interface and a first vehicle interface.

[0103] The second controller can be a real-time security controller with a built-in hardware encryption engine and a real-time operating system. All authentication logic runs in a secure execution environment. The second controller continuously monitors the communication frames of the first vehicle interface. Once it detects a legitimate message containing the second random code, it immediately initiates the authentication process.

[0104] The second controller supports an offline caching mode: when the cloud is unreachable, it can perform local fast authentication based on the first random code sent in advance by the computing server to ensure availability in emergency charging scenarios.

[0105] In some alternative implementations, the second controller is configured to determine the matching relationship between the second random code and the first random code when the second random code is valid and the second cloud interface is configured to receive the first random code from the cloud server.

[0106] The second random code is valid when it is the default value or a non-invalid value.

[0107] The second random code is the default value, meaning that after receiving the first random code, the charging pile compares the second random code with the first random code sent by the cloud server bit by bit. If the second random code contains the first random code, it is determined that the second random code is the default value; if the second random code does not contain the first random code, it is determined that the second random code is a non-default value. Alternatively, when the content of the second random code is the same as the content of the first random code, the second random code is directly compared with the first random code. If they are completely the same, the second random code is determined to be the default value; if they are different, the second random code is a non-default value.

[0108] The second random code is a non-invalid value, that is: the second random code is an empty value, an error type, an error format, incomplete, out of range, format error (such as not 128 bits), checksum failure, timeout (such as not received for more than 5 seconds), or an unexpected character set, etc.

[0109] The comparison process is seamless and efficient, and it is executed after obtaining the first random code from the cloud server, avoiding misjudgment when there is no authoritative source. This ensures the authority of the cloud server and prevents the implementation of seamless charging and seamless payment after the communication between the cloud server and the charging pile or between the cloud server and the vehicle is interrupted. It enriches the completeness and necessity of local verification, improves the user experience, and eliminates the possibility of charging piles being forged or random codes being tampered with by a middleman, thus improving security.

[0110] In some alternative implementations, the second controller is configured to: determine the matching relationship between the second random code and the first random code when the second random code is valid and the second cloud interface is configured to receive the first random code from the cloud server.

[0111] The second controller is configured to, if the second random code contains the first random code, verify the identity as valid and initiate energy transfer between the charging station and the vehicle.

[0112] Once the second controller confirms that the second random code matches the first random code, it immediately activates the high-voltage contactor control circuit inside the charging pile to initiate the charging process for the vehicle, or to initiate the discharging process from the vehicle to the charging pile. Energy transfer between the charging pile and the vehicle only begins after successful authentication. This process is entirely driven by the logic of the second controller, without any manual intervention, achieving a zero-delay response of "authentication equals power-on," ensuring safety and efficiency, and significantly improving user charging efficiency.

[0113] Energy transfer between charging stations and vehicles can be either from the charging station to the vehicle (charging from the station to the vehicle) or from the vehicle to the charging station (charging the grid from the vehicle to the charging pile).

[0114] In some alternative implementations, the second controller is configured to: determine the matching relationship between the second random code and the first random code when the second random code is valid and the second cloud interface is configured to receive the first random code from the cloud server.

[0115] The second controller is configured to, if the second random code does not contain the first random code, determine that the authentication result is invalid and stop the communication between the charging pile and the vehicle.

[0116] When the second random code does not contain the first random code, the second controller immediately disconnects the communication channel between the charging pile and the vehicle, stops the charging and discharging handshake protocol between the charging pile and the vehicle, and cuts off all unnecessary power (such as the display screen and LED indicators), retaining only the lowest power listening circuit, waiting for the next plug-in. This operation effectively prevents attackers from obtaining a valid response through repeated probing, reducing the possibility of brute-force attacks. After the communication is interrupted, the charging pile enters a "secure isolation" state until the physical connection is broken and the plug-in is reinstated.

[0117] In some alternative implementations, the second controller is configured to: determine the matching relationship between the second random code and the first random code when the second random code is valid and the second cloud interface is configured to receive the first random code from the cloud server.

[0118] The second controller is configured to stop communication between the charging pile and the vehicle and issue a prompt message if the second random code does not contain the first random code.

[0119] While communication is suspended, the second controller drives the charging pile's display screen to show: "Authentication failed, please confirm if the vehicle is an authorized vehicle," and "Invalid charging code, please re-insert the charging gun"; and / or drives the voice module to play voice prompts: "Authentication failed, please confirm if the vehicle is an authorized vehicle," and "Invalid charging code, please re-insert the charging gun." This prompt is dynamically generated using locally stored multi-text and multi-language packets, supporting multiple languages ​​such as Chinese, English, German, and dialects, improving user comprehension. Simultaneously, the second controller encrypts and uploads this failure event (including but not limited to: time, vehicle ID, and second random code hash) to the cloud server for subsequent security auditing and abnormal behavior analysis. Alternatively, a flashing red LED can guide the user to physically re-insert the charging gun; this mechanism effectively defends against malicious injection attacks and protocol interference.

[0120] In some alternative implementations, the second cloud interface is configured to receive the authentication result from the cloud server.

[0121] In some alternative implementations, the second controller is configured to control energy transfer between the charging station and the vehicle if the authentication result is a valid identity.

[0122] In some alternative implementations, the second controller is configured to stop communication between the charging station and the vehicle if the authentication result is invalid.

[0123] In some alternative implementations, the second controller is configured to stop communication between the charging station and the vehicle and issue a prompt message if the authentication result is invalid.

[0124] In the "cloud-led authentication" mode, the charging pile does not perform local comparison. Instead, it sends a third random code to the cloud server, which then completes the final authentication. The authentication result returned by the cloud server to the charging pile is an encrypted message.

[0125] If the authentication result received by the second controller is valid, the charging pile will immediately start energy transmission.

[0126] In some alternative implementations, the second controller is configured to stop communication between the charging station and the vehicle if the second random code is invalid.

[0127] In some alternative implementations, the second controller is configured to stop communication between the charging station and the vehicle and issue a prompt message if the second random code is invalid.

[0128] If the authentication result received by the second controller is invalid, the charging pile will execute a communication interruption and prompt process. The content of the prompt message is dynamically generated based on the error type returned by the cloud server, such as "Insufficient account balance" or "Vehicle not registered," improving user guidance efficiency. This mode has high security and is suitable for high-security scenarios (such as government fleets and corporate vehicles), preventing the charging pile from being compromised locally, which could lead to vehicle-charging pile authentication failure.

[0129] In some alternative implementations, the second controller is configured to control the second cloud interface to output the third random code to the cloud server when the second random code is valid and the second cloud interface is configured to output the third random code to the cloud server.

[0130] In two-way authentication mode, after receiving the second random code, the second controller generates a third random code containing the second random code. This third random code is then encrypted and sent to the cloud server via the second cloud interface. The cloud server compares the third random code with the first random code using a triplet to confirm their logical consistency, thereby authenticating the vehicle and the charging station. This design achieves mutual trust between the vehicle, the charging station, and the cloud, preventing any party from forging its identity. The third random code is used only a preset number of times and automatically expires if no response is received from the cloud server within a certain time, preventing replay attacks.

[0131] In some alternative implementations, the second controller is also configured to control the second cloud interface to send settlement information to the cloud server after the energy transfer between the charging pile and the vehicle has ended.

[0132] Upon completion of energy transfer, the battery detection system at the charging station sends settlement information to the cloud server via a second cloud interface. The second controller collects the start and end times, voltage, current, energy consumption, charging station ID, VIN code, and successful authentication timestamp for this charging session. It then generates a structured settlement message and uploads it to the cloud server via the second cloud interface. The settlement message includes a digital signature to ensure its immutability. Based on this, the cloud server completes billing, invoice generation, and payment deduction, achieving closed-loop management of the entire charging and discharging process.

[0133] In some alternative implementations, the second controller is also configured to control the charging and discharging between the charging station and the vehicle, including communication interaction and energy transfer.

[0134] like Figure 4 As shown, the second controller supports the V2G bidirectional charging and discharging protocol, and upon receiving a discharge request from the vehicle... begAfter authorization from the cloud server, the vehicle switches to discharge mode, feeding its electrical energy back to the grid. At this time, the second random code still serves as identification, ensuring that the discharge activity is limited to authorized vehicles. The second controller simultaneously records the discharge amount and time for subsequent settlement. This function provides a secure foundation for V2G (vehicle-to-grid) scenarios.

[0135] Example 3:

[0136] Embodiment 3 of this application provides a cloud server, including:

[0137] The third controller is configured to generate a first random code, which is a random string output by the cloud server for authentication between the vehicle and the charging pile.

[0138] The second vehicle interface is connected to the third controller and is configured to output a first random code to the vehicle.

[0139] The charging pile interface is connected to the third controller. The charging pile interface is configured to receive a third random code from the charging pile, which is a random string output by the charging pile for authentication between the vehicle and the charging pile; and / or, the charging pile interface is configured to output a first random code to the charging pile.

[0140] like Figure 3 As shown, the first random code can be generated using a hardware random number generator or combined with an encryption algorithm to ensure sufficient and unpredictable entropy source. The first random code can be a number randomly generated by the third controller, or the third controller can combine the random number with information such as the VIN code, current time, charging pile geographical location (such as GPS coordinates), and vehicle historical charging frequency to generate a unique first random code.

[0141] The first random code can be encapsulated and sent to the vehicle via the second vehicle interface. At the same time, it waits for the charging pile interface to receive the third random code from the charging pile. Then, the third controller determines the matching relationship between the third random code and the first random code, thereby realizing cloud authentication.

[0142] The first random code can be encapsulated and sent to the vehicle via the second vehicle interface, while simultaneously being pushed to the currently connected charging station via the charging station interface, achieving "one code, two transmissions". This design ensures that the vehicle and charging station have synchronized authoritative identity credentials before local communication, avoiding authentication misalignment caused by network latency.

[0143] Cloud servers can adopt a microservice architecture, serve as authentication service nodes in a distributed cluster, and have horizontal scalability.

[0144] The second vehicle interface of the cloud server transmits information with the first cloud interface of the vehicle, such as transmitting a first random code used for authentication between the vehicle and the charging pile. The connection between the second vehicle interface and the first cloud interface can be a wired connection or a wireless connection.

[0145] Information is transmitted between the charging pile interface of the cloud server and the second cloud interface of the charging pile, such as transmitting a third random code used for authentication between the vehicle and the charging pile. The connection between the charging pile interface and the second cloud interface can be wired or wireless.

[0146] In some alternative implementations, when the charging pile interface is configured to receive a third random code from the charging pile, the third controller is configured to control the charging pile interface to output the authentication result to the charging pile.

[0147] When the cloud server receives the third random code, it matches it with the corresponding first random code stored in the cloud server. If they match, the authentication result between the charging pile and the vehicle is a valid identity; if they do not match, the authentication result is an invalid identity. Regardless of the authentication result, the result is returned to the charging pile through the charging pile interface. Subsequent operations can only be performed after the charging pile verifies the signature. This achieves authoritative authentication from the cloud server and prevents local devices from forging identities.

[0148] In some alternative implementations, the third controller is configured to obtain the authentication result by matching the third random code with the first random code.

[0149] In some alternative implementations, the third controller is configured to: when the third random code contains the first random code, the authentication result is a valid identity;

[0150] In some alternative implementations, the third controller is configured to determine an invalid identity if the third random code does not contain the first random code.

[0151] In some alternative implementations, the charging pile interface is configured to output a first random code to the charging pile, including: a third controller is configured to control the charging pile interface to output the first random code to the charging pile when the vehicle has payment capability.

[0152] The third controller integrates a payment system that allows real-time queries of the vehicle's linked account balance, membership benefits, preferential benefits, credit limit, and historical payment records, enabling seamless payment and connecting the entire vehicle-charging station chain for convenience and time-saving.

[0153] If the account balance is greater than or equal to the charging fee for this session, or if there are charging discount benefits, the charging fee is usually calculated based on the current electricity price and the amount of electricity charged, then the account is deemed to have "payment ability" and a valid identity is returned. If the account is frozen, in arrears, has not been linked to a payment method, or has insufficient balance, then the account is deemed to have "no payment ability" and an invalid identity is returned. This mechanism links identity authentication with financial credit, enabling intelligent management of "service first, payment later" and "suspension upon arrears," thereby enhancing the platform's fund security.

[0154] After the vehicle's payment ability is verified ("has payment ability"), the third controller sends the first random code to the charging pile interface. Simultaneously, it sends the vehicle's payment ability (such as account balance) to the charging pile, allowing the charging pile to control the charging duration based on this information. If the payment ability is "no payment ability," no code is sent, and the charging pile refuses to charge because it cannot obtain the first random code within a certain time period. This implements a "payment pre-processing" security strategy, preventing malicious users from using forged vehicle identities to charge for free and eliminating theft at its source.

[0155] In some alternative implementations, the third controller is configured to control the second vehicle interface to output a first random code to the vehicle when the vehicle has the ability to make payments.

[0156] After the vehicle's payment ability is verified ("has payment ability"), the third controller sends the first random code to the second vehicle interface. The first random code carries information about the vehicle's payment ability. Thus, when the vehicle sends the second random code to the charging station, it also carries this payment ability information, allowing the charging station to control the charging time based on the vehicle's payment ability. If the vehicle's payment ability is "no payment ability," the first random code is not sent to the second vehicle interface. In this case, the vehicle does not have the functions of contactless authentication, contactless charging, and contactless payment, ensuring that contactless authentication and contactless charging are implemented safely, thereby preventing malicious users from stealing electricity and improving the security of contactless authentication and contactless charging.

[0157] In some alternative implementations, the charging pile interface is configured to receive settlement information from the charging pile.

[0158] In some alternative implementations, the third controller is configured to perform settlement based on settlement information received from the charging pile via the charging pile interface.

[0159] The settlement information includes the current electricity price, the amount of electricity charged, and the charging fee calculated by the charging station. The charging fee calculated by the charging station can be used as a reference when the cloud server calculates the total charging fee, or the cloud server can directly use the charging fee calculated by the charging station for settlement, thereby saving computing space on the cloud server.

[0160] After receiving settlement information, the cloud server automatically calls the financial system to generate bills, issue invoices, and deduct payments from third-party payment platforms (WeChat / Alipay / UnionPay), and pushes a notification to the user's device. If the cloud server fails to deduct payments, the system automatically enters an "overdue payment cache" state, sending a payment reminder to the user's device, allowing the user to pay within a certain period. If the payment is not made within the specified period, the vehicle's charging access is locked. This closed-loop process enables unattended automated operation.

[0161] In some alternative implementations, the third controller is configured to: update the first random code after a preset time period; and control the second vehicle interface to output the updated first random code to the vehicle, and / or control the charging pile interface to output the updated first random code to the charging pile.

[0162] The preset time period can be set to any period between 5 minutes and 5 days by default, with the specific period dynamically adjusted by the third controller based on system load. The preset time period can also be user-defined. The first random code can be updated once, daily, or after a certain number of uses, thus ensuring the timeliness and security of the first random code.

[0163] When the third controller updates the first random code, the system generates an updated first random code and distributes it via a "push + confirmation" mechanism: the cloud server sends the first random code to the vehicle, and after receiving confirmation from the vehicle, it stops sending the updated first random code and updates the first random code stored on the cloud server with the updated first random code. If the cloud server sends the first random code to the vehicle but does not receive confirmation from the vehicle within a certain time, indicating that the vehicle has not successfully received the updated first random code (possibly due to communication issues), the cloud server stops sending the updated first random code to the vehicle, deletes the updated first random code, and saves the previous first random code. The authentication between the vehicle and the charging station is then confirmed using the previous first random code. Simultaneously, after a preset time period, the first random code is updated again, and the updated first random code is resent to the vehicle until confirmation is received from the vehicle. At this point, the cloud server stops sending the updated first random code to the vehicle and updates the first random code stored on the cloud server with the updated first random code.

[0164] By generating a first random code for the vehicle (or charging station) in real time via the cloud, and updating this first random code in real time (simultaneously updating the second and third random codes), the risk of malicious theft of charging access or cracking of vehicle-charging station authentication is reduced, thus improving the security of vehicle-charging station authentication. The updating process of the first random code does not affect the ongoing charging and only takes effect the next time the charging station is plugged in, achieving automatic key rotation and enhancing authentication security.

[0165] In some alternative implementations, the third controller is configured to: update the first random code upon receiving a random code update request; and control the second vehicle interface to output the updated first random code to the vehicle; and / or control the charging pile interface to output the updated first random code to the charging pile.

[0166] When a vehicle initiates a random code update request, such as when a communication anomaly is detected, the vehicle has not been charged for an extended period, or the user proactively requests a "refresh authentication," the third controller immediately responds to the random code update request, generates an updated first random code, and pushes it to the vehicle and / or charging station. This function supports proactive safety intervention by the user, enhancing the user's sense of control over the system; it also supports authentication security in situations such as communication anomalies or prolonged periods without charging.

[0167] In some alternative implementations, the third controller is configured to reduce a preset time period in the event of a communication failure between the vehicle and the cloud server.

[0168] If the vehicle fails to communicate with the cloud server and cannot receive the updated first random code, the number of times the previous first random code can be used is limited (e.g., 3 times), and / or the duration of the preset time period is shortened to improve security in fault conditions, prevent the random code from being stolen when the vehicle is offline, and prevent loss of user account rights and property.

[0169] When the third controller detects that the vehicle's heartbeat timeout occurs a preset number of times (e.g., 1-5 times) (within a certain timeframe of 5 seconds to 2 hours), or if the packet loss rate between the cloud server and the vehicle exceeds a preset probability (e.g., a preset probability of 5% to 30%), the preset time period will be automatically shortened from 15 minutes to 5 minutes. This strategy is suitable for vehicles entering weak network environments such as tunnels and underground parking garages, reducing the risk of key reuse due to communication interruptions through high-frequency key updates. After the update, if communication is restored, the vehicle will automatically synchronize the new code without user intervention.

[0170] In some alternative implementations, the third controller is configured to recalculate a preset time period after receiving confirmation of receipt from the vehicle.

[0171] Based on the confirmation of receipt of the vehicle information, the budget time period is updated to ensure that the first random code can be updated in real time and effectively, thereby improving the accuracy and security of seamless authentication.

[0172] Example 4:

[0173] Embodiment 4 of this application provides a charging and discharging system, including: the vehicle as described above, and / or, the charging pile as described above, and / or, the cloud server as described above.

[0174] The charging and discharging system is a core component of the intelligent charging and discharging ecosystem, supporting collaboration between any one of the vehicles, charging piles, and / or cloud servers and other terminals.

[0175] The charging and discharging system supports a hybrid mode: vehicles can prioritize cloud authentication for fast and secure authentication. If cloud authentication fails, local authentication can continue (e.g., authentication according to the relevant standards for vehicle charging and discharging). In case of poor network conditions or other malfunctions, authentication between the vehicle and the charging station can be achieved, ensuring the stability of authentication and the convenience and efficiency of user use, thereby improving user satisfaction.

[0176] Example 5:

[0177] Embodiment 5 of this application provides a charging and discharging system, including:

[0178] The cloud server is configured to generate a first random code, which is a random string output by the cloud server for authentication between the vehicle and the charging station.

[0179] The vehicle is connected to a cloud server and is configured to receive a first random code and output a second random code to the charging station. The second random code is a random string output by the vehicle for authentication between the vehicle and the charging station.

[0180] The charging station is connected to a cloud server and is configured to receive a second random code.

[0181] The charging pile is configured to output a third random code to the cloud server. The third random code is a random string output by the charging pile for authentication between the vehicle and the charging pile. The cloud server is configured to perform authentication between the vehicle and the charging pile based on the first random code and the third random code. And / or, the charging pile is configured to receive the first random code from the cloud server and perform authentication between the vehicle and the charging pile based on the first random code and the second random code.

[0182] The charging and discharging system is a core component of the intelligent charging and discharging ecosystem, supporting collaboration between vehicles, charging piles, and cloud servers.

[0183] The charging and discharging system supports a dual-mode authentication architecture: Cloud-dominated mode: The vehicle sends a second random code to the charging pile, and the charging pile forwards a third random code containing the second random code to the cloud server. The cloud server compares the first random code with the third random code to confirm their consistency. This mode is suitable for high-security scenarios, such as bus stations and military facilities. Charging pile-dominated mode: The charging pile obtains a first random code from the cloud server and compares it with the second random code sent by the vehicle to the charging pile. The charging pile compares the first random code with the second random code to confirm their consistency. This mode is suitable for areas with unstable networks, such as charging stations in remote areas, and offers faster response times.

[0184] like Figure 5 As shown, the transmission of random authentication codes between the charging pile and the cloud server is as follows: After receiving the second random code from the vehicle, the charging pile sends a third random code containing the second random code and a charging request command to the cloud server through the second cloud interface. During wireless transmission, the relevant charging and discharging protocols (including communication interaction and energy transmission) are also encrypted. After receiving the relevant command, the cloud server matches the received third random code with the current first random code and performs account verification: it identifies whether the vehicle's account has relevant charging rights or a balance. If the account supports online payment, the cloud server feeds back the authentication result (including payment ability and / or authentication result) and the charging / discharging start command to the charging pile. After receiving the charging / discharging start command, the charging pile officially enters the charging process. Otherwise, the cloud server feeds back the authentication result and the reason for failure to the charging pile. The charging pile provides status prompts to the user through voice, text display, and light prompts.

[0185] After the user plugs in the charging gun, the vehicle recognizes the connection between the vehicle and the charging pile. The vehicle then transmits its stored first random code (second random code) to the charging pile via the charging / discharging interface, awaiting further processing. Upon receiving the third random code from the charging pile, the cloud server performs authentication based on the first and third random codes stored in its random code library. If authentication is successful, it sends a success message; otherwise, it reports an authentication failure.

[0186] like Figure 6As shown, the cloud server issues a first random code to the vehicle in real time. Simultaneously, the vehicle updates and stores this first random code. After verifying the vehicle's account and confirming its payment capability, the cloud server sends the first random code to the charging station in real time. The charging station then updates and stores this first random code. This allows for local authentication via the charging station when necessary. In response to the connection between the vehicle and the charging station, the vehicle sends a second random code containing the first random code to the charging station, which then performs authentication between the vehicle and the charging station. The cloud server does not participate in this authentication process; after the vehicle sends the second random code, authentication is directly performed by the charging station. This avoids situations where the cloud server cannot authenticate in a timely manner, improving the efficiency and security of seamless authentication.

[0187] like Figure 7 As shown, after the charging pile recognizes the second random code sent by the vehicle, it determines whether the second random code is valid. If the second random code is not a default value or an invalid value, i.e., the second random code is valid, then the third random code containing the second random code is output to the cloud server. While waiting for the authentication result from the cloud server, the charging pile enters the charging and discharging process: first, it enters the early interaction stage such as version negotiation. After receiving the authentication result from the cloud server indicating a valid identity, the charging pile continues the subsequent energy transmission stage. If the authentication result from the cloud server indicates an invalid identity, the charging pile stops charging and waits again for card swiping or code scanning authentication.

[0188] The charging and discharging system automatically selects the optimal mode based on current network quality, historical network quality, charging pile model, and vehicle permissions (payment permissions, user permissions, etc.). For example, when the charging pile is a new type and the current network quality is good and / or the historical network quality is good, the cloud-dominated mode is prioritized; when the charging pile is an older type and the current network quality is poor and / or the historical network quality is poor, it automatically switches to the charging pile-dominated mode. This adaptive mechanism ensures that the system can operate safely and efficiently in all scenarios, achieving "intelligent adaptive safety authentication".

[0189] Example 6:

[0190] Embodiment 6 of this application provides a charging and discharging method applied to vehicles, such as... Figure 8 As shown, the charging and discharging methods include:

[0191] Step S110: In response to the connection between the vehicle and the charging pile, authentication is performed. Authentication includes the vehicle outputting a second random code to the charging pile. The second random code is a random string output by the vehicle for authentication between the vehicle and the charging pile. Specifically, in response to the physical connection signal between the vehicle and the charging pile, the second controller triggers the vehicle to enter the authentication preparation state. This connection signal is detected by the signal line of the charging and discharging interface, and parameter configuration is performed. Authentication is mainly used to confirm the vehicle user's permission to use the charging pile, payment, etc. If the vehicle and the charging pile confirm during the function negotiation phase that authentication is required for this interaction, then authentication is performed after the parameter configuration phase is completed, and authentication is completed through data interaction.

[0192] Step S120: Based on the authentication result, control the energy transfer between the vehicle and the charging pile. After successful authentication, the charging pile can control the electronic locking device of the vehicle plug to lock. After successful vehicle-charging pile authentication, if the vehicle interface is not disconnected and the vehicle-charging pile enters automatic reconnection or restart, subsequent charging or charging / discharging processes will not require secondary authentication. Secondary authentication can be performed if the vehicle interface is disconnected or the vehicle lacks payment capability (insufficient balance in the authentication account).

[0193] In some alternative implementations, authentication is performed in response to the connection between the vehicle and the charging station, including:

[0194] Step S130: In response to the connection between the vehicle and the charging pile, and the fact that the vehicle has received the first random code, authentication is performed; the first random code is a random string output by the cloud server for authentication between the vehicle and the charging pile.

[0195] In some alternative implementations, the vehicle has received a first random code, including:

[0196] Step S131: In response to receiving the first random code, the vehicle sends a confirmation message to the cloud server to confirm that the vehicle has received the first random code.

[0197] And / or, in step S132, in response to the wake-up signal, output a random code update request to the cloud server, wherein the wake-up signal is a request message to update the first random code;

[0198] And / or, in step S133, in response to receiving the first random code, store the first random code.

[0199] In some alternative implementations, the charging and discharging method further includes:

[0200] Step S140: If energy transfer between the vehicle and the charging pile is not initiated within the preset request time after the second random code is output, control the vehicle to send an authentication failure message.

[0201] And / or, in step S150, in response to the connection signal between the vehicle and the charging station, communication interaction between the charging station and the vehicle begins.

[0202] Example 7:

[0203] Embodiment 7 of this application provides a charging and discharging method, applied to charging piles, such as... Figure 9 As shown, the charging and discharging methods include:

[0204] Step S211: In response to the second random code from the vehicle, output the third random code to the cloud server and wait for the authentication result from the cloud server. The third random code is a random string output by the charging pile for authentication between the vehicle and the charging pile; the second random code is a random string output by the vehicle for authentication between the vehicle and the charging pile.

[0205] In some alternative implementations, in response to a second random code from the vehicle, a third random code is output to a cloud server, including:

[0206] Step S2111: In response to the second random code from the vehicle, determine the validity of the second random code; if the second random code is valid, send the third random code to the cloud server.

[0207] And / or, in step S2112, in response to the second random code from the vehicle, determine the validity of the second random code; if the second random code is invalid, stop the communication interaction between the charging pile and the vehicle.

[0208] And / or, in step S2113, in response to the second random code from the vehicle, determine the validity of the second random code; if the second random code is invalid, stop the communication interaction between the charging pile and the vehicle and issue a prompt message.

[0209] In some alternative implementations, the charging and discharging method further includes:

[0210] Step S212: Based on the authentication result, control the energy transfer between the vehicle and the charging pile.

[0211] In some alternative implementations, based on the authentication result, energy transfer between the vehicle and the charging station is controlled, including:

[0212] Step S2121: If the authentication result is a valid identity, control the energy transfer between the charging pile and the vehicle;

[0213] And / or, in step S2122, if the authentication result is an invalid identity, stop the communication interaction between the charging pile and the vehicle;

[0214] And / or, in step S2123, if the authentication result is an invalid identity, stop the communication interaction between the charging pile and the vehicle and issue a prompt message.

[0215] In some alternative implementations, the charging and discharging method further includes:

[0216] Step S213: After the energy transfer between the charging pile and the vehicle is completed, the settlement information is output to the cloud server.

[0217] And / or, Embodiment 7 of this application also provides a charging and discharging method, applied to charging piles, such as... Figure 10 As shown, the charging and discharging methods include:

[0218] Step S221: In response to the matching relationship between the second random code and the first random code, the authentication result is obtained. The first random code is a random string output by the cloud server for authentication between the vehicle and the charging pile; the second random code is a random string output by the vehicle for authentication between the vehicle and the charging pile.

[0219] In some alternative implementations, in response to a second random code from the vehicle, a third random code is output to the cloud server, and the system waits for the authentication result from the cloud server, including:

[0220] Step S2211: If the authentication result is a valid identity, control the energy transfer between the charging pile and the vehicle;

[0221] And / or, in step S2212, if the authentication result is an invalid identity, stop the communication interaction between the charging pile and the vehicle;

[0222] And / or, in step S2213, if the authentication result is an invalid identity, stop the communication interaction between the charging pile and the vehicle and issue a prompt message.

[0223] Step S222: Based on the authentication result, control the energy transfer between the vehicle and the charging pile.

[0224] In some alternative implementations, the authentication result is obtained in response to the matching relationship between the second random code and the first random code, including:

[0225] Step S2214: If the second random code is valid, determine the matching relationship between the second random code and the first random code to obtain the authentication result.

[0226] In some optional implementations, if the second random code is valid, the matching relationship between the second random code and the first random code is determined to obtain the authentication result, including:

[0227] Step S22101: If the second random code is valid and the second random code contains the first random code, start the energy transfer between the charging pile and the vehicle.

[0228] Step S22102: If the second random code is valid and the second random code does not contain the first random code, stop the communication between the charging pile and the vehicle.

[0229] Step S22103: If the second random code is valid and does not contain the first random code, stop the communication between the charging pile and the vehicle and issue a prompt message.

[0230] In some alternative implementations, the charging and discharging method further includes:

[0231] Step S223: After the energy transfer between the charging pile and the vehicle is completed, the settlement information is output to the cloud server.

[0232] In some alternative implementations, the charging and discharging method further includes:

[0233] Step S2215: If the second random code is invalid, stop the communication between the charging pile and the vehicle;

[0234] And / or, in step S2216, if the second random code is invalid, stop the communication between the charging pile and the vehicle and issue a prompt message.

[0235] Example 8:

[0236] Embodiment 8 of this application provides a charging and discharging method applied to a cloud server, such as... Figure 11 As shown, the charging and discharging methods include:

[0237] Step S311: Generate a first random code and output the first random code to the vehicle. The first random code is a random string output by the cloud server for authentication between the vehicle and the charging pile.

[0238] In some alternative implementations, generating a first random code and outputting the first random code to the vehicle includes:

[0239] Step S3111: Update the first random code after a preset time period; output the updated first random code to the vehicle;

[0240] And / or, in step S3112, update the first random code after a preset time period; output the updated first random code to the charging pile;

[0241] And / or, in step S3113, upon receiving a random code update request, update the first random code; output the updated first random code to the vehicle;

[0242] And / or, in step S3114, upon receiving a random code update request, update the first random code; output the updated first random code to the charging pile.

[0243] In some alternative implementations, the first random code is updated after a preset time period, including:

[0244] Step S31111: In the event of communication failure between the vehicle and the cloud server, reduce the preset time period and update the first random code after the reduced preset time period.

[0245] And / or, in step S31112, after receiving confirmation information from the vehicle, recalculate the preset time period and update the first random code after the recalculated preset time period.

[0246] Step S312: Respond to the third random code from the charging station;

[0247] Step S313: Based on the matching relationship between the third random code and the first random code, the authentication result is obtained, and the authentication result is output to the charging pile. The third random code is a random string output by the charging pile for authentication between the vehicle and the charging pile.

[0248] In some optional implementations, the authentication result is obtained based on the matching relationship between the third random code and the first random code, including:

[0249] Step S3131: If the third random code contains the first random code, the authentication result is valid;

[0250] And / or, in step S3132, if the third random code does not contain the first random code, the authentication result is invalid.

[0251] In some alternative implementations, the charging and discharging method further includes:

[0252] Step S310: If the vehicle has the ability to pay, output the first random code to the charging pile; and / or, if the vehicle has the ability to pay, output the first random code to the vehicle.

[0253] And / or, step S314, settlement is performed based on settlement information from the charging pile.

[0254] And / or, Embodiment 8 of this application provides a charging and discharging method applied to a cloud server, such as... Figure 12 As shown, the charging and discharging methods include:

[0255] Step S321: Generate a first random code and output the first random code to the vehicle. The first random code is a random string output by the cloud server for authentication between the vehicle and the charging pile.

[0256] In some alternative implementations, generating a first random code and outputting the first random code to the vehicle includes:

[0257] Step S3211: Update the first random code after a preset time period and output the updated first random code to the vehicle;

[0258] And / or, in step S3212, after a preset time period, update the first random code and output the updated first random code to the charging pile;

[0259] And / or, in step S3213, upon receiving a random code update request, update the first random code; output the updated first random code to the vehicle.

[0260] And / or, in step S3214, upon receiving a random code update request, update the first random code; output the updated first random code to the charging pile.

[0261] In some alternative implementations, the first random code is updated after a preset time period, including:

[0262] Step S32111: In the event of communication failure between the vehicle and the cloud server, reduce the preset time period and update the first random code after the reduced preset time period.

[0263] And / or, in step S32112, after receiving confirmation information from the vehicle, recalculate the preset time period, and update the first random code after the recalculated preset time period.

[0264] Step S322: Output the first random code to the charging station.

[0265] In some alternative implementations, the charging and discharging method further includes:

[0266] Step S320: If the vehicle has the ability to pay, output the first random code to the charging pile; and / or, if the vehicle has the ability to pay, output the first random code to the vehicle.

[0267] And / or, step S323, settlement is performed based on settlement information from the charging pile.

[0268] Example 9:

[0269] Embodiment 9 of this application provides a charging and discharging method applied to a charging and discharging system, which includes a cloud server, a vehicle, and a charging pile, such as... Figure 13 As shown, the charging and discharging methods include:

[0270] Step S411: The cloud server generates a first random code, which is a random string output by the cloud server for authentication between the vehicle and the charging pile.

[0271] Step S412: Authentication is performed using the first random code. The specific steps are as follows:

[0272] Step S4121: The cloud server outputs the first random code to the vehicle, and the vehicle receives the first random code.

[0273] Step S4122: In response to the connection between the vehicle and the charging pile, the vehicle outputs a second random code to the charging pile; the second random code is a random string output by the vehicle for authentication between the vehicle and the charging pile; the third random code is a random string output by the charging pile for authentication between the vehicle and the charging pile.

[0274] Step S4123: Upon receiving the second random code, the charging pile outputs the third random code to the cloud server.

[0275] Step S4124: The cloud server obtains the authentication result based on the matching relationship between the third random code and the first random code, and outputs the authentication result to the charging pile.

[0276] Step S4125: Based on the authentication result, the charging pile controls the energy transfer between the vehicle and the charging pile.

[0277] In some alternative implementations, the charging and discharging method further includes:

[0278] Step S4131: If the cloud server determines that the vehicle has the ability to pay, the cloud server outputs the first random code to the charging pile.

[0279] And / or, in step S4132, if the cloud server determines that the vehicle has the ability to pay, the cloud server outputs the first random code to the vehicle.

[0280] And / or, in step S414, in response to the end of energy transmission, the charging pile outputs settlement information to the cloud server; the cloud server receives the settlement information and performs settlement based on the settlement information.

[0281] And / or, Embodiment 9 of this application provides a charging and discharging method applied to a charging and discharging system, which includes a cloud server, a vehicle, and a charging pile, such as... Figure 14 As shown, the charging and discharging methods include:

[0282] Step S421: The cloud server generates a first random code, which is a random string output by the cloud server for authentication between the vehicle and the charging pile.

[0283] Step S422: Authentication is performed using the first random code. The specific steps are as follows:

[0284] Step S4221: The cloud server outputs the first random code to the charging pile;

[0285] Step S4223: Upon receiving the second random code, the charging pile obtains the authentication result based on the matching relationship between the second random code and the first random code; the second random code is a random string output by the vehicle for authentication between the vehicle and the charging pile.

[0286] Step S4224: Based on the authentication result, the charging pile controls the energy transfer between the vehicle and the charging pile.

[0287] In some alternative implementations, the charging and discharging method further includes:

[0288] Step S4231: If the cloud server determines that the vehicle has the ability to pay, the cloud server outputs the first random code to the charging pile.

[0289] And / or, in step S4232, if the cloud server determines that the vehicle has the ability to pay, the cloud server outputs the first random code to the vehicle;

[0290] And / or, in step S424, in response to the end of energy transmission, the charging pile outputs settlement information to the cloud server; the cloud server receives the settlement information and performs settlement based on the settlement information.

[0291] Example 10:

[0292] Embodiment 10 of this application provides

[0293] A charging and discharging method is applied to a charging and discharging system, which includes a vehicle and a charging station. The charging and discharging method includes:

[0294] The charging station's vehicle plug is inserted into the vehicle's socket.

[0295] The charging station confirms the vehicle interface connection, and / or the vehicle confirms the vehicle interface connection; confirming the vehicle interface connection means determining whether the vehicle plug and the vehicle socket are connected.

[0296] The charging station and the vehicle interact with basic parameters and perform parameter matching.

[0297] After the parameters are successfully matched, authentication is performed. Authentication is the process of the vehicle and the charging pile exchanging data through a random string to confirm the vehicle's permission to use the charging pile.

[0298] If the authentication result is valid, control the energy transfer between the vehicle and the charging station.

[0299] In some alternative implementations, the charging and discharging system further includes a cloud server, and the charging and discharging method further includes: a random string being generated by the cloud server.

[0300] Example 11:

[0301] Embodiment 11 of this application provides a computer-readable storage medium storing computer instructions that, when executed on a processor, cause the processor to perform: steps performed by a vehicle in the described charging and discharging method; and / or steps performed by a charging pile in the described charging and discharging method; and / or steps performed by a cloud server in the described charging and discharging method; and / or steps performed by a cloud charging and discharging system in the described charging and discharging method.

[0302] Example 12:

[0303] Embodiment 12 of this application provides a computer program product comprising a computer program that, when run on a computer, causes the computer to perform: steps performed by a vehicle in the described charging and discharging method; and / or steps performed by a charging pile in the described charging and discharging method; and / or steps performed by a cloud server in the described charging and discharging method; and / or steps performed by a charging and discharging system in the described charging and discharging method.

[0304] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A vehicle, characterized in that, include: A first cloud interface is configured to receive a first random code from a cloud server. The first random code is a random string output by the cloud server for authentication between the vehicle and the charging pile. A charging / discharging interface is configured to output a second random code to the charging pile in response to the connection between the vehicle and the charging pile. The second random code is a random string output by the vehicle for authentication between the vehicle and the charging pile.

2. The vehicle as described in claim 1, characterized in that, The vehicle also includes a first controller, which is connected to the charging / discharging interface and the first cloud interface. The first controller is configured to: in response to a connection signal between the vehicle and the charging pile, control the charging / discharging interface to output the second random code to the charging pile; And / or, the first controller is configured to: initiate communication interaction between the charging pile and the vehicle in response to a connection signal between the vehicle and the charging pile; And / or, the first controller is configured to: in response to a wake-up signal, control the first cloud interface to output a random code update request to the cloud server, wherein the wake-up signal is a request message to update the first random code; And / or, the first controller is configured to: within a preset request time after the charging / discharging interface outputs the second random code, if energy transfer between the vehicle and the charging pile is not initiated, control the vehicle to issue an authentication failure message; And / or, the first controller is configured to: in response to the first cloud interface receiving the first random code, the vehicle sends a confirmation message to the cloud server, the confirmation message being used to confirm that the vehicle has received the first random code.

3. The vehicle as described in claim 1 or 2, characterized in that, The vehicle also includes a memory connected to the first cloud interface and the charging / discharging interface, and the memory is configured to store the first random code.

4. A charging pile, characterized in that, include: A first vehicle interface, configured to receive a second random code from a vehicle; A second cloud interface is connected to the first vehicle interface; the second cloud interface is configured to output a third random code to a cloud server, and / or the second cloud interface is configured to receive a first random code from the cloud server. The first random code is a random string output by the cloud server for authentication between the vehicle and the charging pile; the second random code is a random string output by the vehicle for authentication between the vehicle and the charging pile; and the third random code is a random string output by the charging pile for authentication between the vehicle and the charging pile.

5. The charging pile as described in claim 4, characterized in that, The charging pile also includes a second controller, which is connected to the second cloud interface and the first vehicle interface.

6. The charging pile as described in claim 5, characterized in that, The second controller is configured to determine the matching relationship between the second random code and the first random code when the second random code is valid and the second cloud interface is configured to receive the first random code from the cloud server.

7. The charging pile as described in claim 6, characterized in that, When the second controller is configured to determine the matching relationship between the second random code and the first random code, provided that the second random code is valid and the second cloud interface is configured to receive the first random code from the cloud server: The second controller is configured to: enable energy transfer between the charging pile and the vehicle when the second random code contains the first random code; And / or, the second controller is configured to: stop the communication interaction between the charging pile and the vehicle if the second random code does not contain the first random code; And / or, the second controller is configured to: stop the communication interaction between the charging pile and the vehicle and issue a prompt message if the second random code does not contain the first random code.

8. The charging pile as described in claim 7, characterized in that, The second cloud interface is configured to receive the authentication result from the cloud server.

9. The charging pile as described in claim 8, characterized in that, The second controller is configured to control energy transfer between the charging pile and the vehicle if the authentication result is a valid identity. And / or, the second controller is configured to stop the communication interaction between the charging pile and the vehicle if the authentication result is an invalid identity; And / or, the second controller is configured to stop the communication interaction between the charging pile and the vehicle and issue a prompt message if the authentication result is an invalid identity.

10. The charging pile as described in any one of claims 7-9, characterized in that, The second controller is configured to: stop the communication between the charging pile and the vehicle when the second random code is invalid; And / or, the second controller is configured to: stop the communication interaction between the charging pile and the vehicle and issue a prompt message when the second random code is invalid; And / or, the second controller is configured to: when the second random code is valid and the second cloud interface is configured to output the third random code to the cloud server, control the second cloud interface to output the third random code to the cloud server; And / or, the second controller is further configured to control the second cloud interface to send settlement information to the cloud server after the energy transfer between the charging pile and the vehicle is completed; And / or, the second controller is further configured to control charging and discharging between the charging pile and the vehicle, the charging and discharging including communication interaction and energy transfer.

11. A cloud server, characterized in that, include: A third controller is configured to generate a first random code, which is a random string output by the cloud server for authentication between the vehicle and the charging pile. A second vehicle interface, which is connected to the third controller, is configured to output the first random code to the vehicle. A charging pile interface, which is connected to the third controller, is configured to receive a third random code from the charging pile, the third random code being a random string output by the charging pile for authentication between the vehicle and the charging pile; and / or, the charging pile interface is configured to output a first random code to the charging pile.

12. The cloud server as described in claim 11, characterized in that, When the charging pile interface is configured to receive the third random code from the charging pile, the third controller is configured to control the charging pile interface to output the authentication result to the charging pile.

13. The cloud server as described in claim 12, characterized in that, The third controller is configured to: obtain the authentication result based on the matching relationship between the third random code and the first random code, and control the charging pile interface to output the authentication result to the charging pile.

14. The cloud server as described in claim 13, characterized in that, The third controller is configured such that, if the third random code contains the first random code, the authentication result is valid; And / or, the third controller is configured such that, if the third random code does not contain the first random code, the authentication result is invalid.

15. The cloud server as described in claim 11, characterized in that, The charging pile interface is configured to output the first random code to the charging pile, including: The third controller is configured to: when the vehicle has the ability to pay, control the charging pile interface to output the first random code to the charging pile; And / or, the third controller is configured to: control the second vehicle interface to output the first random code to the vehicle when the vehicle has the ability to pay.

16. The cloud server as described in claim 11, characterized in that, The charging pile interface is configured to receive settlement information from the charging pile.

17. The cloud server as described in claim 16, characterized in that, The third controller is configured to perform settlement based on the settlement information received from the charging pile via the charging pile interface.

18. The cloud server as described in any one of claims 11-17, characterized in that, The third controller is configured to: update the first random code after a preset time period; and control the second vehicle interface to output the updated first random code to the vehicle. And / or, the third controller is configured to: update the first random code after a preset time period; and control the charging pile interface to output the updated first random code to the charging pile; And / or, the third controller is configured to: update the first random code upon receiving a random code update request; and control the second vehicle interface to output the updated first random code to the vehicle; And / or, the third controller is configured to: update the first random code upon receiving a random code update request; and control the charging pile interface to output the updated first random code to the charging pile; And / or, the third controller is configured to reduce the preset time period in the event of a communication failure between the vehicle and the cloud server; And / or, the third controller is configured to recalculate the preset time period after receiving confirmation of receipt from the vehicle.

19. A charging and discharging system, characterized in that, include: The vehicle as described in any one of claims 1-3, and / or the charging pile as described in any one of claims 4-10, and / or the cloud server as described in any one of claims 11-18.

20. A charging and discharging system, characterized in that, include: A cloud server, configured to generate a first random code, the first random code being a random string output by the cloud server for authentication between the vehicle and the charging station; The vehicle is connected to the cloud server and is configured to receive the first random code and output a second random code to the charging pile. The second random code is a random string output by the vehicle for authentication between the vehicle and the charging pile; A charging pile, which is connected to the cloud server, and is configured to receive the second random code; The charging pile is configured to output a third random code to the cloud server. The third random code is a random string output by the charging pile for authentication between the vehicle and the charging pile. The cloud server is configured to perform authentication between the vehicle and the charging pile based on the first random code and the third random code. And / or, the charging pile is configured to: receive the first random code from the cloud server, and perform authentication between the vehicle and the charging pile based on the first random code and the second random code.

21. A charging and discharging method, characterized in that, Applied to vehicles, the charging and discharging method includes: In response to the connection between the vehicle and the charging pile, authentication is performed, the authentication including the vehicle outputting a second random code to the charging pile; the second random code is a random string output by the vehicle for the authentication between the vehicle and the charging pile; Based on the authentication result, the energy transfer between the vehicle and the charging pile is controlled.

22. The charging and discharging method as described in claim 21, characterized in that, The authentication process, performed in response to the connection between the vehicle and the charging station, includes: In response to the connection between the vehicle and the charging pile, and the fact that the vehicle has received the first random code, the authentication is performed; the first random code is a random string output by the cloud server for the authentication between the vehicle and the charging pile.

23. The charging and discharging method as described in claim 22, characterized in that, The vehicle has received the first random code, including: In response to receiving the first random code, the vehicle sends a confirmation message to the cloud server, the confirmation message being used to confirm that the vehicle has received the first random code; And / or, in response to a wake-up signal, output a random code update request to the cloud server, wherein the wake-up signal is a request message to update the first random code; And / or, in response to receiving the first random code, store the first random code.

24. The charging and discharging method as described in claim 21, characterized in that, The charging and discharging method further includes: If, within a preset request time after the second random code is output, the energy transmission between the vehicle and the charging pile is not initiated, the vehicle is controlled to issue an authentication failure message. And / or, in response to a connection signal between the vehicle and the charging station, initiate communication interaction between the charging station and the vehicle.

25. A charging and discharging method, characterized in that, Applied to charging piles, the charging and discharging method includes: In response to a second random code from the vehicle, a third random code is output to the cloud server, and the system waits for the authentication result from the cloud server. The third random code is a random string output by the charging pile for authentication between the vehicle and the charging pile. And / or, in response to the matching relationship between the second random code and the first random code, the system obtains the authentication result. The first random code is a random string output by the cloud server for authentication between the vehicle and the charging pile. Based on the authentication result, control the energy transfer between the vehicle and the charging pile; The second random code is a random string output by the vehicle for authentication between the vehicle and the charging pile.

26. The charging and discharging method as described in claim 25, characterized in that, The control of energy transfer between the vehicle and the charging station based on the authentication result includes: If the authentication result is a valid identity, control the energy transfer between the charging pile and the vehicle; And / or, if the authentication result is an invalid identity, stop the communication interaction between the charging pile and the vehicle; And / or, if the authentication result is an invalid identity, stop the communication interaction between the charging pile and the vehicle and issue a prompt message.

27. The charging and discharging method as described in claim 25, characterized in that, The step of obtaining the authentication result based on the matching relationship between the second random code and the first random code includes: If the second random code is valid, determine the matching relationship between the second random code and the first random code to obtain the authentication result.

28. The charging and discharging method as described in claim 27, characterized in that, When the second random code is valid, determining the matching relationship between the second random code and the first random code to obtain the authentication result includes: When the second random code is valid and contains the first random code, the energy transfer between the charging pile and the vehicle is initiated. If the second random code is valid and the second random code does not contain the first random code, the communication between the charging pile and the vehicle shall be stopped. If the second random code is valid and does not contain the first random code, the communication between the charging pile and the vehicle is stopped, and a prompt message is issued.

29. The charging and discharging method as described in claim 28, characterized in that, The charging and discharging method further includes: After the energy transfer between the charging pile and the vehicle is completed, settlement information is output to the cloud server.

30. The charging and discharging method according to any one of claims 25-29, characterized in that, The charging and discharging method further includes: If the second random code is invalid, the communication between the charging pile and the vehicle shall be stopped. And / or, if the second random code is invalid, stop the communication between the charging pile and the vehicle and issue a prompt message.

31. A charging and discharging method, characterized in that, Applied to cloud servers, the charging and discharging method includes: A first random code is generated and output to the vehicle. The first random code is a random string output by the cloud server for authentication between the vehicle and the charging pile. In response to a third random code from the charging pile, the authentication result is obtained based on the matching relationship between the third random code and the first random code, and the authentication result is output to the charging pile. The third random code is a random string output by the charging pile for the authentication between the vehicle and the charging pile; and / or, the first random code is output to the charging pile.

32. The charging and discharging method as described in claim 31, characterized in that, The step of generating a first random code and outputting the first random code to the vehicle includes: The first random code is updated after a preset time period, and the updated first random code is output to the vehicle. And / or, after a preset time period, update the first random code and output the updated first random code to the charging pile; And / or, upon receiving a random code update request, update the first random code and output the updated first random code to the vehicle; And / or, upon receiving a random code update request, update the first random code; and output the updated first random code to the charging pile.

33. The charging and discharging method as described in claim 32, characterized in that, The update of the first random code after the preset time period includes: In the event of a communication failure between the vehicle and the cloud server, the preset time period is reduced, and the first random code is updated after the reduced preset time period. And / or, after receiving confirmation of receipt from the vehicle, the preset time period is recalculated, and the first random code is updated after the recalculated preset time period.

34. The charging and discharging method as described in claim 31, characterized in that, The step of obtaining the authentication result based on the matching relationship between the third random code and the first random code includes: If the third random code contains the first random code, the authentication result is valid; And / or, if the third random code does not contain the first random code, the authentication result is invalid.

35. The charging and discharging method according to any one of claims 31-34, characterized in that, The charging and discharging method further includes: If the vehicle has the ability to pay, the first random code is output to the charging pile; And / or, if the vehicle has the ability to pay, output the first random code to the vehicle; And / or, settlement is made based on settlement information from the charging pile.

36. A charging and discharging method, characterized in that, Applied to a charging and discharging system, the charging and discharging system including a cloud server, a vehicle, and a charging pile, the charging and discharging method includes: The cloud server generates a first random code, which is a random string output by the cloud server for authentication between the vehicle and the charging pile. The cloud server outputs the first random code to the vehicle, the vehicle receives the first random code, and in response to the connection between the vehicle and the charging pile, the vehicle outputs a second random code to the charging pile. In response to receiving the second random code, the charging pile outputs a third random code. The cloud server, based on the matching relationship between the third random code and the first random code, obtains the authentication result and outputs the authentication result to the charging pile. The charging pile, based on the authentication result, controls the energy transfer between the vehicle and the charging pile; and / or, the cloud server outputs the first random code to the charging pile, and in response to receiving the second random code, the charging pile, based on the matching relationship between the second random code and the first random code, obtains the authentication result and, based on the authentication result, controls the energy transfer between the vehicle and the charging pile. The second random code is a random string output by the vehicle for authentication between the vehicle and the charging pile; the third random code is a random string output by the charging pile for authentication between the vehicle and the charging pile.

37. The charging and discharging method as described in claim 36, characterized in that, The charging and discharging method further includes: If the cloud server determines that the vehicle has the ability to pay, the cloud server outputs the first random code to the charging pile; And / or, if the cloud server determines that the vehicle has the ability to pay, the cloud server outputs the first random code to the vehicle; And / or, in response to the end of the energy transfer, the charging pile outputs settlement information to the cloud server; the cloud server receives the settlement information and performs settlement based on the settlement information.

38. A charging and discharging method, characterized in that, Applied to a charging and discharging system, the charging and discharging system including a vehicle and a charging station, the charging and discharging method includes: The vehicle plug of the charging pile is connected to the vehicle socket of the vehicle. The charging pile performs vehicle interface connection confirmation, and / or the vehicle performs vehicle interface connection confirmation; the vehicle interface connection confirmation is to determine whether the vehicle plug is connected to the vehicle socket. The charging pile and the vehicle interact with basic parameters and perform parameter matching. After the parameters are successfully matched, authentication is performed. The authentication is a process in which the vehicle and the charging pile exchange data through a random string to confirm the vehicle's permission to use the charging pile. If the authentication result is valid, control the energy transfer between the vehicle and the charging pile.

39. The charging and discharging method as described in claim 38, characterized in that, The charging and discharging system also includes a cloud server, and the charging and discharging method further includes: the random string is generated by the cloud server.

40. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed on a processor, cause the processor to perform: the steps performed by the vehicle in the charging / discharging method as described in any one of claims 21-24; and / or, the steps performed by the charging pile in the charging / discharging method as described in any one of claims 25-30; and / or, the steps performed by the cloud server in the charging / discharging method as described in any one of claims 31-35; and / or, the steps performed by the charging / discharging system in the charging / discharging method as described in any one of claims 36 or 37; and / or, the steps performed by the charging / discharging system in the charging / discharging method as described in any one of claims 38 or 39.

41. A computer program product, characterized in that, The computer program product includes a computer program that, when run on a computer, causes the computer to perform: the steps performed by the vehicle in the charging / discharging method as described in any one of claims 21-24; and / or, the steps performed by the charging pile in the charging / discharging method as described in any one of claims 25-30; and / or, the steps performed by the cloud server in the charging / discharging method as described in any one of claims 31-35; and / or, the steps performed by the charging / discharging system in the charging / discharging method as described in any one of claims 36 or 37; and / or, the steps performed by the charging / discharging system in the charging / discharging method as described in any one of claims 38 or 39.