Research on Optimized Energy Scheduling of Rural Microgrid

: This paper introduces a new rural microgrid model, including residents and agricultural greenhouses. Based on the new model framework, the precise energy scheduling of a rural microgrid is realized by means of load classiﬁcation and load forecasting. Moreover, we also adopt a new energy-storage mode, cloud energy storage (CES), as the shared energy-storage unit of rural microgrid, and analyze the service and operation mechanism of CES in detail. The shared storage characteristic and adjustable storage capacity of CES are helpful for the precise management of power dispatching. At the same time, in order to accurately implement energy scheduling, we fully consider the load characteristics of rural areas and divide the load into residential load and agricultural load. Then the extreme gradient boosting (XGBoost) algorithm is used to predict the short-term power consumption of the two types of load respectively, which can e ﬀ ectively alleviate the uncertainty of load power consumption and improve the accuracy of scheduling. Finally, an illustrative example of rural energy scheduling is given. The example studies the impact of energy-storage capacity on the cost of the scheduling scheme, and designs a power-dispatching scheme based on load forecasting, which accurately solves the energy charging and discharging planning and grid energy trading planning.


Introduction
A smart grid is a highly integrated power system with information technology and physical grid [1]. Demand-side management (DSM), energy generation and energy storage are considered the main promoters of smart grid deployment [2]. In the past, large commercial and industrial customers have been known as the active participants in DSM and demand-response (DR) programs because of their potential to achieve large peak-load and energy consumption reduction [3]. However, this ignores the potential value of residential and agricultural users. These small consumers are numerous [4], especially in remote rural areas. There are more than one billion people worldwide living in rural areas, and some are facing severe energy shortages [5]. This makes the need to solve the energy management problem in rural areas urgent. As an important part of the smart grid, a microgrid can effectively solve the problem of power supply in remote areas and has broad application prospects in rural areas. Therefore, it is important and necessary to explore the energy demand of rural microgrids and precisely schedule the limited energy. All these factors will imply more specific requirements for optimal energy dispatching of rural microgrid with resource shortage [6].
Microgrids are promoted as a potential technology for electricity provision to rural communities. The primary objective for scaling up or introducing a microgrid for a rural community lies in the 2 of 17 provision of "basic electricity access by identifying necessary electrical appliances" aimed at overall social well-being [7]. At present, research on the rural microgrid mainly focuses on regional energy management [8], rural-electrification technology [9,10], and rural building energy conservation [11,12]. Among them, energy has always been an important development parameter for rural microgrids. A large number of studies have contributed to alleviating the energy shortage of rural microgrids, and [13] presents an energy-management system (EMS) for an isolated rural microgrid; [14] proposes a novel framework that includes techno-financial analysis of the energy system for designing a rural sustainable microgrid; [15] creates a comprehensive model to investigate the optimal management of a rural microgrid infrastructure; [16] presents a novel mixed-integer linear optimization model and considers the security-constrained of microgrid; and [17] presents the current socio-economic status of a rural community fulfilling its electrical need from the rural microgrid. In rural areas where energy is scarce, microgrids can provide consistent, reliable electricity to rural communities [18]. However, when optimizing the energy management of a rural microgrid, the actual load data or typical load data is usually used as input, which may reduce the practicality and feasibility of the energy-management strategy. Meanwhile, they also take the total rural load consumption as a unified variable, which lacks the consideration of load characteristics in rural areas.
In addition, the energy-storage system (ESS) can also make a significant contribution to energy development in rural areas. With the reduction of renewable energy generation costs and the improvement of energy-storage technology, an ESS plays an important role in stabilizing the intermittent of renewable energy generation and ensuring the reliability of microgrid energy dispatching [19][20][21], and the reasonable configuration of ESS can improve the economy of the microgrid [22]. An improved distributed energy-storage model is proposed by [23] to maintain the frequency stability and supply-demand balance of a microgrid; and [24] utilizes the optimal capacity of ESS in hybrid power systems to minimize costs. Although the impact of energy-storage capacity on the scheduling strategy is significant, the energy-storage capacity cannot be adjusted frequently in practical applications.
Therefore, in order to optimize rural energy management and achieve precise energy scheduling, this paper focuses on solving the problem of optimized energy scheduling in a rural microgrid. A new energy scheduling model is proposed. In the new model, the energy-storage unit of the rural microgrid is undertaken by the cloud energy storage (CES) system, in which users can subscribe to energy-storage services and obtain adjustable energy-storage capacity. In addition, this paper fully considers the load characteristics of rural microgrids, details the load types in rural areas, and uses the extreme gradient boosting (XGBoost) algorithm to predict the future load power consumption. The energy scheduling of the rural microgrid is more accurate and effective through the load classification, load forecasting, and adjustable energy-storage capacity of CES. The main contributions of this paper are summarized as follows.

