Charging and discharging power determination method and device, equipment, storage medium and program product

CN122830474APending Publication Date: 2026-09-29SHENZHEN POWER SUPPLY BUREAU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611295269.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-25
Publication Date
2026-09-29

AI Technical Summary

Technical Problem

然而,现有的方法存在准确性较差的问题

Benefits of technology

[0021]上述充放电功率确定方法、装置、计算机设备、计算机可读存储介质和计算机程序产品,先获取目标用户的家庭用电数据,并基于家庭用电数据、环境数据和目标车辆的车辆数据确定目标车辆的荷电状态,目标车辆的充电设备接入目标用户的家庭用电系统;然后,根据当前时间信息确定充放电场景,并利用充放电场景对应的模型权重值对初始模型进行权重加载处理,以获得目标模型;最后,利用家庭用电数据和荷电状态,基于目标模型确定目标车辆的充放电指令;充放电指令包括充放电功率,充放电指令用于指示充电设备按照充放电功率对目标车辆进行充放电。本申请提供的充放电功率确定方法,根据当前时间识别充放电场景,加载对应场景的模型权重得到目标模型,可以适配不同场景下用户用电行为、车辆充放电需求的差异,使模型输出的充放电功率贴合当前场景的实际特征,有效提升了充放电功率确定的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122830474A_ABST
    Figure CN122830474A_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, computer device, computer-readable storage medium, and computer program product for determining charge and discharge power. The method includes: acquiring household electricity consumption data of a target user, and determining the state of charge (SOC) of a target vehicle based on the household electricity consumption data, environmental data, and vehicle data of the target vehicle; connecting the target vehicle's charging equipment to the target user's household electricity system; determining a charging and discharging scenario based on current time information, and performing weight loading processing on an initial model using the model weight values ​​corresponding to the charging and discharging scenario to obtain a target model; determining charging and discharging instructions for the target vehicle based on the target model using the household electricity consumption data and SOC; the charging and discharging instructions include charging and discharging power, and are used to instruct the charging equipment to charge and discharge the target vehicle according to the charging and discharging power. This method can improve the accuracy of determining the charging and discharging power.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power technology, and in particular to a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for determining charging and discharging power. Background Technology

[0002] With the popularization of electric vehicles, the number of electric vehicles in household scenarios continues to grow. A large number of vehicle power batteries are connected to users' household power systems to participate in bidirectional charging and discharging scheduling. The optimization of electric vehicle charging and discharging has become a key means to improve the efficiency of power grid operation, smooth the peak and valley differences of household electricity consumption, reduce users' electricity costs, and reduce carbon emissions.

[0003] In existing technologies, most methods utilize a single fixed model to determine the charging and discharging power of a vehicle in order to achieve charging and discharging. However, existing methods suffer from poor accuracy. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product with high accuracy for determining charge and discharge power, in order to address the above-mentioned technical problems.

[0005] In a first aspect, this application provides a method for determining charge and discharge power, including:

[0006] Acquire household electricity consumption data of the target user, and determine the state of charge of the target vehicle based on household electricity consumption data, environmental data and vehicle data of the target vehicle. The charging equipment of the target vehicle is connected to the household electricity system of the target user.

[0007] The charging and discharging scenario is determined based on the current time information, and the initial model is weighted using the model weight values ​​corresponding to the charging and discharging scenario to obtain the target model.

[0008] Using household electricity consumption data and state of charge, the charging and discharging instructions for the target vehicle are determined based on the target model. The charging and discharging instructions include the charging and discharging power, and are used to instruct the charging equipment to charge and discharge the target vehicle according to the charging and discharging power.

[0009] In one embodiment, determining the state of charge (SBC) of a target vehicle based on household electricity consumption data, environmental data, and vehicle data of the target vehicle includes: determining the charge / discharge load corresponding to the target vehicle based on household electricity consumption data and environmental data; and determining the SBC of the target vehicle based on the charge / discharge load and vehicle data of the target vehicle.

[0010] In one embodiment, determining the state of charge (SBC) of a target vehicle based on the charge / discharge load and vehicle data of the target vehicle includes: acquiring time information of the target vehicle being connected to the charging device, and determining the battery capacity and charge / discharge efficiency of the target vehicle based on the vehicle data; and using the charge / discharge load, determining the SBC of the target vehicle based on the time information, battery capacity, and charge / discharge efficiency.

[0011] In one embodiment, the charging and discharging scenarios include weekday scenarios and non-weekday scenarios. The initial model is weighted using the model weight values ​​corresponding to the charging and discharging scenarios to obtain a target model. This includes: when the charging and discharging scenario is a weekday scenario, the initial model is weighted using the first model weights corresponding to the weekday scenario to obtain the target model; when the charging and discharging scenario is a non-weekday scenario, the initial model is weighted using the second model weights corresponding to the non-weekday scenario to obtain the target model. The second model weights are obtained by adjusting and training the initial model using sample data corresponding to non-weekday scenarios, with the first model weights as the initial weights.

[0012] In one embodiment, the charging and discharging instructions for the target vehicle are determined based on a target model using household electricity consumption data and state of charge, including: determining real-time baseline load and user occupancy status based on household electricity consumption data; and determining the charging and discharging instructions for the target vehicle based on the target model using household electricity consumption data, state of charge, real-time baseline load, and user occupancy status.

