7.1 Introduction

With the rapid development of global maritime transportation, ports have become energy and emission-intensive, and under the drive of the “dual carbon” strategy, the electrification level of ports is constantly improving [1]. Refrigerated containers (referred to as “reefers”) convert electrical energy into cooling energy through their own refrigeration compressors, maintaining the temperature of the reefers within the allowed range. Large ports can store several thousand or even tens of thousands of reefers at the same time. Due to the impact of the global COVID-19 pandemic, the capacity of cold chain transportation has been reduced, and the density of reefers in port yards has continued to increase [2]. Reefers have become one of the largest energy consumers in ports [3, 4]. According to statistics, reefers at the Port of Los Angeles account for 20% of the total energy demand [5]. In ports where cold chain transportation is the main focus, the proportion of energy used by reefers is even higher. For example, at the Port of Valencia in Spain, the energy demand of reefers accounts for as much as 45%, exceeding logistics equipment to become the largest load in the port [6].

The large number of reefers and high electricity consumption of reefers will increase the system power during peak periods, leading to conflicts between power supply and demand and equipment overload. In addition, disorderly electricity use will also cause large-scale fluctuations in power supply lines, leading to increased losses and reduced efficiency. On the other hand, reefers have certain thermal storage capacity. Reefers with good insulation can maintain an internal temperature rise of about 0.11 °C/h in the non-refrigeration state, which is a controllable flexible load [7]. Therefore, optimizing the electricity consumption of reefers is becoming increasingly important for green ports. It can significantly reduce the peak-to-valley difference of the load while reducing operating costs, thereby improving the economic and safety performance of the port energy system. However, the large scale of the reefer load, high dimensionalities of individual participation in global optimization, and low computational efficiency make it difficult to meet the real-time requirements of reefer group optimization scheduling. In addition, unlike temperature-constrained loads such as air conditioning [8] and electric heat pumps [9], different reefers have different temperature limits, which further increases the complexity of reefer group optimization.

Considering the controllability and thermal storage characteristics of reefers, previous studies have used reefers as flexible response resources to optimize electricity use and peak shaving. For example, literatures [10, 11] established a demand response model for multiple loads including refrigeration systems in ports and incorporated reefers into the port power system scheduling to reduce operating costs. Literature [12] integrated energy storage systems and different flexible loads including reefers in ports to achieve effective management of port energy. These studies modeled all reefers in the port as a whole, without considering the optimization and adjustment flexibility brought by individual differences in reefers, and it is also difficult to ensure that the temperature of each reefer does not exceed the limit. Currently, there are few studies on optimization scheduling considering the different characteristics and constraints of reefers. Literature [13] established an energy consumption model for a single reefer and reduced the peak load of the port by direct load control, but the centralized optimization based on a single reefer not only depends on the central node of centralized scheduling but also faces the problem of high computational dimensions and difficult rapid solutions.

The distribution of reefer loads in ports is relatively concentrated and can be interconnected through a small-scale local communication network to achieve the coordination and autonomy of reefer groups, which is suitable for distributed scheduling methods [14, 15]. Literature [16] proposed a distributed optimization scheduling model and solution algorithm based on multi-agent systems for port loads, where each agent makes autonomous decisions by solving local optimization problems. By dividing a large-scale optimization problem into multiple small-scale local optimization problems for solving, the computational dimensions are reduced, but the improvement in computational speed is limited, which cannot meet the requirements of accurate temperature control of reefers while ensuring overall optimization effects.

In this chapter, a consistent hierarchical optimization scheduling method is proposed to solve the problem of power optimization for large scale reefer groups at green port. Considering the heat exchange process of reefer, the thermoelectric coupling model of reefer is established. The reefers are divided into different clusters according to their electrical characteristics. Combined with dynamic electricity prices, the pre-scheduling strategy of the power consumption of the clusters is optimized with the lowest electricity cost as the goal. The refrigeration efficiency factor was proposed as the consistent state variable, and the dynamic power distribution model of the multi-intelligent body consistent master–slave power of the reefer was established to realize the fast response of the reefer in the cluster, so that the actual power demand of the reefer and the pre-scheduling strategy could be consistent as far as possible and meet their strict temperature constraints. Taking Rizhao Port as an example, the optimization effect and computational efficiency of the proposed method are verified.

7.2 Operation Characteristics and Modeling of Reefers

The front end of the refrigerated container is equipped with a built-in refrigeration compressor, and the temperature inside the container is controlled by power supply through the cold chain plug. As shown in Fig. 7.1a, when the refrigerated container is in the refrigeration state, the refrigeration compressor works, and the cold air blows from the ventilation duct inside the container, flows through the ventilation guide rail at the bottom of the container and surrounds the goods, and then returns to the refrigeration device through the cold air inlet on the front wall, forming a loop. In order to improve the cooling effect, the walls, top and bottom of the container are all lined with insulation materials. The operating characteristics of a single refrigerated container without ordered power supply are shown in Fig. 7.1b, where ton is the time when the refrigerated container is in the refrigeration state, and toff is the time when the refrigerated container is not in the refrigeration state. The operation of the refrigerated container is usually divided into two types: variable frequency operation and fixed frequency operation. After the fixed frequency refrigerated container starts refrigeration, the compressor speed remains unchanged. Under certain working conditions, its refrigeration capacity is fixed. However, as the external environmental conditions change, the working conditions and load inside the container will change, and the fixed frequency operation mode will cause large temperature fluctuations in the container and lower compressor unit efficiency. The variable frequency refrigerated container can change the power output by the frequency converter to achieve continuous and quantitative control of the compressor speed. In recent years, the market share of variable frequency refrigerated containers has been increasing, so in this chapter, it is assumed that the refrigerated container operates in a variable frequency manner.

