Simulation charging pile test method, system and device based on charging pile simulator

Through TCP long connection and multi-threaded design based on the charging pile simulator, the charging process and faults are simulated, and the problem of manpower and material consumption in the development and testing of charging piles is solved, efficient data interaction and fault simulation are achieved, and cost is reduced.

CN120528837APending Publication Date: 2025-08-22ZHEJIANG AICHONG NETWORK TECH CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510619078.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2025-08-22

AI Technical Summary

Technical Problem

During the development and testing of charging piles, physical charging piles and new energy vehicles are needed to cooperate, which consumes a lot of manpower and material resources and is inefficient.

Method used

The charging pile simulator is adopted to establish a long connection with the platform server through the TCP protocol, simulate the charging process and faults, display data in real time, and adopt multi-threaded design to improve efficiency.

Benefits of technology

The data interaction test of charging APP, mini programs, and management platforms is realized without physical charging piles, saving material costs, and improving testing efficiency and operation convenience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120528837A_ABST
    Figure CN120528837A_ABST
Patent Text Reader

Abstract

The invention discloses a simulation charging pile test method, system and device based on a charging pile simulator, and relates to the technical field of simulation charging piles, and the method comprises the steps: obtaining parameters of a simulation charging pile and a platform server; tCP long connection is established between the simulation charging pile and the platform server; selecting different charging modes to test each charging flow to obtain charging process data; and obtaining fault data and log message data. According to the main technical scheme and effects, the charging pile simulator simulates data interaction of various business test scenes of a charging APP, an applet and a management platform, including charging pile charging and discharging, fault warning and the like, the test development process is separated from an actual charging pile and a new energy automobile, and the material preparation cost is greatly saved; according to the simulation charging pile, the multi-thread design is adopted, it is ensured that the process runs smoothly, the multiple charging pile simulators can be started to work at the same time, and the data interaction efficiency of the simulation charging pile and the platform server side is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of simulated charging piles, and in particular to a simulated charging pile testing method, system and device based on a charging pile simulator. Background Art

[0002] With the explosive growth of new energy vehicles, the number of simulated charging stations continues to increase, and various charging platforms have emerged one after another. Each platform faces the constant iteration of charging apps, mini-programs, and management platforms. During the development and testing process, physical charging stations and new energy vehicles are required to cooperate in development and debugging, which consumes a lot of manpower and material resources and reduces work efficiency. Summary of the Invention

[0003] In view of the shortcomings of the existing technology, there is a need for a charging pile simulator that can simulate charging pile data according to the charging protocol to meet the needs of data interaction during the development and testing of charging APPs, mini-programs, and management platforms. The present invention discloses a simulated charging pile testing method, system, and device based on a charging pile simulator.

[0004] A charging pile simulator-based test method for simulating data interaction and charging and discharging processes between a charging pile and a platform server is provided, and is characterized in that it includes the following steps:

[0005] Get the parameters of the simulated charging pile and platform server, and select the test environment from the drop-down list;

[0006] The simulated charging pile establishes a TCP long connection with the platform server through the TCP protocol;

[0007] Select different charging modes to test each charging process to obtain charging process data, and upload the charging process data to the platform server;

[0008] Acquire simulated charging pile faults and muzzle faults, and simulate output fault data;

[0009] Get log message data;

[0010] Real-time display of charging process data, fault data and log message data.

[0011] As an implementable embodiment, the simulated charging pile and platform server parameters include the simulated charging pile number, the number of gun muzzles, the platform server IP and port number.

[0012] As an implementable method, the simulated charging pile establishes a TCP long connection with the platform server through the TCP protocol, including the following steps:

[0013] Define the data format according to the charging protocol and simulate the data interaction between the charging pile and the platform server;

[0014] Use socket.socket to create a socket object and set socket options, including heartbeat maintenance, timeout, and exception handling;

[0015] According to the platform server IP and port number, call client.connect to establish a TCP long connection between the simulated charging pile and the platform server.

[0016] As an implementable method, the user inputs data parameters, selects the test environment, and views charging process data, fault data, and log message data through the graphical user interface of the PC-side charging pile simulator. The single or multiple charging pile simulators run on the PC side, and the charging pile simulator implements multi-threaded operation based on the threading module.