[0013] In one embodiment, the charging and discharging instructions for the target vehicle are determined based on the target model using household electricity consumption data, state of charge, real-time baseline load, and user occupancy status. This includes: inputting household electricity consumption data, state of charge, real-time baseline load, and user occupancy status into the target model so that the target model can perform multi-objective optimization under preset charging and discharging power constraints, battery state of charge constraints, and household load constraints to obtain the charging and discharging instructions for the target vehicle.

[0014] Secondly, this application also provides a charging / discharging power determining device, comprising:

[0015] The acquisition module is used to acquire the household electricity consumption data of the target user, and determine the state of charge of the target vehicle based on the household electricity consumption data, environmental data and vehicle data of the target vehicle. The charging equipment of the target vehicle is connected to the household electricity system of the target user.

[0016] The determination module is used to determine the charging and discharging scenario based on the current time information, and to perform weight loading processing on the initial model using the model weight values ​​corresponding to the charging and discharging scenario to obtain the target model;

[0017] The execution module is used to determine the charging and discharging commands for the target vehicle based on the target model using household electricity consumption data and state of charge. The charging and discharging commands include charging and discharging power, and are used to instruct the charging equipment to charge and discharge the target vehicle according to the charging and discharging power.

[0018] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any of the embodiments of the first aspect above.

[0019] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the embodiments of the first aspect above.

[0020] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the embodiments of the first aspect above.

[0021] The aforementioned method, apparatus, computer equipment, computer-readable storage medium, and computer program product for determining charging and discharging power first acquire the target user's household electricity consumption data, and determine the target vehicle's state of charge (SOC) based on the household electricity consumption data, environmental data, and vehicle data. The target vehicle's charging equipment is then connected to the target user's household electricity system. Next, a charging and discharging scenario is determined based on the current time information, and the initial model is weighted using the model weight values ​​corresponding to the charging and discharging scenario to obtain a target model. Finally, charging and discharging instructions for the target vehicle are determined based on the target model using the household electricity consumption data and SOC. The charging and discharging instructions include charging and discharging power, and are used to instruct the charging equipment to charge and discharge the target vehicle according to the charging and discharging power. The charging and discharging power determination method provided in this application identifies the charging and discharging scenario based on the current time and loads the corresponding scenario's model weights to obtain the target model. This method can adapt to the differences in user electricity consumption behavior and vehicle charging and discharging needs under different scenarios, ensuring that the charging and discharging power output by the model closely matches the actual characteristics of the current scenario, effectively improving the accuracy of charging and discharging power determination. Attached Figure Description

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

[0023] Figure 1This is a flowchart illustrating a method for determining charge / discharge power in one embodiment;

[0024] Figure 2 This is a flowchart illustrating a method for determining the state of charge of a target vehicle in one embodiment.

[0025] Figure 3 This is a flowchart illustrating a method for determining the state of charge of a target vehicle in another embodiment;

[0026] Figure 4 This is a flowchart illustrating a method for obtaining a target model in one embodiment;

[0027] Figure 5 This is a flowchart illustrating a method for determining a charging / discharging command for a target vehicle in one embodiment.

[0028] Figure 6 This is a flowchart illustrating the method for determining charge / discharge power in another embodiment;

[0029] Figure 7 This is a structural block diagram of a charge / discharge power determination device in one embodiment;

[0030] Figure 8 This is an internal structural diagram of a computer device in one embodiment;

[0031] Figure 9 This is a diagram of the internal structure of a computer device in another embodiment. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0033] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0034] With the popularization of electric vehicles, the number of electric vehicles in household scenarios continues to grow. A large number of vehicle power batteries are connected to users' household power systems to participate in bidirectional charging and discharging scheduling. The optimization of electric vehicle charging and discharging has become a key means to improve the efficiency of power grid operation, smooth the peak and valley differences of household electricity consumption, reduce users' electricity costs, and reduce carbon emissions.

[0035] In existing technologies, most methods utilize a single fixed model to determine the charging and discharging power of a vehicle in order to achieve charging and discharging. However, existing methods suffer from poor accuracy.

[0036] In view of this, this application provides a method for determining charging and discharging power. First, it acquires the target user's household electricity consumption data, and determines the target vehicle's state of charge (SOC) based on the household electricity consumption data, environmental data, and vehicle data. The target vehicle's charging equipment is connected to the target user's household electricity system. Then, it determines the charging and discharging scenario based on the current time information, and applies the corresponding model weights to the initial model to obtain a target model. Finally, it uses the household electricity consumption data and SOC to determine the target vehicle's charging and discharging instructions based on the target model. The charging and discharging instructions include the charging and discharging power, and are used to instruct the charging equipment to charge and discharge the target vehicle according to the specified power. The charging and discharging power determination method provided in this application identifies the charging and discharging scenario based on the current time and applies the corresponding model weights to obtain the target model. This method can adapt to differences in user electricity consumption behavior and vehicle charging and discharging needs under different scenarios, ensuring that the model's output charging and discharging power matches the actual characteristics of the current scenario, effectively improving the accuracy of charging and discharging power determination.

[0037] The charging and discharging power determination method provided in this application can be executed by a computer device, which can be a terminal or a server.

