CN114077426A - Lightweight power grid Web system front-end and back-end data proxy conversion system and method - Google Patents

Lightweight power grid Web system front-end and back-end data proxy conversion system and method Download PDF

Info

Publication number
CN114077426A
CN114077426A CN202010799995.8A CN202010799995A CN114077426A CN 114077426 A CN114077426 A CN 114077426A CN 202010799995 A CN202010799995 A CN 202010799995A CN 114077426 A CN114077426 A CN 114077426A
Authority
CN
China
Prior art keywords
request
result
data
mapping
template
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
CN202010799995.8A
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.)
NR Electric Co Ltd
NR Engineering Co Ltd
Original Assignee
NR Electric Co Ltd
NR 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 NR Electric Co Ltd, NR Engineering Co Ltd filed Critical NR Electric Co Ltd
Priority to CN202010799995.8A priority Critical patent/CN114077426A/en
Publication of CN114077426A publication Critical patent/CN114077426A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven
    • G06F8/355Round-trip engineering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a lightweight power grid Web system front-end and back-end data proxy conversion system and a method, which comprises the following steps: a front-end browser in the dispatching automation Web system sends a front-end request to the proxy conversion system according to user operation; the agent conversion system analyzes the front-end request according to a predefined rule, generates a back-end request and sends the back-end request to a back-end service; the proxy conversion system receives the back-end return data; and the proxy conversion system analyzes the back-end return data according to a predefined rule, generates a front-end request response and sends the front-end request response to the front-end browser. The data exchange of the front and rear end development of the power grid web is decoupled, and the flexibility of the front and rear end service program development is improved.

Description

