A charging pile quantity configuration method and system

By combining queuing theory models and deep learning, the number of charging piles is dynamically adjusted, solving the problems of low sample efficiency and insufficient real-time performance in existing technologies. This achieves efficient and stable configuration of the number of charging piles, making it suitable for intelligent operation and scheduling of large-scale charging networks.

CN120634176BActive Publication Date: 2026-05-12SHANDONG JINGRUI ELECTRIC APPLIANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG JINGRUI ELECTRIC APPLIANCE CO LTD
Filing Date
2025-07-15
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing methods for configuring the number of charging piles are inefficient, fail to meet the real-time requirements of commercial sites, and are prone to failure under extreme loads.

Method used

By employing a queuing theory model and deep learning approach, combined with real-time data, the number of charging piles is dynamically adjusted. Through a custom operator and a dual safety threshold constraint mechanism, the number of charging piles can be configured efficiently and in real time.

Benefits of technology

It improves the sample efficiency and response agility of charging pile configuration, ensures service stability and equipment lifespan under extreme load conditions, and is suitable for intelligent operation and scheduling of large-scale charging networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120634176B_ABST
    Figure CN120634176B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of charging pile planning, and discloses a charging pile quantity configuration method and system, which comprises the following steps: collecting real-time data of a charging station, using a queuing theory model to calculate a queuing index under current configuration based on the real-time data, encapsulating the queuing index as a self-defined operator, and outputting a queuing state vector; constructing a charging pile configuration model based on a value function, dynamically determining the number of parallel service modules required to be adjusted in each control period based on the queuing state vector; establishing a double safety threshold constraint mechanism to correct the adjustment action output by the charging pile configuration model, and realizing the quantity configuration of the charging pile. The method has the advantages of low sample learning ability, edge deployability and strong robustness, and is suitable for intelligent operation and scheduling scenes of large-scale charging networks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of charging pile planning technology, specifically to a method and system for configuring the number of charging piles. Background Technology

[0002] In recent years, the number of electric vehicles has grown exponentially, and the peak-valley difference in charging demand in urban and highway scenarios has continued to widen. Traditional charging pile planning methods mostly rely on historical traffic flow and experience coefficients to configure the number of piles at one time, which is difficult to adapt to traffic surges caused by holidays, weather, or sudden events, resulting in severe queuing during peak hours and idle equipment during off-peak hours.

[0003] Meanwhile, with increasingly stringent carbon trading and demand-based electricity pricing, operators must not only control construction investment but also manage power allocation during operation to reduce peak loads and costs. While there have been attempts at dynamic scheduling based on reinforcement learning in recent years, queuing models are generally treated as black boxes, learning scaling strategies through trial and error, resulting in low sample efficiency and difficulty in meeting the real-time requirements of commercial sites. On the other hand, safety strategies that rely entirely on thresholds lack adaptability and are prone to failure under extreme loads. Therefore, a comprehensive solution combining the accuracy of queuing theory with the decision-making speed of deep learning is urgently needed. Summary of the Invention

[0004] In view of the above-mentioned problems, the present invention is proposed.

[0005] Therefore, the technical problem solved by the present invention is that the existing methods for configuring the number of charging piles have low sample efficiency and are difficult to meet the real-time requirements of commercial sites.

[0006] To solve the above technical problems, the present invention provides the following technical solution: a method for configuring the number of charging piles, comprising: collecting real-time data of charging stations, calculating queuing indicators under the current configuration based on the real-time data and using a queuing theory model, encapsulating the queuing indicators into a custom operator, and outputting a queuing state vector.

[0007] A charging pile configuration model based on value functions is constructed, and the number of parallel service modules that need to be adjusted in each control cycle is dynamically determined based on the queuing state vector.

[0008] A dual safety threshold constraint mechanism is established to correct the adjustment actions output by the charging pile configuration model, thereby realizing the configuration of the number of charging piles.

[0009] As a preferred embodiment of the charging pile quantity configuration method described in this invention, the real-time data includes charging station operation data, vehicle flow data, queuing data, and environmental data.