[0038] In one exemplary embodiment, such as Figure 1 As shown, a method for determining charge and discharge power is provided, which includes the following steps:

[0039] Step 101: Obtain the household electricity consumption data of the target user, and determine the state of charge of the target vehicle based on the household electricity consumption data, environmental data, and vehicle data of the target vehicle.

[0040] Optionally, household electricity consumption data may include power consumption data collected by smart meters, user time-of-use tariff plan data, and historical electricity load data before and after the popularization of electric vehicles. Among them, power consumption data refers to the time-series power data collected from the household's total electricity consumption port, which includes the total power of the household's basic electricity load and the charging and discharging of electric vehicles; user time-of-use tariff plan data refers to the peak-shaving-valley time-of-use electricity pricing configuration information implemented by the user.

[0041] Environmental data refers to external environmental data that affects electricity consumption and charging / discharging optimization calculations. Examples include time-specific carbon emission marginal factors, ambient temperature, and ambient humidity.

[0042] Vehicle data refers to the inherent parameters of the target electric vehicle itself, as well as vehicle operation-related parameters. Examples include battery rated capacity, charging and discharging efficiency, maximum charging power, and maximum discharging power.

[0043] The target vehicle's charging equipment is connected to the target user's home power system. The target vehicle's state of charge (SOC) refers to the proportion of the remaining charge of the target vehicle's power battery to its rated capacity, especially including the SOC at the moment the vehicle is connected to the home charging equipment, reflecting the remaining battery charge level when the vehicle is connected to the charging equipment.

[0044] In some exemplary embodiments, a computer device may acquire household electricity consumption data of a target user.

[0045] Specifically, computer equipment can establish a communication connection with the target user's smart meter and obtain household electricity consumption data from the smart meter.

[0046] Furthermore, after acquiring the target user's household electricity consumption data, the computer equipment can determine the target vehicle's state of charge based on the household electricity consumption data, environmental data, and the target vehicle's vehicle data.

[0047] Specifically, computer equipment can input household electricity consumption data, environmental data, and vehicle data of the target vehicle into a pre-trained state of charge determination model to obtain the state of charge of the target vehicle output by the state of charge determination model.

[0048] Step 102: Determine the charging and discharging scenario based on the current time information, and use the model weight values ​​corresponding to the charging and discharging scenario to perform weight loading processing on the initial model to obtain the target model.

[0049] Optionally, the current time information may include date and time information. Charging and discharging scenarios can be used to indicate the user behavior patterns of the target user; different charging and discharging scenarios correspond to different household electricity consumption habits, user home occupancy patterns, and the distribution of electric vehicle charging and discharging demand. For example, charging and discharging scenarios may include weekday scenarios and non-weekday scenarios.

[0050] The initial model is a pre-built basic neural network model. For example, the initial model can be a fully connected neural network with 3 hidden layers and 64 neurons in each layer, with Leaky-ReLU as the activation function and AdamW as the optimizer.

[0051] In some exemplary embodiments, the computer device can determine the charging and discharging scenario based on the current time information.

[0052] Specifically, computer devices can parse the day of the week in the current time information. If it is identified as Monday to Friday, it is determined to be a weekday scenario; if it is identified as Saturday or Sunday, it is determined to be a non-working day scenario.

[0053] Furthermore, after determining the charging and discharging scenario based on the current time information, the computer device can use the model weight values ​​corresponding to the charging and discharging scenario to perform weight loading processing on the initial model to obtain the target model.

[0054] Specifically, computer equipment can load the pre-saved model weight values ​​corresponding to the charging and discharging scenarios into the initial model to obtain a target model that adapts to the user's electricity consumption and charging and discharging behavior in the charging and discharging scenarios.

[0055] Step 103: Using household electricity consumption data and state of charge, determine the charging and discharging commands for the target vehicle based on the target model.

[0056] Optionally, the charge / discharge command includes the charge / discharge power, which instructs the charging equipment to charge and discharge the target vehicle according to the charge / discharge power.

[0057] In some exemplary embodiments, after obtaining the target model, the computer device can use household electricity consumption data and state of charge to determine the charging and discharging instructions for the target vehicle based on the target model.

[0058] Specifically, computer equipment can input household electricity consumption data and state of charge into the target model to obtain charging and discharging commands for the target vehicle output by the target model.

[0059] The aforementioned method for determining charging and discharging power first acquires the target user's household electricity consumption data, and then determines the target vehicle's state of charge (SOC) based on the household electricity consumption data, environmental data, and vehicle data. The target vehicle's charging equipment is then connected to the target user's household electricity system. Next, the charging and discharging scenario is determined based on the current time information, and the initial model is weighted using the model weights corresponding to the charging and discharging scenario to obtain the target model. Finally, using the household electricity consumption data and SOC, the charging and discharging instructions for the target vehicle are determined based on the target model. The charging and discharging instructions include the charging and discharging power, and are used to instruct the charging equipment to charge and discharge the target vehicle according to the charging and discharging power. The charging and discharging power determination method provided in this application identifies the charging and discharging scenario based on the current time and loads the corresponding scenario's model weights to obtain the target model. This method can adapt to the differences in user electricity consumption behavior and vehicle charging and discharging needs under different scenarios, ensuring that the model's output charging and discharging power matches the actual characteristics of the current scenario, effectively improving the accuracy of charging and discharging power determination.

