CN108471424A - A kind of encapsulation of communication message for electric energy efficiency monitoring system and analytic method - Google Patents

A kind of encapsulation of communication message for electric energy efficiency monitoring system and analytic method Download PDF

Info

Publication number
CN108471424A
CN108471424A CN201810580958.0A CN201810580958A CN108471424A CN 108471424 A CN108471424 A CN 108471424A CN 201810580958 A CN201810580958 A CN 201810580958A CN 108471424 A CN108471424 A CN 108471424A
Authority
CN
China
Prior art keywords
data
function
encapsulation
communication message
instruction type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810580958.0A
Other languages
Chinese (zh)
Inventor
刘湛
李驹光
唐东明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CHENGDU ZHONGQIAN AUTOMATION ENGINEERING Co Ltd
Original Assignee
CHENGDU ZHONGQIAN AUTOMATION ENGINEERING Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CHENGDU ZHONGQIAN AUTOMATION ENGINEERING Co Ltd filed Critical CHENGDU ZHONGQIAN AUTOMATION ENGINEERING Co Ltd
Priority to CN201810580958.0A priority Critical patent/CN108471424A/en
Publication of CN108471424A publication Critical patent/CN108471424A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)

Abstract

The invention discloses it is a kind of for electric energy efficiency monitor system communication message encapsulation and analytic method, the method includes:Communication message encapsulation function and communication message analytical function are established, communication message encapsulation function and communication message analytical function externally provide unified access interface;Function interface identifies that the encapsulation to be carried out or parsing operate by incoming instruction type, calls corresponding data encapsulation and analytical function to complete function according to order number inside program;Method is directed to the combination and analysis of communication message, establishes data encapsulation function and data analytical function respectively, provides unified access interface outside the two function pairs, facilitate program development and code administration.

Description