Lightweight power grid Web system front-end and back-end data proxy conversion system and method
Technical Field
The invention belongs to the technical field of power systems, and particularly relates to a lightweight front-end and back-end data proxy conversion system and method for a power grid Web system.
Background
With the rapid development of the scale of the power grid, the information capacity of the power grid also increases rapidly, so that not only is the power grid state required to be accurately monitored in real time in a production area, but also the Web panoramic browsing query of the power grid resource information in a management area becomes more and more important.
The power grid Web system is a power automation system platform which is based on a local area network or a wide area network, and a client browser browses and inquires power grid resource information by using a network protocol. The power grid Web system becomes an indispensable component of a power grid management large area due to the characteristics of rich display effect, convenient access and the like.
In a power grid Web system, real-time production information such as a plant station diagram, a tidal current diagram and the like can be displayed, and statistical management information such as assets, counters and the like can also be displayed, so that high requirements are provided for the real-time performance and large data volume processing of front-end and back-end data of the Web system. However, the traditional development of the back-end service program is limited on B/S framework languages such as JAVA, and the operation efficiency and the processing of big data are not ideal.
Disclosure of Invention
Aiming at the problem that the traditional Web two-layer front-end and back-end cannot meet the development requirement of the power grid Web, the invention provides a lightweight Web front-end and back-end data conversion agent system and method, which can realize the decoupling of the exchanged data when the Web front-end and back-end operate, so that a back-end service program is concentrated on the functions and the performance and is not limited to the solution in a B/S framework.
The invention adopts the following technical scheme for solving the technical problems:
a lightweight Web front-end data transformation proxy system,
the system comprises:
the request analysis module is used for receiving a request sent by a front end according to user operation, performing deserialization analysis on the request according to a predefined rule and transmitting an analysis result to the request mapping module;
the request mapping module defines a mapping rule from a front-end request to a back-end request in a configuration file, receives an analysis result of the request analysis module, searches a matched back-end request template in the configuration file according to the type attribute of the analysis result of the request, carries out serialized mapping on the analysis result and then sends the request to the back end of the power grid Web system;
the result analysis module is used for receiving the back-end returned data, performing deserialization analysis on the returned data according to a predefined rule and transmitting an analysis result to the result mapping module;
and the result mapping module defines a mapping rule from the back-end returned data to the returned front-end result in the configuration file, receives the analysis result of the result analysis module, searches a matched returned front-end data template according to the analysis result type attribute of the back-end returned data in the configuration file, carries out serialized mapping on the analysis result of the back-end returned data and then sends the mapping result to the front end.
Further, the request analysis module deserializes the request sent by the front end according to a predefined rule and extracts the objectified data such as the type, the id, the service attribute and the like of the request.
Furthermore, the configuration file in the request mapping module configures mapping rules between the objectified data of different types of requests and the request template of the sending back end, the request mapping module receives the request objectified data obtained by the request analyzing module, the request mapping module searches and fills the request template of the sending back end according to the mapping rules, and finally the back end request is formed and sent to the back end service.
Further, the result analysis module deserializes the back-end return data according to a predefined rule and extracts object data such as types, ids, service attributes and the like.
Furthermore, the configuration file in the result mapping module configures mapping rules from the object data of different types of results to the front-end result template, the result mapping module receives the result object data obtained by the result analyzing module, searches and fills the front-end result template according to the mapping rules, and finally forms the front-end result and sends the front-end result to the front-end service.
A lightweight Web front-end and back-end data conversion proxy method comprises the following steps:
step 1, a user operates in a Web page and triggers a front-end request;
step 2, the request analysis module analyzes the front-end request, extracts service data and sends the service data to the request mapping module, wherein the service data comprises the type, the id and the service attribute of the request;
step 3, the request mapping module searches a back-end request template of the requested object according to the mapping relation from the front-end request to the back-end request defined by the configuration file;
step 4, if the matching fails, the operation is sent to the back end without a request, and the ending step is carried out; if the matching is successful, the matched back-end request template is combined with the service data and sent to the back end;
step 5, the result analysis module analyzes the back end result, extracts the service data and sends the service data to the result mapping module, wherein the service data comprises the type, the id and the service attribute of the result;
step 6, the result mapping module searches a front end result template of the requested result object according to the mapping relation from the rear end result to the front end result defined by the configuration file;
step 7, if the matching fails, the operation is sent to the front end without result, and the ending step is carried out; and if the matching is successful, sending the matched front-end result template to the front end in combination with the service data.
The invention has the beneficial effects that:
compared with the prior art, the invention adopting the technical scheme has the following technical effects: aiming at the requirements of the interaction of the request and the result of the front end and the back end, the mapping rules of the data messages of the front end and the back end are described through the configuration file, and the mapping rules are distinguished through the type of the request or the type of the result. The front end and the back end can be concentrated in the service scene, and the modification of the interactive data structure only needs to be processed in the proxy conversion system, so that the flexibility of extension is increased, and the development and deployment efficiency of the Web system is improved.
Drawings
FIG. 1 is a block diagram of a lightweight Web front-end data transformation proxy system according to the present invention;
FIG. 2 is a flow diagram of a lightweight Web front-end data transformation proxy method of the present invention;
Detailed Description
The following detailed description of the embodiments of the present invention is provided in conjunction with the accompanying drawings and specific embodiments to enable those skilled in the art to better understand the present invention and to implement the present invention, but the embodiments are not intended to limit the present invention.
As shown in fig. 1, a lightweight Web front-end and back-end data conversion proxy system includes a request parsing module, a request mapping module, a result parsing module, and a result mapping module, where the functions of each module are as follows:
the request analysis module receives a request sent by a browser according to user operation, and the content format is a JSON data format:
Figure BDA0002627031320000031
wherein, id represents the unique identification object of the sender, type represents the request type, and param represents the service parameter. The parsing module parses the objectified data of the request service attribute from param.
The request mapping module defines a mapping rule from a front-end request to a back-end request in a configuration file, receives a front-end request analysis result, searches a matched back-end request template in the configuration file according to a request type attribute, carries out serialization mapping on request data and then sends the request to a back end.
The configuration file defines the template content of the back-end request, and comprises the mapping relation definition from the front-end request to the back-end request and the definition of the back-end request template. The configuration file content may use the JSON format, the following is a basic configuration file format:
Figure BDA0002627031320000032
Figure BDA0002627031320000041
wherein, rules defines the mapping rule from the front-end request to the back-end request:
type is a front-end request type.
Request is the corresponding back-end request template.
The above configuration explains that the front end request of the request _ graph type uses the template graph, the front end request of the request _ data type uses the template data, and the front end request of the request _ menu type uses the template menu.
Templates in the configuration specifically define templates of backend requests:
id is the template unique identity.
Name is the template name.
Type is the request type.
The result analysis module receives a processing result sent by a back-end service, and the content format is a JSON data format:
Figure BDA0002627031320000051
wherein id represents a unique identification object of a receiver, type represents a result type, and data represents service data. And the analysis module analyzes the objectified data of the result service attribute from the data.
The result mapping module defines a mapping rule from a back end result to a front end result in a configuration file, receives a back end return result for analysis, searches a matched return front end data template according to a return type attribute in the configuration file, serializes and maps the return result data, and then sends the return data to a front end;
the configuration file defines the template content of the front-end result, and comprises the definition of the mapping relation from the back-end result to the front-end result and the definition of the front-end result template. The configuration file content may use the JSON format, the following is a basic configuration file format:
Figure BDA0002627031320000052
Figure BDA0002627031320000061
wherein, rules defines the mapping rule from the back end result to the front end result:
type is backend result type.
Response is the corresponding front end result template.
The above configuration explains that the template graph is used for the backend result of the response _ graph type, the template data is used for the backend result of the response _ data type, and the template menu is used for the backend result of the response _ menu type.
The schema in the configuration specifically defines a template for the front-end result:
id is the template unique identity.
Name is the template name.
Type is result type.
Once the template of the front-end result is determined according to the type of the back-end result, the result mapping module performs instantiation on the template after matching the service data to form the front-end result, and sends the front-end result to the front end.
The definition of the template content generally uses the JSON file format, and the following is an example of the definition of a template:
Figure BDA0002627031320000071
the service data definition configured with a data type template comprises three types of service data:
1. numerical value and color of numerical quantity
2. Display scheme and color of state quantities
3. Display scheme and color of primary device
As shown in fig. 2, a lightweight Web front-end and back-end data transformation proxy method includes the following steps:
step 1, a user operates in a Web page and triggers a front-end request;
step 2, the request analysis module analyzes the front-end request, extracts service data and sends the service data to the request mapping module, wherein the service data comprises attributes such as the type and the id of the request;
step 3, the request mapping module searches a back-end request template of the requested object according to the mapping relation from the front-end request to the back-end request defined by the configuration file;
step 4, if the matching fails, the operation is sent to the back end without a request, and the ending step is carried out; if the matching is successful, the matched back-end request template is combined with the service data and sent to the back end;
step 5, the result analysis module analyzes the back end result, extracts the service data and sends the service data to the result mapping module, wherein the service data comprises attributes such as the type and the id of the result;
step 6, the result mapping module searches a front end result template of the requested result object according to the mapping relation from the rear end result to the front end result defined by the configuration file;
step 7, if the matching fails, the operation is sent to the front end without result, and the ending step is carried out; if the matching is successful, the matched front-end result template is sent to the front end in combination with the service data;
in the implementation, the web request and the result both contain the object id, the operation type and the business data. The configuration file comprises the corresponding relation between the operation type and the template and the definition of the template. The returned template expresses the content organization relation of the request or the result, and the content organization relation comprises definitions of various service data types, such as values, colors, display modes and the like.
When data interaction of development operation is carried out each time, corresponding data analysis is only needed to be added, corresponding template contents in the configuration file are defined, and a template used by the matching rule appointed type object is designed. Under the condition that the content is completed, the codes needing to be written are only data sending, processing and updating of the business level of the front end and the back end of the web. The method can obviously reduce the code development amount during interactive processing of the front-end and back-end data, reduce the data coupling between the front-end and the back-end, and improve the development efficiency.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (6)