[0060] In one exemplary embodiment, such as Figure 2As shown, the state of charge of the target vehicle is determined based on household electricity consumption data, environmental data, and vehicle data, including the following steps:

[0061] Step 201: Based on household electricity consumption data and environmental data, determine the charging and discharging load corresponding to the target vehicle.

[0062] Optionally, the charging and discharging load corresponding to the target vehicle can characterize the charging and discharging power generated by the target vehicle on a home charging device.

[0063] In some exemplary embodiments, a computer device can determine the charging and discharging load corresponding to a target vehicle based on household electricity consumption data and environmental data.

[0064] Specifically, the computer equipment can input the time-series measured power sequence from household electricity consumption data and meteorological data from environmental data into a pre-trained Long Short-Term Memory (LSTM) network model. The LSTM model then predicts and outputs the household baseline load. By subtracting the predicted household baseline load from the measured household load, the charging and discharging load corresponding to the target vehicle can be calculated. The household baseline load is the electricity load generated by the household's electrical appliances after excluding the charging and discharging behavior of electric vehicles.

[0065] Step 202: Determine the state of charge of the target vehicle based on the charging and discharging load and the vehicle data of the target vehicle.

[0066] In some exemplary embodiments, after determining the charging and discharging load corresponding to the target vehicle based on household electricity consumption data and environmental data, the computer device can determine the state of charge of the target vehicle based on the charging and discharging load and the vehicle data of the target vehicle.

[0067] Specifically, the computer equipment can obtain the time information of the target vehicle connecting to the charging equipment, and determine the state of charge of the target vehicle based on the time information, the charging and discharging load and the vehicle data of the target vehicle.

[0068] In this embodiment, the charging and discharging load corresponding to the target vehicle is determined based on household electricity consumption data and environmental data; the state of charge (SOC) of the target vehicle is determined based on the charging and discharging load and the vehicle data; the household baseline load is predicted by combining long short-term memory network with time-series measured power and meteorological environmental data, thus effectively separating the baseline load from the vehicle charging and discharging load in the total household load. No additional on-board data acquisition equipment is required; the vehicle charging and discharging load can be obtained solely based on the existing smart meter and environmental data on the household side; and the SOC is then derived by combining the vehicle access time and inherent vehicle parameters, achieving non-intrusive SOC estimation. This avoids problems such as limited data acquisition and transmission anomalies caused by relying on data uploaded from the vehicle's on-board terminal, thereby improving the reliability of the SOC estimation results.

[0069] In one exemplary embodiment, such as Figure 3 As shown, the state of charge of the target vehicle is determined based on the charging and discharging load and the vehicle data of the target vehicle, including the following steps:

[0070] Step 301: Obtain the time information of the target vehicle connecting to the charging equipment, and determine the battery capacity and charging / discharging efficiency of the target vehicle based on the vehicle data.

[0071] In some exemplary embodiments, the computer device can obtain time information of when the target vehicle connects to the charging device.

[0072] Specifically, the computer equipment can read charging start-stop event records from local records of the home charging equipment or cloud management platform to obtain the arrival time of the target vehicle when it connects to the charging equipment and the departure time of the vehicle when it leaves the charging equipment, as time information; this time information marks the time interval during which the vehicle participates in charging and discharging scheduling at the station.

[0073] Furthermore, computer equipment can determine the battery capacity and charge / discharge efficiency of a target vehicle based on vehicle data.

[0074] Specifically, computer equipment can analyze vehicle data of the target vehicle to obtain the rated capacity and charge / discharge efficiency of the target vehicle's power battery. For example, the rated capacity of the battery can be 60kWh, and the charge / discharge efficiency can be 0.9; the battery capacity represents the maximum electrical energy that the power battery can store, and the charge / discharge efficiency represents the energy loss coefficient of electrical energy during the charging and discharging process of the battery.

[0075] Step 302: Using the charge and discharge load, based on time information, battery capacity, and charge and discharge efficiency, determine the state of charge of the target vehicle.

[0076] In some exemplary embodiments, a computer device can use charge / discharge load to determine the state of charge of a target vehicle based on time information, battery capacity, and charge / discharge efficiency.

[0077] Specifically, using the vehicle's state of charge at the moment of departure as a known benchmark, the charging and discharging load time-series data within the interval from arrival to departure are taken, and combined with battery capacity and charging and discharging efficiency, integral quantization is performed to back-calculate and obtain the arrival state of charge when the vehicle is connected to the charging equipment. The calculation formula is as follows: , The state of charge of the vehicle at the time of arrival (when it is connected to the charging equipment). The state of charge at the moment the vehicle leaves. Battery capacity; For charge and discharge efficiency; The arrival time of the vehicle; The time the vehicle leaves; Let t be the charge / discharge load at time t. This is a linear rectified function; if the input is positive, the output is the original value; if the input is negative, the output is 0. The process involves summing the time steps from arrival to departure. The charging / discharging load corresponding to charging is taken as positive, and the charging / discharging load corresponding to discharging is taken as negative. The discharging power is constrained using a linear rectification function, and only the actual electrical energy input to the battery is counted. By accumulating and converting the charging and discharging energy within the time interval, the ratio of the remaining battery charge to the rated capacity at arrival time is obtained, which represents the target vehicle's state of charge.

