• No results found

An XML Based Data Exchange Model for Power System Studies

N/A
N/A
Protected

Academic year: 2021

Share "An XML Based Data Exchange Model for Power System Studies"

Copied!
8
0
0

Loading.... (view fulltext now)

Full text

(1)

Communicated by Sondan Durukano˘glu Feyiz

An XML Based Data Exchange Model for Power System Studies

Hasan Da˘g

Department of Electrical Engineering, Istanbul Technical University, 34469 Maslak, Istanbul, Turkey

Umut Utkan

Department of Computational Science and Engineering, Institute of Informatics, Istanbul Technical University, 34469 Maslak, Istanbul, Turkey

(Received 09 April 2004)

Data exchange is very important in electrical and electronics engineering applications. The exchange needs to be reliable, error-free and adaptable to different types of software used in the related industries. In power community, IEEE common format, WSCC format, and PTI’s PCI format have been used extensibly to date with almost no problem for data exchange purposes. As the industry goes under big changes, such as deregulation and use of power electronics more and more, aforementioned formats are not adequate. In this paper we present a model for exchanging power system data using eXtensibly Markup Language (XML) as the exchange base. The developed software can accept IEEE common format data as input and convert it to any other forms of data formats desired such as WSCC, PTI, HTML, or even to another form of XML.

Keywords: XML, data exchange, power systems. 1. Introduction

Data exchange is a major necessity in engineering world because any data can be output of a process while being input for another. For the reliability the data exchange must have a protocol that makes the transferred data meaningful for the other processes. Defining a protocol for data exchange for a specific area is a difficult and time consuming task due to the expectation of being a standard for every relevant study and software developments.

Data exchange is also a major problem and a new value in power industry with the open access. New participants join the market as generation companies, transmission companies, and distributors. Because of the physical connectivity property of power systems, all levels of industry like generation, transmission, distribution and market need proper operational and equipmental data. As expected, the data to be shared is huge and this requires an efficient and reliable data exchange method.

The data exchange model should be expandable and should not exclude any other technologies used or will be used in the future. It must also be software and hardware independent for fully integration with all environments and industries. This paper suggests a data exchange method and conversion from or to the related protocols, especially the IEEE Common For-mat [1]. The suggested method is currently at intro-ductory level and is open for development. Its format is based on XML (Extensible Markup Language) [2]. In the following sections we present a brief

his-tory on data exchange in power systems, then we pro-vide some general information on XML and its re-lated technologies. Then we present the suggested data exchange model. We conclude with some ex-amples and related future research directions on the topic.

1.1. A Brief History of Power System Data Ex-change

For a variety of reasons, such as simulation needs for proper operation of power systems, real-time monitoring, maintenance planning, transmission planning and operation standardization of power sys-tems, data exchange is important for power systems. Real-time monitoring needs big amount of data to be transferred for processing, like equipment types, grid connections, layout information etc. While the data exchange is a big problem, non-reliable data and/or data loss are not acceptable for power system opera-tion at all. To this end several formats were offered in the past for exchanging power system data either pro-prietary or not, all having some advantages and disad-vantages.

The first and the most widely used format is the ”IEEE Common Format” implemented in 1968 by an IEEE working group [1]. IEEE Common Format is used for transferring solved load flow data and is a textual, column-wise representation of grid data. Dur-ing 1980s firstly PTI format was appeared; a propri-etary format developed by Power Technologies, Inc., for using data with the software developed by the same company. PTI is similar to IEEE Common

(2)

For-1 For-1 For-1 For-1 0 For-1.0284 5.9500 90.00 49.00 0.000 0.000 For-1For-15.00 0.000 0.0000 0.0000 0.0000 0.0000 0 2 1 1 1 0 1.0354 7.7400 56.00 15.00 0.000 0.000 115.00 0.000 0.0000 0.0000 0.0000 0.0000 0 3 1 1 1 0 0.9971 6.6400 20.00 0.000 0.000 0.000 230.00 0.000 0.0000 0.0000 0.0000 0.0000 0 ---<?xml version="1.0" encoding="UTF-8"?>