A kind of encapsulation of communication message for electric energy efficiency monitoring system and analytic method
Technical field
The present invention relates to the computer communication fields in computer realm, and in particular, to one kind is supervised for electric energy efficiency The encapsulation of the communication message of examining system and analytic method.
Background technology
In the existing monitoring specification to electric energy efficiency, main (son) stands and power channel information is concentrated and the communication of interactive terminal The package unpacking of associated data type and message involved by agreement is defined in agreement.On current realization algorithm, Be different protocol types is distinguished by the message id of every message, and to id to each attribute assignment, property content is report The protocol type of text, read-write properties, data format and data parse pointer.
The defect of this algorithm is:Different protocol data messages needs to write different encapsulation and analytical function, Program development increases workload, calls upper inconvenience in interface, unnecessary confusion is be easy to cause in project management.
Invention content
The present invention provides a kind of encapsulation of communication message monitoring system for electric energy efficiency and analytic methods, solve The deficiency of existing algorithm, method are directed to the combination and analysis of communication message, establish data encapsulation function and data parsing respectively Function, the two function pairs provide unified access interface outside, facilitate program development and code administration.
For achieving the above object, this application provides a kind of envelopes for the communication message monitoring system for electric energy efficiency Dress and analytic method, the method includes:
Communication message encapsulation function and communication message analytical function are established, communication message encapsulates function and communication message parsing Unified access interface is provided outside function pair;Function interface identifies the encapsulation or parsing to be carried out by incoming instruction type Operation calls corresponding data encapsulation and analytical function to complete function inside program according to order number.
Further, communication message encapsulation function and communication message analytical function are by order-driven, input instruction encapsulation There are in an association for data after corresponding frame, or parsing.
Further, the method includes predefined various data types, including operate as follows:
To be different instruction types for the Operation Definition of data type, data type includes but not limited to:Electric current, electricity Pressure, power, forward direction electricity, reversed electricity, date data;
Define the format of communication message;
Association of the definition for stored messages parsing data.
Further, communication message encapsulates function pack_D_frame, and specific format is:void pack_D_frame (TYPE_D_CMD type, DFrame*snd_frame), input parameter are instruction type;Output parameter is packaged leads to Believe message.
Further, communication message analytical function upack_D_frame, specific format are:void upack_D_frame (TYPE_D_CMD type, DFrame*recv_frame, Get_D_Data*outdata), input parameter be instruction type, The communication message received;Output parameter is the data that parsing finishes.
Further, communication message encapsulation flow is:
By data organization to be packaged at self-defined message format, data class to be packaged is judged according to incoming instruction type The corresponding instruction type of current data is passed to generic encapsulation function, then called by type if data to be packaged are current data Generic encapsulation function;If data to be packaged are voltage data, the corresponding instruction type of voltage data is passed to generic encapsulation letter Then number calls generic encapsulation function;If data to be packaged are power data, the corresponding instruction type of power data is passed to Then generic encapsulation function calls generic encapsulation function;If data to be packaged are preceding to electricity data, by preceding to electricity data Corresponding instruction type is passed to generic encapsulation function, then calls generic encapsulation function;If data to be packaged are direction electricity number According to electricity data corresponding instruction type in direction is then passed to generic encapsulation function, then calls generic encapsulation function;If waiting sealing Dress data are time electricity data, then the corresponding instruction type of time data are passed to generic encapsulation function, then called general Encapsulate function.
Further, communication message process of analysis is:
By data organization to be resolved at self-defined message format, data class to be resolved is judged according to incoming instruction type The corresponding instruction type of current data is passed to generic encapsulation function, then called by type if data to be resolved are current data Then the data parsed are stored in self-defining data association by generic encapsulation function;If data to be resolved are voltage The corresponding instruction type of voltage data is then passed to generic encapsulation function by data, then calls generic encapsulation function, then will solution The data separated out are stored in self-defining data association;If data to be resolved are power data, power data is corresponded to Instruction type be passed to generic encapsulation function, then call generic encapsulation function, then by the data parsed be stored in from It defines in data complex;If data to be resolved, to electricity data, are passed preceding to the corresponding instruction type of electricity data to be preceding Enter generic encapsulation function, then call generic encapsulation function, the data parsed are then stored in self-defining data joint In body;If data to be resolved are direction electricity data, electricity data corresponding instruction type in direction is passed to generic encapsulation letter Then number calls generic encapsulation function, then the data parsed is stored in self-defining data association;If to be resolved Data are time data, then the corresponding instruction type of time data are passed to generic encapsulation function, then call generic encapsulation letter The data parsed, are then stored in self-defining data association by number.
One or more technical solution provided by the present application, has at least the following technical effects or advantages:
This method realizes a kind of function interface of new encapsulation and parsing, will be into identify by incoming instruction type Capable encapsulation or parsing operation, calls corresponding data encapsulation and analytical function to complete inside program according to order number Function;This method is directed to the combination and analysis of communication message, establishes communication message encapsulation function and communication message parsing respectively Function, the two function pairs provide unified access interface outside, facilitate program development and code administration.
Description of the drawings
Attached drawing described herein is used for providing further understanding the embodiment of the present invention, constitutes one of the application Point, do not constitute the restriction to the embodiment of the present invention;
Fig. 1 is that communication message encapsulates flow diagram in the application;
Fig. 2 is communication message process of analysis schematic diagram in the application.
Specific implementation mode
To better understand the objects, features and advantages of the present invention, below in conjunction with the accompanying drawings and specific real Mode is applied the present invention is further described in detail.It should be noted that in the case where not conflicting mutually, the application's Feature in embodiment and embodiment can be combined with each other.
Many details are elaborated in the following description to facilitate a thorough understanding of the present invention, still, the present invention may be used also Implemented with being different from the other modes being described herein in range using other, therefore, protection scope of the present invention is not by under The limitation of specific embodiment disclosed in face.
This method is implemented as:
1 interface is divided to two kinds of functions:Communication message encapsulates function, communication message analytical function;
The concrete thought that 2 interfaces are realized:
Entire function will encapsulate corresponding frame by order-driven, i.e. input instruction;
Analytical function is also by order-driven, and there are in an association for the data after parsing.
3 realize process:
3.1 predefine various data types, and main includes following operation:
To be different fingers for the Operation Definition of the data such as electric current, voltage, power, forward direction electricity, reversed electricity, date Enable type;
Define the format of communication message;
Association of the definition for stored messages parsing data;
3.2 communication messages encapsulate function pack_D_frame
Its input parameter is instruction type;Output parameter is packaged communication message.
3.3 communication message analytical function upack_D_frame
The communication message that its input parameter is instruction type, receives;Output parameter is the data that parsing finishes.
Referring to FIG. 1, communication message encapsulation flow is:
By data organization to be packaged at self-defined message format, data class to be packaged is judged according to incoming instruction type The corresponding instruction type of current data is passed to generic encapsulation function, then called by type if data to be packaged are current data Generic encapsulation function;If data to be packaged are voltage data, the corresponding instruction type of voltage data is passed to generic encapsulation letter Then number calls generic encapsulation function;If data to be packaged are power data, the corresponding instruction type of power data is passed to Then generic encapsulation function calls generic encapsulation function;If data to be packaged are preceding to electricity data, by preceding to electricity data Corresponding instruction type is passed to generic encapsulation function, then calls generic encapsulation function;If data to be packaged are direction electricity number According to electricity data corresponding instruction type in direction is then passed to generic encapsulation function, then calls generic encapsulation function;If waiting sealing Dress data are time electricity data, then the corresponding instruction type of time data are passed to generic encapsulation function, then called general Encapsulate function.
Referring to FIG. 2, communication message process of analysis is:
By data organization to be resolved at self-defined message format, data class to be resolved is judged according to incoming instruction type The corresponding instruction type of current data is passed to generic encapsulation function, then called by type if data to be resolved are current data Then the data parsed are stored in self-defining data association by generic encapsulation function;If data to be resolved are voltage The corresponding instruction type of voltage data is then passed to generic encapsulation function by data, then calls generic encapsulation function, then will solution The data separated out are stored in self-defining data association;If data to be resolved are power data, power data is corresponded to Instruction type be passed to generic encapsulation function, then call generic encapsulation function, then by the data parsed be stored in from It defines in data complex;If data to be resolved, to electricity data, are passed preceding to the corresponding instruction type of electricity data to be preceding Enter generic encapsulation function, then call generic encapsulation function, the data parsed are then stored in self-defining data joint In body;If data to be resolved are direction electricity data, electricity data corresponding instruction type in direction is passed to generic encapsulation letter Then number calls generic encapsulation function, then the data parsed is stored in self-defining data association;If to be resolved Data are time data, then the corresponding instruction type of time data are passed to generic encapsulation function, then call generic encapsulation letter The data parsed, are then stored in self-defining data association by number.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art God and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.

