## Case Study
### Case II: DG Networking Control and Protection System in Distribution Network  
DG networking control and protection system in distribution network realizes coordinated control by means of communication network, as shown in Figure 7. In a DG substation, each CT / PT digitizes the current and voltage respectively and then uploads them to the internal communication network of the substation. All kinds of protection and control intelligent electronic equipment in the substation collect information from the internal communication network, and transmit the control command to each DG and switch. In addition to the information exchange in the station, the substation also needs to exchange information with the main station and other sub stations through a secure power communication network. It should be noted that the internal communication network in this paper is a simplified diagram. The actual DG substation is usually a complex mixed mode of multiple communication networks and protocols, such as fiber-optic Ethernet or various process buses and corresponding communication protocols. Meanwhile, DG and its corresponding acquisition and control system also present diversified characteristics. Like photovoltaic DG, in addition to classic AC signals, it also needs to collect DC signals. Even for the same electrical quantity, different functions of intelligent electronic equipment have different requirements for data acquisition granularity and data processing process. Photovoltaic DG and wind power DG are mostly based on PWM control, while small hydropower with rotating motor characteristics involves power and excitation regulation. Because of the diversity and complexity of the whole DG system, it brings a great challenge to the software design. The traditional method mostly adopts the modular software design method, which has the advantages of clear hierarchy in theory. However, in the actual DG software programming process, \begin{table}
\begin{tabular}{c c} \hline \hline
**Pseudo Code** & **Meaning** \\ \hline Hardware\_io();Raw\_driver(); & Field IED obtains power data directly through IO, \\  & not via communication \\ \hline CAN\_driver();Ethernet\_driver() & Communication driver \\ \hline Hardware\_CAN();Hardware\_Ethernet(); & Initialization of communication register \\ Hardware\_Ethernet(); & \\ \hline Obtain\_XXXdata() & XXX represents the form of obtaining data from the \\  & corresponding lower XXX \\ \hline XXX\_PDU(); & Obtaining the message data unit of XXX \\ \hline XXX\_protocol() & XXX protocol analysis \\ \hline Virtual\_planet() & The virtual planet layer proposed in the paper \\ \hline DG\_application & Power advanced applications \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Meaning of Pseudo Code. we found that it is not easy to achieve cohesion and coupling between modules. In particular, it also involves the cross content of electrical and communication information. Reasonably dividing functional modules and assigning them to different software programmers specialized in electrical or information processing, is a hard job. Taking an example of the current and voltage sampling to illustrating the classical modular software method, electrical quantity information sending to IEDs via communication network is mainly a communication processing step. Generally, the programmer who specializes in information processing deals with this module. However, due to the different granularity of the electrical quantity information that the module transmits to different IEDs with various functions, the transmission quantity of the module is actually different. According to the classical module software design method, it requires electrical professionals. With the development of DG networking control and protection system, the classical modular software design method is more complex and difficult to implement. The method proposed in this paper attempts to reduce the difficulty of the classical module design method by two means.