Disclosure of Invention
The invention aims to provide a web-side graphical power grid metadata online analysis system, which enables a user to conveniently and rapidly access metadata in a database within an allowable authority range and can efficiently obtain data analysis processing results of specified analysis types after data acquisition.
In order to achieve the purpose, the technical scheme adopted by the invention is that the web-side graphical power grid metadata online analysis system comprises a client side and a server side;
the client receives user login information and transmits the user login information to the server;
the server determines a data range which is allowed to be accessed by the corresponding user according to the user login information and displays the data range to the user through a client web interface;
the client receives user access request data, and transmits the user access request data to the server, wherein the user access request data comprises access target data information selected by a user from a data range displayed by a web interface;
the server side obtains corresponding data information according to the user access request data, stores the data information in a user personal data space and displays the corresponding information through a client side web interface;
the client receives data selection information, model selection information and result display mode selection information input by a user, sends the data selection information to the server, and sends a corresponding model template code request to the server according to the model selection information;
the server determines a data set to be analyzed according to the data selection information, and determines a corresponding analysis model according to the model template code request;
the method comprises the steps that a client obtains user model parameter setting information, and a server obtains a code file of a target data analysis model according to the user model parameter setting information;
The server takes the data set to be analyzed as the input of the data analysis model, compiles and runs a code file corresponding to the data analysis model, and performs corresponding data analysis processing to obtain a data analysis processing result;
And the server or the client performs display mode processing on the data analysis processing result according to the result display mode selection information, and displays the graphical data analysis processing result to a user through a web interface.
Optionally, corresponding to each registered user, the server side configures corresponding user access levels respectively, different user access levels configure different data access allowable ranges, and the data access allowable ranges include a metadata table allowing access and a database field allowing access, and the higher the user access level is, the more metadata allowing access is.
Optionally, the user access request data further includes unauthorized access request information, and the server side outputs corresponding user information and unauthorized access request information in response to receiving the unauthorized access request information, and requests to manually audit the corresponding unauthorized access request. For different unauthorized access target data, the server side can preset users with unauthorized access approval authorities according to the data source or the data management party, and send corresponding unauthorized access verification requests to the corresponding users, and if the unauthorized access requests are approved, the server side subsequently allows the corresponding users to access the corresponding data targets.
Optionally, corresponding to each registered user, the server side configures corresponding user personal data space respectively;
The server side obtains corresponding data information according to the user access request data and stores the data information in a user personal data space, and the method comprises the following steps:
positioning a corresponding metadata table according to metadata table information to be accessed in the access target information;
determining query parameters according to the field information of the database to be accessed in the access target information;
Substituting the query parameters into a preset SQL query template to obtain an SQL statement for accessing corresponding data;
and carrying out data query by utilizing the SQL statement, writing the data obtained by query into a file, and storing the file into a user personal data space.
Optionally, the server is provided with a model template database for storing model codes of a preset analysis model, and a model management module, and a model management interface is arranged on a corresponding client user interface of a user preset with model management authority;
The client responds to the model management interface to be called, obtains model management data and transmits the model management data to the server, and the server model management module performs new adding, deleting or modifying processing on the analysis model in the model database according to the model management data. That is, the invention supports the user to manage the analysis model which can be provided by the server through the client according to the analysis requirement, and can configure the ordinary user to only have the new model adding authority for the authority of the model management, and mark the creation user information of the new adding model in the analysis model database.
Optionally, the analysis model includes one or more of a regression analysis model, a classification model, a prediction model, and an evaluation model. A user can select a corresponding model to construct a complete data analysis model through a web interface under different data analysis requirements, and then a server runs a data analysis model code to obtain an analysis result.
Optionally, the client web interface includes a data display area, a model display area and a result display area, where the data display area is used to display selectable files in a user personal data space, the model display area is used to display multiple selectable analysis model names in a tree form, and the result display area is used to display data analysis processing results obtained after compiling and running the data analysis model in a chart form according to a display mode selected by the user.
Optionally, for the selected analysis model, the client web interface provides a model parameter setting interface for the user, and the server acquires the code file of the target data analysis model according to the user model parameter setting information, including:
The client receives model parameter setting data input by a user through the model parameter setting interface, forwards the model parameter setting data to the server, and the server modifies template code parameters of the selected analysis model according to the model parameter setting data to obtain a target analysis model code.
As another method for synchronizing analysis model configuration parameters by the server, optionally, for the selected analysis model, the client web interface provides a model parameter setting interface for the user, where the server obtains a code file of the target data analysis model according to the user model parameter setting information, and includes:
And the server returns the determined template codes corresponding to the analysis model to the client according to the model template code request, the client receives model parameter setting data input by a user through the model parameter setting interface, performs parameter setting on the analysis model codes to obtain target analysis model codes, and sends the target analysis model codes to the server.
Optionally, the model display area is further provided with a model code editing interface and a code editing area, the client responds to the call of the model code editing interface, and the client obtains the template code of the selected analysis model from the server and outputs the template code to the code editing area;
after the user code is edited, the client sends the edited target analysis model code to the server. The model code in the present invention may be selected to be the python language.
Advantageous effects
Compared with the prior art, the invention has the following advantages and advances:
(1) The method and the system can enable the user to conveniently and rapidly access the metadata in the database of the server side within the permission range, ensure the effectiveness of the data set, simultaneously enable the compiling operation of the model code to be carried out at the server side, have low requirements on the computing capacity of the client side, and can improve the overall efficiency of data analysis;
(2) According to the invention, through graphical model construction, a user can more easily construct a required data analysis model, and the difficulty of constructing the data analysis model at the user side is greatly reduced;
(3) The online compiling and running environment provided by the invention does not need complicated environment installation of a user, is convenient for accessing the target data set, and can achieve the effect of being used after unpacking;
(4) The invention can realize graphical display of the analysis result according to the form of the user demand, so that the user can intuitively see the analysis result, and the analysis efficiency and the user experience are improved.
Detailed Description
Further description is provided below in connection with the drawings and the specific embodiments.
The technical concept of the invention is that the safety and the effectiveness of data are considered, the safety access of a user to metadata in a database is realized through user authentication, and the data are positioned and a data set for data analysis is generated according to the selection of the user;
The modeling capability of the user is considered, the mathematical model for data analysis is conveniently built by the user through a graphical interface without processing related codes, the computing capability of the client is considered, the code compiling operation is executed by the server, and the overall data analysis efficiency is improved.
The web-side graphical power grid metadata online analysis system comprises a client side and a server side, wherein the process when the client side and the server side execute the online analysis of the power grid metadata mainly comprises the following steps:
the client receives user login information and transmits the user login information to the server;
the server determines a data range which is allowed to be accessed by the corresponding user according to the user login information and displays the data range to the user through a client web interface;
the client receives user access request data, and transmits the user access request data to the server, wherein the user access request data comprises access target data information selected by a user from a data range displayed by a web interface;
the server side obtains corresponding data information according to the user access request data, stores the data information in a user personal data space and displays the corresponding information through a client side web interface;
the client receives data selection information, model selection information and result display mode selection information input by a user, sends the data selection information to the server, and sends a corresponding model template code request to the server according to the model selection information;
the server determines a data set to be analyzed according to the data selection information, and determines a corresponding analysis model according to the model template code request;
the method comprises the steps that a client obtains user model parameter setting information, and a server obtains a code file of a target data analysis model according to the user model parameter setting information;
The server takes the data set to be analyzed as the input of the data analysis model, compiles and runs a code file corresponding to the data analysis model, and performs corresponding data analysis processing to obtain a data analysis processing result;
And the server or the client performs display mode processing on the data analysis processing result according to the result display mode selection information, and displays the graphical data analysis processing result to a user through a web interface.
Examples
As shown in fig. 1, the analysis system of the embodiment includes a client web side and a server side, wherein the web side is directly oriented to a user and is used for displaying and responding to the operation of the user, and the analysis system includes a personal space display and management module, a metadata application module, a model graphical construction and display module and a model code operation control module. The server provides a network interface for the web to call, and the main services include file service, data set generation service, authority authentication service, code compiling and running service and database management service, wherein the database management service comprises metadata database management and model template database management.
The personal space display and management module of the web terminal obtains data by calling file service of the server terminal, displays files in the personal space to a user, and simultaneously provides a file management function so that the user can manage the files in the personal space. The metadata application module is used for applying metadata by the user. The model graphical construction and display module realizes the function of graphically constructing an analysis model, the compiling operation service of the server side realizes the function of on-line compiling and operating of codes, the server side creates independent code compiling operation service for each user, and all operation services are managed by using the code operation management service, so that the simultaneous use and complementary influence of multiple people are realized. The code running control module provides the function of controlling the code running for the user.
Specifically, the present embodiment mainly relates to the following matters.
1. User authentication
When the power grid metadata acquisition and analysis are needed, a user logs in the system through a client interface, and the client receives user login information and transmits the user login information to the server.
In order to ensure the safe access of the user to the power grid metadata in the database, the authentication of the user is necessary, the embodiment designs the access level of the user and the field authority in the database, wherein corresponding user access levels are respectively configured by the server side corresponding to each registered user, different data access permission ranges are configured by different user access levels, different metadata tables and database fields can be accessed, the lowest-level user cannot acquire the metadata in the database, and the higher the other user levels are, the more the acquired metadata are. And the server determines the data range which is allowed to be accessed by the corresponding user according to the user login information, and displays the data range to the user through a client web interface.
When a user submits a data access application through a web interface, the user access request data comprises an authorized data table and a data field, if the unauthorized data is to be accessed, the user access request data also comprises unauthorized access request information, and the access request needs to be submitted for manual verification.
For different unauthorized access target data, the server side can preset users with unauthorized access approval authorities according to the data source or the data management party, and send corresponding unauthorized access verification requests to the corresponding users, and if the unauthorized access requests are approved, the server side subsequently allows the corresponding users to access the corresponding data targets.
Fig. 2 shows a flowchart of a metadata set applied by a user, the user logs in the system through authority authentication, and enters a metadata application process after clicking a button for applying metadata on a page, at this time, the system displays a data table which can be accessed by the user according to the user authority, the user selects the data table, only one data table can be selected each time the user applies, the selection is completed to click on the next step, the system displays data table fields which can be accessed by the user, the user performs the check of the data table fields, the user can check a plurality of table fields, and the user clicks to submit the application after the check. At this time, the user completes the application of metadata.
2. Target data acquisition
After a user selects target data through a web interface and submits an access request, the client transmits user access request data to the server, wherein the user access request data comprises access target data information selected by the user from a data range displayed by the web interface, and the access target data information comprises a metadata table and data fields.
Corresponding to each registered user, the server side configures corresponding user personal data space respectively, after receiving a user access request, the server side obtains corresponding data information according to the user access request data, stores the corresponding data information in the user personal data space, and displays the corresponding information through a client web interface.
Fig. 3 shows a flow of generating a target data set requested by a user by a system, firstly, a server obtains a data table and a field selected by the user according to the access request data of the user, then, query SQL is dynamically generated according to the selection of the user and an SQL template, metadata is obtained by using the SQL query database, and the system writes the queried metadata into a file and stores the file in a personal space of the user. The method comprises the following specific steps:
positioning a corresponding metadata table according to metadata table information to be accessed in the access target information;
determining query parameters according to the field information of the database to be accessed in the access target information;
Substituting the query parameters into a preset SQL query template to obtain an SQL statement for accessing corresponding data;
and carrying out data query by utilizing the SQL statement, writing the data obtained by query into a file, and storing the file into a user personal data space.
The data display area of the client web interface can display the data set files which can be selected in the personal data space of the user for the user to select, and can default to the data set files which are generated by the latest request of the analysis target.
To facilitate user access to the data set, the system encapsulates a method of data set reading for use by the user. The metadata set file applied by the user is stored in the personal space of the user and is used for an analysis model.
3. Graphical construction of data analysis model
The core of data analysis is an analysis model, the mathematical analysis model is usually built by a programming language, and the process needs to be familiar to analysts by the mathematical model and the programming language. When the graphical model construction mode is used for constructing the analysis models, a programming language is not needed to be directly used, and each analysis model is realized in a programming language in advance and is tested and verified to form a code template and is stored in a database. The user simply clicks the corresponding model button on the browser page to use the model, and the model can then be adjusted by parameters, and the system generates the python code for the model based on the user parameters. The graphical model construction method only needs the analyst to have basic knowledge of the analytical model used.
Specifically, in this embodiment, the server is provided with a model template database for storing model codes of a preset analysis model. The analysis model can comprise a regression analysis model, a classification model, a prediction model, an evaluation model and other models required by power grid data analysis, and a user can select corresponding models to construct a complete data analysis model through a web interface under different data analysis requirements.
In the system of the embodiment, the client web interface comprises a data display area, a model display area and a result display area, wherein the data display area is used for displaying selectable files in a user personal data space, the model display area is used for displaying various selectable analysis model names in a tree form, and the result display area is used for displaying data analysis processing results obtained after compiling and running of the data analysis model in a chart form according to a display mode selected by a user.
The implementation steps of the graphical model construction are as follows;
The user selects an analysis model to be used through the web interface model display area, the selection mode can be click or drag, the selected analysis model is added into a new construction model area in a graphic form, and the same data set clicked by the user from the user personal data space file display area can also be added into the new construction model area in a graphic form, so that the user can understand the construction process of the analysis model more intuitively;
the client web interface provides a model parameter setting interface for the user aiming at the selected analysis model, and receives model parameter setting data input by the user through the interface;
The server acquires template codes corresponding to the analysis models from the database according to the model selection information of the user, sets parameters in the analysis model template codes according to the model parameter setting data, obtains updated target analysis model codes, and generates final python code implementation.
In addition to the above model generation manner, according to the user model parameter setting information, the manner in which the server side obtains the code file of the target data analysis model may be:
after the client sends out a model template code request, the server returns the determined template code corresponding to the analysis model to the client according to the model template code request, the client receives model parameter setting data input by a user through the model parameter setting interface, performs parameter setting on the analysis model code, and obtains a target analysis model code, and the target analysis model code is sent to the server.
Aiming at the second target analysis model generation mode, taking the code editing capability and the demand of a user into consideration, the model display area of the embodiment can also be provided with a model code editing interface and a code editing area, and a client responds to the model code editing interface to be called, acquires the template code of the selected analysis model from a server and outputs the template code to the code editing area;
After the user code is edited, the client generates the data analysis model according to the analysis model code and the data selection information after the editing is completed. The model code in the present invention may be selected to be the python language as previously described.
In order to realize the expansion of the analysis function of the system, in the embodiment, the server side can also be provided with a model management module, a model management interface is arranged on a corresponding client user interface of a user preset with model management authority, the client side responds to the model management interface to be called, model management data is acquired and transmitted to the server side, and the server side model management module carries out new addition, deletion or modification treatment on the analysis model in the model database according to the model management data. Therefore, the invention supports the management of the analysis model which can be provided by the user through the client according to the analysis requirement of the user, and can configure the authority of model management that the common user only has the new authority of the model, and marks the creation user information of the new model in the analysis model database.
4. Code compiling operation and result display
The system of the embodiment realizes the compiling and running python environment at the server, and after the target data set and the target analysis model code are determined, the server takes the data set to be analyzed as the input of the data analysis model, compiles and runs the code file corresponding to the data analysis model, and carries out corresponding data analysis processing to obtain the data analysis processing result.
After the data analysis processing result is obtained, the server side can process the data analysis processing result in a display mode according to the user result display mode selection information to obtain graphical analysis result data, the graphical analysis result data is transmitted to the client side to be displayed through the web interface, or the server side can also directly transmit the data analysis processing result to the client side, the client side generates a corresponding graphical analysis result according to the result display selected by the user, and the graphical analysis result data is displayed to the user through the web interface.
When the result display mode is selected, the client interface can provide a line diagram, a bar diagram, a pie chart and other chart forms for the user to select, and even if the processing of the result display mode is realized by the client, the processing efficiency of the operation of the client is not obviously affected.
In summary, the method and the device can ensure the access safety of the metadata database, reduce the construction difficulty of the data analysis model at the user side and improve the efficiency of the data analysis processing of the client.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are all within the protection of the present invention.