[0010] The charging station operation data includes the start / end timestamp, duration, charging capacity, and charging voltage and current curves for each charging pile;

[0011] The traffic flow data includes vehicle arrival rate, parking duration distribution, and parking space turnover rate.

[0012] As a preferred embodiment of the charging pile quantity configuration method described in this invention, the queuing theory model includes calculating traffic intensity based on real-time data:

[0013] ;

[0014] in, Indicates traffic intensity; Indicates vehicle arrival rate; Indicates the number of parallel service modules that have been enabled; This represents the average service rate of a single parallel service module;

[0015] when At that time, the probability that a vehicle needs to enter the queue is calculated using Erlang-C equations. Further calculate the queuing time:

[0016] ;

[0017] in, Indicates the waiting time in the queue; This indicates the probability that a vehicle needs to enter the queue;

[0018] when When the charging station is deemed saturated, queuing probability is not calculated, and the process switches to the safety coverage branch to determine the number of parallel service modules that need to be added at once, as follows:

[0019] ;

[0020] in, This indicates the total number of parallel service modules to be activated in the next cycle; This indicates taking the maximum value; This indicates the minimum number of parallel service modules that need to be started. This indicates the preset upper limit of security utilization. This indicates a floor function; it directly adjusts the number of enabled parallel service modules to the nearest integer. .

[0021] As a preferred embodiment of the charging pile quantity configuration method described in this invention, the queuing state vector includes the vehicle arrival rate. Average service rate and the number of parallel service modules As key input, the probability that a vehicle needs to enter the queue is calculated based on Erlang-C equations. The partial derivatives of the vehicle arrival rate with respect to the key inputs are expressed as:

[0022] ;

[0023] in, Represents the differential symbol;

[0024] Compile the forward formula and partial derivatives of the key inputs into a custom Autograd operator. The forward formula is: , and The calculation formula;

[0025] Output the queue state vector by concatenating tensors:

[0026] ;

[0027] in, Represents the queuing state vector; This indicates the concatenation operator; Represents an environmental data vector; Output by a custom Autograd operator.

[0028] As a preferred embodiment of the charging pile configuration method of the present invention, the charging pile configuration model includes defining output actions. , Indicates whether the content for the next cycle is enabled or disabled. Each parallel service module, based on the Dueling-DQN architecture, will... Input shared feature extractor Obtain the hidden vector;

[0029] The hidden vector is fed into both branch 1 and branch 2 simultaneously. Branch 1 calculates the state value, and branch 2 calculates the action advantage. Then, branch 1 and branch 2 are combined. The value was calculated, and the loss was calculated using the mean square TD-error.

[0030] Output actions based on a greedy strategy ,according to The number of parallel service modules can be dynamically adjusted.

[0031] As a preferred embodiment of the charging pile configuration method of the present invention, the charging pile configuration model further includes, based on the output action... After adjusting the number of parallel service modules, an immediate reward is obtained based on the reward function, which is expressed as follows:

[0032] ;

[0033] in, Indicates an immediate reward; The weighting factor representing the waiting cost; The weighting factor representing the cost of electricity; The weighting coefficient representing the module switching cost; Indicates time-of-use electricity pricing; This indicates the absolute value;

[0034] It is not a numerical result called separately from the queuing time function, but a tensor output from the custom Autograd operator, and has full automatic differentiation properties;

[0035] During the reverse propagation phase, from Initially, following the Dueling-DQN architecture, the process sequentially passes through branches one and two and the shared feature extractor, generating... , It contains three channels:

[0036] ;

[0037] in, Represents the loss function;

[0038] Based on the partial derivative formula in the custom Autograd operator, the error is further transformed into:

[0039] ;

[0040] The weights of the shared feature extractor are affected by the chain rule. The direction in which the waiting time deteriorates when a key input change is obtained within a single backpropagation.