[0078] In this embodiment, the time information of the target vehicle's access to the charging equipment is obtained, and the battery capacity and charging / discharging efficiency of the target vehicle are determined based on the vehicle data. Using the charging / discharging load, the state of charge (SOC) of the target vehicle is determined based on the time information, battery capacity, and charging / discharging efficiency. The access and departure times of the vehicle are obtained through the start-stop event records on the charging equipment side, without relying on the on-board battery management system to upload the original SOC data in real time, reducing the dependence on the vehicle-side data communication interface. By using the separated charging / discharging load time-series data and combining it with the battery's inherent parameters, the SOC at the time of vehicle arrival is derived through a quantitative summation formula. Non-intrusive SOC estimation can be completed using only data that can be collected on the home side, avoiding estimation failures caused by missing on-board data or transmission anomalies, and ensuring the accuracy of SOC estimation.

[0079] In one exemplary embodiment, such as Figure 4 As shown, the charging and discharging scenarios include weekday and non-weekday scenarios. The initial model is weighted using the model weight values ​​corresponding to the charging and discharging scenarios to obtain the target model, including the following steps:

[0080] Step 401: When the charging / discharging scenario is a weekday scenario, the initial model is weighted using the first model weight corresponding to the weekday scenario to obtain the target model.

[0081] In some exemplary embodiments, when the charging and discharging scenario is a weekday scenario, the computer device can use the first model weight corresponding to the weekday scenario to perform weight loading processing on the initial model to obtain the target model.

[0082] Step 402: When the charging and discharging scenario is a non-working day scenario, the initial model is weighted using the second model weight corresponding to the non-working day scenario to obtain the target model.

[0083] In some exemplary embodiments, when the charging and discharging scenario is a non-working day scenario, the computer device can use the second model weight corresponding to the non-working day scenario to perform weight loading processing on the initial model to obtain the target model.

[0084] The second model weights are obtained by adjusting and training the initial model using sample data corresponding to non-working days, with the first model weights as the initial weights. For example, the initial model network structure remains fixed, while the first and second model weights are two independently stored sets of network parameters, differing only in the weight parameters, while the network layer structure and the number of neurons remain completely consistent.

[0085] In an optional embodiment of this application, the offline training process for the first model weights and the second model weights can be as follows: The initial model is fully trained using a historical sample dataset from weekday scenarios. The training epochs can be set to 5000 epochs, the batch size to 100, and the learning rate to 1×10⁻⁶. -3 After training, the network parameters are saved to obtain the first model weights. Then, these first model weights are used as the network initialization parameters to import the initial model. Fine-tuning training is then carried out using historical sample datasets from non-working days, with 3000 training epochs set, keeping the AdamW optimizer and learning rate unchanged. During the fine-tuning process, the multi-objective weight coefficients are adjusted, increasing the weight coefficient corresponding to carbon emissions from 1 to 1.2 to adapt to the behavioral characteristics of users' electricity consumption and charging needs on non-working days. After the fine-tuning training is completed, the network parameters are saved to obtain the second model weights.

[0086] In this embodiment, when the charging / discharging scenario is a weekday scenario, the initial model is weighted using the first model weights corresponding to the weekday scenario to obtain the target model. When the charging / discharging scenario is a non-weekday scenario, the initial model is weighted using the second model weights corresponding to the non-weekday scenario to obtain the target model. The second model weights are obtained by adjusting and training the initial model using the first model weights as the initial weights and the sample data corresponding to non-weekday scenarios. By using the same initial model network architecture, two sets of weight parameters are trained for weekdays and non-weekdays respectively. Non-weekday scenarios are fine-tuned based on the model weights used for weekdays, eliminating the need to train the network from scratch and reducing training costs and sample requirements for non-weekday scenarios. In actual operation, the target model can be generated simply by loading the corresponding weights based on the identified charging / discharging scenario, without the need for online training, resulting in a fast response time. Compared to the processing method of a single fixed model, the two sets of weights adapt to the differences in user household occupancy patterns, electricity usage habits, and electric vehicle charging / discharging needs under the two scenarios, improving the model's insufficient cross-scenario generalization ability and making the model output results more consistent with the real working conditions of the current scenario, thereby improving the accuracy of subsequent charging / discharging power determination.

[0087] In one exemplary embodiment, such as Figure 5 As shown, using household electricity consumption data and state of charge, the charging and discharging commands for the target vehicle are determined based on the target model, including the following steps:

[0088] Step 501: Determine the real-time baseline load and user occupancy status based on household electricity consumption data.

[0089] Optionally, the real-time baseline load is the real-time power load generated by the operation of various household appliances inside the home after excluding the charging and discharging power of electric vehicles, which can reflect the power consumption level of the user's household itself.

[0090] User occupancy status is used to characterize whether a target user is in a residential household. Whether a user is at home or not will directly change household electricity consumption behavior and the time window for scheduled charging and discharging of electric vehicles. It is divided into two states: occupied and unoccupied.

[0091] In some exemplary embodiments, a computer device can determine real-time baseline load and user occupancy status based on household electricity consumption data.

