# Design and Application of a Distribution Network Phasor Data Concentrator
## 3 DPDC Design
### Software Architecture
In flow F12, assume that pdcData[k] is the element that meets the criteria and is closest to the cache header, store pmusData[i] into pdcData[k], and assign the synchronization time to it, and then process and judge pdcData[k].haspmu. When there is uMPMU disconnected communication, it will enter flow F13 because pmusData[i] with synchronization time cannot find the elements of the same time and elements without time in the whole buffer, indicating that all elements have data at this time. But they have not been sent yet, they are waiting for some uMPMUs data that has not been received.. In order to control the delay of the data and avoid the overflow of the buffer, process the element with the earliest time, assuming it is pdcData[m], then pmusData[i] can be placed in the cache normally. Because pdcData[m] has not collected all the data, the empty pmusData[ ] element will keep the original value, except stat is 0x8000, the rest of the fields are all 0. According to the stat, the main station can know which uMPMU data is missing. 3. The first step in F2 is to look for the element that already has data but no i-th uMPMU data from the buffer header. If the eligible element is found, assume it is pdcData[p], ends the query, goes to flow F21, and puts pmusData[i] into pdcData[p]. If the pdcData[p] data has already aggregated all the data, it will be judged whether its time is 0 before processing. If it is 0, the local time obtained in the previous step is used. This is in order to deal with the extreme situation where all uMPMUs are out of sync. 4. If pdcData[p] is not found, continue to look for elements with time 0 and no i-th uMPMU data. If an element that meets the criteria is found, assume it is pdcData[q], go to flow F22, otherwise go to flow F23. Put pmusData[i] into pdcData[q]. If the pdcData[q] data has already aggregated all the data, assign the local time to pdcData[q] and process it. Similar to F13, F23 is also dealing with extreme situations. Some uMPMUs are disconnected, and some uMPMUs with normal communication connections are out of synchronization, the data will go to the F23 process. In order to control the delay of the data and avoid the overflow of the buffer, when the cache is full for the first time, the local time is assigned to the pdcData[m] at the top of the buffer, and then it is processed. Each time F23 is entered, the program will move down one element for processing. The standard format DPDC data frame enters the U_data_pipe data processing module and is ready for transmission. Because the communication rate requirement of the main station to the DPDC may be different from that between the DPDC and the uMPMU, it is necessary to perform a transmission check on the data frame and select a data frame that satisfies the timestamp interval requirement for transmission. The U_data_pipe data processing module can realize the control of the data transmission rate and can also solve the problem that different main stations require different transmission rates when the DPDC communicates with the multi-main station. The uMPMU command pipe (D_cmd_pipe) data processing module is responsible for command interaction with the uMPMU to complete the transmission of commands and configuration information, and also write configuration frames to the CFG files. DPDCs with the extended protocol can also send remote commands. The data processing module of the uMPMU file pipe (D_file_pipe) is responsible for file command interaction with the uMPMU, sending file commands to the uMPMU, and then receiving and storing the transient data files, which may also be referred to as high dynamic (HD) (the file format refers to [25]). The data processing module of the main station command pipe (U_cmd_pipe) is responsible for command interaction with the main station and can read and write CFG files.