•
The paper applies the CES system to the rural microgrid, which is a new type of shared energy-storage model. The CES can help users save on the high cost of purchasing energy-storage equipment and provide users with variable energy-storage capacity. According to the daily electricity consumption and power generation, the rural microgrid can adjust its energy-storage capacity. The optimal energy-storage capacity helps to improve the performance of energy scheduling.

•
According to the load characteristics of rural areas, the load is divided into residential load and agricultural load. Studying the power consumption models of the two types of loads separately helps to accurately analyze the load power consumption of the rural microgrid.

•
In this paper, the XGBoost algorithm is used to train prediction models to perform residential load prediction and agricultural load prediction, respectively. Then we combined the information of prediction data and real-time electricity prices to solve the energy-dispatching scheme of a rural microgrid. Load forecasting can effectively alleviate the uncertainty of users' electricity usage and help the microgrid achieve precise energy scheduling.

Rural Microgrid Architecture Based on Cloud Energy Storage (CES)
Compared with the traditional smart microgrid, a rural microgrid not only needs to consider the daily electricity consumption of residents, but also needs to study the power consumption of crops in agricultural greenhouses and the operating mechanism of ESS. In this paper, a shared ESS model called CES is applied to a rural microgrid. All users in the rural microgrid can participate in the CES system and meet their own energy-storage requirements by ordering the energy-storage services of CES without the need to purchase physical energy-storage equipment separately. In addition, the rural microgrid is grid-connected, allowing energy exchanges between all users and the grid.
Rural microgrid architecture is mainly composed of four parts, which are the control unit, distributed generation unit, energy-storage unit, and load unit. Figure 1 is a summary architecture diagram of the rural microgrid, which shows the components and the relationship between them. As shown in Figure 1, the control unit connects each part to help realize coordinated management of electrical energy. The energy-storage unit provides energy-storage services for all users in the microgrid. The load unit includes residential loads and greenhouse loads.

Distributed Generation Unit Modeling
The distributed generation unit includes photovoltaic (PV) and wind turbines. Both rural residents and greenhouses are equipped with photovoltaic equipment for power generation. Wind turbines need to be placed in relatively wide areas, such as loosely spaced residential areas and open planting areas.
The output power of PV is mainly affected by solar radiation intensity and ambient temperature, and the power generation is as follows: where, STC refers to the test data under standard conditions, in which the light intensity G STC is 1 kW/m 2 and the temperature T STC is 25 • C. P STC is the rated output power of PV under the standard conditions, which is generally given by manufacturers.
The output power of wind turbines can be obtained according to the wind speed. The segmented function of the wind power-generation model is as follows: Combined with the wind speed data of the system statistics, the amount of power generation at each moment can be calculated by the function of the above wind power generation model.