[0092] Specifically, the computer equipment can input the time-series measured power sequence from household electricity consumption data into a pre-trained long short-term memory network model to predict and output the real-time baseline load of the household. For user occupancy status, it selects the daily power sequence from household electricity consumption data and calculates three indicators: average power, power standard deviation, and power range. During the daytime, it dynamically executes threshold judgment logic for these three indicators, and during the nighttime, it infers based on the previous night's data. When the average power, power standard deviation, and power range all meet the preset judgment thresholds, the user is determined to be occupying the household; otherwise, the user is determined not to be occupying the household, thus completing the identification of user occupancy status. This identification method relies solely on household electricity consumption data collected by smart meters, eliminating the need for additional human body or infrared sensors, achieving non-invasive status determination.

[0093] After acquiring various features such as baseline load, electricity price, state of charge, and carbon emission factor, the computer equipment can also perform data standardization: normalize the baseline load to the [-1, 0] interval; normalize the electricity price data to the [-1, 1] interval; normalize the state of charge and carbon emission factor features to the [0, 1] interval, completing the dimensionless transformation of all features and ensuring the stability of the subsequent target model training and inference process.

[0094] Step 502: Using household electricity consumption data, state of charge, real-time baseline load and user occupancy status, determine the charging and discharging commands for the target vehicle based on the target model.

[0095] In some exemplary embodiments, after determining the real-time baseline load and user occupancy status based on household electricity consumption data, the computer device can use the household electricity consumption data, state of charge, real-time baseline load, and user occupancy status to determine the charging and discharging commands for the target vehicle based on the target model.

[0096] Specifically, computer equipment can input household electricity consumption data, state of charge, real-time baseline load, and user occupancy status into the target model to obtain the target vehicle's charging and discharging commands output by the target model.

[0097] In an exemplary embodiment, the charging and discharging instructions for the target vehicle are determined based on the target model using household electricity consumption data, state of charge, real-time baseline load, and user occupancy status. This includes: inputting household electricity consumption data, state of charge, real-time baseline load, and user occupancy status into the target model, so that the target model performs multi-objective optimization under preset charging and discharging power constraints, battery state of charge constraints, and household load constraints to obtain the charging and discharging instructions for the target vehicle.

[0098] Optionally, the charging and discharging power constraint is used to limit the output power of electric vehicle charging and discharging, so as to prevent the charging and discharging power from exceeding the allowable working range of the charging equipment and the power battery. The charging power is taken as a positive value and the discharging power is taken as a negative value.

[0099] Battery state of charge (SOC) constraints are used to limit the upper and lower limits of the SOC of a power battery, preventing overcharging or over-discharging and ensuring the safety and lifespan of the power battery.

[0100] Household load constraints are used to constrain the total electricity load on the household side after electric vehicles participate in charging and discharging scheduling, ensuring that the overall household electricity load meets the requirements of actual electricity use conditions and preventing unreasonable loads or other calculation results that do not conform to physical reality.

[0101] In some exemplary embodiments, the computer device can input household electricity consumption data, state of charge, real-time baseline load, and user occupancy status into the target model, so that the target model can perform multi-objective optimization under preset charging and discharging power constraints, battery state of charge constraints, and household load constraints to obtain the charging and discharging instructions of the target vehicle.

[0102] Specifically, the target model can use electricity cost savings, carbon emission reduction, and household load peak shaving as multiple optimization objectives. It combines input household electricity consumption data, state of charge (SBC), real-time baseline load, and user occupancy status, and substitutes these into a multi-objective optimization objective function for solution. During the solution process, it is continuously constrained by three types of constraints: charging and discharging power constraints limit the vehicle's charging and discharging power to within the charging equipment's allowable power range; battery SBC constraints limit the battery's SBC to a safe operating range at each moment; and household load constraints ensure that the household's real-time total load does not become negative. Under the premise that all constraints are satisfied, the optimal charging and discharging power is obtained, and a charging and discharging command containing this power is generated and output to the household charging equipment. The charging equipment then executes the charging and discharging operation on the target vehicle according to the command. The user occupancy status participates in the time window selection during the optimization process, and charging and discharging power adjustment is only performed during the schedulable period when the user's vehicle is connected to the charging equipment.

[0103] In this embodiment, household electricity consumption data, state of charge (SBC), real-time baseline load, and user occupancy status are input into the target model. This allows the target model to perform multi-objective optimization under preset constraints on charging / discharging power, battery SBC, and household load to obtain the charging / discharging commands for the target vehicle. The optimization process is constrained by triple constraints on charging / discharging power, battery SBC, and household load, ensuring that the output charging / discharging power is feasible in terms of hardware, battery safety, and household electricity consumption. Simultaneously, multiple objectives are considered, including electricity cost savings, carbon emission reduction, and load peak shaving. Furthermore, user occupancy status and vehicle on-site status are used to filter schedulable time, ensuring that the optimization results closely reflect real-world household electricity and vehicle usage conditions. This reduces unreasonable scheduling solutions and further improves the rationality and accuracy of the charging / discharging power determination results.