[0017] As an implementable method, the method of selecting different charging modes to test each charging process to obtain charging process data, and uploading the charging process data to the platform server includes:

[0018] Selecting a card charging mode, a VIN code charging mode, or a code scanning charging mode through the graphical user interface;

[0019] Receive charging command messages, check muzzle status and gun insertion status, and calculate charging parameters based on charging speed;

[0020] Construct and send charging start, charging and charging end event messages to obtain the current rate of the charging pile and the charging rate;

[0021] Receive rate information, analyze rate information, and calculate charging fees based on rate information during charging;

[0022] The muzzle status and charging parameters during the charging process, the current rate of the charging pile, and the charging rate in progress are uploaded to the platform server as charging process data.

[0023] As an implementable method, obtaining a simulated charging pile fault and muzzle fault and simulating output of fault data includes:

[0024] Select various fault states of the simulated charging pile and the muzzle through the graphical user interface;

[0025] During the charging process, the generation of charging pile faults and fault alarms are simulated according to the fault status, and the graphical user interface outputs fault data in real time.

[0026] As an implementable method, the acquisition of log message data, the simulated charging pile test system based on the charging pile simulator includes:

[0027] The logoutput function records the received and sent messages and event information into the log display control to generate log message data.

[0028] A simulated charging pile test system based on a charging pile simulator, comprising: a data simulation module, a long connection establishment module, a process simulation module, a fault simulation module, a log message acquisition module, and a data display module;

[0029] The data simulation module is used to obtain the parameters of the simulated charging pile and platform server, and select the test environment through the drop-down list;

[0030] The long connection establishment module is used to simulate the charging pile to establish a TCP long connection with the platform server through the TCP protocol;

[0031] The process simulation module is used to select different charging modes to test each charging process and upload the charging process data to the platform server;

[0032] The fault simulation module is used to obtain the simulated charging pile fault option and the muzzle fault option, simulate and output the fault data of the simulated charging pile, and upload the fault data to the platform server;

[0033] The log message acquisition module is used to obtain log message data;

[0034] The data display module is used to display charging process data, fault data and log message data in real time.

[0035] A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the following method:

[0036] Get the parameters of the simulated charging pile and platform server, and select the test environment from the drop-down list;

[0037] The simulated charging pile establishes a TCP long connection with the platform server through the TCP protocol;

[0038] Select different charging modes to test each charging process to obtain charging process data, and upload the charging process data to the platform server;

[0039] Acquire simulated charging pile faults and muzzle faults, and simulate output fault data;

[0040] Get log message data;

[0041] Real-time display of charging process data, fault data and log message data.

[0042] A simulated charging pile test device based on a charging pile simulator includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the following method is implemented:

[0043] Get the parameters of the simulated charging pile and platform server, and select the test environment from the drop-down list;

[0044] The simulated charging pile establishes a TCP long connection with the platform server through the TCP protocol;

[0045] Select different charging modes to test each charging process to obtain charging process data, and upload the charging process data to the platform server;

[0046] Acquire simulated charging pile faults and muzzle faults, and simulate output fault data;

[0047] Get log message data;

[0048] Real-time display of charging process data, fault data and log message data.

[0049] The present invention has significant technical effects due to the adoption of the above technical solutions:

[0050] 1. The charging pile simulator of the present invention simulates the data interaction of various business test scenarios of charging apps, mini-programs, and management platforms, including charging and discharging of charging piles, fault alarms, etc., realizing the separation of the test development process from the actual charging piles and new energy vehicles, greatly saving material preparation costs;

[0051] 2. The simulated charging pile of the present invention adopts a multi-threaded design to ensure smooth process operation and avoid lag caused by long tasks. If the PC performance is sufficient, multiple charging pile simulators can be started to work simultaneously, which greatly improves the data interaction between the simulated charging pile and the platform server and the efficiency of various business debugging;

[0052] 3. The graphical user interface of the charging pile simulator described in this embodiment is simple and easy to operate. The charging speed, charging results, and various types of faults can be selected through the graphical user interface, which facilitates the reproduction of the fault process, greatly improves the work efficiency of test development, and reduces the cost of use. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The following drawings are examples of specific implementation methods of this application:

[0054] Figure 1 1 is a flow chart of a method for testing a simulated charging pile based on a charging pile simulator according to an embodiment of the present invention;