[0041] As a preferred embodiment of the charging pile quantity configuration method described in this invention, the dual safety threshold constraint mechanism includes, upon acquiring the output action... Then, the arrival rate for the next period is estimated using an exponentially weighted moving average. ,according to The lower limit number of piles is calculated based on the average service rate.

[0042] ;

[0043] in, Indicates the lower limit number of stakes;

[0044] The number of parallel service modules enabled as output by the charging pile configuration model Theoretical constraints are ,like Then output action ;

[0045] like Then the coverage is ;

[0046] When the traffic intensity is less than the preset minimum traffic intensity, and the output action is... If the value is still negative, then it will be overwritten. .

[0047] A charging pile quantity configuration system using any of the methods described in this invention, wherein: a data acquisition module acquires real-time data of the charging station, calculates the queuing index under the current configuration based on the real-time data and using a queuing theory model, encapsulates the queuing index into a custom operator, and outputs a queuing state vector;

[0048] The scheduling module constructs a charging pile configuration model based on value functions and dynamically determines the number of parallel service modules that need to be adjusted in each control cycle based on the queuing state vector.

[0049] The constraint module establishes a dual safety threshold constraint mechanism to correct the adjustment actions output by the charging pile configuration model, thereby realizing the configuration of the number of charging piles.

[0050] The beneficial effects of this invention are as follows: This invention constructs a dynamic configuration method for the number of charging piles based on an analytical differentiable queuing analyzer and a value function-based reinforcement learning network. It achieves gradient propagation of queuing performance indicators to load parameters, making policy training more efficient and response more agile. Furthermore, it incorporates a two-way safety barrier mechanism to ensure service stability and equipment lifespan. This method possesses advantages such as low-sample learning capability, edge deployability, and strong robustness, making it suitable for intelligent operation and scheduling scenarios in large-scale charging networks. Attached Figure Description

[0051] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This is an overall flowchart of a method for configuring the number of charging piles according to an embodiment of the present invention;

[0053] Figure 2 This is a schematic diagram of a custom Autograd operator for a method of configuring the number of charging piles provided in the second embodiment of the present invention. Detailed Implementation

[0054] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0055] Example 1, referring to Figure 1 As an embodiment of the present invention, a method for configuring the number of charging piles is provided, comprising:

[0056] S1: Collect real-time data from the charging station, and based on the real-time data, use the queuing theory model to calculate the queuing index under the current configuration, encapsulate the queuing index into a custom operator, and output the queuing state vector.

[0057] A distributed data acquisition architecture based on edge computing gateways is adopted to monitor various operational and environmental factors of the target charging station and its surroundings in real time, collecting real-time data. Specifically, by communicating with the charging pile control unit, the system periodically collects data on the working status of each charging pile, the start and end times of charging orders, charging duration, current and voltage curves, and cumulative charging power, thereby accurately deriving the service rate per unit time and the utilization rate of the current charging pile group. In addition, by using geomagnetic detectors at the entrances and exits of the charging station or by employing camera license plate recognition technology, the system continuously counts vehicles entering the station, obtaining real-time vehicle arrival rate and parking behavior data; simultaneously, combined with ultrasonic or millimeter-wave sensors in the parking spaces, it further estimates the average dwell time of vehicles within the station and the turnover rate of parking spaces.

[0058] To effectively reflect queuing conditions, a queue recognition algorithm based on video intelligent analysis is introduced, or a multi-point geomagnetic detection module is used to count the number of waiting vehicles in the queuing lanes at the stations, forming continuous queue length data. Furthermore, to comprehensively consider the potential impact of external environmental factors on electric vehicle charging behavior, a network interface is used to connect with third-party meteorological services to obtain real-time meteorological data such as temperature, rainfall, and wind speed for the station's location. This data is then combined with public event data such as holiday information and local large-scale event schedules to construct an external environmental feature vector. To facilitate subsequent dynamic scheduling optimization based on electricity price response, the time-of-use electricity price curve, demand price tier, and historical station load curves of the power grid where the station is located are incorporated into the data acquisition system and uniformly stored and synchronized in the time-series database of the local edge node. All raw data is statistically analyzed using a sliding window at fixed intervals (e.g., every 5 minutes) to form a standardized, time-consistent input feature sequence, providing multi-dimensional data support for subsequent queuing analysis and reinforcement learning decision-making stages.