Fig. 7.1
figure 1

Operation mechanism of a reefer

The load modeling of the reefer is the basis for the study of its demand response mechanism. In the process of thermal-electric coupling modeling of the reefer, an exponential model is used to describe the dynamic temperature characteristics of the reefer [7]. Considering factors such as environmental temperature, solar radiation intensity, and type of goods inside the box, a thermodynamic dynamic model of the reefer can be established based on the principle of heat balance, as shown in (7.1).

$$ \begin{array}{*{20}c} {T\left( {t + \Delta t} \right) = T\left( t \right) + \left[ {T_{amb} \left( t \right) - T\left( t \right)} \right] \cdot \left( {1 - e^{{ - \frac{{\sigma \cdot A \cdot k_{t} }}{{10^{3} \cdot m \cdot c}} \cdot \Delta t}} } \right) - \frac{{P_{R} \left( t \right) \cdot \Delta t}}{m \cdot c}} \\ \end{array} $$
(7.1)

where \(\Delta t\) is the unit scheduling period(s). T represents the internal temperature of the reefer (°C). Tamb is the temperature of the external environment (°C). σ is the correction factor considering the introduction of solar radiation. A is the outer area of the reefer (m2). kt is heat transfer coefficient (W/m2 K). m and c are the mass (kg) and specific heat capacity (kJ/kg K) of the goods in the container respectively. PR is the refrigerating capacity (kW), and when the refrigeration compressor stops working, PR = 0.

The actual power consumption of the reefer is related to the refrigerating capacity, and the power at all times should not exceed the limit. Generally speaking, the higher the internal temperature of the reefer, the higher the available refrigeration capacity, the higher the maximum power consumption. The power consumption of the reefer satisfies the relation described in (7.2).