[0055] Figure 2It is a schematic diagram of the overall structure of the simulated charging pile test system based on the charging pile simulator according to an embodiment of the present invention. DETAILED DESCRIPTION

[0056] The present invention will be further described below with reference to the accompanying drawings and embodiments. The following embodiments are intended to explain the present invention but the present invention is not limited to the following embodiments.

[0057] Example 1:

[0058] A simulation charging pile test method based on a charging pile simulator, such as Figure 1 As shown, the following steps are included:

[0059] S100: Obtain the parameters of the simulated charging pile and platform server, and select the test environment through the drop-down list;

[0060] S200, the simulated charging pile establishes a TCP long connection with the platform server through the TCP protocol;

[0061] S300, selecting different charging modes to test each charging process to obtain charging process data, and uploading the charging process data to the platform server;

[0062] S400: Acquire simulated charging pile fault and muzzle fault, and simulate output fault data;

[0063] S500, obtaining log message data;

[0064] S600: Display charging process data, fault data, and log message data in real time.

[0065] The charging pile simulator described in the present invention adopts a multi-threaded design to ensure smooth process operation and avoid freezes caused by long tasks. If the PC performance is sufficient, multiple charging pile simulators can be started to work simultaneously, which greatly improves the data interaction between the simulated charging pile and the platform server and the efficiency of various business debugging; the charging pile simulator simulates the data interaction between the simulated charging pile and the platform server in various business test scenarios of the charging APP, mini-programs, and management platform, and realizes that the test development process does not rely on actual charging piles and new energy vehicles, which greatly saves material preparation costs; the graphical user interface of the charging pile simulator is simple and easy to operate, and the charging speed, charging results, and various faults can be directly selected through the graphical user interface, which facilitates the reproduction of the fault process, greatly improves the work efficiency of test development, and reduces the cost of use.

[0066] In this embodiment, step S100 obtains the parameters of the simulated charging pile and the platform server, and selects the test environment through a drop-down list, which specifically includes the following steps:

[0067] S101: Use the PySimpleGUI library to build a graphical user interface for the charging pile simulator, providing multiple interactive controls, including drop-down menus, check boxes, buttons, and multi-line text display areas;

[0068] S102: Obtaining parameters of the simulated charging pile and the platform server through the graphical user interface input box of the charging pile simulator, wherein the parameters of the simulated charging pile and the platform server include the simulated charging pile number, the number of guns, the platform server IP and port number;

[0069] S103: Select a test environment through a drop-down list in the graphical user interface of the charging pile simulator.

[0070] The charging pile simulator implements multithreading through a threading module, ensuring that the program does not block the main thread when processing long-running tasks. For example, the charging process, card authentication, and offline charging functions are run in independent threads, improving the program's responsiveness and stability.

[0071] In this embodiment, the simulated charging pile in step S200 establishes a TCP long connection with the platform server through the TCP protocol, specifically including the following steps:

[0072] S210: defining multiple message formats according to the charging protocol to simulate data interaction between the charging pile and the platform server;

[0073] S220: Use socket.socket to create a socket object and set socket options, including heartbeat maintenance, timeout and exception handling, to implement communication based on the TCP protocol;

[0074] S230: Based on the platform server IP and port number, call client.connect to establish a TCP long connection between the simulated charging pile and the platform server, which can receive and parse the message sent by the platform server, and generate and send a response message that complies with the specific protocol.

[0075] Finally, when the program exits or the simulated charging station is disconnected from the network, call client.close() to close the socket connection and release resources such as memory and file handles.

[0076] In this embodiment, step S300 selects different charging modes to test each charging process to obtain charging process data, and uploads the charging process data to the platform server, specifically including the following steps:

[0077] The method of selecting different charging modes to test each charging process to obtain charging process data, and uploading the charging process data to the platform server, includes:

[0078] S310: Select from the card swiping charging mode, VIN code charging mode, and code scanning charging mode through the graphical user interface; the QR code used in the code scanning charging mode is generated by calling the qrepcode function based on the simulated charging pile number and muzzle number information.

[0079] S320: Receive the charging command message, check the muzzle status and the gun insertion status, and calculate the charging parameters according to the charging speed;