[0059] Through the integrated acquisition and normalization preprocessing of the above multi-source data, this invention can comprehensively capture and predict the core variables closely related to electric vehicle charging demand and queuing risk during the configuration and dynamic scheduling of charging piles, significantly improving the accuracy of characterizing the transient behavior of charging stations, and thus laying a data foundation for achieving optimized pile configuration and real-time control.

[0060] Furthermore, within each control cycle (a 5-minute cycle is selected in this embodiment), the vehicle arrival rate, service rate, number of activated service modules, and external environment feature vectors are received in real time, and queuing performance indicators with gradient information are generated accordingly to provide trainable input for subsequent reinforcement learning decisions.

[0061] Specifically, traffic intensity is calculated based on real-time data:

[0062] ;

[0063] in, Indicates traffic intensity; Indicates vehicle arrival rate; Indicates the number of parallel service modules that have been enabled; This represents the average service rate of a single parallel service module.

[0064] when At that time, the probability that a vehicle needs to enter the queue is calculated using Erlang-C equations. , is represented as:

[0065] ;

[0066] in, This indicates the probability that a vehicle needs to enter the queue; express factorial; Indicates a virtual summation index; express factorial.

[0067] Further calculation of queue waiting time:

[0068] ;

[0069] in, Indicates the waiting time in the queue; This indicates the probability that a vehicle needs to enter the queue.

[0070] when When the charging station is deemed saturated, queuing probability is not calculated, and the process switches to the safety coverage branch to determine the number of parallel service modules that need to be added at once, as follows:

[0071] ;

[0072] in, This indicates the total number of parallel service modules to be activated in the next cycle; This indicates taking the maximum value; This indicates the minimum number of parallel service modules that need to be started. This indicates the preset upper limit of security utilization. This indicates a floor function; it directly adjusts the number of enabled parallel service modules to the nearest integer. .

[0073] It should be noted that the actual meaning of the parallel service module depends on the specific type of charging pile. Currently, DC charging equipment typically has two power configuration methods: integrated small and medium power piles and modular high power piles. For integrated pile scenarios, the parallel service module is the charging gun, which is almost equal to the number of charging piles. For modular pile scenarios, the parallel service module refers to the power supply module or power module. The total parallel capacity is adjusted by switching the module on and off. Multiple modules can be connected in parallel to the same gun or split to multiple guns, depending on the site's scheduling strategy.

[0074] Similarly, the average service rate is the average service rate of a single parallel service unit (i.e., an independent charging gun or a power module that can be independently switched on and off) within the control cycle, which is equivalent to the number of vehicles that the unit can fully serve per unit time.

[0075] Furthermore, to enable the aforementioned queuing metrics to be directly optimized in deep reinforcement learning networks, analytical partial derivatives of the Erlang-C equations are derived, specifically:

[0076] In the Erlang-C equation, the probability that a vehicle needs to enter the queue is... and expected waiting time Relying on only three types of quantities: vehicle arrival rate Average service rate and the number of parallel service modules Other features (holidays, weather, etc.) also affect queuing, but they are primarily altered through the prediction network. or And then indirectly change Therefore, the vehicle arrival rate Average service rate and the number of parallel service modules As key input, the probability that a vehicle needs to enter the queue is calculated based on Erlang-C equations. Partial derivatives with respect to key inputs, including:

[0077] ;

[0078] by For example, the partial derivative of the vehicle arrival rate is expressed as:

[0079] ;

[0080] in, This represents the differential symbol. Similarly, for... , The partial derivatives can also be obtained strictly according to the chain rule, which will not be elaborated here.

[0081] Compile the forward formula and partial derivatives of the key inputs into a custom Autograd operator. The forward formula is: , and The calculation formula.

