Service primitive description-based method for identifying service between main station and sub station
Technical Field
The invention belongs to the technical field of power dispatching automation, and particularly relates to a method for identifying service between a master station and a slave station based on service primitive description.
Background
The construction of the ultra-high voltage power grid enables the national power grid to become the power grid with the highest voltage level, the largest transmission capacity, the most advanced technical level and the most complex operation characteristics in the world, the existing form of the national power grid is fundamentally changed, and the structure, the power supply structure, the operation characteristics, the balance pattern and the external environment of the power grid are deeply changed. Various kinds of power grid data have become the data core of the work of each business department in the aspects of power transformation, power generation and scheduling, and are also the basis of system operation, and the information amount still keeps a remarkable increasing trend. In addition, the application types and business departments supported by each system in the field of electric network automation are gradually expanded, the system data service applications are gradually increased, and the calculation and analysis functions gradually and comprehensively go on line, so that a large number of data service functions exist among the systems, and the conventional service-oriented system architecture lacks the self-description capability of service information and has poor capability of expanding newly-added or changed services. Therefore, the data service access mode between the dispatch control center and the data service sub-station faces a significant challenge.
Disclosure of Invention
In order to meet the above requirements, the present invention provides a method for identifying services between a master station and a slave station based on service primitive description, so as to implement automatic identification of data services between the master station and the slave station of a scheduling system, and have a dynamic analysis capability for access data.
The purpose of the invention is realized by adopting the following technical scheme:
a method for identifying service between a master station and a slave station based on service primitive description comprises the following steps:
(1) adding description information for the service primitive;
(2) the service access parties identify the service interaction data content through the description information in the service primitive; the service interaction data comprises a service request data unit and a service response data unit.
Preferably, in the step (1), description information is added to the service primitive, that is, parameters of the service primitive are described on the basis of a standard service primitive, and the service primitive carrying the description information is forwarded to the service requester through the front-end server;
after receiving the service primitive carrying the description information, the service requester writes the service primitive carrying the description information into a service request data unit header, writes the service request data into a service request data unit body one by one according to the sequence of input parameters in the service primitive, and sends the service request data unit to a front-end server; the description information comprises input parameters, output parameters and parameter type identifications.
Further, the service primitive carrying the description information is issued by a service provider or obtained by a service requester by using a service query mechanism preset by both service access parties.
Preferably, the step (2) of identifying the service interaction data content comprises: the front-end server acquires the service name of the service primitive and forwards the service name and the service request data unit to a corresponding service provider; and after receiving the service request data unit, the service provider analyzes the service request data unit.
Further, parsing the service request data unit includes: and the service provider reads the service primitives according to the sequence of the input parameters in the service primitives, writes the response data into the service response data unit one by one according to the sequence of the output parameters in the service primitives, and returns the service response data unit to the service requester through the front-end server.
Further, the data unit structure of the service response data unit is the same as the structure of the service request data unit;
and after receiving the service response data unit, the service requester identifies the unit according to the sequence of the output parameters in the service primitive to acquire a response result.
Compared with the closest prior art, the invention has the following beneficial effects:
the method is characterized in that on the basis of standard service primitives, input, output and parameter type identifiers in the description primitives are added, service access information is identified by expanding the service primitives of the description information, service data is exchanged by using an access data body with the description information of the service primitives, and finally, the service access data is forwarded to a service provider by a front end of the service provider for analysis processing. The self-identification of the data service information and the dynamic analysis capability of the access data between the main stations and the sub stations are achieved; therefore, the self-description capability of the data service between the main station and the sub-station is improved, so that both data interaction parties can dynamically access and interact data without presetting the data format of the exchange, and the service expansion capability of the sub-stations is greatly enhanced.
Drawings
FIG. 1 is a general flowchart of a method for identifying services between a master station and a slave station according to the present invention;
FIG. 2 is a flow diagram of a method for identifying service interaction data content provided in an embodiment of the present invention;
FIG. 3 is a diagram illustrating a structure of a service request data unit provided in an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a service response data unit provided in an embodiment of the present invention.
The specific implementation mode is as follows:
the application of the service-oriented architecture between the power systems provides support for information data interaction in a service mode, but the conventional service-oriented architecture requires that two interaction parties need to know service definition information in advance or make a prearrangement, and along with the continuous expansion of the application requirements of future services, the data service functions of substations are continuously increased, and the service predefinition and access complexity is higher and higher. The invention relates to a method for identifying service between a main station and a sub station based on service primitive description, which identifies service access data by adding description information in service primitives, adds service primitive description content at the head of the service access data to enable the service provider front end to identify the requested service, and finally forwards the service access data to the service provider by the service provider front end for analysis processing. The method of the invention improves the self-description capability of the data service between the main station and the sub-station, and both sides of the data interaction can dynamically access and carry out the data interaction without the prior agreement, thereby greatly enhancing the service expansion capability of the sub-station. As shown in fig. 1, the method comprises the steps of:
(1) adding description information for the service primitive;
service Primitive (GSSP): the interface between the user and the protocol entity is actually a piece of program code, but it is not divisible. The communication between the service user and the service provider can be realized by means of service primitives, which are used for the service provider and the service user, in contrast to the protocol, which is used for the communication between the service users. The concept of the universal safety service primitive is oriented to callers of different protocol layers.
In the same open system, when (N +1) entity requests service to N entity, information interaction is needed between service user and service provider, and the interacted information is called as service primitive; the service primitive is composed of two parts, a service action and a primitive type.
There are only 4 types of service primitives, including:
requesting (Request) a user entity to Request the service to do a work source (N +1) entity- > source (N) entity;
indicating (Indication) that the user entity is informed of some event occurrence destination (N) entity- > destination (N +1) entity;
the responding (Response) user entity represents the responding destination (N +1) entity- > destination (N) entity for an event;
confirm (Confirm) that the user entity received a reply source (N) entity- > source (N +1) entity to its request.
The switching sequence of service primitives is called service authentication mode, and different authentication modes require different primitive types, but all the primitive types are in the above 4 types.
In the step (1), description information is added for the Service primitive, namely, the parameters of the Service primitive are described on the basis of the standard Service primitive Service A primitive Service B primitive, and the Service primitive carrying the description information is forwarded to a Service requester through a front-end server;
after receiving the service primitive carrying the description information, the service requester writes the service primitive carrying the description information into a service request data unit header, writes the service request data into a service request data unit body one by one according to the sequence of input parameters in the service primitive, and sends the service request data unit to a front-end server; the description information comprises input parameters, output parameters and parameter type identifications.
The service primitive carrying the description information is issued by a service provider or acquired by a service requester by adopting a service query mechanism preset by both service access parties.
As shown in fig. 2, (2) both sides of service access identify the service interaction data content through the description information in the service primitive; as shown in fig. 3 and 4, the service interaction data includes a service request data unit and a service response data unit.
The step (2) of identifying the service interaction data content comprises: the front-end server acquires the service name of the service primitive and forwards the service name and the service request data unit to a corresponding service provider A or a service provider B; and after receiving the service request data unit, the service provider analyzes the service request data unit.
Parsing the service request data unit includes: and the service provider reads the service primitives according to the sequence of the input parameters in the service primitives, writes the response data into the service response data unit one by one according to the sequence of the output parameters in the service primitives, and returns the service response data unit to the service requester through the front-end server.
The data unit structure of the service response data unit is the same as the structure of the service request data unit;
and after receiving the service response data unit, the service requester identifies the unit according to the sequence of the output parameters in the service primitive to acquire a response result.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting the same, and although the present invention is described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: modifications and equivalents may be made to the embodiments of the invention without departing from the spirit and scope of the invention, which is to be covered by the claims.