[0080] S330: Construct and send charging start, charging in progress, and charging end event messages to obtain the current rate and charging rate of the charging pile;

[0081] S340: Receive the rate message, parse the rate information, and calculate the charging fee according to the rate information during the charging process;

[0082] S350: Upload the muzzle status and charging parameters, the current rate of the charging pile, and the charging rate in progress as charging process data to the platform server.

[0083] In this embodiment, step S400 obtains simulated charging pile faults and muzzle faults, and simulates output of fault data, including the following steps:

[0084] S410: Select various fault states of the simulated charging pile and the muzzle through the graphical user interface;

[0085] S420: During the charging process, the generation of a charging pile fault and a fault alarm are simulated according to the fault state, and the graphical user interface outputs the fault data in real time.

[0086] In this embodiment, the step S500 of obtaining log message data includes:

[0087] The logoutput function records the received and sent messages and event information into the log display control to generate log message data. During the operation of the charging pile simulator, if there are exceptions such as network interruption or message processing failure, the charging pile simulator captures the exception and provides an exception handling mechanism, while generating the corresponding log message data.

[0088] In this embodiment, the real-time display of charging process data, fault data and log message data in step S600 specifically refers to real-time display of charging process data, fault data and log message data through a graphical user interface simulating a charging pile for user viewing.

[0089] In addition, the charging pile simulator described in this embodiment uses the epcode.txt local file to save the user's configuration information, including: test environment, simulated charging pile number, number of muzzles, etc., to facilitate loading at the next startup.

[0090] This embodiment captures and processes possible abnormal situations (such as network abnormalities, message parsing errors, etc.) to ensure the robustness of the charging pile simulator.

[0091] The charging pile simulator described in the present invention simulates the data interaction of various business test scenarios of charging APPs, mini-programs, and management platforms, including charging and discharging of charging piles, fault alarms, etc., thereby realizing the separation of the test development process from actual charging piles and new energy vehicles, greatly saving material preparation costs; the simulated charging pile described in the present invention adopts a multi-threaded design to ensure smooth process operation and avoid freezes caused by long-term tasks. If the PC performance is sufficient, multiple charging pile simulators can be started to work simultaneously, which greatly improves the data interaction between the simulated charging pile and the platform server and the efficiency of various business debugging; the graphical user interface of the charging pile simulator described in this embodiment is simple and easy to operate, and the charging speed, charging results, and various faults can be selected through the graphical user interface, which facilitates the reproduction of the fault process, greatly improves the work efficiency of test development, and reduces the cost of use.

[0092] Example 2:

[0093] A simulation charging pile test system based on a charging pile simulator, such as Figure 2 As shown, the single or multiple charging pile simulators are run on the PC side, and the simulated charging pile test system based on the charging pile simulator includes: a data simulation module 100, a long connection establishment module 200, a process simulation module 300, a fault simulation module 400, a log message acquisition module 500, and a data display module 600;

[0094] The data simulation module 100 is used to obtain the parameters of the simulated charging pile and platform server, and select the test environment through the drop-down list;

[0095] The long connection establishment module 200 is used to simulate the charging pile to establish a TCP long connection with the platform server through the TCP protocol;

[0096] The process simulation module 300 is used to select different charging modes to test each charging process and upload the charging process data to the platform server;

[0097] The fault simulation module 400 is used to obtain the simulated charging pile fault option and the muzzle fault option, simulate and output the fault data of the simulated charging pile, and upload the fault data to the platform server;

[0098] Log message acquisition module 500, used to obtain log message data;

[0099] The data display module 600 is used to display charging process data, fault data and log message data in real time.

[0100] Various changes and modifications can be made without departing from the spirit and scope of the present invention, and all equivalent technical solutions also fall within the scope of the present invention.

[0101] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referenced to each other.

[0102] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, apparatus, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0103] The present invention is described with reference to the flowcharts and / or block diagrams of the method, terminal device (system), and computer program product according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the process in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0104] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0105] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0106] It should be noted that:

[0107] References in this specification to "one embodiment" or "an embodiment" mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Therefore, appearances of the phrases "one embodiment" or "an embodiment" in various places throughout this specification do not necessarily refer to the same embodiment.

