Energy storage operation optimization policy
This topic describes how to use an SDK to call the CreateEssOptJob algorithm API to create an energy storage optimization job.
Prerequisites
You have installed the SDK and obtained your Alibaba Cloud account's AccessKey information.
API parameters
Request parameters
Field Name | Field Details |
Freq string | The default value is 15min. This must be consistent with the data frequency of historyData. Enumeration values:
Example value: FIFTEEN_MINEnumeration values: FIFTEEN_MIN, FIVE_MIN, ONE_HOUR, ONE_DAY |
Duration integer<int32> | The prediction duration in days, starting from and including the run date. This parameter is optional. The default value is 1 day. Example value: 1 |
RunDate string | The run date, accurate to the day. Use the yyyy-MM-dd format. Example value: 2025-02-12 |
TimeZone string | The time zone. The default value is Asia/Shanghai. Example value: Asia/Shanghai |
ModelVersion string | The version number of the model. The default value is latest. Example value: latest |
TopoType string | The resource topology type of the station:
Example value: LOAD_ESS_SOLAREnumeration values: LOAD_ESS, LOAD_ESS_SOLAR |
- SystemData array<object> | The system data, which includes the parameters and historical data of each system in the station. |
--- object | |
----SystemType string | The system type. Valid values for SystemType are:
Example value: ess |
----SystemId string | The system ID. Example value: 1 |
----SystemParams object | The system parameters. These are the parameter values for each system type. Example value: For example, the parameters for a solar power system: |
-----HistoryData array<object> | The historical operational data for each system. |
------- object | The operational data for a historical time period. Example value: For example, the historical data for the grid power system: |
- ElecPrice array<object> | The time-of-use price changes for grid power on the target date. The time granularity must be the same as the value of freq. |
--- object | The grid power price at a specific time on the target date. |
----DataTime string | A specific time of day. Example value: 00:00:15 |
----Price string | The grid power price. Example value: 0.5 |
- GenPrice array<object> | The time-of-use price changes for selling power to the grid on the target date. The time granularity must be the same as the value of freq. |
--- object | The price for selling power at a specific time on the target date. |
----DataTime string | A specific time of day. Example value: 00:00:15 |
----Price string | The price for selling power. Example value: 0.3 |
- Location object | The geographic location information, including longitude and latitude. |
--Altitude number<double> | The altitude, accurate to three decimal places. The default value is 10. Example value: 10.123 |
--Latitude number<double> | The latitude, accurate to three decimal places. Example value: 40.027 |
--Longitude number<double> | The longitude, accurate to three decimal places. Example value: 120.042 |
BusinessKey string | A business key, such as the station name or ID. Example value: stationA |
The system parameters for each SystemType are different and must be consistent with the definition of TopoType. Note the following:
A grid power system and an energy storage system must be included.
Each system type can have at most one instance. For example, there can be only one grid power system, one energy storage system, one solar power system, one air conditioner system (all air conditioner devices belong to this single system), one lighting system (all lighting devices belong to this single lighting system), and one charging pile system.
In addition to grid power and energy storage, the solar power system and other power consumption systems are optional. You can provide data for these systems in the request parameters as needed.
The air conditioner, lighting, and charging pile systems are all power consumption systems and are not adjustable.
Specify a unique systemId for each system. The algorithm results provide adjustment policies that correspond to each systemId and systemType.
Request examples
The following example shows the format for systemData:
[
{
"SystemType":"load",
"SystemId": 1,
"SystemParams":{
"sfktj": 0, // Specifies whether the system is adjustable.
"state": 1, // The running state. 0: stopped. 1: running.
"cfdfs": 0, // The charge and discharge mode. 0: Positive for discharge, negative for charge. 1: Negative for discharge, positive for charge.
// Border properties
"byqyxsx": "1200", // The upper operating limit of the transformer.
"byqyxxx": "-1200", // The lower operating limit of the transformer.
"bwdydj": "90", // The voltage level.
},
"HistoryData":[
{
"runTime": "2023-05-06 20:00:00",
"pwr": 0.0, // Total active power, in kW.
"qvr": 0.0, // Total reactive power, in Var.
"sva": 0.0, // Total apparent power, in VA.
"cos": 1, // Total power factor.
"fwdActngy": 0.0, // Cumulative forward active energy, in kWh.
"rvsActngy": 0.0, // Cumulative reverse active energy, in kWh.
"demandpwr": 0.0 // Forward active demand power, in kW.
},
...
{
"runTime": "2023-08-06 20:00:00",
"pwr": 0.0, // Total active power, in kW.
"qvr": 0.0, // Total reactive power, in Var.
"sva": 0.0, // Total apparent power, in VA.
"cos": 1, // Total power factor.
"fwdActngy": 0.0, // Cumulative forward active energy, in kWh.
"rvsActngy": 0.0, // Cumulative reverse active energy, in kWh.
"demandpwr": 0.0 // Forward active demand power, in kW.
}
]
},
{
"systemType":"ess",
"systemId": 2,
"systemParams":{
"sfktj": 1, // Specifies whether the system is adjustable.
"cfdfs": 0, // The charge and discharge mode. 0: Positive for discharge, negative for charge. 1: Negative for discharge, positive for charge.
// Border properties
"zxfdgl": "0", // The minimum discharge power.
"zdfdgl": "100", // The maximum discharge power.
"zxcdgl": "0", // The minimum charge power.
"zdcdgl": "100", // The maximum charge power.
"socyxxx": "0.05", // The lower operating limit of the SOC.
"socyxsx": "0.98", // The upper operating limit of the SOC.
"rcdcssx": "2", // The upper limit of daily charge and discharge cycles.
"rcdcsxx": "1", // The lower limit of daily charge and discharge cycles.
"edrl": "215", // The rated capacity.
"edgl": "xxx", // The power rating.
},
"historyData":[
{
"runTime": "2023-05-06 20:00:00",
"essRunPwr":0,// Total active power of the energy storage system, in kW.
"essRunQvr":0,// Total reactive power of the energy storage system, in Var.
"essRunSva":0,// Total apparent power of the energy storage system, in VA.
"essSOC":0,// The SOC of the energy storage system.
"essSOH":0,// The SOH of the energy storage system.
"cos":0,// The power factor.
"aggChrgNgy":0,// The cumulative charge of the energy storage system, in kWh.
"aggDischrgNgy":0,// The cumulative discharge of the energy storage system, in kWh.
"runState":0,// The running state. 0: fault. 1: running. 2: standby.
"controlState":0,// The control state. 0: local. 1: remote.
},
...
{
"runTime": "2023-08-06 20:00:00",
"essRunPwr":0,// Total active power of the energy storage system, in kW.
"essRunQvr":0,// Total reactive power of the energy storage system, in Var.
"essRunSva":0,// Total apparent power of the energy storage system, in VA.
"essSOC":0,// The SOC of the energy storage system.
"essSOH":0,// The SOH of the energy storage system.
"cos":0,// The power factor.
"aggChrgNgy":0,// The cumulative charge of the energy storage system, in kWh.
"aggDischrgNgy":0,// The cumulative discharge of the energy storage system, in kWh.
"runState":0,// The running state. 0: fault. 1: running. 2: standby.
"controlState":0,// The control state. 0: local. 1: remote.
}
]
},
{
"systemType":"solar",
"systemId": 4,
"systemParams":{
"sfktj": 0, // Specifies whether the system is adjustable. 0: not adjustable. 1: adjustable. Solar power systems are typically not adjustable.
"cfdfs": 0, // The charge and discharge mode. 0: Positive for discharge, negative for charge. 1: Negative for discharge, positive for charge.
"zjrl": "xxx", // The installed capacity.
},
"historyData":[
{
"runTime": "2023-05-06 20:00:00",
"alterPwr":0, // AC-side active power, in kW.
"aggGenNgy":0, // Cumulative power generation, in kWh.
"dayGenNgy":0, // Daily power generation, in kWh.
"runState":0, // The running state. 0: fault. 1: running. 2: standby.
},
...
{
"runTime": "2023-08-06 20:00:00",
"alterPwr":0, // AC-side active power, in kW.
"aggGenNgy":0, // Cumulative power generation, in kWh.
"dayGenNgy":0, // Daily power generation, in kWh.
"runState":0, // The running state. 0: fault. 1: running. 2: standby.
}
]
},
{
"systemType":"hvac",
"systemId": 5,
"systemParams":{
"sfktj": 0, // Specifies whether the system is adjustable. 0: not adjustable. 1: adjustable.
"edgl": "" // Total power rating, in kW.
},
"historyData":[
{
"runTime": "2023-05-06 20:00:00",
"pwr": 0.0, // Total active power, in kW.
"qvr": 0.0, // Total reactive power, in Var.
"sva": 0.0, // Total apparent power, in VA.
"cos": 1, // Total power factor.
"fwdActngy": 0.0, // Cumulative forward active energy, in kWh.
"rvsActngy": 0.0, // Cumulative reverse active energy, in kWh.
"demandpwr": 0.0 // Forward active demand power, in kW.
},
...
{
"runTime": "2023-08-06 20:00:00",
"pwr": 0.0, // Total active power, in kW.
"qvr": 0.0, // Total reactive power, in Var.
"sva": 0.0, // Total apparent power, in VA.
"cos": 1, // Total power factor.
"fwdActngy": 0.0, // Cumulative forward active energy, in kWh.
"rvsActngy": 0.0, // Cumulative reverse active energy, in kWh.
"demandpwr": 0.0 // Forward active demand power, in kW.
}
]
},
{
"systemType":"flexible",
"systemId": 6,
"systemParams":{
"sfktj": 0, // Specifies whether the system is adjustable. 0: not adjustable. 1: adjustable. We recommend that you do not set lighting systems as adjustable.
"edgl": "" // Total power rating, in kW.
},
"historyData":[
{
"runTime": "2023-05-06 20:00:00",
"pwr": 0.0, // Total active power, in kW.
"qvr": 0.0, // Total reactive power, in Var.
"sva": 0.0, // Total apparent power, in VA.
"cos": 1, // Total power factor.
"fwdActngy": 0.0, // Cumulative forward active energy, in kWh.
"rvsActngy": 0.0, // Cumulative reverse active energy, in kWh.
"demandpwr": 0.0 // Forward active demand power, in kW.
},
...
{
"runTime": "2023-08-06 20:00:00",
"pwr": 0.0, // Total active power, in kW.
"qvr": 0.0, // Total reactive power, in Var.
"sva": 0.0, // Total apparent power, in VA.
"cos": 1, // Total power factor.
"fwdActngy": 0.0, // Cumulative forward active energy, in kWh.
"rvsActngy": 0.0, // Cumulative reverse active energy, in kWh.
"demandpwr": 0.0 // Forward active demand power, in kW.
}
]
},
{
"systemType":"charge",
"systemId": 7,
"systemParams":{
"sfktj": 0, // Specifies whether the system is adjustable. 0: not adjustable. 1: adjustable.
"edgl": "" // Total power rating, in kW.
},
"historyData":[
{
"runTime": "2023-05-06 20:00:00",
"pwr": 0.0, // Total active power, in kW.
"qvr": 0.0, // Total reactive power, in Var.
"sva": 0.0, // Total apparent power, in VA.
"cos": 1, // Total power factor.
"fwdActngy": 0.0, // Cumulative forward active energy, in kWh.
"rvsActngy": 0.0, // Cumulative reverse active energy, in kWh.
"demandpwr": 0.0 // Forward active demand power, in kW.
},
...
{
"runTime": "2023-08-06 20:00:00",
"pwr": 0.0, // Total active power, in kW.
"qvr": 0.0, // Total reactive power, in Var.
"sva": 0.0, // Total apparent power, in VA.
"cos": 1, // Total power factor.
"fwdActngy": 0.0, // Cumulative forward active energy, in kWh.
"rvsActngy": 0.0, // Cumulative reverse active energy, in kWh.
"demandpwr": 0.0 // Forward active demand power, in kW.
}
]
}
]The following example shows the format for elecPrice and genPrice:
[
{
"dataTime":"00:00:00",
"price": 0.9
},
{
"dataTime":"00:15:00",
"price": 0.3
},
{
"dataTime":"00:30:00",
"price": 0.34
},
...
{
"dataTime":"23:45:00",
"price": 0.1
}
]Response parameters
Field Name | Field Details |
RequestId string | The ID of the request. Example value: 68738E75-43C1-5AE5-9F3A-AFEF576D7B5F |
Success string | Indicates whether the call was successful.
Example value: True |
Code string | The status code. Note A value of 200 indicates success. Example value: 200 |
Message string | The returned message. Example value: successful |
- Data object | Returns job details |
--Completed boolean | Indicates whether the operation is complete. Valid values: True: The job is complete. False: The job is still in progress. Example value: True |
--CreateTime string | The time when the task was created. Example value: 2024-12-22 00:00:21 |
--Error string | The error message returned when the operation is abnormal or fails. Example value: "" |
--JobId string | The ID of the algorithm calculation task. Example value: 8c0ca18a-246a-4acd-80ca-e16d8ff5ef33 |
--Progress integer<int32> | The progress of the task. Example value: 25 |
--- Response object | The result of the calculation task. |
----DebugInfo any | The debugging information. Example value: {} |
----JobType string | The type of the calculation task. Enumeration values: LoadForecast, PowerForecast. Example value: LoadForecast |
----Result any | The result of the calculation task. Example value: {} |
--Status string | The status of the task. Enumeration values: RUNNING, SUCCESS, FAIL. Example value: RUNNING |
The calculation is an asynchronous task. To retrieve the final result, use the returned JobId to query the task.
Response example
{
"RequestId": "68738E75-43C1-5AE5-9F3A-AFEF576D7B5F",
"Success": "True",
"Code": "200",
"Message": "successful",
"Data": {
"Completed": true,
"CreateTime": "2024-12-22 00:00:21",
"Error": "\"\"",
"JobId": "8c0ca18a-246a-4acd-80ca-e16d8ff5ef33",
"Progress": 25,
"Response": {
"DebugInfo": "{}",
"JobType": "LoadForecast",
"Result": "{}"
},
"Status": "RUNNING"
}
}SDK call examples
Java SDK examples
Use the synchronous method to call the SDK if concurrent calls are not required. Use the asynchronous method if concurrent calls are required.
Java synchronous (pom.xml):
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>brain_industrial20200920</artifactId>
<version>2.1.2</version>
</dependency>Synchronous Java (sample.java):
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sample;
import com.aliyun.tea.*;
public class Sample {
/**
* description :
* <p>Initializes a client with credentials.</p>
* @return Client
*
* @throws Exception
*/
public static com.aliyun.brain_industrial20200920.Client createClient() throws Exception {
// For production environments, use a more secure way to manage credentials, such as using credential files. For more information, see https://help.aliyun.com/document_detail/378657.html.
com.aliyun.credentials.Client credential = new com.aliyun.credentials.Client();
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
.setCredential(credential);
// For more information about endpoints, see https://api.aliyun.com/product/brain-industrial.
config.endpoint = "brain-industrial.cn-hangzhou.aliyuncs.com";
return new com.aliyun.brain_industrial20200920.Client(config);
}
public static void main(String[] args_) throws Exception {
com.aliyun.brain_industrial20200920.Client client = Sample.createClient();
com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest.CreateEssOptJobRequestLocation location = new com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest.CreateEssOptJobRequestLocation()
.setAltitude(10D)
.setLatitude(23D)
.setLongitude(113.5D);
com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest.CreateEssOptJobRequestGenPrice genPrice0 = new com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest.CreateEssOptJobRequestGenPrice()
.setDataTime("00:00:00")
.setPrice("0.8");
com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest.CreateEssOptJobRequestElecPrice elecPrice0 = new com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest.CreateEssOptJobRequestElecPrice()
.setDataTime("00:00:00")
.setPrice("2.1");
java.util.Map<String, Object> systemData0HistoryData0 = TeaConverter.buildMap(
new TeaPair("runTime", "2025-01-01"),
new TeaPair("value", 3)
);
java.util.Map<String, Integer> systemData0SystemParams = TeaConverter.buildMap(
new TeaPair("byqyxsx", 1200),
new TeaPair("byqyxxx", 0),
new TeaPair("bwdydj", 220)
);
com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest.CreateEssOptJobRequestSystemData systemData0 = new com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest.CreateEssOptJobRequestSystemData()
.setSystemType("load")
.setSystemId("1")
.setSystemParams(systemData0SystemParams)
.setHistoryData(java.util.Arrays.asList(
systemData0HistoryData0
));
java.util.Map<String, Object> systemData1HistoryData0 = TeaConverter.buildMap(
new TeaPair("runTime", "2025-01-01 00:00:00"),
new TeaPair("value", 100)
);
java.util.Map<String, String> systemData1SystemParams = TeaConverter.buildMap(
new TeaPair("zxfdgl", "0"),
new TeaPair("zdfdgl", "100"),
new TeaPair("zxcdgl", "0"),
new TeaPair("zdcdgl", "100"),
new TeaPair("socyxxx", "0.05"),
new TeaPair("socyxsx", "0.98"),
new TeaPair("rcdcssx", "2"),
new TeaPair("rcdcsxx", "1"),
new TeaPair("edrl", "215"),
new TeaPair("edgl", "100")
);
com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest.CreateEssOptJobRequestSystemData systemData1 = new com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest.CreateEssOptJobRequestSystemData()
.setSystemType("ess")
.setSystemId("2")
.setSystemParams(systemData1SystemParams)
.setHistoryData(java.util.Arrays.asList(
systemData1HistoryData0
));
java.util.Map<String, Object> systemData2HistoryData0 = TeaConverter.buildMap(
new TeaPair("runTime", "2025-01-01 00:00:00"),
new TeaPair("value", 0)
);
java.util.Map<String, Integer> systemData2SystemParams = TeaConverter.buildMap(
new TeaPair("zjrl", 800)
);
com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest.CreateEssOptJobRequestSystemData systemData2 = new com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest.CreateEssOptJobRequestSystemData()
.setSystemType("solar")
.setSystemId("3")
.setSystemParams(systemData2SystemParams)
.setHistoryData(java.util.Arrays.asList(
systemData2HistoryData0
));
com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest createEssOptJobRequest = new com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest()
.setFreq("FIFTEEN_MIN")
.setDuration(1)
.setRunDate("2025-01-01")
.setTimeZone("Asia/Shanghai")
.setModelVersion("latest")
.setTopoType("LOAD_ESS_SOLAR")
.setSystemData(java.util.Arrays.asList(
systemData0,
systemData1,
systemData2
))
.setElecPrice(java.util.Arrays.asList(
elecPrice0
))
.setGenPrice(java.util.Arrays.asList(
genPrice0
))
.setLocation(location)
.setBusinessKey("stationA");
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
try {
// If you copy the code to run, print the API return value.
client.createEssOptJobWithOptions(createEssOptJobRequest, runtime);
} catch (TeaException error) {
// This is for demonstration purposes only. Handle exceptions with caution. Do not ignore exceptions in your project.
// Error message
System.out.println(error.getMessage());
// Diagnosis address
System.out.println(error.getData().get("Recommend"));
com.aliyun.teautil.Common.assertAsString(error.message);
} catch (Exception _error) {
TeaException error = new TeaException(_error.getMessage(), _error);
// This is for demonstration purposes only. Handle exceptions with caution. Do not ignore exceptions in your project.
// Error message
System.out.println(error.getMessage());
// Diagnosis address
System.out.println(error.getData().get("Recommend"));
com.aliyun.teautil.Common.assertAsString(error.message);
}
}
}Asynchronous Java (pom.xml):
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>alibabacloud-brain_industrial20200920</artifactId>
<version>2.0.4</version>
</dependency>Java asynchronous sample (sample.java):
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sample;
import com.aliyun.tea.*;
public class Sample {
/**
* description :
* <p>Initializes a client with credentials.</p>
* @return Client
*
* @throws Exception
*/
public static com.aliyun.brain_industrial20200920.Client createClient() throws Exception {
// For production environments, use a more secure way to manage credentials, such as using credential files. For more information, see https://help.aliyun.com/document_detail/378657.html.
com.aliyun.credentials.Client credential = new com.aliyun.credentials.Client();
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
.setCredential(credential);
// For more information about endpoints, see https://api.aliyun.com/product/brain-industrial.
config.endpoint = "brain-industrial.cn-hangzhou.aliyuncs.com";
return new com.aliyun.brain_industrial20200920.Client(config);
}
public static void main(String[] args_) throws Exception {
com.aliyun.brain_industrial20200920.Client client = Sample.createClient();
java.util.Map<String, Integer> systemData0SystemParams = TeaConverter.buildMap(
new TeaPair("byqyxxx", 0),
new TeaPair("byqyxsx", 1200)
);
com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest.CreateEssOptJobRequestSystemData systemData0 = new com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest.CreateEssOptJobRequestSystemData()
.setSystemType("load")
.setSystemId("1")
.setSystemParams(systemData0SystemParams);
com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest createEssOptJobRequest = new com.aliyun.brain_industrial20200920.models.CreateEssOptJobRequest()
.setFreq("FIFTEEN_MIN")
.setDuration(1)
.setRunDate("2025-01-01")
.setTopoType("LOAD_ESS")
.setSystemData(java.util.Arrays.asList(
systemData0
));
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
try {
// If you copy the code to run, print the API return value.
client.createEssOptJobWithOptions(createEssOptJobRequest, runtime);
} catch (TeaException error) {
// This is for demonstration purposes only. Handle exceptions with caution. Do not ignore exceptions in your project.
// Error message
System.out.println(error.getMessage());
// Diagnosis address
System.out.println(error.getData().get("Recommend"));
com.aliyun.teautil.Common.assertAsString(error.message);
} catch (Exception _error) {
TeaException error = new TeaException(_error.getMessage(), _error);
// This is for demonstration purposes only. Handle exceptions with caution. Do not ignore exceptions in your project.
// Error message
System.out.println(error.getMessage());
// Diagnosis address
System.out.println(error.getData().get("Recommend"));
com.aliyun.teautil.Common.assertAsString(error.message);
}
}
}Python SDK examples
Python dependencies:
pip install alibabacloud_brain_industrial20200920==2.1.2# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
import os
import sys
from typing import List
from alibabacloud_brain_industrial20200920.client import Client as brain_industrial20200920Client
from alibabacloud_credentials.client import Client as CredentialClient
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_brain_industrial20200920 import models as brain_industrial_20200920_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient
class Sample:
def __init__(self):
pass
@staticmethod
def create_client() -> brain_industrial20200920Client:
"""
Initializes a client with credentials.
@return: Client
@throws Exception
"""
# For production environments, use a more secure way to manage credentials, such as using credential files. For more information, see https://help.aliyun.com/document_detail/378659.html.
credential = CredentialClient()
config = open_api_models.Config(
credential=credential
)
# For more information about endpoints, see https://api.aliyun.com/product/brain-industrial.
config.endpoint = f'brain-industrial.cn-hangzhou.aliyuncs.com'
return brain_industrial20200920Client(config)
@staticmethod
def main(
args: List[str],
) -> None:
client = Sample.create_client()
system_data_0system_params = {
'byqyxxx': 0,
'byqyxsx': 1200
}
system_data_0 = brain_industrial_20200920_models.CreateEssOptJobRequestSystemData(
system_type='load',
system_id='1',
system_params=system_data_0system_params
)
create_ess_opt_job_request = brain_industrial_20200920_models.CreateEssOptJobRequest(
freq='FIFTEEN_MIN',
duration=1,
run_date='2025-01-01',
topo_type='LOAD_ESS',
system_data=[
system_data_0
]
)
runtime = util_models.RuntimeOptions()
try:
# If you copy the code to run, print the API return value.
client.create_ess_opt_job_with_options(create_ess_opt_job_request, runtime)
except Exception as error:
# This is for demonstration purposes only. Handle exceptions with caution. Do not ignore exceptions in your project.
# Error message
print(error.message)
# Diagnosis address
print(error.data.get("Recommend"))
UtilClient.assert_as_string(error.message)
@staticmethod
async def main_async(
args: List[str],
) -> None:
client = Sample.create_client()
system_data_0system_params = {
'byqyxxx': 0,
'byqyxsx': 1200
}
system_data_0 = brain_industrial_20200920_models.CreateEssOptJobRequestSystemData(
system_type='load',
system_id='1',
system_params=system_data_0system_params
)
create_ess_opt_job_request = brain_industrial_20200920_models.CreateEssOptJobRequest(
freq='FIFTEEN_MIN',
duration=1,
run_date='2025-01-01',
topo_type='LOAD_ESS',
system_data=[
system_data_0
]
)
runtime = util_models.RuntimeOptions()
try:
# If you copy the code to run, print the API return value.
await client.create_ess_opt_job_with_options_async(create_ess_opt_job_request, runtime)
except Exception as error:
# This is for demonstration purposes only. Handle exceptions with caution. Do not ignore exceptions in your project.
# Error message
print(error.message)
# Diagnosis address
print(error.data.get("Recommend"))
UtilClient.assert_as_string(error.message)
if __name__ == '__main__':
Sample.main(sys.argv[1:])