[0082] The operator outputs during forward propagation Three scalars are used, and intermediate variables are cached in the context; during the backpropagation phase, the cache is read, and the values ​​are returned all at once according to the parsing formula. The gradient vector has a time complexity of O(1). Regardless of the size of the input data, the execution time of the algorithm (or a certain step of the operation) remains within a constant range and does not increase with the change of the input amount. No Monte Carlo sampling or temperature annealing is required.

[0083] The original real-time data vector is then concatenated with the key input tensor along the feature dimension to output the queuing state vector:

[0084] ;

[0085] in, Represents the queuing state vector; This indicates the concatenation operator; Represents an environmental data vector; The gradient is output by a custom Autograd operator, so it can flow smoothly back to the Erlang-C equation along the concatenation position, thus affecting... Action selection in the next control cycle.

[0086] Through the aforementioned real-time analytical computation and gradient propagation mechanism, this invention achieves end-to-end coupling between queuing performance metrics and value function-based deep reinforcement learning networks without altering the fundamental Erlang-C theory. Compared to simply adding a waiting penalty to the reward signal, the introduction of analytical gradients significantly improves policy convergence speed and decision stability. Furthermore, compared to differentiable discrete event simulation methods that require complete event simulation and temperature smoothing, the computational load of the analytical layer in this embodiment is significantly reduced. When deployed on an Intel NUC i7 edge node, the total time for a single forward + backward pass does not exceed 20ms, meeting the real-time requirements for parallel operation of multiple sites within a 5-minute control cycle.

[0087] S2: Construct a charging pile configuration model based on value functions, and dynamically determine the number of parallel service modules that need to be adjusted in each control cycle based on the queuing state vector.

[0088] Furthermore, a charging pile configuration model based on value functions is constructed, and dynamic scaling control of power modules is achieved through a reinforcement learning decision layer. The decision layer is based on the deep Q-learning framework (DuelingDouble-DQN) with dual network advantage-value structure, and a differentiable queuing operator is embedded in the network computation graph to achieve analytical gradient coupling between queuing indicators, load parameters, and network weights.

[0089] Specifically, define the output action. , Indicates whether the content for the next cycle is enabled or disabled. Each parallel service module obtains the queuing state vector of the control cycle. ,Will Input shared feature extractor The hidden vectors are obtained. The shared feature extractor consists of two fully connected layers with hidden dimensions of 256 and 128, respectively, both using ReLU activation. Layer-Norm and Dropout of 0.1 are applied after the output of each layer to mitigate the uneven effect of features of different dimensions on the gradient scale.

[0090] The hidden vector is fed into both branch one and branch two simultaneously; branch one calculates the state value. Branch 2 calculation action advantage Combine branch one and branch two. The value is represented as:

[0091] ;

[0092] in, Represents the action value function; State value function; Represents the action advantage function; Indicates the number of elements in the action set; Represents a set of actions; This means removing the action variable from the action set. Take them out one by one. Output the action according to the greedy strategy. ,according to The number of parallel service modules can be dynamically adjusted.

[0093] Furthermore, based on the output action After adjusting the number of parallel service modules, an immediate reward is obtained based on the reward function, which is expressed as follows:

[0094] ;

[0095] in, Indicates an immediate reward; The weighting factor representing the waiting cost; The weighting factor representing the cost of electricity; The weighting coefficient representing the module switching cost; Indicates time-of-use electricity pricing; This indicates the absolute value; It is not a numerical result called separately from the queuing time function, but a tensor output from the custom Autograd operator, and has full automatic differentiation properties.

[0096] The training phase employs a Double-DQN update mechanism. After each batch of sampling is completed, an update is performed on the target network. Above calculation target value:

[0097] ;

[0098] in, Indicates the target value of the time difference; Indicates the discount factor; Indicate the target network; This represents the queuing state vector for the next cycle. Indicates using the main network in The optimal action selected below; Indicates the main network (currently online). network).

[0099] And using the mean squared TD-error as the loss function:

[0100] ;

[0101] in, Represent the loss function; update the main network weights using the AdamW optimizer. .