<!--XML file generated by CF2XML converter (http://dexchange.fbe.itu.edu.tr)--> <NETWORK xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="CF.xsd"> <TITLE>

<MVA_BASE>100.0</MVA_BASE>

<CASE_IDENTIFICATION>16 BUS AC SYSTEM</CASE_IDENTIFICATION> </TITLE>

<BUS id="1" type="3" area_number="0" loss_zone_number="1" remote_bus_number="0"> <NAME>BUS_1 18.0</NAME> <FINAL> <VOLTAGE>1.0</VOLTAGE> <ANGLE>0.0</ANGLE> </FINAL> <LOAD> <MW>0.0</MW> <MVAR>0.0</MVAR> </LOAD> <GENERATION> <MW>0.0</MW> <MVAR>0.0</MVAR> </GENERATION> <BASE_kV>18.0</BASE_kV> <DESIRED_VOLTS>1.0</DESIRED_VOLTS> <LIMITS unit=’MVAR’> <MAX>-99999.0</MAX> <MIN>999999.0</MIN> </LIMITS> <CONDUCTANCE>0.0</CONDUCTANCE> <SUSCEPTANCE>0.0</SUSCEPTANCE> </BUS>

Figure 1.A portion of a Common Format Data (upper part) and the corresponding XML representation (lower part) mat except it includes the DC links. After PTI, The

Western System Coordinating Council (WSCC) also developed its own format.

These three formats are the most frequently used power system data exchange formats. Whenever a more general necessity occurred another extended version of power system data exchange method is de-veloped. When these methods were proposed, mostly the interzonal exchange of data was needed.

With the deregulation of the power industry there is now a greater need for data exchange. The ex-changes are now between companies and between the interconnected networks, extending to countries. As a result, a more standardized and extensible format of data exchange is needed due to the international-wide differences in power industry standards and data ma-nipulating techniques used. The only unchanged fact is the data and it’s usage. A method that answers all deficiencies of the aforementioned methods is the best solution for the problem.

1.2. IEEE Common Format Data as a Base for the Suggested Method

IEEE Common Format was implemented by IEEE in 1968 and is the basic framework for power system data exchange. We offer a data exchange model using the strength of XML while chosing the IEEE Com-mon Format due to its simplicity of implementation. Certainly IEEE Common Format is not competent for power system data exchange. IEEE Common Format is a column-wise representation of solved power flow data. Lines are separated by section headers such as bus data, branch data etc. Columns represent load flow data, loss zones, bus and branch types, and trans-former settings. All elements have to be presented between exact column numbers with exact lengths. It is not easy to read at the first glance because values are not labeled and it requires a knowledge about the format. Furthermore, reading it programmatically re-quires several string manipulations such as splitting and concatenation, etc.

(3)

<xs:element name="LOAD"> <xs:complexType>

<xs:sequence>

<xs:element name="MW" type="xs:float"/> <xs:element name="MVAR" type="xs:float"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="GENERATION"> <xs:complexType> <xs:sequence>

<xs:element name="MW" type="xs:float"/> <xs:element name="MVAR" type="xs:float"/> </xs:sequence>

</xs:complexType> </xs:element>

<xs:element name="BASE_KV" type="xs:float" minOccurs="0"/> <xs:element name="DESIRED_VOLTS" type="xs:float" minOccurs="0"/> <xs:element name="LIMITS" minOccurs="0">

Figure 2.A portion of an XSD document used for validation Using IEEE common format as a data exchange format thus has some disadvantages that make the ex-change out of standard. Replacement of this stan-dard with a newer, extensible and programming-environment-independent will make the process more efficient.

2. XML

eXtensible Markup Language (XML) [2] is a markup language defined by World Wide Web Con-sortium (W3C) (http://www.w3c.org) and standard-ized by a W3C recommendation. It is a very pop-ular format for structured, semi-structured and un-structured data exchange over Internet and private net-works.

XML is a simple and flexible text format de-rived from Standard Generalized Markup Language (SGML) and generic type of its antecedent Hyper Text Markup Language (HTML). Unlike a few pre-defined HTML tags, a user can create and use his/her own tags in XML according to his/her own like.

An XML document is similar to HTML document in terms of appearance. However, the former has strict rules whereas the later does not in terms of syntax. Fig. 1 shows both a portion of a common format data and the corresponding XML representation of the same data. As apparent from the figure, an XML document provides more information than a common format document. The first line in the XML docu-ment begins with a processing instruction - the XML declaration defining the XML version and the char-acter encoding used in the document. NETWORK is the root element and the others defined under the NETWORK element are the child elements of NET-WORK. id, type, area number, loss zone number, and

remote bus number are the attributes of the element BUS. As can be seen from the figure, the form of XML is very simple, it consists of elements and el-ement attributes. Every elel-ement has an opening tag <foo> and ending tag </foo>. An element that does not require an ending tag is called empty tag. 2.1. Syntax

XML syntax rules require that all tags be properly nested. Thus, the first usage below

<bus><name> BUS 1 180 </bus></name> is invalid. The correct form of this representation is

<bus><name> BUS 1 180 </name></bus> All XML documents must have a root element. For example, the the root element in Fig. 1 is the NETWORK. Unlike HTML, all opening tags must be closed in XML. If these rules are followed XML doc-ument is said to be well-formed.

Unlike HTML, XML is case sensitive, hence the tag <Bus> is different from the tag <bus> and the closing tags must therefore be written in the same case. The attribute values must be quoted in XML. Another difference between the HTML syntax and that of XML is that whitespaces are generally pre-served not collapsed into a single whitespace. The syntax for writing a comment is similar to that of HTML.

<!– This is a comment –>

Usually a dictionary, a text file that describes the allowable content of the elements, attribute type, oc-currence frequency of an element, etc. accompanies an XML file. This dictionary is called document type definition or Schema depending on the usage ex-plained below.

(4)

<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsl:template match="/"> <html> <body> <table border="1"> <thead> <tr> <td>id</td> <td>type</td> <td>NAME</td> <td>BASE_kV</td> <td>D_Voltage</td> </tr> </thead> <tbody> <xsl:for-each select="NETWORK/BUS[5>=position()]"> <tr> <td><xsl:value-of select="@id"/></td> <td><xsl:value-of select="@type"/></td> <td><xsl:value-of select="NAME"/></td> <td><xsl:value-of select="BASE_kV"/></td> <td><xsl:value-of select="DESIRED_VOLTS"/></td> </tr> </xsl:for-each> </tbody> </table> </body> </html> </xsl:template> </xsl:stylesheet>

Figure 3.Sample XSL document

2.2. Validation

In most applications it is essential to create an ex-act definition of the syntax; elements, their attributes, and the occurrence frequencies of the elements within a document. This can be done in XML using Doc-ument Type Definitions (DTD) [3] or XML Schema Document (XSD) [4]. XSD is an XML based alter-native to DTD, which has a different way of defining elements. Both them specify the syntax of the XML document. If an XML document conforms to the ac-companying DTD or XSD file it is said to be valid.

Fig. 2 shows a portion of an XSD document used to validate the XML document given in Fig. 1 (be-low part). Fig. 2 establishes mandatory, the hierarchy of the document, order of elements, and occurrence frequencies of elements etc.

Using a DTD or XSD before processing the asso-ciated XML document maintains the exact data relia-bility for applications. Programmer does not need to spend time for data reliability controls. XML proces-sor does all the work for the programmer.

2.3. Viewing

XML document also have some extra capabilities because of being a standard for the future’s web. All browsers have XML libraries for manipulation. XML

Table 1

Output produced by the XSL document.

id type Name Base kV Voltage

1 3 BUS 1 18.0 18 1.0

2 0 BUS 2 230.0 230 1.0

3 2 BUS 3 138.0 138 1.0

4 0 BUS 4 230.0 230 1.0

5 0 BUS 5 125.0 125 1.0

documents do not have to be seen in the form they are created. With the help of the XML Stylesheet Language (XSL) [5] one can convert his/her own XML document to any other form such as html, pdf, postscript, even to XML.

XSL is a standard recommended by the World Wide Web Consortium. XSL can output the XML document as HTML and is supported by all current web browsers. The process is quite easy, one uses defined tags of XSL to reach the nodes (elements) in XML documents and print them into the clas-sic HTML documents as tables, images, links, etc. The XML data can be embedded wherever desired in HTML. The result of applying Fig. 3 to the XML document in Fig. 1 is shown in Table 1.

(5)

Figure 4.A pictorial overview of the suggested model

3. Suggested Data Exchange Model

Fig. 4 gives a pictorial overview of the pro-posed data exchange model. To realize this model a Java API is developed. API has capability of transforming IEEE Common Format Data to XML and XML document to Common Format Data. It is only a programming effort to support other formats such as WSCC format or PTI format. Inclusion of FACTS data is also easy since each element can eas-ily be defined and added to the model. Currently, only Common Format Data is supported because the proposed model is an introduction to XML based data exchange model for power systems. When-ever a standardized power system data model de-veloped as XML (especially the type definitions ei-ther XSD or DTD), oei-ther formats can be added eas-ily. Here we want to show that XML has big ad-vantages over other exchange formats. XML data produced by the developed converter program is val-idated using the accompanying XSD document (or DTD document) and is viewed as HTML. The de-veloped programs and their usage can be viewed at http://dexchange.fbe.itu.edu.tr/pwModel. The XML document created can be edited online by the use of DOM class developed. As can be seen from Fig. 4 viewing and editing of XML documents is eas-ier than viewing and editing other forms of data such as Common Format, WSCC and PTI formats. Pro-duced output can be directly processed by other ap-plications or can be transformed to the other structural

representations again as XML by the use of eXtensi-ble Stylesheet Transformation (XSLT) [5] language. XML transformations are the most important parts of XML data exchange. Transformation makes XML data exchange more valuable. The same data can be used in other areas with little programming effort, all work is done with XSLT. For example the suggested model gets the XML document produced from the related Common Format Data and transforms into a form that YFiles can process to produce graph of the power grid in GraphML [6] format.

The developed Java API consists of six base classes to transform Common Format to XML or vica versa.

• readCf: reads whole Common Format Data document and checks the validity of Common Format document.

• titleData: stores all title values of the given Common Format document and has methods for writing the title data as XML or as Common Format.

• busData: stores all bus values and has methods for writing the bus data as XML or as Common Format.

• branchData: stores all branch values and has methods for writing the branch data as XML or as Common Format.

• networkData: stores all network data as title data and arrays of bus and branch objects and

(6)

Figure 5. Orthogonal layout of a sample power grid generated using evaluation version of YFiles developed by YWorks (http://www.yworks.de)

has methods for writing the whole document as XML or as Common Format. readCf invokes the methods of networkData to store the data as read from the Common Format Document. • xmlParser: controls the validity of the XML

document against the accompanying XSD (or DTD) document and reads the whole document into networkData object.

All code will be opened to public access and will be available for download when the development is matured.

The developed program is only an introductory model to the proposed framework for the power sys-tem data exchange. The most important advantage of XML is that it is self-described in a way that the data (element of XML) mean both the data and the label. Simply, when you transfer data you also get the description of it. The only need then is an XML processor and a DTD or XSD. The processors checks whether the document is well-formed or not.

The proposed model have all the requirements ex-pressed in [7]. It is self-defined, expandable, re-strictable and secure. It also gets the power of XML behind such as the full web integration and strong support provided by various programming languages. XML based power system data can be easily inte-grated with the existing technology standards for the same purpose like CIM, which is an acronym for com-mon information model used for power system con-trol. CIM and XML integration is discussed in [8]. 3.1. Tools Used

For this paper a sample XML Schema is formed for power system data based on the elements and relationships used in IEEE Common Format. A

Java API (application programming interface) is developed for transformation of IEEE Common Format Data to XML. Conversion from XML to IEEE Common Format is also available. The de-veloped software can be checked online at url; http://dexchange.fbe.itu.edu.tr/pwModel.

Representing power system data as XML is advan-tageous because it can be transformed error-free be-tween various types of platforms, programming lan-guages, and database systems. All database server vendors provide XML support and this is a very big advantage for different corporations that use different database servers. Power system corporations can eas-ily integrate the use of XML as a standard.

The transformation of IEEE Common Format to XML is made by Document Object Model (DOM) [9], which is also a W3C Recommendation. DOM is a document object model that models the XML data in a tree form. It reads the whole XML data and generates its tree model in the memory and has a lot of func-tions to manipulate XML elements. Each node and attribute is easily accessible by DOM. One disadvan-tage of DOM is that it requires large memory space because it reads whole XML document into memory to form a tree model.

However, since Java also provides additional li-braries for applications that parse large XML docu-ments and requires less memory one may prefer Java APIs instead of DOM. The SAX (Simple API for XML) API is formed in this way. It follows an event based procedure when processing XML files. That is, when it sees an element opening it triggers startEle-ment() function, and when it sees an element closing it triggers closeElement() function, etc. It does not load the whole XML document to memory at once. The disadvantage of SAX is that it does not allow

(7)

up-<?xml version="1.0" encoding="UTF-8"?>

<!--XML file generated by CF2XML converter (http://dexchange.fbe.itu.edu.tr)--> <p:NETWORK xmlns:p="http://dexchange.fbe.itu.edu.tr/pwModel">

<p:TITLE>

<p:MVA_BASE>100.0<p:/MVA_BASE>

<p:CASE_IDENDIFICATION>16 BUS AC SYSTEM <p:CASE_IDENTIFICATION> <LOCATION> <COMPANY>ITU</COMPANY> <CITY>ISTANBUL</CITY> </LOCATION> <p:/TITLE> <p:/NETWORK>

Figure 6.An example of Namespace usage

date on XML data. It can be used for query purposes. Additionally using orthogonal layouter component from YFiles on our transformed XML file generates power system grid layout shown in Fig. 5. This generated layout can be stored as GraphML; another markup language developed to store graphs and bi-graphs as XML data.

XML is also extensible, additional elements can be added afterwards to the power system data to get extra functionalities. This lets the exchange to be special-ized within company transformations. Companies can do any additions to the XML documents except the changes that do not ruin the validity of the document. Also XML documents can contain other data than power system data. For example documents can con-tain both directed graph data as GraphML represent-ing topology of the grid and solved power flow data corresponding to grid in the same document. This can be done with the help of the XML Namespaces. 3.2. XML Namespaces

Since element names in XML are not fixed, very of-ten a name conflict may occur when two different doc-uments use the same name describing two different types of elements. It is impossible to provide unique-ness over all markup languages developed by classi-cal ways. To overcome this difficulty XML Names-paces are used. XML elements are used with prefixes, which are mapped to a URL (uniform resource loca-tor), that usually corresponds to an Internet resource usually the IP addresses to the creator company or as-sociation of the document. Fig. 6 shows the usage of XML Namespaces.

In the fifth line of the figure a names-pace is declared with prifix p and url http://dexchange.fbe.itu.edu.tr/pwModel. The ele-ments associated to the namespace declared are used with the prefix p in the sample document. The other elements without prefix do not belong to the docu-ment declarations. They are included for other

pur-poses such as additional information.

Additional capabilities come with the usage of XML Namespaces that make power system data more powerful. Power system data can be transferred with directed graph data as well, which provides layout representation. When the clients get the network lay-out data, real time monitoring and power system sim-ulations become aware of the predefined network lay-out information. If program gets the laylay-out infor-mation with the related power system data, simula-tion environments can visualize every power system data on its original grid layout. This capability can be transferred to web using Java applets that makes the application place-independent. One can view and monitor the power system everywhere in Intranet and also on the web if desired.

4. Discussions And Conclusions

XML is mostly used for data exchange solution for enterprise applications such as web publishing, e-commerce, etc., due to the features it contains. The huge support provided by various programming lan-guages is an indication for this. Easy integration with the web and Intranet/Internet applications makes XML one of the best solutions for data exchange sce-narios.

This paper suggests the use of XML as the data ex-change base for power system data. Towards this end a program is developed and published on the web for the use of power system community. With the help of this program IEEE common format data can be con-verted to XML, from which conversion to any other form is then depends on user’s like.

References

[1] Common Format for Exchange of Solved Load Flow Data, Technical Report 6 (1973).

(8)

[2] Extensible Markup Language (XML) 1.0, Technical report, http://www.w3.org/TR/REC-xml (2001). [3] Guide to the W3C XML Specification (XMLspec)

DTD, Technical report, W3C Recommendation, http://www.w3.org/XML/1998/06/xmlspec-report (1998).

[4] XML Schema Primer, Structures, Datatypes.

Technical report, W3C Recommendation,

http://www.w3.org/TR/xmlschema-0 (2001). [5] XSL Transformations (XSLT) Version 1.0, Technical

report, W3C Recommendation (1999).

[6] GraphML Progress Report: Structural Layer Pro-posal,LNCS 2265, 501 (2001).

[7] S. S. Miller, J. V. Staron, M. L. Oatts, and M. K. Enns, Power Systems,17, 337 (2002).

[8] J. Zhu A. deVos and S.E. Widergren, Power Industry Computer Applications Conference, 31 (2001).

[9] Document Object Model (DOM)

Specifica-tion, Technical report, W3C RecommendaSpecifica-tion, http://www.w3.org/TR/REC-DOM-Level-1 (1998).

References

Related documents

Using a sample case study, identify a patient’s stage of change, diagnosis, problem statements, goals, objectives, and a plan for therapies and activities Using a case

Implementation of the Edinburgh Postnatal Depression Scale in a Implementation of the Edinburgh Postnatal Depression Scale in a Midwest Primary Care Clinic.. Midwest Primary

Second, the good fit to active data, especially in segments 1 and 2, supports the inferred transition from the rupture barrier to the asperity based on observations of large

Thus, as one begins to develop a course or program to help prepare doctoral students for a successful teaching experience rather than one of mere survival, an extensive search

The center exposes undergraduates to the commercial real estate industry through its Integrated Real Estate at Lehigh (ire@l) program.. Unique in its interdisciplin- ary

The recognised prestige of our teaching faculty, the degree of excellence of our academic programmes and a clear international focus are the keys behind a learning model that

(2005) &#34;Factors affecting cost performance: Evidence from Indian construction projects&#34;, International Journal of Project Management, 23(4), pp. (2015) &#34;Determinants

We hypothesized that (1) species of pine seeds differ in traits such as nutritional content and size, (2) seeds with a negative selection in field experiments (P. montezumae) will