Energy-Storage Unit Modeling
CES is a grid-based shared energy-storage model, as shown in Figure 2. The CES system consists of three main components: users, the CES operator and energy-storage facilities [25]. Users participating in a CES system do not need to purchase their own energy-storage devices with a fixed capacity. Instead, they get access to cloud batteries by subscribing to CES services, which not only meet their own storage needs but also allow them to get adjustable storage capacity. After subscribing to CES services, users can freely control the charging and discharging behavior of the cloud batteries through a software interface with the CES operator [26]. Moreover, the users can also change the storage capacity of their leased cloud batteries for a period of a day, a month or even a quarter [26]. There is two-way transmission of information and energy between CES and users, and this relies on the grid to realize two-way transmission of energy. On the other hand, the CES operator invests and manages large-scale energy-storage facilities, thus eliminating the trouble of installation and maintenance for users. The CES has lower energy-storage cost, higher energy-storage resource utilization and more variable energy-storage capacity than other energy-storage models. All the electricity generated from the rural microgrid can be stored in the CES, which will centralize the storage resources of all participants to help the microgrid achieve energy dispatching.
There are battery charging/discharging behaviors and energy trading behaviors with the grid in the CES system. The energy-storage status of a CES system is as follows: The CES also needs to meet the following capacity constraints and power constraints in the process of power dispatching: 0 ≤ P ch ces (h) ≤ P ch,max ces , ∀h ∈ Γ,

Load Unit Modeling
The rural microgrid load unit includes residential loads and agricultural loads. The electricity consumption of agricultural loads accounts for a large part of the total consumption of the rural microgrid. Meanwhile, the electricity consumption of agricultural loads will change with crop types, growth period and climate environment. Therefore, modeling and analysis of agricultural power consumption is of great significance to optimize the electricity dispatching of rural microgrid.

Model of Residential Loads
The residential loads can be divided into rigid loads and flexible loads according to the flexibility of scheduling time [27]. Among them, rigid loads, such as lamps and televisions, need to respond immediately when there is demand for electricity, so rigid loads do not participate in scheduling optimization. Flexible loads, such as washing machines and water heaters, are different from rigid loads. They have scheduling flexibility that can be scheduled in advance or later within the permitted operating range. We assume that there are a total of A flexible loads in the microgrid, and flexible load a ∈ {1, 2, . . . , A}. Moreover, we divide the day into H equal time periods, and the time period h ∈ Γ = {1, 2, . . . , H}. The basic constraints of flexible loads are shown as follows [28]: The binary variable Sa represents the operating state of the flexible load a, 1 indicates that it is working, and 0 indicates the standby state. Flexible loads can be further divided into interruptible loads and uninterruptible loads. In addition to satisfying the above basic constraints of (8)-(10), the uninterruptible load b∈{1, 2, . . . ,A} also needs to satisfy the following constraints [28]: Therefore, the total power of flexible loads is: The total electricity consumption of residential loads is:

Model of Agricultural Loads
It is assumed that the agricultural loads in rural microgrid is mainly composed of greenhouses. In a typical greenhouse, energy consumption is related to temperature, humidity, light and carbon dioxide (CO 2 ) concentration [29,30]. The greenhouse model is shown in Figure 3. The electrical equipment used to control the above four indicators includes the temperature control system (heaters and coolers), irrigation system, lighting system, and CO 2 generators.  The total electricity consumption of the greenhouse is the sum of the electricity consumption of all electrical equipment. The calculation formula is as follows: Among them, the temperature and light intensity in the greenhouse are greatly affected by the external environmental. Therefore, there is a close relationship between environmental factors and greenhouse power consumption. Finding the factors affecting agricultural power consumption and analyzing the relationship between load characteristics and power consumption is an important step to achieving optimal scheduling.

Short-Term Rural Electricity Load Forecast
In terms of agricultural load forecasting, we first set up a database of crop growth environment indicators. Combined with the crop growth characteristics, it is necessary to explore the relationship between the crop growth environment and the electrical energy consumption of greenhouses. Then we select the data samples from the database and build a short-term agricultural load-forecasting model based on the XGBoost algorithm.
In terms of residential load forecasting, the effective features are directly selected from the database as data samples to train the prediction model. Finally, the overall load forecasting results of the rural area are obtained, which will help us to grasp the trend of electricity consumption and work out the appropriate energy-dispatching scheme.