[0104] In an optional embodiment of this application, during the offline training phase of the initial model, a gradient experiment on the training data scale is also performed to determine the optimal threshold for the training data scale under different scenarios, thereby achieving a balance between model performance and training efficiency. Specifically, three types of continuous sample data volumes are set: 7 days, 14 days, and 21 days, covering different data scale dimensions such as small, medium, and large. Evaluation is conducted from three dimensions: optimization performance, constraint satisfaction, and training efficiency. Evaluation indicators include electricity cost savings rate, carbon emission reduction, peak load reduction rate, number of SOC constraint violations, number of load non-negativity violations, and total training time. Comparative testing determined that the optimal training data scale for weekday scenarios is 21 days, under which the overall performance of optimization and constraint satisfaction is optimal. For non-weekday scenarios, the optimal training data scale is 7 days, which reduces training time by 40% compared to the 21-day data scale without causing significant performance loss. By determining the optimal training data size threshold, we can avoid the problem of increased model constraint violation rate and poor optimization effect caused by insufficient data, and also avoid the problems of wasted training resources and excessive training time caused by data redundancy. This provides a data size reference for the offline training of the first model weights and the second model weights.

[0105] In an optional embodiment of this application, when the target model performs the charge and discharge power solution, a multi-objective optimization method is used to determine the optimal charge and discharge power. The corresponding multi-objective optimization overall objective function and constraints are as follows.

[0106] With electricity cost savings, carbon emission reduction, and peak shaving of household load as multiple optimization objectives, the overall objective function for multi-objective optimization is: where i is the user number and t is the time step. , and These are the dimensionless target weights corresponding to electricity costs, carbon emissions, and load shaving, respectively. Let t be the time-of-use electricity price. Let t be the marginal factor of carbon emissions during the time period. Let i be the total household load at time t. Let V be the 24-hour load sequence variance for user i, used to characterize the flatness of the load.

[0107] In one exemplary embodiment, such as Figure 6 As shown, another method for determining charge and discharge power is provided, which includes the following steps:

[0108] Step 601: Obtain the target user's household electricity consumption data; based on the household electricity consumption data and environmental data, determine the charging and discharging load corresponding to the target vehicle; obtain the time information of the target vehicle connecting to the charging equipment, and determine the battery capacity and charging and discharging efficiency of the target vehicle based on the vehicle data; using the charging and discharging load, based on the time information, battery capacity and charging and discharging efficiency, determine the state of charge of the target vehicle, and connect the charging equipment of the target vehicle to the target user's household electricity system.

[0109] Step 602: Determine the charging / discharging scenario based on the current time information. The charging / discharging scenario includes weekday scenarios and non-weekday scenarios. If the charging / discharging scenario is a weekday scenario, apply weight loading to the initial model using the first model weights corresponding to the weekday scenario to obtain the target model. If the charging / discharging scenario is a non-weekday scenario, apply weight loading to the initial model using the second model weights corresponding to the non-weekday scenario to obtain the target model. The second model weights are obtained by adjusting and training the initial model using the sample data corresponding to the non-weekday scenario, with the first model weights as the initial weights.

[0110] Step 603: Determine the real-time baseline load and user occupancy status based on household electricity consumption data; input the household electricity consumption data, state of charge, real-time baseline load, and user occupancy status into the target model so that the target model can perform multi-objective optimization under the preset charging and discharging power constraints, battery state of charge constraints, and household load constraints to obtain the charging and discharging instructions for the target vehicle; the charging and discharging instructions include the charging and discharging power, and the charging and discharging instructions are used to instruct the charging equipment to charge and discharge the target vehicle according to the charging and discharging power.

[0111] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0112] Based on the same inventive concept, this application also provides a charge / discharge power determination device for implementing the charge / discharge power determination method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more embodiments of the charge / discharge power determination device provided below can be found in the limitations of the charge / discharge power determination method described above, and will not be repeated here.

[0113] In one exemplary embodiment, such as Figure 7 As shown, a charge / discharge power determination device 700 is provided, including: an acquisition module 701, a determination module 702, and an execution module 703, wherein:

[0114] The acquisition module 701 is used to acquire the household electricity consumption data of the target user, and determine the state of charge of the target vehicle based on the household electricity consumption data, environmental data and vehicle data of the target vehicle. The charging equipment of the target vehicle is connected to the household electricity system of the target user.

[0115] The determination module 702 is used to determine the charging and discharging scenario based on the current time information, and to perform weight loading processing on the initial model using the model weight values ​​corresponding to the charging and discharging scenario to obtain the target model;

[0116] The execution module 703 is used to determine the charging and discharging instructions for the target vehicle based on the target model using household electricity data and state of charge; the charging and discharging instructions include charging and discharging power, and the charging and discharging instructions are used to instruct the charging equipment to charge and discharge the target vehicle according to the charging and discharging power.

[0117] In one embodiment, the acquisition module 701 is specifically used to determine the charging and discharging load corresponding to the target vehicle based on household electricity consumption data and environmental data; and to determine the state of charge of the target vehicle based on the charging and discharging load and the vehicle data of the target vehicle.

[0118] In one embodiment, the acquisition module 701 is specifically used to acquire the time information of the target vehicle connecting to the charging equipment, and determine the battery capacity and charging / discharging efficiency of the target vehicle based on the vehicle data; using the charging / discharging load, based on the time information, battery capacity and charging / discharging efficiency, the state of charge of the target vehicle is determined.