[0102] During the reverse propagation phase, from Initially, following the Dueling-DQN architecture, the process sequentially passes through branches one and two and the shared feature extractor, generating... , It contains three channels:

[0103] ;

[0104] in, This represents the loss function.

[0105] because This is the forward output of the Erlang-C equation. Based on the partial derivative formula in the custom Autograd operator, the error is further transformed into:

[0106] ;

[0107] Therefore, when the loss function includes a reward term At that time, backpropagation will automatically propagate the partial derivative of the loss with respect to the reward through the chain rule to the next level. This further affects the weights of the shared feature extractor. This means that even if the reward function itself does not include... With variables such as these, the network can also obtain the sensitivity feedback of queuing performance to action selection through the embedded analytical partial derivative information, which is not possible in traditional RL methods based on reward numerical estimation.

[0108] In other words, in this invention, the reward function in It is a function node with a differential path, rather than just a numerical assignment. Therefore, a backpropagation bridge from the queuing index to the input state variable is established between the reward and policy networks, enabling reinforcement learning to identify whether the expansion is effective earlier and more accurately.

[0109] Compared to the traditional approach where waiting time is merely used as a reward value, this invention encapsulates the queuing index into a differentiable operator, establishing:

[0110] ;

[0111] The analytical gradient channel. In each backpropagation, the network obtains the sensitivity information of the waiting deterioration rate to the load-service parameters, thereby significantly reducing the sample complexity; at the same time, this channel does not require additional simulation, and the edge inference still maintains an analytical complexity of O(1).

[0112] After completing online learning, the main network weights are quantized to INT8 format to export the inference model. The quantization process does not alter the parsing calculations of the Erlang-C layer, allowing edge nodes to perform forward evaluation of queuing indicators using only O(1) floating-point operations, followed by a single quantization matrix multiplication to output the action. Actual testing on the Jetson OrinNano platform showed an end-to-end inference latency of 18ms and power consumption below 6W, meeting the real-time requirement of a 5-minute decision cycle for commercial charging stations.

[0113] In summary, by embedding the queuing index into the DuelingDouble-DQN computation graph and constructing a complete analytical gradient mechanism, the reinforcement learning decision layer of this invention not only significantly improves sample efficiency and convergence speed, but also takes into account the inference requirements of low-computing-power edge hardware, achieving high-precision, low-latency adaptive control of the number of charging pile power modules.

[0114] S3: Establish a dual safety threshold constraint mechanism to correct the adjustment actions output by the charging pile configuration model and realize the number configuration of charging piles.

[0115] Furthermore, to ensure that the charging station can maintain its established service level and avoid equipment fatigue under any extreme load conditions, this invention adds an independent dual safety threshold constraint mechanism before the reinforcement learning action is actually delivered to the power module. This mechanism performs deterministic correction on the number of candidate servers output by DD-DQN and forms a two-way confirmation mechanism with the field PLC; at the same time, it feeds back the historical records that have been forced to be overwritten or delayed to the experience buffer so that the policy network can reduce the probability of violations in subsequent training.

[0116] Specifically, in obtaining the output action Then, the arrival rate for the next period is estimated using an exponentially weighted moving average. ,according to The lower limit number of piles is calculated based on the average service rate.

[0117] ;

[0118] in, This indicates the lower limit number of stakes.

[0119] The number of parallel service modules enabled as output by the charging pile configuration model Theoretical constraints are ,like Then output action ;like Then the coverage is .

[0120] When the traffic intensity is less than the preset minimum traffic intensity, and the output action is... If the value is still negative, then it will be overwritten. In addition, to avoid oscillations at the load edge, each power module must have a minimum 15-minute interval between two switching operations; requests that violate this minimum interval are flagged and carried over to the next cycle.

[0121] Number of target servers corrected by mechanism The data is sent to the PLC in the station via the OPC-UA channel. After the PLC completes the contactor action, it returns a timestamp confirmation frame. If no confirmation frame is received within 2 seconds, the system immediately enters fault degradation mode: all current modules are kept running, the fault code is recorded and stored in the log, and an alarm is triggered to prompt maintenance personnel to check the hardware interlocks or communication links.