Establish a Database of Crop Growth Environment Indicators
The growth environment required for greenhouse crops is related to their growth stage and species. Different crop types and growth stages require different growing environments and consume different amounts of electricity. Therefore, in order to accurately predict the electricity consumption of agricultural loads, it is necessary to establish a database of crop growth environment indicators based on the actual situation in rural areas.
In the process of formulating environment indicators for greenhouse crops, the indicators selected in this paper are mainly related to the following four aspects: light intensity (I), ambient temperature (T), soil moisture (θ) and carbon dioxide concentration (C). By analyzing the degree of correlation between these environmental indicators and electricity consumption, the indicators with high correlation coefficient are selected as the input feature vector, which is used to train the prediction model. The total electricity consumption of the greenhouse is the sum of the electricity consumption of all electrical equipment. The calculation formula is as follows: Among them, the temperature and light intensity in the greenhouse are greatly affected by the external environmental. Therefore, there is a close relationship between environmental factors and greenhouse power consumption. Finding the factors affecting agricultural power consumption and analyzing the relationship between load characteristics and power consumption is an important step to achieving optimal scheduling.

Short-Term Rural Electricity Load Forecast
In terms of agricultural load forecasting, we first set up a database of crop growth environment indicators. Combined with the crop growth characteristics, it is necessary to explore the relationship between the crop growth environment and the electrical energy consumption of greenhouses. Then we select the data samples from the database and build a short-term agricultural load-forecasting model based on the XGBoost algorithm.
In terms of residential load forecasting, the effective features are directly selected from the database as data samples to train the prediction model. Finally, the overall load forecasting results of the rural area are obtained, which will help us to grasp the trend of electricity consumption and work out the appropriate energy-dispatching scheme.

Establish a Database of Crop Growth Environment Indicators
The growth environment required for greenhouse crops is related to their growth stage and species. Different crop types and growth stages require different growing environments and consume different amounts of electricity. Therefore, in order to accurately predict the electricity consumption of agricultural loads, it is necessary to establish a database of crop growth environment indicators based on the actual situation in rural areas.
In the process of formulating environment indicators for greenhouse crops, the indicators selected in this paper are mainly related to the following four aspects: light intensity (I), ambient temperature (T), soil moisture (θ) and carbon dioxide concentration (C). By analyzing the degree of correlation between these environmental indicators and electricity consumption, the indicators with high correlation coefficient are selected as the input feature vector, which is used to train the prediction model.

Identify Sample Data and Build the Predictive Model
By analyzing the factors affecting the growth of crops and household consumption, the sample data of rural area electricity load prediction is preliminarily determined. It is worth noting that the sample data used to predict agricultural load are different from the sample data used to predict residential load, and their prediction is carried out separately. More specific data samples are shown in Tables 1 and 2. Table 1. Sample data of residential load forecasting.

Parm Meaning
Input f0 Day of the week f1 Holidays or working days f2 Season f3 Data (year/month/day) f4 Weather (sunny/cloudy/rainy/snowy) f5 Temperature f6 Resident population f7 Type of career (farmer/non-farmer) f8 Demographic age f9 Residential area Output Y1 Predicted residential load Table 2. Sample data of agricultural load forecasting.

Parm Meaning
Input f1 Temperature f2 Sunlight intensity f3 Weather f4 Growth stage of crop f5 Crop type f6 CO 2 concentration in greenhouse f7 Air humidity in greenhouse f8 Soil moisture in greenhouse Output Y1 Predicted greenhouse load Then the prediction model is established, which is divided into three steps: sample data preprocessing, training model and load prediction, as shown below.
Step 1: Data preprocessing. First, the sample data in Tables 1 and 2 is subjected to outlier detection, abnormal elimination and mean interpolation. Then, the Pearson correlation coefficient of the multi-dimensional vector is used as the correlation index to analyze the correlation of the sample data. The calculated correlation thermodynamic diagram is shown in Figures 4 and 5. According to the figures, the correlation of the preliminarily selected sample data is high, so that they can all be used for prediction. Finally, the selected sample data is divided into the training set, verification set and test set by cross-validation.
Step 2: Training model. The pre-processed data is input into the XGBoost predictive model. The XGBoost model uses the greedy algorithm to calculate the parameter allocation of the decision tree layer by layer, thereby minimizing the objective function. Then, we use the verification set to judge whether the model is excellent. If it does not meet the criteria, continue to optimize the parameters until the best results are achieved and the final prediction model will be saved.
Step 3: Load prediction. According to the error indexes between the predicted value and the actual value: Root Mean Square Error (RMSE) and Mean Absolute Percentage Error (MAPE), the optimal model is selected as the load prediction model to obtain the optimal load prediction results.
where, n is the number of predicted values. The smaller the values of RMSE and MAPE, the closer the predicted value (ŷ i ) is to the true value (y i ), and the better the prediction model works.