1. A lightweight front-end and back-end data proxy conversion system for a power grid Web system is characterized by comprising:
the request analysis module is used for receiving a request sent by a front end according to user operation, performing deserialization analysis on the request according to a predefined rule and transmitting an analysis result to the request mapping module;
the request mapping module defines a mapping rule from a front-end request to a back-end request in a configuration file, receives an analysis result of the request analysis module, searches a matched back-end request template in the configuration file according to the type attribute of the analysis result of the request, carries out serialized mapping on the analysis result and then sends the request to the back end of the power grid Web system;
the result analysis module is used for receiving the back-end returned data, performing deserialization analysis on the returned data according to a predefined rule and transmitting an analysis result to the result mapping module;
and the result mapping module defines a mapping rule from the back-end returned data to the returned front-end result in the configuration file, receives the analysis result of the result analysis module, searches a matched returned front-end data template according to the analysis result type attribute of the back-end returned data in the configuration file, carries out serialized mapping on the analysis result of the back-end returned data and then sends the mapping result to the front end.
2. The system of claim 1, wherein the request parsing module deserializes the request from the front end according to a predefined rule to extract the type, id and service attribute objectification data of the request.
3. The system according to claim 1, wherein a configuration file in the request mapping module configures mapping rules between different types of requested object data and a sending backend request template, the request mapping module receives the request object data obtained by the request parsing module, searches and fills the sending backend request template according to the mapping rules, and finally forms and sends a backend request to a backend service.
4. The system of claim 1, wherein the result parsing module deserializes backend return data according to predefined rules to extract type, id, and service attribute objectification data.
5. The system according to claim 1, wherein a configuration file in the result mapping module configures mapping rules between the objectified data of different types of results and the sending front end result template, the result mapping module receives the result objectified data obtained by the result parsing module, searches and fills the sending front end result template according to the mapping rules, and finally forms a front end result and sends the front end result to the front end for service.
6. A lightweight Web front-end and back-end data conversion proxy method is characterized by comprising the following steps:
step 1, a user operates in a Web page and triggers a front-end request;
step 2, the request analysis module analyzes the front-end request, extracts service data and sends the service data to the request mapping module, wherein the service data comprises the type, the id and the service attribute of the request;
step 3, the request mapping module searches a back-end request template of the requested object according to the mapping relation from the front-end request to the back-end request defined by the configuration file;
step 4, if the matching fails, the operation is sent to the back end without a request, and the ending step is carried out; if the matching is successful, the matched back-end request template is combined with the service data and sent to the back end;
step 5, the result analysis module analyzes the back end result, extracts the service data and sends the service data to the result mapping module, wherein the service data comprises the type, the id and the service attribute of the result;
step 6, the result mapping module searches a front end result template of the requested result object according to the mapping relation from the rear end result to the front end result defined by the configuration file;
step 7, if the matching fails, the operation is sent to the front end without result, and the ending step is carried out; and if the matching is successful, sending the matched front-end result template to the front end in combination with the service data.
CN202010799995.8A 2020-08-11 2020-08-11 Lightweight power grid Web system front-end and back-end data proxy conversion system and method Pending CN114077426A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010799995.8A CN114077426A (en) 2020-08-11 2020-08-11 Lightweight power grid Web system front-end and back-end data proxy conversion system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010799995.8A CN114077426A (en) 2020-08-11 2020-08-11 Lightweight power grid Web system front-end and back-end data proxy conversion system and method