[0119] In one embodiment, the charging and discharging scenario includes weekday scenarios and non-weekday scenarios; the determining module 702 is specifically used to, when the charging and discharging scenario is a weekday scenario, perform weight loading processing on the initial model using the first model weight corresponding to the weekday scenario to obtain the target model; when the charging and discharging scenario is a non-weekday scenario, perform weight loading processing on the initial model using the second model weight corresponding to the non-weekday scenario to obtain the target model; wherein, the second model weight is obtained by adjusting and training the initial model using the sample data corresponding to the non-weekday scenario, with the first model weight as the initial weight.

[0120] In one embodiment, the execution module 703 is specifically used to determine the real-time baseline load and user occupancy status based on household electricity consumption data; and to determine the charging and discharging instructions of the target vehicle based on the target model using the household electricity consumption data, state of charge, real-time baseline load, and user occupancy status.

[0121] In one embodiment, the execution module 703 is specifically used to input household electricity consumption data, state of charge, real-time baseline load and user occupancy status into the target model, so that the target model can perform multi-objective optimization solution under preset charging and discharging power constraints, battery state of charge constraints and household load constraints, so as to obtain the charging and discharging instructions of the target vehicle.

[0122] Each module in the aforementioned charge / discharge power determination device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0123] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network. When executed by the processor, the computer program implements a method for determining charging and discharging power.

[0124] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a method for determining charging and discharging power. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0125] Those skilled in the art will understand that Figure 8 and Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0126] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any of the above embodiments.

[0127] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the above embodiments.

[0128] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the method described in any of the above embodiments.

[0129] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0130] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0131] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0132] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for determining charge / discharge power, characterized in that, The method includes: Acquire household electricity consumption data of the target user, and determine the state of charge of the target vehicle based on the household electricity consumption data, environmental data and vehicle data of the target vehicle, and connect the charging equipment of the target vehicle to the household electricity system of the target user; The charging and discharging scenario is determined based on the current time information, and the initial model is weighted using the model weight values ​​corresponding to the charging and discharging scenario to obtain the target model. Using the household electricity consumption data and the state of charge, the charging and discharging instructions for the target vehicle are determined based on the target model; the charging and discharging instructions include charging and discharging power, and the charging and discharging instructions are used to instruct the charging equipment to charge and discharge the target vehicle according to the charging and discharging power.

2. The method according to claim 1, characterized in that, Determining the state of charge of the target vehicle based on the household electricity consumption data, environmental data, and vehicle data of the target vehicle includes: Based on the household electricity consumption data and the environmental data, the charging and discharging load corresponding to the target vehicle is determined; Based on the charging and discharging load and the vehicle data of the target vehicle, the state of charge of the target vehicle is determined.

3. The method according to claim 2, characterized in that, Determining the state of charge of the target vehicle based on the charging / discharging load and the vehicle data of the target vehicle includes: Obtain the time information of the target vehicle connecting to the charging equipment, and determine the battery capacity and charging / discharging efficiency of the target vehicle based on the vehicle data; Using the charge / discharge load, and based on the time information, the battery capacity, and the charge / discharge efficiency, the state of charge of the target vehicle is determined.

4. The method according to claim 1, characterized in that, The charging and discharging scenarios include weekday and non-weekday scenarios; the step of applying weights to the initial model using the model weight values ​​corresponding to the charging and discharging scenarios to obtain the target model includes: When the charging and discharging scenario is the weekday scenario, the initial model is weighted using the first model weight corresponding to the weekday scenario to obtain the target model. When the charging / discharging scenario is a non-working day scenario, the initial model is weighted using the second model weight corresponding to the non-working day scenario to obtain the target model. The second model weight is obtained by adjusting and training the initial model using the first model weight as the initial weight and using sample data corresponding to non-working days.

5. The method according to any one of claims 1 to 4, characterized in that, The step of determining the charging and discharging commands of the target vehicle based on the target model using the household electricity consumption data and the state of charge includes: Based on the household electricity consumption data, determine the real-time baseline load and user occupancy status; Using the household electricity consumption data, the state of charge, the real-time baseline load, and the user occupancy status, the charging and discharging commands for the target vehicle are determined based on the target model.

6. The method according to claim 5, characterized in that, The step of determining the charging and discharging commands for the target vehicle based on the target model using the household electricity consumption data, the state of charge, the real-time baseline load, and the user occupancy status includes: The household electricity consumption data, the state of charge, the real-time baseline load, and the user occupancy status are input into the target model so that the target model can perform multi-objective optimization under preset charging and discharging power constraints, battery state of charge constraints, and household load constraints to obtain the charging and discharging instructions of the target vehicle.

7. A charging / discharging power determining device, characterized in that, The device includes: The acquisition module is used to acquire the household electricity consumption data of the target user, and determine the state of charge of the target vehicle based on the household electricity consumption data, environmental data and vehicle data of the target vehicle, wherein the charging equipment of the target vehicle is connected to the household electricity system of the target user; The determination module is used to determine the charging and discharging scenario based on the current time information, and to perform weight loading processing on the initial model using the model weight values ​​corresponding to the charging and discharging scenario to obtain the target model; An execution module is used to determine the charging and discharging instructions for the target vehicle based on the target model using the household electricity consumption data and the state of charge; the charging and discharging instructions include charging and discharging power, and the charging and discharging instructions are used to instruct the charging device to charge and discharge the target vehicle according to the charging and discharging power.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.