Energy Scheduling Model of Rural Microgrid
The rural microgrid is a micro power system that integrates bidirectional power flow, renewable energy generation, CES system and multiple loads. The research content of this section is to solve the optimal power-dispatching scheme of the rural microgrid containing cloud energy storage. The scheduling cycle is for one day, and the decision taken is for day-ahead scheduling. The goal of scheduling is to minimize the total electricity cost of the microgrid.
The electricity cost mainly includes grid electricity charge, CES service fee and renewable energy generation cost. So, the objective function can be expressed as: According to the actual charging/discharging behavior, the equivalent throughput of the cloud battery is calculated. The calculated throughput is used to estimate the battery life loss. We then refer to the method in the literature [31,32] to convert the battery depreciation cost into the CES service fee. The calculation formula of the CES service fee is as follows: The calculation formula for the cost of renewable energy generation is as follows: In the process of electric energy dispatching, the microgrid system satisfies the energy conservation: The energy structure relationship of each part in the rural microgrid is as shown in Figure 6 and the research methodology is as shown in Figure 7.  The optimization variables of electric energy scheduling include the working state of household appliances, the power of greenhouse electrical equipment, the charging and discharging power of the CES battery and the power purchased from the grid. It is a typical mixed integer programming problem. At present, the methods for solving the optimal problem mainly include mathematical programming methods, solvers and heuristic algorithms. The problems of the mathematical programming method and heuristic algorithm are easy to fall into local optimal solution and slow convergence. However, highly integrated business solvers have fast-solving speed and global searching ability, and do not easil fall into a local optimal. They can solve various linear or nonlinear, optimization problems. This method is applied to the microgrid dispatching optimization problem [21], which proves to be a feasible method.
Therefore, the Linear Interactive and General Optimizer (LINGO) is adopted in this paper to solve the daily power dispatching scheme of the rural microgrid and its scheduling optimization process is as follows. Firstly, the XGBoost algorithm is used to predict power consumption of household loads and greenhouse loads according to information provided by users. Then, on the basis of all users participating in the CES, the solver is used to solve the optimal power scheduling scheme of a rural microgrid. Finally, the scheme is applied to the actual dispatching control of the microgrid.

Solution Procedure
There are several types of users in the rural microgrid, so we only consider residential users and agricultural greenhouses. The simulation object is a village with a small geographical range, located in the low-voltage side of the distribution network, and the distance between users is relatively close. The power-dispatching scheme solved in this paper is a day-ahead decision, which is more susceptible to the uncertainty of users' power usage behavior. In order to alleviate the impact of uncertainty, we need to predict their load accurately before solving the power-dispatching scheme, so as to improve the feasibility and effectiveness of the scheduling scheme.
After knowing the user's load consumption in advance, we also need to consider the CES service mechanism, rationally use CES system to help users improve the utilization of energy-storage resources, maximize the power cost saving, and finally develop an economically viable power dispatching scheme.