[0108] In addition, it should be noted that the shapes and names of the components of the specific embodiments described in this specification may vary. Any equivalent or simple variation based on the structure, features, and principles described in the patent concept of the present invention is included within the scope of protection of the patent. Those skilled in the art of the present invention may make various modifications, additions, or substitutions to the described specific embodiments, and these modifications, as long as they do not deviate from the structure of the present invention or exceed the scope defined by the claims, shall fall within the scope of protection of the present invention.

Claims

1. A charging pile simulation test method based on a charging pile simulator, used to simulate the data interaction and charging and discharging process between the charging pile and the platform server, characterized in that: The following steps are involved: Get the parameters of the simulated charging pile and platform server, and select the test environment from the drop-down list; The simulated charging pile establishes a TCP long connection with the platform server through the TCP protocol; Select different charging modes to test each charging process to obtain charging process data, and upload the charging process data to the platform server; Acquire simulated charging pile faults and muzzle faults, and simulate output fault data; Get log message data; Real-time display of charging process data, fault data and log message data.

2. The method for testing a simulated charging pile based on a charging pile simulator according to claim 1, wherein: The simulated charging pile and platform server parameters include the simulated charging pile number, the number of muzzles, the platform server IP and port number.

3. The method for testing a simulated charging pile based on a charging pile simulator according to claim 2, wherein: The simulated charging pile establishes a TCP long connection with the platform server through the TCP protocol, including the following steps: Define the data format according to the charging protocol and simulate the data interaction between the charging pile and the platform server; Use socket.socket to create a socket object and set socket options, including heartbeat maintenance, timeout, and exception handling; According to the platform server IP and port number, call client.connect to establish a TCP long connection between the simulated charging pile and the platform server.

4. The method for testing a simulated charging pile based on a charging pile simulator according to claim 1, wherein: The user inputs data parameters, selects the test environment, and views charging process data, fault data, and log message data through the graphical user interface of the PC-side charging pile simulator. The single or multiple charging pile simulators run on the PC side, and the charging pile simulator implements multi-threaded operation based on the threading module.

5. The method for testing a simulated charging pile based on a charging pile simulator according to claim 4, characterized in that: The method of selecting different charging modes to test each charging process to obtain charging process data, and uploading the charging process data to the platform server, includes: Selecting a card charging mode, a VIN code charging mode, or a code scanning charging mode through the graphical user interface; Receive charging command messages, check muzzle status and gun insertion status, and calculate charging parameters based on charging speed; Construct and send charging start, charging and charging end event messages to obtain the current rate of the charging pile and the charging rate; Receive rate information, analyze rate information, and calculate charging fees based on rate information during charging; The muzzle status and charging parameters during the charging process, the current rate of the charging pile, and the charging rate in progress are uploaded to the platform server as charging process data.

6. The method for testing a simulated charging pile based on a charging pile simulator according to claim 4, characterized in that: The obtaining of simulated charging pile faults and muzzle faults and the simulated output of fault data include: Select various fault states of the simulated charging pile and the muzzle through the graphical user interface; During the charging process, the generation of charging pile faults and fault alarms are simulated according to the fault status, and the graphical user interface outputs fault data in real time.

7. The method for testing a simulated charging pile based on a charging pile simulator according to claim 1, wherein: The acquisition of log message data, based on the charging pile simulator simulation charging pile test system includes: The logoutput function records the received and sent messages and event information into the log display control to generate log message data.

8. A simulated charging pile test system based on a charging pile simulator, characterized in that: include: Data simulation module, long connection establishment module, process simulation module, fault simulation module, log message acquisition module, data display module; The data simulation module is used to obtain the parameters of the simulated charging pile and platform server, and select the test environment through the drop-down list; The long connection establishment module is used to simulate the charging pile to establish a TCP long connection with the platform server through the TCP protocol; The process simulation module is used to select different charging modes to test each charging process and upload the charging process data to the platform server; The fault simulation module is used to obtain the simulated charging pile fault option and the muzzle fault option, simulate and output the fault data of the simulated charging pile, and upload the fault data to the platform server; The log message acquisition module is used to obtain log message data; The data display module is used to display charging process data, fault data and log message data in real time.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. A simulated charging pile test device based on a charging pile simulator, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Charging pile fault safety test method, system, medium and equipment

    CN121090972A