Publications (1)

Publication Number Publication Date
CN114077426A true CN114077426A (en) 2022-02-22

Family

ID=80279668

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010799995.8A Pending CN114077426A (en) 2020-08-11 2020-08-11 Lightweight power grid Web system front-end and back-end data proxy conversion system and method

Country Status (1)

Country Link
CN (1) CN114077426A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104199725A (en) * 2014-09-27 2014-12-10 上海瀚之友信息技术服务有限公司 Service interface data simulation method and system
CN106528129A (en) * 2016-10-27 2017-03-22 南京南瑞继保电气有限公司 Web application interface generation system and method
WO2017113457A1 (en) * 2015-12-30 2017-07-06 邦彦技术股份有限公司 Light-weight embedded network management system and method
KR101966815B1 (en) * 2018-07-11 2019-08-13 임홍순 Integrated ORM System of RDBMS and Web API

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104199725A (en) * 2014-09-27 2014-12-10 上海瀚之友信息技术服务有限公司 Service interface data simulation method and system
WO2017113457A1 (en) * 2015-12-30 2017-07-06 邦彦技术股份有限公司 Light-weight embedded network management system and method
CN106528129A (en) * 2016-10-27 2017-03-22 南京南瑞继保电气有限公司 Web application interface generation system and method
KR101966815B1 (en) * 2018-07-11 2019-08-13 임홍순 Integrated ORM System of RDBMS and Web API

Similar Documents

Publication Publication Date Title
CN110022289B (en) Data transmission method, device and system
CN103077185A (en) Object-based user-defined information-expanding method
CN109842675B (en) Universal satellite telemetering data processing system and method
CN112527528A (en) Data transmission method, device and storage medium based on message queue
WO2017156916A1 (en) Data access method and device
CN105049256B (en) A kind of general self defined interface message realization method and system
EP2352269B1 (en) Service access method and system
CN102214099B (en) Automatic run-time environment (RTE) code generating method for automobile system architecture (AUTOSAR)
CN102968307A (en) Java-based web development middleware
CN101655943A (en) Management method and system of enterprise application integrated working flow
CN110955674B (en) Asynchronous exporting method and component based on java service
CN112235159B (en) Gateway quality portrait generation method, system, network equipment and storage medium
CN104135536A (en) Data interaction method of Web management system based on Json data protocols
CN109241384A (en) Scientific research information visualization method and device
WO2022134878A1 (en) Data processing method and apparatus, data querying method and apparatus, electronic device, and storage medium
CN114077426A (en) Lightweight power grid Web system front-end and back-end data proxy conversion system and method
CN111562964A (en) Settlement service system simulator implementation method based on rule engine
CN113591448B (en) Report generation method, device and storage medium
CN115062051A (en) Universal assembly cross-database language query method and system
CN106570118B (en) Report data processing system and method based on electric power material allocation mobile platform
CN114390033A (en) Loop state patrol instrument acquisition system and method based on extensible communication protocol
CN115048437A (en) Data service method and system based on nuclear power Paas platform
CN112613965A (en) Method and system for data processing based on middleware
CN112445811A (en) Data service method, device, storage medium and component based on SQL configuration
CN110300371A (en) A kind of computer equipment manager method based on Internet of Things behavior economics

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