Claims (7)

1. a kind of encapsulation of communication message for electric energy efficiency monitoring system and analytic method, which is characterized in that the method Including:
Communication message encapsulation function and communication message analytical function are established, communication message encapsulates function and communication message analytical function Unified access interface is externally provided;Function interface identifies that the encapsulation to be carried out or parsing are grasped by incoming instruction type Make, calls corresponding data encapsulation and analytical function to complete function according to order number inside program.
2. the encapsulation of the communication message according to claim 1 for electric energy efficiency monitoring system and analytic method, special Sign is that communication message encapsulates function and communication message analytical function by order-driven, and input instruction encapsulates corresponding frame, or There are in an association for data after parsing.
3. the encapsulation of the communication message according to claim 1 for electric energy efficiency monitoring system and analytic method, special Sign is that the method includes predefined various data types, including operate as follows:
To be different instruction types for the Operation Definition of data type, data type includes but not limited to:Electric current, voltage, Power, forward direction electricity, reversed electricity, date data;
Define the format of communication message;
Association of the definition for stored messages parsing data.
4. the encapsulation of the communication message according to claim 1 for electric energy efficiency monitoring system and analytic method, special Sign is that communication message encapsulates function pack_D_frame, and specific format is:void pack_D_frame(TYPE_D_CMD Type, DFrame*snd_frame), input parameter is instruction type;Output parameter is packaged communication message.
5. the encapsulation of the communication message according to claim 1 for electric energy efficiency monitoring system and analytic method, special Sign is, communication message analytical function upack_D_frame, and specific format is:void upack_D_frame(TYPE_D_CMD Type, DFrame*recv_frame, Get_D_Data*outdata), the communication that input parameter is instruction type, receives Message;Output parameter is the data that parsing finishes.
6. the encapsulation of the communication message according to claim 1 for electric energy efficiency monitoring system and analytic method, special Sign is that communication message encapsulation flow is:
By data organization to be packaged at self-defined message format, data type to be packaged is judged according to incoming instruction type, if Data to be packaged are current data, then the corresponding instruction type of current data are passed to generic encapsulation function, then called general Encapsulate function;If data to be packaged are voltage data, the corresponding instruction type of voltage data is passed to generic encapsulation function, so Generic encapsulation function is called afterwards;If data to be packaged are power data, the corresponding instruction type of power data is passed to general Function is encapsulated, generic encapsulation function is then called;If data to be packaged, to electricity data, are corresponded to preceding to electricity data to be preceding Instruction type be passed to generic encapsulation function, then call generic encapsulation function;If data to be packaged are direction electricity data, Electricity data corresponding instruction type in direction is passed to generic encapsulation function, then calls generic encapsulation function;If number to be packaged According to for time electricity data generic encapsulation is then called then by the incoming generic encapsulation function of the corresponding instruction type of time data Function.
7. the encapsulation of the communication message according to claim 1 for electric energy efficiency monitoring system and analytic method, special Sign is that communication message process of analysis is:
By data organization to be resolved at self-defined message format, data type to be resolved is judged according to incoming instruction type, if Data to be resolved are current data, then the corresponding instruction type of current data are passed to generic encapsulation function, then called general Function is encapsulated, then the data parsed are stored in self-defining data association;If data to be resolved are voltage data, The corresponding instruction type of voltage data is then passed to generic encapsulation function, generic encapsulation function is then called, then will parse The data come are stored in self-defining data association;If data to be resolved are power data, by the corresponding finger of power data It enables type be passed to generic encapsulation function, then calls generic encapsulation function, be then stored in the data parsed self-defined In data complex;If data to be resolved, to electricity data, preceding will be led to be preceding to the corresponding instruction type of electricity data is incoming With encapsulation function, generic encapsulation function is then called, then the data parsed are stored in self-defining data association; If data to be resolved are direction electricity data, electricity data corresponding instruction type in direction is passed to generic encapsulation function, so Generic encapsulation function is called afterwards, and then the data parsed are stored in self-defining data association;If data to be resolved For time data, then the corresponding instruction type of time data is passed to generic encapsulation function, then calls generic encapsulation function, so The data parsed are stored in self-defining data association afterwards.
CN201810580958.0A 2018-06-07 2018-06-07 A kind of encapsulation of communication message for electric energy efficiency monitoring system and analytic method Pending CN108471424A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810580958.0A CN108471424A (en) 2018-06-07 2018-06-07 A kind of encapsulation of communication message for electric energy efficiency monitoring system and analytic method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810580958.0A CN108471424A (en) 2018-06-07 2018-06-07 A kind of encapsulation of communication message for electric energy efficiency monitoring system and analytic method