Prediction Model Parameter Setting and Prediction Results
The prediction model is built on the Python 3.7 environment. By collecting information from rural areas to build a database of crop environmental indicators, and the sample data for agricultural load forecasting is selected from [33]. The sample data for residential load forecasting is derived from the University of California Irvine (UCI) dataset [34].
After the sample data is obtained, we build the XGBoost prediction model and set the parameters of the model. The Coefficient of Variance (CV) function in XGBoost model can be used to return the desired number of decision trees after determining the learning rate. Therefore, the parameters of the learning rate and the number of decision trees are first determined, and then the grid search method is used to find the best combination of the tree depth and the minimum leaf node sample weight. Next, adjust the random sampling decision tree scale and regularization parameters. Finally adjust the remaining parameters. The adjustment of parameters requires multiple attempts. By evaluating the size of the indicator and observing the prediction effect, the parameters of XGBoost are finally determined, as shown in Table 3.
After building the XGBoost prediction model, we use the residential and agricultural sample data to train the model separately. Then, the well-performing models are selected to predict the short-term load of home owners and greenhouses in a rural area of Shanghai, China, respectively. The load prediction result is shown in Figure 8. Among them, Figure 8a is the predicted result of all residential load in a rural microgrid, and it can be found that the predicted values are close to the actual values. There are three reasons why the results of residential load forecasting can be so accurate: first, we treat all home owners as a whole, and then predict its overall load instead of predicting the load of each owner in turn. Compared with the load of a house, the region load fluctuation is more gradual and less affected by subjective factors. Second, rural users' electricity use behavior is relatively simple and their life is more regular than that of urban users. Third, our database is large enough that the time resolution of sample data and predictive model is 1 min. The predicted value is the residential load per minute. Although the predicted value per minute deviates from the actual value, when the data of thirty minutes is added up, the deviation between the predicted value and the actual value of each period will decrease. So, it seems that the predicted values are nearly identical to the actual values when displayed in Figure 8a with a time resolution of 0.5 h. More importantly, the prediction accuracy should be judged based on the value deviation per minute instead of each period. Therefore, we use the data per minute to calculate the values of MAPE and RSME to accurately estimate the prediction accuracy. RMSE and MAPE of residential load are 0.059 and 12.52% respectively. In addition, Figure 8b is the predicted result of all agricultural load in rural microgrid. The growth of greenhouse crops is more controllable and regular than the naturally growing crops, which will make the prediction more accurate. The error indexes of agricultural load are RMSE 0.162 and MAPE 9.84%.
It can be seen from Figure 8 that the load of agricultural greenhouses accounts for the majority of the total load. The power consumption of the rural microgrid mainly depends on the agricultural load. Comparing the power consumption of residential load and agricultural load in Figure 8c, it can be found that their peak power appears in different time periods, so they can complement each other in power dispatching.

Scheduling Results and Analysis
In this study, power generation and electricity consumption data with a time resolution of 30 min in a rural area in Shanghai, China, are used for simulation. Moreover, the dispatching scheme and optimal storage capacity of rural microgrid can be solved by using the solver LINGO, which is a software specially used for solving optimization problems. To simplify the calculation, several reasonable assumptions are made. First, users and the CES system cannot sell excess power to the grid. Second, there is no energy available in the CES system in the initial state. Third, the network loss and line loss during power transmission is negligible. Fourth, it is assumed that all rural users do not purchase distributed energy-storage devices, and they can meet their energy-storage requirements by ordering energy-storage services from CES system. Fifth, it is assumed that the charging and discharging characteristics of the CES battery are linear and independent of the internal characteristics of the battery. The parameters of CES service and power generation cost are as shown in Table 4. Table 4. Parameters of energy storage and power generation.