[0122] This invention establishes a differentiable coupling mechanism between the queuing model and the deep reinforcement learning framework. For the first time, it rewrites the Erlang-C equation as a custom Autograd operator, providing closed-form partial derivatives of waiting probability and waiting time with respect to arrival rate, service rate, and number of servers. This operator is then embedded into the DuelingDouble-DQN computation graph. Consequently, queuing performance metrics not only serve as numerical inputs but also carry complete gradients into the value network, forming an analytical gradient path of "loss function → queuing metrics → load parameters." The network can accurately perceive the marginal benefit of scaling up or down on waiting time within a single backpropagation, significantly improving sample efficiency.

[0123] This embodiment also provides a charging pile quantity configuration system, including: a data acquisition module, which collects real-time data of charging stations, calculates queuing indicators under the current configuration based on the real-time data and using a queuing theory model, encapsulates the queuing indicators into a custom operator, and outputs a queuing state vector; a scheduling module, which constructs a charging pile configuration model based on a value function, and dynamically determines the number of parallel service modules to be adjusted in each control cycle based on the queuing state vector; and a constraint module, which establishes a dual safety threshold constraint mechanism to correct the adjustment actions output by the charging pile configuration model, thereby realizing the quantity configuration of charging piles.

[0124] Example 2, refer to Figure 2 This is one embodiment of the present invention.

[0125] like Figure 2 The image shows a schematic diagram of a custom Autograd operator. The real-time data is... The key input is .

[0126] The forward path is represented by a solid line, and the operator internally uses Erlang-C formulas to calculate traffic intensity. Probability of waiting Compared to expected waiting time The result is output to the network's state vector. The difference between this step and the traditional offline formula call is that the operator is embedded in the computation graph. The forward output is no longer a numerical value, but a complete differentiable tensor: PyTorch will concatenate them with the subsequent layers of the network in the same computation graph. Therefore, any subsequent operations that occur in the network (activation, normalization, linear transformation) can continue to track the gradient.

[0127] The reverse path is represented by a dashed line, when the loss function... When backpropagation begins, the network first generates pairs of... The gradients are then mapped to the pre-derived analytical partial derivatives by the custom operator. The gradients are fed back to the upstream layer. The analytical gradients are returned at the tensor level, requiring only constant-level operations, so the additional time consumed by the edge hardware is less than 10µs. After receiving these gradients, the upstream parameter layer (feature extraction network) can immediately adjust the weights, enabling the network to learn that "when λ increases slightly, wait for a rapid increase" and should tend to output expansion actions.

[0128] By using a custom Autograd operator to analyze gradient channels, the policy network can understand queuing dynamics without going through a lot of trial-penalty-correction blind exploration, thus significantly improving sample utilization and keeping inference latency negligible.