Publications (1)

Publication Number Publication Date
CN108471424A true CN108471424A (en) 2018-08-31

Family

ID=63262086

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810580958.0A Pending CN108471424A (en) 2018-06-07 2018-06-07 A kind of encapsulation of communication message for electric energy efficiency monitoring system and analytic method

Country Status (1)

Country Link
CN (1) CN108471424A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103391290A (en) * 2013-07-16 2013-11-13 沈阳时尚实业有限公司 Power consumer power utilization information acquisition system with protocol parsing
US20150120270A1 (en) * 2013-10-29 2015-04-30 Electronics And Telecommunications Research Institute Apparatus and method for automating smart grid common information model interoperability test
CN105186697A (en) * 2015-10-28 2015-12-23 云南电网有限责任公司红河供电局 Remote diagnosis system of IED operating conditions of IEC61850 intelligent substation
CN106850464A (en) * 2016-12-20 2017-06-13 全球能源互联网研究院 Message processing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103391290A (en) * 2013-07-16 2013-11-13 沈阳时尚实业有限公司 Power consumer power utilization information acquisition system with protocol parsing
US20150120270A1 (en) * 2013-10-29 2015-04-30 Electronics And Telecommunications Research Institute Apparatus and method for automating smart grid common information model interoperability test
CN105186697A (en) * 2015-10-28 2015-12-23 云南电网有限责任公司红河供电局 Remote diagnosis system of IED operating conditions of IEC61850 intelligent substation
CN106850464A (en) * 2016-12-20 2017-06-13 全球能源互联网研究院 Message processing method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘华锋: "《电力能效监测系统设计与实现》", 《中国优秀硕士学位论文全文数据库工程科技Ⅱ辑》 *

Similar Documents

Publication Publication Date Title
CN102790776B (en) Heartbeat connection normalizing processing method, terminal, server and communication system
CN102202093B (en) A kind of method and system realizing transducer adaptation
CN103281311B (en) A kind of Internet of Things protocol analysis method using Protobuf to describe
CN104216761B (en) It is a kind of that the method for sharing equipment is used in the device that can run two kinds of operating system
CN103067918B (en) Method, device and system of privacy data anonymization in communication network
US20190095200A1 (en) Compatibility method based on hybrid, adapter, operation device, system and computer-readable storage medium
CN105338550B (en) A kind of management method and device of the connection for wireless network
CN107172108A (en) Data encryption, decryption method, data encryption, decryption device and communication system
CN109561395A (en) A kind of blue-tooth transmission method and device
CN105025056A (en) Internet of Things information collection and monitoring system design method
CN112686358A (en) Data transmission method, NFC electronic tag, terminal device and storage medium
CN111294235A (en) Data processing method, device, gateway and readable storage medium
CN107450929A (en) Page development method and device
US11709722B2 (en) Extensible communication framework and communication method supporting multiple communication protocols
US20190114183A1 (en) Terminal Configuration Method and Terminal Based on Provision Protocol for Transmission
CN108363588A (en) Realize method, electronic device and readable storage medium storing program for executing that web is interacted with primary function
CN111163052A (en) Method, device, medium and electronic equipment for connecting Internet of things platform
CN104199680B (en) A kind of processing method for supporting to call a variety of safety means
CN115794437A (en) Calling method and device of microservice, computer equipment and storage medium
CN106201526B (en) Service Component method and system
CN204989857U (en) Remote control device based on pioneer robot
CN108471424A (en) A kind of encapsulation of communication message for electric energy efficiency monitoring system and analytic method
CN105516106A (en) Packet packing method and device of message, and unpacking method and device of message
CN103942484A (en) Security auxiliary device using mobile phone as carrier and identity authentication method
CN101819524B (en) Access method of RFID (Radio Frequency Identification Device) reader and interface driving device thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20180831

RJ01 Rejection of invention patent application after publication