## 3 Materials and Methods  
In this study, the distribution of AI services among edge data centers is discussed. Edge data centers supplied by operators and private organizations or individuals are mesh-connected with optical transport network (OTN) technology. OTN not only provides large-particle bandwidth multiplexing, flexible cross-connection and configuration scheduling but also has enhanced networking and protection capabilities, as shown in Figure 1.  
Notably, routing between each edge data center pair is pre-configured. Thus, to simplify the problem, routing and optical resource allocation problems are not considered in this letter. Given a set of AI services from different users and edge computational resources from different edge data center suppliers, this letter mainly focuses on the  
Figure 1: The schematic diagram of dynamic computational resource scheduling for AI services.  
dynamic distribution of AI services to multiple edge data centers. The schematic diagram of the dynamic distribution problem is shown in Figure 1. Edge data centers are provided by different edge suppliers such as operators, third parties, etc. Moreover, idle edge computing resources of government, enterprise and personal advanced terminals are also considered. Notably, edge data centers are characterized by selfish interest and competitiveness. AI services usually require massive computational resources by a large amount of AI data. Based on distributed data parallelism, AI data can be split into multiple flexible data segments. In other words, AI services can be divided into multiple distributed model training tasks, and distributed model training can be executed on multiple edge data centers. We formulate an AI service as \(R_{k}\), and its distribution model training task is denoted as \(\left\{r_{k,f}\right\}\). It is essential to integrate all these edge computing resources and encourage all edge suppliers to share their edge computing resources for fair competition, aiming to achieve an efficient computing resource scheduling for all distributed model training tasks of AI services. The distribution of distributed model training tasks of AI services to multiple edge data centers in the ECFN of the smart grid should solve several sub-problems shown as follows.  
1. Splitting of AI training data The AI service includes a large amount of training data. How to split the AI training data into multiple data segments for distributed model training should be determined.
2. Task scheduling order As multiple distributed model training tasks of the AI service arrive, determining the task scheduling order can not only impact the overall computing resource utilization but also impact the training latency of the AI service. This is the foundation of computing resource scheduling.
3. Edge data center selection Edge data center selection includes the determination of the number and location of edge data centers and how to assign distributed model training tasks of the AI services to edge data centers.
4. Edge computing resource scheduling In order to schedule limited computing resources on edge data centers for AI services, the economic profit of AI service providers and the backlog of distributed training tasks should be jointly optimized.