Parameter
Numerical Value Users can periodically adjust the storage capacity ordered from CES according to the situation of power consumption and power generation. The size of storage capacity will affect the scheduling and management of energy. The total electricity cost is composed of grid electricity cost, storage cost and generation cost, which fluctuates with the change of the energy-storage capacity. Therefore, ordering the optimal CES storage capacity can further reduce the electricity costs of the microgrid.
According to the predicted power consumption of all loads in a day, the optimal storage capacity and electricity costs suitable for that day are calculated, as shown in Figure 9. The fluctuations of each cost are not exactly same. It can be found that the grid electricity cost reaches the local optimal when the capacity is 44 kWh, but the total electricity cost is not the minimum at this time. The total cost continues to decline until the local optimum is achieved at 47 kWh, after which the search continues and the optimal capacity is finally determined to be 57 kWh, which is the total storage capacity that the microgrid should order from the CES system. and management of energy. The total electricity cost is composed of grid electricity cost, storage cost and generation cost, which fluctuates with the change of the energy-storage capacity. Therefore, ordering the optimal CES storage capacity can further reduce the electricity costs of the microgrid.
According to the predicted power consumption of all loads in a day, the optimal storage capacity and electricity costs suitable for that day are calculated, as shown in Figure 9. The fluctuations of each cost are not exactly same. It can be found that the grid electricity cost reaches the local optimal when the capacity is 44 kWh, but the total electricity cost is not the minimum at this time. The total cost continues to decline until the local optimum is achieved at 47 kWh, after which the search continues and the optimal capacity is finally determined to be 57 kWh, which is the total storage capacity that the microgrid should order from the CES system. The daily load consumption of the microgrid is different. Adjusting the energy-storage capacity to match the daily power consumption can help users improve energy utilization and thus reduce power costs. The above experiment verifies that the optimal energy-storage capacity can help users minimize the electricity cost of the scheduling scheme. In order to further verify that the rural microgrid architecture with CES proposed in this paper has better scheduling results, we designed the following two cases.
Case 1: All users in the rural microgrid are equipped with distributed energy-storage equipment. The storage capacity is fixed and the total capacity of the equipment is 57 kWh. The forecast data, power generation data and load data are input into LINGO to solve the energy-dispatching scheme. The daily load consumption of the microgrid is different. Adjusting the energy-storage capacity to match the daily power consumption can help users improve energy utilization and thus reduce power costs. The above experiment verifies that the optimal energy-storage capacity can help users minimize the electricity cost of the scheduling scheme. In order to further verify that the rural microgrid architecture with CES proposed in this paper has better scheduling results, we designed the following two cases.
Case 1: All users in the rural microgrid are equipped with distributed energy-storage equipment. The storage capacity is fixed and the total capacity of the equipment is 57 kWh. The forecast data, power generation data and load data are input into LINGO to solve the energy-dispatching scheme.
Case 2: All users in the rural microgrid use cloud energy-storage equipment, and the total energy-storage capacity is adjusted to 57 kWh. The same forecast data, power generation data, and load data as in case 1 are input into LINGO to solve the energy-dispatching scheme.
In the process of dispatching, we adopt the real-time price (RTP) of the grid [28], and fully consider the users' power generation and power consumption demand. The total electricity cost of case 1 is 1627 RMB and the cost of case 2 is 1531 RMB. Therefore, the rural microgrid architecture with CES proposed in this paper has better scheduling results. Their scheduling results are shown in Figure 10.
Since the CES has economies of scale, the unit cost of setting CES investment is 20% lower than the unit cost of distributed energy storage (DES) investment [25]. Therefore, when calculating the energy-storage cost according to Equation (20) in scenario 1, the parameter α needs to be changed to 0.586. This means that the unit storage cost of DES is higher than CES. Comparing Figure 10b with Figure 10d, we can find that the state of charge (SOC) of DES equipment at 3:00-8:00 is lower than that of CES. Higher energy-storage costs result in DES reducing the utilization of energy-storage space.
After renting 57 kWh of energy-storage capacity from CES, the dispatching result of rural microgrid is solved, as shown in Figure 10c. By analyzing the generation power curve in Figure 10c, it can be found that the generation peak is located at 4:00 and 14:00. This is because wind-power generation is relatively large due to high wind speed in the early morning, and the light at noon leads to more photovoltaic power generation. However, it does not generate enough electricity to meet the demand of the microgrid. Therefore, users still need to purchase electricity from the grid and the total power purchased is shown as the grid power curve in Figure 10c. In addition, CES can be used as a shared energy-storage unit for the rural microgrid to meet the energy-storage needs of all users. The charging/discharging behavior planning of CES batteries is also a part of the energy dispatching. From the SOC curve of CES batteries in Figure 10d, it can be found that the available stored energy in the battery is completely used up at the end of the day, and the battery has experienced the maximum SOC and the minimum SOC during the day's use, which indicates that the space is fully used. Therefore, the new microgrid architecture with CES can optimize the energy dispatching of a rural microgrid.
consider the users' power generation and power consumption demand. The total electricity cost of case 1 is 1627 RMB and the cost of case 2 is 1531 RMB. Therefore, the rural microgrid architecture with CES proposed in this paper has better scheduling results. Their scheduling results are shown in Figure 10.
Since the CES has economies of scale, the unit cost of setting CES investment is 20% lower than the unit cost of distributed energy storage (DES) investment [25]. Therefore, when calculating the energy-storage cost according to Equation (20) in scenario 1, the parameter  needs to be changed to 0.586. This means that the unit storage cost of DES is higher than CES. Comparing Figure 10b with Figure 10d, we can find that the state of charge (SOC) of DES equipment at 3:00-8:00 is lower than that of CES. Higher energy-storage costs result in DES reducing the utilization of energy-storage space. After renting 57 kWh of energy-storage capacity from CES, the dispatching result of rural microgrid is solved, as shown in Figure 10c. By analyzing the generation power curve in Figure 10c, it can be found that the generation peak is located at 4:00 and 14:00. This is because wind-power generation is relatively large due to high wind speed in the early morning, and the light at noon leads to more photovoltaic power generation. However, it does not generate enough electricity to meet the demand of the microgrid. Therefore, users still need to purchase electricity from the grid and the total power purchased is shown as the grid power curve in Figure 10c. In addition, CES can