$$ \begin{array}{*{20}c} {\left\{ {\begin{array}{*{20}c} {StR\left( t \right) \cdot P_{eR}^{\min } \le P_{eR} \left( t \right) \le StR\left( t \right) \cdot P_{eR}^{\max } } \\ {P_{R} \left( t \right) = ERR \cdot P_{eR} \left( t \right) } \\ \end{array} } \right.} \\ \end{array} $$
(7.2)

where StR(t) is the operating state of the reefer, (when reefer operates StR(t) = 1, otherwise StR(t) = 0). \(P_{eR}\) is the electrical power of the reefer. \(P_{eR}^{\max }\) and \(P_{eR}^{\min }\) are respectively the upper and lower limits of the power consumption of the reefer. ERR is the refrigeration energy efficiency ratio. ERR of the reefer is different at different temperature setting points.

Since the goods in the reefer have certain requirements on the storage temperature, in order not to damage the goods, it is necessary to keep the temperature in the box within a certain range, as shown in (7.3).

$$ \begin{array}{*{20}c} {T^{\min } \le T\left( t \right) \le T^{\max } } \\ \end{array} $$
(7.3)

where \(T^{\max }\) and \(T^{\min }\) are the upper and lower limits of the temperature in the box respectively.

Equations (7.1)–(7.3) constitute the electricity consumption model of a single refrigerated container. Using a single refrigerated container as an optimization unit in a port scenario with more than a thousand containers would introduce hundreds of thousands or even millions of variables, greatly increasing the difficulty of optimization calculations. It is difficult to solve with the existing computing resources. Therefore, this chapter adopts the method of cluster equivalent modeling to describe the electricity consumption behavior and related constraints of the refrigerated container group. Several refrigerated container clusters (CR) are divided according to the type of goods, and refrigerated containers that are included in the same cluster have the same specific heat of goods, temperature setting value, and temperature allowable range. All refrigerated containers in the cluster can be equivalent to a large-capacity refrigerated container set, and the electricity consumption model of each CR can adopt the framework of a single refrigerated container electricity consumption model, with the quality and size taking the sum of all refrigerated container quality and size in the cluster.

7.3 Hierarchical Scheduling Modeling of Reefer Groups

7.3.1 Hierarchical Scheduling Architecture

The hierarchical scheduling architecture for reefer load groups is shown in Fig. 7.2 and consists of three layers: Port Dispatching Center (PDC), Reefer Aggregator (RFA), and Reefer (RF) load groups. By adopting a hierarchical scheduling strategy and establishing multiple small coordinated communication networks within the reefer load groups, the conventional management method of “collection-processing-control” loop entirely through the dispatching center is avoided, and a good balance between decentralized autonomy and centralized coordination is achieved from bottom to top. PDC-RFA-RF can achieve high-speed communication through 5G networks and fiber optic networks. The functions of each layer in the optimized scheduling process are as follows.

  1. (1)

    First level: PDC is responsible for supplying power to the basic load and refrigerated containers within its jurisdiction, and guides the power demand response of refrigerated containers by releasing time-of-use pricing signals, thus smoothing out load power fluctuations. PDC receives information about basic electricity prices, basic loads, and aggregated refrigerated container load demands during the optimization period, and calculates a new electricity price based on the total load and electricity price elasticity within the port area, and issues it to the load aggregator. Through the price signal guidance, refrigerated containers can be used as much as possible during periods of low load.

  2. (2)

    Second level: This layer is connected to the dispatching center and issues instructions to the reefer load group. After receiving the electricity price signal, RFA calculates the optimal power curve (i.e., pre-scheduling plan) for each CR based on the lowest cost as the optimization objective, according to the electricity price and CR model parameters, and issues it to the corresponding cluster. At the same time, RFA collects and integrates refrigerated container load information, aggregates the load demand curves of each CR into a total demand curve, and reports it to PDC.

  3. (3)

    Third level: This layer aggregates a certain number of refrigerated containers with similar electricity usage characteristics into a cluster, and adds a communication network between each refrigerated container in the cluster. An intelligent agent is assigned to each refrigerated container in the cluster, and during each scheduling cycle, each refrigerated container agent only communicates with the adjacent two agents, and receives the pre-scheduled power instructions for the CR issued by the upper layer as the target for consistency control through the leading refrigerated container agent. By executing certain protocols and combining their own practical constraints, each refrigerated container can obtain its own power demand. Then, each CR uploads its actual demand curve to the upper layer.

Fig. 7.2
figure 2

The hierarchical dispatching architecture for reefers

7.3.2 Dynamic Model of PDC

The regulation goal of PDC is to reduce the peak-valley difference of system load. By utilizing dynamic time-of-use pricing mechanism, it achieves the transfer and reduction of cold box load during peak load periods. The forecasted electricity prices and the elasticity of electricity prices to cold box power demand during optimized periods are known, and the formula for updating electricity prices is shown in (7.4).

$$ \begin{array}{*{20}c} {EP\left( {t,n} \right) = E\hat{P}\left( t \right) \cdot \left( {1 + a \cdot \mathop \sum \limits_{i = 1}^{M} \mathop \sum \limits_{j = 1}^{{N_{i} }} P_{eR,ij} \left( {t,n - 1} \right)} \right) \cdot TSL\left( {t,n} \right)} \\ \end{array} $$
(7.4)

where \(i = 1,2, \ldots ,M\), \( j = 1,2, \ldots ,N_{i}\). \(M\) is the number of clusters. \(N_{i}\) is the number of reefers in CRi. n is the number of iterations. \(EP\left( {t,n} \right)\) is the electricity price at time t calculated by PDC at the nth iteration. \(E\hat{P}\) is the predicted electricity price. a is the price elasticity factor, which indicates the change in unit price for every 1 kW change in electricity demand. \(TSL\) represents the load factor.

In order to define TSL, a high load threshold needs to be defined for the port grid. When the total load power of the port area exceeds this threshold, the TSL increases, thereby shifting the reefer load from peak to other time periods. TSL is calculated as shown in (7.5) and (7.6).

$$ \begin{array}{*{20}c} {P_{total} \left( {t,n - 1} \right) = P_{load} \left( t \right) + \mathop \sum \limits_{i = 1}^{M} \mathop \sum \limits_{j = 1}^{{N_{i} }} P_{eR,ij} \left( {t,n - 1} \right)} \\ \end{array} $$
(7.5)
$$ \begin{array}{*{20}c} {TSL\left( {t,n} \right) = \left\{ {\begin{array}{*{20}l} {1,} \hfill & {P_{total} \left( {t,n - 1} \right) \le P_{thres} } \hfill \\ {1 + \rho \cdot \frac{{P_{total} \left( {t,n - 1} \right) - P_{thres} }}{{P_{thres} }},} \hfill & {P_{total} \left( {t,n - 1} \right) > P_{thres} } \hfill \\ \end{array} } \right.,} \\ \end{array} $$
(7.6)

where \(P_{total}\) is the total load power in the port area. \(P_{load}\) is the base load in the port area except the reefer. \(P_{thres}\) is the threshold of high load in the port area. \(\rho\) is the penalty factor for overload.

In each iteration, the electricity price should be recalculated according to (7.4)–(7.6) until the electricity price converges.

7.3.3 RFA Decision Model

After collecting CR model parameters and electricity price information, RFA develops pre-scheduling strategy with the goal of lowest electricity cost for reefer, as shown in (7.7).

$$ \begin{array}{*{20}c} {\min \left( {\mathop \sum \limits_{{t = t_{0} }}^{{t_{f} }} \mathop \sum \limits_{i = 1}^{M} P_{eR,i} \left( t \right) \cdot EP\left( {t,n} \right)} \right)} \\ \end{array} $$
(7.7)

where \(P_{eR,i}\) is pre-scheduling planned power for CRi.

To optimize scheduling in successive cycles, the temperature at the end of each CR scheduling cycle is set the same as the initial temperature, as shown in (7.8).

$$ \begin{array}{*{20}c} {T_{i} \left( {t_{0} } \right) = T_{i} \left( {t_{f} } \right)} \\ \end{array} $$
(7.8)

where \(T_{i} \left( {t_{0} } \right)\) and \(T_{i} \left( {t_{f} } \right)\) are respectively the equivalent temperature of CRi at the beginning and end of the scheduling period.

7.4 Consensus Based Multi-agent Power Dynamic Distribution Model

7.4.1 Refrigeration Efficiency Factor of Reefers

After obtaining the CR pre-scheduling strategy, it is necessary to develop an efficient power allocation strategy to ensure that the reefers in the cluster fully responds to the RFA scheduling instructions. Due to the differences in the quality of goods in each reefer in the cluster, simply allocating the total power instruction equally to each reefer may result in some reefers with small refrigeration demands being over-cooled below the temperature lower limit, while reefers with larger refrigeration demands may be insufficiently cooled and exceed the temperature upper limit. On the other hand, power allocation is actually a process of anti-aggregation. In order to avoid the diversity of power consumption of reefer within the same cluster being undermined and its flexibility cannot be fully utilized, it is necessary to combine the reefer load model parameters and real-time operating status, judge the urgency and controllability of reefer power consumption at different times, formulate response tracking strategies, and achieve self-trend optimization operation of reefer load.

Consensus algorithm has the advantages of high computational efficiency, strong practicality, small amount of transmitted information, and “plug and play” characteristics when solving power allocation problems [17], and has gained some application research in the fields of power system economic dispatching [17, 18], automatic power generation control [19, 20], etc. Therefore, this chapter proposes the refrigeration efficiency factor of reefer, which is used as the consistency state variable among reefers, and adopts the “leader–follower” mode of power allocation algorithm to make reefers with higher temperature (i.e., larger refrigeration demands) in the same cluster bear a larger share of power. The jth reefer refrigeration efficiency factor ωij of CRi is defined as (7.9).

$$ \begin{array}{*{20}c} {\omega_{ij} \left( t \right) = \frac{{\frac{{ERR_{ij} \cdot P_{eR,ij} \left( t \right)}}{{m_{ij} \cdot c_{ij} }}}}{{T_{ij} \left( t \right) - T_{ij}^{\min } }}} \\ \end{array} $$
(7.9)

In (7.9), the numerator represents the cooling rate, and the denominator represents the cooling margin of the reefer at time t. The uniformity of the cooling efficiency factor of reefers within the same cluster at each time point after total power allocation is used as the criterion for correct allocation. The reefers with higher cooling reserve have higher priority in refrigeration, and their cooling rates and corresponding power requirements are also higher.

7.4.2 Leader–Follower Consensus Algorithm for Refrigeration Efficiency of Multi-agent System

In the leader–follower refrigerating efficiency consensus (LREC) algorithm, the “leader–follower” mode is used as the basic framework to solve the centralized control problems in a distributed way to realize the autonomous response of loads. Each CR is regarded as a multi-agent system network, and each reefer represents an agent. Assume B = [bjv] the adjacency matrix of the multi-agent network, where bjv ≥ 0 represents the connection weight between agent j and agent v. The topology of the multi-agent network can be reflected by the Laplacian matrix Ljv = [l] [21], which is defined as shown in (7.10).

$$ \begin{array}{*{20}c} {l_{jj} = \mathop \sum \limits_{v = 1,v \ne j}^{{N_{i} }} b_{jv} , \;l_{jv} = - b_{jv} ,\quad \forall j \ne v} \\ \end{array} $$
(7.10)

Refrigeration efficiency factor is selected as the consistent variable of each reefer in CR. Using the discrete time first-order consistency algorithm framework in literature [22], the refrigeration efficiency factor ωij[k + 1] of CRi’s jth follower reefer agent at the k + 1 iteration is related to the refrigeration efficiency factor of all reefers at the k + 1 iteration, as shown in (7.11).

$$ \begin{array}{*{20}c} {\omega_{ij} \left[ {k + 1} \right] = \mathop \sum \limits_{v = 1}^{{N_{i} }} d_{jv} \left[ k \right]\omega_{iv} \left[ k \right]} \\ \end{array} $$
(7.11)

where djv[k] represents the term of the row random matrix \(D = d_{jv} \left[ k \right] \in R^{{N_{i} \times N_{i} }}\) in the kth iteration, and its calculation is shown in (7.12).

$$ \begin{array}{*{20}c} {d_{jv} \left[ k \right] = \frac{{\left| {l_{jv} } \right|}}{{\mathop \sum \nolimits_{v = 1}^{{N_{i} }} \left| {l_{jv} } \right|}},\quad j = 1,2, \ldots ,N_{i} } \\ \end{array} $$
(7.12)

In order to keep the actual power demand of CRi as consistent as possible with the pre-scheduling policy, ΔPerror,i(t) is defined to represent the power instruction difference of CRi at time t, as shown in (7.13).

$$ \begin{array}{*{20}c} {\Delta P_{error,i} \left( t \right) = P_{eR,i} \left( t \right) - \mathop \sum \limits_{j = 1}^{{N_{i} }} P_{eR,ij} \left( t \right)} \\ \end{array} $$
(7.13)

The refrigeration efficiency factor updating rule of CRi’s leading agent is shown in (7.14).

$$ \begin{array}{*{20}c} {\omega_{ij} \left[ {k + 1} \right] = \mathop \sum \limits_{v = 1}^{{N_{i} }} d_{jv} \left[ k \right]\omega_{iv} \left[ k \right] + \mu_{i} \Delta P_{error,i} \left( t \right)} \\ \end{array} $$
(7.14)

where \(\mu_{i}\) is the power deviation adjustment factor for CRi, and is a positive scalar that controls the convergence rate of LREC algorithm.

When LREC algorithm is used between reefers, some safety constraints need to be added to prevent the temperature or power of reefers from exceeding the limit. When the temperature of the jth reefer of CRi reaches the lower limit at some point, the reefer stops refrigeration, StRij(t) = 0, and the corresponding power consumption PeR,ij is also zero. At this time, the reefer should exit from the network information topology, and the weight of the connection with the reefer agent j becomes zero, as shown in (7.15).

$$ \begin{array}{*{20}c} {b_{jv} = 0,\quad v = 1,2, \ldots ,N_{i} } \\ \end{array} $$
(7.15)

When the power consumption of the jth reefer of CRi reaches its limit, it needs to be checked and corrected for safety, as shown in (7.16).

$$ \begin{array}{*{20}c} {P_{eR,ij} \left( t \right) = \left\{ {\begin{array}{*{20}c} {P_{eR,ij}^{\min } \left( t \right),P_{eR,ij} \left( t \right) < P_{eR,ij}^{\min } \left( t \right)} \\ {P_{eR,ij}^{\max } \left( t \right),P_{eR,ij} \left( t \right) > P_{eR,ij}^{\min } \left( t \right)} \\ \end{array} } \right.} \\ \end{array} $$
(7.16)

Similarly, at this time the connection weights with the reefer agent j all become zero. Equations (7.10)–(7.16) is a mathematical expression of the LREC algorithm. The flow chart of LREC algorithm is shown in Fig. 7.3. As can be seen from the figure, in each iteration, the leading cold-box agent needs to execute the whole process, while the follower agent only needs to carry out the steps of basic master–slave consistency algorithm and security constraint check in the small box shown in Fig. 7.3. When the security constraint of a reefer exceeds the limit, it needs to exit the multi-agent network immediately, and the corresponding network information connection weight also needs to be updated. When the difference between CRi’s actual power demand and the pre-scheduling policy ΔPerror,i(t) is less than the maximum allowable deviation \(\varepsilon_{i}\), the algorithm iteration terminates.

Fig. 7.3
figure 3

The flow chart of LREC algorithm

The above analysis for the LREC algorithm is based on an ideal communication environment. In large-scale systems with a massive number of reefers, communication delay and noise may occur due to factors such as large amounts of interaction data, observation errors, and external interference in the communication network. To address these issues, the attenuation consistency gain function can be used to reduce the delay and noise assigned to the weights of corresponding edges of neighboring individuals, thereby utilizing the effective information of adjacent individuals for consensus calculation. Equations (7.11) and (7.14), which represent the updating rules of follower and dominant agents, can be modified into (7.17) and (7.18).

$$ \begin{array}{*{20}c} {\omega_{ij} \left[ {k + 1} \right] = \omega_{ij} \left[ k \right] - c\left[ k \right]\mathop \sum \limits_{v = 1}^{{N_{i} }} l_{jv} \left[ k \right]\left( {\omega_{iv} \left[ {k - \tau_{jv} \left[ k \right]} \right] + \eta_{jv} \left[ k \right]} \right)} \\ \end{array} $$
(7.17)
$$ \begin{aligned} \omega_{ij} \left[ {k + 1} \right] & = \omega_{ij} \left[ k \right] - c\left[ k \right]\mathop \sum \limits_{v = 1}^{{N_{i} }} l_{jv} \left[ k \right]\left( {\omega_{iv} \left[ {k - \tau_{jv} \left[ k \right]} \right] + \eta_{jv} \left[ k \right]} \right) \\ & \quad + \mu_{i} \Delta P_{error,i} \left( t \right) \\ \end{aligned} $$
(7.18)

where τjv[k] is the communication delay of information transmitted from the v reefer agent to the j reefer agent. ηjv[k] is the noise of channel transmission. c[k] is the consistent gain function.

To ensure that the algorithm converges, c[k] needs to satisfy the two conditions shown in (7.19) and (7.20) [23].

$$ \begin{array}{*{20}c} {\mathop \sum \limits_{k = 0}^{\infty } c\left[ k \right] = + \infty } \\ \end{array} $$
(7.19)
$$ \begin{array}{*{20}c} {\mathop \sum \limits_{k = 0}^{\infty } c^{2} \left[ k \right] < + \infty } \\ \end{array} $$
(7.20)

It has been proved in [23] that (7.19) is a convergence condition to ensure that the consistent state variables can converge at an appropriate rate. Equation (7.20) is a robust condition. When there is communication delay and noise in the system, this condition can also make the static error of the closed-loop system within a finite range. In other words, the robust condition ensures the convergence robustness of the algorithm after considering the effect of delay and noise.

7.4.3 Analysis of Power Deviation Adjustment Factor

The convergence rate of the LREC algorithm can be controlled by adjusting the power deviation adjustment factor μi. As can be seen from (7.14), the leader will increase or decrease the refrigeration efficiency factor according to the power instruction difference ΔPerror,i(t), and its updating range is affected by the adjustment factor. When the adjustment factor is too large, the updating amplitude of the consistency state variable of the dominant reefer agent is too large, which may lead to the algorithm non-convergent. However, when the adjustment factor is too small, the amplitude of updating the consistent state variable of the dominant reefer agent is small, and the corresponding convergence rate is slow. Therefore, it is necessary to select an appropriate adjustment factor to ensure that the LREC algorithm has better stability and faster convergence rate.

For CRi containing Ni reefers, when the cooling efficiency factor of the leading reefer intelligent agent increases by μΔPerror,i(t), the cooling efficiency factor of each reefer intelligent system increases by μΔPerror,i(t)/Ni on average. According to (7.9), the total power demand increment of CRi is shown in (7.21).

$$ \begin{array}{*{20}c} {\Delta P_{eR,i} \left( t \right) = \mathop \sum \limits_{j = 1}^{{N_{i} }} \frac{{\mu_{i} \Delta P_{error,i} \left( t \right) \cdot m_{ij} \cdot c_{ij} \cdot \left( {T_{ij} \left( t \right) - T_{ij}^{\min } } \right)}}{{N_{i} \cdot ERR_{ij} }}} \\ \end{array} $$
(7.21)

In LREC algorithm, taking the power instruction difference \(\left| {\Delta P_{error,i} \left( t \right)} \right| < \varepsilon_{i}\) as the convergence criterion, the sufficient condition of algorithm convergence is \(\left| {\Delta P_{error,i} \left( t \right) - \Delta P_{eR,i} \left( t \right)} \right| < \varepsilon_{i}\).

$$ \left\{ {\begin{array}{*{20}l} \begin{gathered} \frac{{N_{i} \left( {\Delta P_{error,i} \left( t \right) - \varepsilon_{i} } \right)}}{{\Delta P_{error,i} \left( t \right)\mathop \sum \nolimits_{j = 1}^{{N_{i} }} \frac{{m_{ij} c_{ij} \left( {T_{ij} \left( t \right) - T_{ij}^{min} } \right)}}{{ERR_{ij} }}}} < \mu_{i} < \frac{{N_{i} \left( {\Delta P_{error,i} \left( t \right) + \varepsilon_{i} } \right)}}{{\Delta P_{error,i} \left( t \right)\mathop \sum \nolimits_{j = 1}^{{N_{i} }} \frac{{m_{ij} c_{ij} \left( {T_{ij} \left( t \right) - T_{ij}^{min} } \right)}}{{ERR_{ij} }}}}, \hfill \\ \quad \quad \quad \quad \Delta P_{error,i} \left( t \right) > 0 \hfill \\ \end{gathered} \hfill \\ \begin{gathered} \frac{{N_{i} \left( {\Delta P_{error,i} \left( t \right) + \varepsilon_{i} } \right)}}{{\Delta P_{error,i} \left( t \right)\mathop \sum \nolimits_{j = 1}^{{N_{i} }} \frac{{m_{ij} c_{ij} \left( {T_{ij} \left( t \right) - T_{ij}^{min} } \right)}}{{ERR_{ij} }}}} < \mu_{i} < \frac{{N_{i} \left( {\Delta P_{error,i} \left( t \right) - \varepsilon_{i} } \right)}}{{\Delta P_{error,i} \left( t \right)\mathop \sum \nolimits_{j = 1}^{{N_{i} }} \frac{{m_{ij} c_{ij} \left( {T_{ij} \left( t \right) - T_{ij}^{min} } \right)}}{{ERR_{ij} }}}}, \hfill \\ \quad \quad \quad \quad \Delta P_{error,i} \left( t \right) < 0 \hfill \\ \end{gathered} \hfill \\ \end{array} } \right. $$
(7.22)

It can be seen from (7.18) that the selection of μi depends primarily on the number of refrigerated cases Ni in CRi, the characteristics and internal temperature of each refrigerated case, and the maximum permissible deviation ɛi. When power instructions for different periods are redistributed in different clusters, the value of μi can be updated according to the value range defined in (7.22).

7.5 Solution Methodology

Under the hierarchical scheduling architecture, PDC updates the electricity price information and sends it to RFA. RFA decides the pre-scheduling strategy for CR based on the electricity price information, and each refrigeration unit in the cluster calculates its own power consumption using the LREC algorithm to ensure that the actual power demand of CR remains consistent with the pre-scheduling plan within the constraint range as much as possible. The obtained load power curve is then aggregated by RFA and uploaded to PDC. PDC updates the electricity price based on the new power demand curve. The optimization process is shown in Fig. 7.4.

Fig. 7.4
figure 4

The flow chart of hierarchical dispatch

The optimization of refrigeration unit power consumption behavior and RFA pre-scheduling strategy is based on linear modeling, which is a mixed-integer linear programming problem. Therefore, each sub-problem can be solved quickly using the commercial solver Gurobi. The entire hierarchical optimization scheduling model can be built and solved on the Matlab platform.

7.6 Case Studies

7.6.1 Case Description

Taking Rizhao Port as an example, the proposed method is validated. The port’s yard contains 3000 refrigerated containers. The model parameters used in this study are shown in Table 7.1. Twenty different temperature settings (−23 °C to +14 °C) and cargo with varying specific heat capacities (ranging from 1.46 to 4.06 kJ/kg.K) that allow for temperature variations are considered. Each refrigerated container loaded with the same cargo follows a log-normal distribution. The hysteresis width of the upper and lower temperature limits inside the container is 1 °C, and the initial temperature is equal to the set temperature. The upper limit of power consumption and cooling capacity of each refrigerated container at different temperature settings are shown in Fig. 7.5 [24]. The ERR at different temperature settings can be obtained based on the ratio of cooling capacity to upper limit of power consumption. The power consumption upper/lower limit ratio of the refrigerated containers is 9/1.

Table 7.1 Reefer parameters
Fig. 7.5
figure 5

Power limits of a reefer at different temperature set-points

The high load threshold of the port is 80 MW, and the penalty factor for overloading is 0.5. The elasticity factor of electricity price a is 5 × 10–4 RMB/MW [25]. The scheduling period is 24 h, and each time interval Δt is 0.5 h. The simulation examples are run in the Matlab R2020b environment, and the computation platform parameters are as follows: CPU: Intel(R) Core TM i5; frequency: 3.1 GHz; memory: 16 GB.

7.6.2 Analysis of Scheduling Results

To verify the optimization effect of the proposed method, an unordered electricity usage scenario for refrigerated containers was added as a comparison. In the unordered electricity usage scenario, the electricity usage of the refrigerated containers is not affected by the electricity price and the port’s basic load. When the internal temperature exceeds the upper limit, the refrigeration compressor of the refrigerated container starts and operates at maximum power. When the internal temperature is below the lower limit, the refrigerated container stops cooling. Figure 7.6 shows the comparison of the port’s total load curve and the basic load curve under the layered optimization scheduling and the unordered electricity usage scenario. The evolution of electricity prices for each round and the load factor TSL are shown in Fig. 7.7. Compared with unordered electricity, the optimization method proposed in this chapter effectively shifts a large amount of refrigerated container load demand from peak hours (9:00–12:00, 19:00–23:00) to off-peak hours (3:00–7:00, 14:00–17:00) through electricity price guidance, effectively reducing the peak-valley difference of the port’s load while reducing the electricity cost of refrigerated containers, which improves the system’s operation. The entire optimization process only requires three iterations to converge. The predicted electricity price is used in the first round of iteration, and then adjusted appropriately according to (7.4).

Fig. 7.6
figure 6

Performance of hierarchical optimal dispatch

Fig. 7.7
figure 7

Electricity price evolution process and loading factor

The electricity cost of reefer optimized by the method in this chapter is 64,543 RMB, and the electricity cost is 73,793 RMB if the method of disorderly electricity consumption is adopted. The method proposed in this chapter can reduce the electricity cost of reefer by 12.5%.

7.6.3 Efficiency Analysis of Consensus Based Multi-agent Hierarchical Optimization

The large-scale optimization and scheduling problem for cold storage load is a constrained mixed integer linear programming problem. If a single cold storage unit is used as an independent scheduling object, it involves 288,000 decision variables and 432,000 constraints in this case. It is actually impossible to solve this problem using a centralized optimization algorithm because it requires very long computation time. In Literature [16], an optimization method based on Multi-Agent Systems (MAS) is proposed. The MAS method can reduce the computational pressure by dividing this large-scale optimization problem into 3000 small-scale optimization problems. In this chapter, we compare our method with the MAS method to demonstrate the effectiveness of our method in improving optimization efficiency.

The optimal power demand for the port cold storage load obtained by our method and the MAS method are shown in Fig. 7.8. Table 7.2 compares the operating costs and optimization time of cold storage units under the two methods. It can be seen that the results obtained by our method are very similar to those obtained by the MAS method, and the optimized electricity cost differs by only 0.02%. However, the optimization time required by our method is reduced by 79.12% compared to the MAS method, and the computational efficiency is improved by about four times. This is because the improvement in computational efficiency by the MAS method depends on high-performance distributed parallel computing units. Therefore, when using the same computing device, our method has an advantage in computation time.

Fig. 7.8
figure 8

Power consumed by the reefers with the proposed method and MAS

Table 7.2 The performance of the two methods

7.6.4 LREC Algorithm Analysis

  1. (1)

    Effect Analysis of LREC Power Dynamic Distribution

The consensus topology of information status in the CR intermediate reefer is shown in Fig. 7.2. The connection weight bij of information exchange is set to 1. In this section, CR1 is taken as the research object, and other CR simulation analyses are similar. The convergence process of the consistency of the refrigeration efficiency factor of reefers in CR1 at a certain moment randomly selected is shown in Fig. 7.9. It can be seen from Fig. 7.9a that the refrigeration efficiency factor of reefers gradually reaches consensus after continuous interaction of information. From Fig. 7.9b, it can be seen that when receiving the pre-scheduling instruction, the leader will respond first, and then other followers will follow the leader to respond to the pre-scheduling instruction.

Fig. 7.9
figure 9

Convergence process of LREC algorithm in ideal communication environment

To verify the convergence robustness of the algorithm in the presence of communication delay and noise, a non-ideal communication scenario under the same conditions was added for comparison. The communication noise follows a normal distribution N[0, 4]and the probability distribution of the channel delay is as follows: the probability of a delay of 0 time unit is 0.8, the probability of a delay of 1 time unit is 0.1, and the probability of a delay of 2 time units is 0.1. The introduced consistency gain function c[k] is shown in (7.23).

$$ \begin{array}{*{20}c} {c\left[ k \right] = 0.5\left[ {\frac{1}{0.05k + 1} + \frac{{{\text{In}}\left( {0.05k + 1} \right)}}{0.05k + 1}} \right]} \\ \end{array} $$
(7.23)

The convergence process of the consistency of the CR1 internal cooling box refrigeration efficiency factor under non-ideal communication conditions is shown in Fig. 7.10. In the presence of noise and delay, the refrigeration efficiency factor of the cooling box needs to iterate more times to reach consistency, and its convergence final value is 0.4602, with a deviation from the result under ideal communication environment of only 0.15%. It can be seen that the algorithm has good robustness to the interference of communication delay and noise.

Fig. 7.10
figure 10

Convergence process of Refrigerating Efficiency in non-ideal communication environment

The temperature variation inside the optimized reefers is shown in Fig. 7.11. The initial internal temperatures of reefers, ranging from CR1 to CR20, are shown from low to high in the figure. It can be seen that throughout the scheduling cycle, although the ambient temperature changes, the internal temperature of the reefers remains stable and within the allowable range of variation. To further verify the ability of the LREC power dynamic allocation algorithm to take into account the specific constraints of each reefer and to respond reasonably to the pre-scheduling strategy, the average allocation method is selected for simulation and comparative analysis. Figure 7.12 shows the maximum and minimum temperatures of all refrigerators in CR1 at different times using the two methods. It can be seen that the use of the power average allocation method, which does not consider the different characteristics and actual constraints of the refrigerators, can cause some refrigerators to exceed their internal temperature limits, while the LREC algorithm can ensure that the refrigerators always operate within the safe constraint range.

Fig. 7.11
figure 11

Ambient temperature and internal temperature of reefers

Fig. 7.12
figure 12

Temperature of reefers in CR1 with the LREC algorithm and average allocation

  1. (2)

    Analysis of the Convergence Rate of LREC Under Different Scales

Generally speaking, as the number of reefers in the same cluster increases, the LREC algorithm needs to iterate more steps to achieve consensus. Here, we discuss the impact of different numbers of reefers on the convergence speed of consistency. Based on the above example, the reefer scale of CR1 is set to (20, 40, 60, …, 200) in turn. The convergence speed of consistency within CR1 under different scales is shown in Fig. 7.13. It can be seen that the median number of iterations only increases linearly. If the traditional centralized optimization method is used, the size of the solution space will exponentially increase with the increase of decision variables, and the optimization time will also increase exponentially with the number of reefers [26]. Therefore, the LREC algorithm can handle more reefers within a reasonable time.

Fig. 7.13
figure 13

Consensus convergence speed under different scales of CR1

7.6.5 Method Accuracy Verification

To validate the accuracy of the proposed method, a simulation was conducted on a case of 1000 refrigerated containers using both the proposed method and a global optimization method. The refrigerated containers were still divided into 20 clusters. The implementation process of the global optimization method was as follows: after the PDC published the electricity price, the optimal power demand curve of all refrigerated containers was solved by RFA, with a single refrigerated container as the scheduling object, and then uploaded to the PDC. The same process was repeated until the electricity price converged. The optimal power demand of the refrigerated containers obtained by the proposed method and the global optimization method is shown in Fig. 7.14. It can be seen that the results obtained by the proposed method are basically consistent with those obtained by the global optimization method, indicating that the two methods are equivalent within the allowable error range and verifying the accuracy of the proposed method. The comparison of optimization effects is shown in Table 7.3. In the scenario of 1000 refrigerated containers, the proposed method can reduce the electricity cost by 10.9%, and compared with the case of 3000 refrigerated containers, the larger the scale of the container terminal, the more significant the cost-saving effect of using the proposed method.

Fig. 7.14
figure 14

Power consumed by the reefers with the proposed method and the global optimization algorithm

Table 7.3 Comparison of optimization effects

In this case, the electricity cost obtained by global optimization is 0.5% lower than that of the proposed algorithm. This small difference can be almost ignored, so the proposed method has good performance in reducing costs. Both methods were simulated on a personal computer. The proposed method converged to a solution after 3 iterations, requiring 156 s, while the global optimization method required 8720 s. In practical applications, the number of refrigerated containers stacked in a port is far more than 1000, and it is almost impossible to use the global optimization method on conventional computing devices.

7.7 Conclusion

This chapter addresses the difficult problem of optimizing the solution and calculation efficiency for large-scale refrigerated container load scheduling in ports. A refrigerated container cluster-layered iterative scheduling architecture and a multi-agent refrigeration efficiency collaborative optimization strategy are proposed. A pre-scheduling model is established for dynamic time-of-use electricity prices and iterative optimization of refrigerated container cluster power consumption. A pre-scheduling power dynamic algorithm for refrigeration efficiency consistency is proposed, achieving efficient optimization of large-scale refrigerated container loads. Using the container yard at Rizhao Port as an example, the proposed method reduced the electricity cost of the refrigerated container cluster by 12.5%, increased the optimization problem-solving speed by 4 times, and the deviation from global optimization was only 0.5%. In addition, the method’s solution efficiency and accuracy are not affected by the number of refrigerated containers, and it has good robustness, providing technical support and reference solutions for energy conservation and emission reduction in large container ports.