[0129] If the above functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0130] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0131] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0132] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0133] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for configuring the number of charging piles, characterized in that, include: Collect real-time data from charging stations, and based on the real-time data, use queuing theory models to calculate queuing indicators under the current configuration, encapsulate the queuing indicators into custom operators, and output queuing state vectors. A charging pile configuration model based on value functions is constructed, and the number of parallel service modules that need to be adjusted in each control cycle is dynamically determined based on the queuing state vector. A dual safety threshold constraint mechanism is established to correct the adjustment actions output by the charging pile configuration model, thereby realizing the configuration of the number of charging piles. The real-time data includes charging station operation data, traffic flow data, queue data, and environmental data; The charging station operation data includes the start / end timestamp, duration, charging capacity, and charging voltage and current curves for each charging pile; The traffic flow data includes vehicle arrival rate, parking duration distribution, and parking space turnover rate. The queuing theory model includes calculating traffic intensity based on real-time data: ; in, Indicates traffic intensity; Indicates vehicle arrival rate; Indicates the number of parallel service modules that have been enabled; This represents the average service rate of a single parallel service module; when At that time, the probability that a vehicle needs to enter the queue is calculated using Erlang-C equations. Further calculate the queuing time: ; in, Indicates the waiting time in the queue; This indicates the probability that a vehicle needs to enter the queue; when When the charging station is deemed saturated, queuing probability is not calculated, and the process switches to the safety coverage branch to determine the number of parallel service modules that need to be added at once, as follows: ; in, This indicates the total number of parallel service modules to be activated in the next cycle; This indicates taking the maximum value; This indicates the minimum number of parallel service modules that need to be started. This indicates the preset upper limit of security utilization. This indicates a floor function; it directly adjusts the number of enabled parallel service modules to the nearest integer. ; The queuing state vector includes the vehicle arrival rate. Average service rate and the number of parallel service modules As key input, the probability that a vehicle needs to enter the queue is calculated based on Erlang-C equations. The partial derivatives of the vehicle arrival rate with respect to the key inputs are expressed as: ; in, Represents the differential symbol; Compile the forward formula and partial derivatives of the key inputs into a custom Autograd operator. The forward formula is: , and The calculation formula; Output the queue state vector by concatenating tensors: ; in, Represents the queuing state vector; This indicates the concatenation operator; Represents an environmental data vector; Output by a custom Autograd operator; The charging pile configuration model includes defining output actions. , Indicates whether the content for the next cycle is enabled or disabled. Each parallel service module, based on the Dueling-DQN architecture, will... Input shared feature extractor Obtain the hidden vector; The hidden vector is fed into both branch 1 and branch 2 simultaneously. Branch 1 calculates the state value, and branch 2 calculates the action advantage. Then, branch 1 and branch 2 are combined. The value was calculated, and the loss was calculated using the mean square TD-error. Output actions based on a greedy strategy ,according to Dynamically adjust the number of parallel service modules; The dual security threshold constraint mechanism includes, when acquiring output actions Then, the arrival rate for the next period is estimated using an exponentially weighted moving average. ,according to The lower limit number of piles is calculated based on the average service rate. ; in, Indicates the lower limit number of stakes; The number of parallel service modules enabled as output by the charging pile configuration model Theoretical constraints are ,like Then output action ; like Then the coverage is ; When the traffic intensity is less than the preset minimum traffic intensity, and the output action is... If the value is still negative, then it will be overwritten. .

2. The method for configuring the number of charging piles as described in claim 1, characterized in that: The charging pile configuration model also includes, based on output actions After adjusting the number of parallel service modules, an immediate reward is obtained based on the reward function, which is expressed as follows: ; in, Indicates an immediate reward; The weighting factor representing the waiting cost; The weighting factor representing the cost of electricity; The weighting coefficient representing the module switching cost; Indicates time-of-use electricity pricing; This indicates the absolute value; It is not a numerical result called separately from the queuing time function, but a tensor output from the custom Autograd operator, and has full automatic differentiation properties; During the reverse propagation phase, from Initially, following the Dueling-DQN architecture, the process sequentially passes through branches one and two and the shared feature extractor, generating... , It contains three channels: ; in, Represents the loss function; Based on the partial derivative formula in the custom Autograd operator, the error is further transformed into: ; The weights of the shared feature extractor are affected by the chain rule. The direction in which the waiting time deteriorates when a key input change is obtained within a single backpropagation.

3. A charging pile quantity configuration system, applied to the charging pile quantity configuration method according to any one of claims 1 to 2, characterized in that, include, The data acquisition module collects real-time data from the charging station. Based on the real-time data, it uses a queuing theory model to calculate the queuing index under the current configuration, encapsulates the queuing index into a custom operator, and outputs the queuing state vector. The scheduling module constructs a charging pile configuration model based on value functions and dynamically determines the number of parallel service modules that need to be adjusted in each control cycle based on the queuing state vector. The constraint module establishes a dual safety threshold constraint mechanism to correct the adjustment actions output by the charging pile configuration model, thereby realizing the configuration of the number of charging piles.