Conclusions
In this paper, the short-term prediction of rural load is carried out before energy scheduling. Through load classification and prediction of various rural power loads, the reliability of the input parameters of an energy scheduling system is guaranteed, and the accuracy of the scheduling strategy is improved. In addition, in order to explore the impact of energy-storage capacity on the economics of scheduling strategy, this paper solves the energy scheduling decisions under various capacities and calculates the corresponding costs. It can be seen from the simulation results that with the increase of energy-storage capacity, the cost will decrease firstly and then increase. The total electricity cost of the rural microgrid is minimized at the optimal energy-storage capacity. Because the CES system can provide the rural microgrid with adjustable capacity suitable for daily situations, the method proposed in this paper is cost effective.
In future, more consideration can be given to the interaction between the CES system and power grid. The energy-storage system in a rural microgrid can no longer be limited to simply powering the homeowner. It can also provide a shared platform for users to help them achieve energy interactions. The service mechanism and service pricing mechanism of CES can be further improved.
Funding: This research was funded by National Natural Science Foundation of China, grant number 61202369 and 61572311, Shanghai Technology Innovation Project (17020500900) and "Shuguang Program" sponsored by Shanghai Education Development Foundation and Shanghai Municipal Education Commission (17SG51).

Conflicts of Interest:
The authors declare no conflict of interest. Effective throughput of the CES in one day S b,max Maximum state of charge(SOC) of the battery α depreciation factor of the CES battery S b,min minimum SOC of the battery v wind speed E total ces total storage capacity of the CES α a start period of allowable operation for the deferrable appliance a E agri total agricultural electricity consumption β a end period of allowable operation for the deferrable appliance a E resi total residential electricity consumption d a total working periods for the deferrable appliance a C storage ces energy-storage service fee of CES p a rate power of deferrable appliance a C gener renewable energy-generation cost T C surface temperature of photovoltaic C wind Unit power-generation cost of wind turbines G c outdoor sunlight intensity C pv Unit power-generation cost of photovoltaics G STC light intensity under the STC standard conditions λ ch ces charging efficiency of the CES P STC rated output power of photovoltaic under the STC standard conditions λ dch ces discharging efficiency of the CES P pv output power of photovoltaic P ch,max ces maximum charge power of the CES P wt output power of wind power generation P dch,max ces maximum discharge power of the CES P r rated power of the fan unit Variables S ces (h) SOC of the CES battery in period h P dch ces (h) discharging power of the CES in period h E ces (h) Energy-storage state at the end of period h s a (h) operation state of deferrable appliance a in period h P ch ces (h) charging power of the CES in period h P de f (h) total power consumption of the deferrable appliances in period h P dch ces (h) discharging power of the CES in period h P nde f (h) total power consumption of the non-deferrable appliances in period h V grid buy (h) price of electricity purchased from the grid in period h P tem (h) agricultural greenhouse temperature control system power V grid sell (h) price of electricity sold to the grid in period h P lig (h) agricultural greenhouse lighting system power E grid buy (h) the energy purchased from the grid in period h P irri (h) agricultural greenhouse irrigation system power E grid sell (h) the energy sold to the grid in period h P carb (h) CO 2 generator power P ch ces (h) charging power of the CES in period h