A kind of configuration of network data form and generation method
Technical field
The present invention relates to field of computer technology, configuration and the generation method of a kind of network data form are specifically provided.
Background technology
Computer has information memory capacity big, and user obtains the advantages of information is convenient and swift, is widely applied.It is special
It is not that in recent years, as economic develops rapidly, computer application field constantly expands, in network performance data monitoring scene
In be used widely.It is more intuitively right, it is necessary to customize the form of a large amount of diversified forms in network performance data monitoring scene
Data are analyzed, so that attendant simply and easily grasps the real-time condition of network performance data.In practical work process,
The form of different patterns is may require that, and the form of different patterns is arranged on the different pages, adds development amount.This
Outside, some forms need to perform by the cycle, such as daily sheet, weekly return, and the generation result of each form needs to preserve, so as to not
Data of the same period are contrasted.But, in the prior art, different data sheets and the data sheet of different patterns are often
It is stored on the different pages, user checks during different data sheet historical results, it is necessary to which multiple pages of leafing through, increase work
Amount, reduces operating efficiency.
The content of the invention
The technical assignment of the present invention is can effectively to reduce development there is provided one kind for above-mentioned problem
Amount, user can inquire about form historical results at any time, and the network data form for simplifying data sheet maintenance cost is matched somebody with somebody
Put and generation method.
To achieve the above object, the invention provides following technical scheme:
A kind of configuration of network data form and generation method, the page of the network data form is using simulation Excel
The streaming layout of file, supports to configure the form of a variety of patterns on multiple Sheet pages of addition, the same page, each form possesses solely
Vertical configuration and data;Report style is defined using XML configuration constraints condition, constraints is stored in database;Use
Task scheduling configures a variety of form timing generation tasks, and each implementing result of form is stored in locally;The page is listed appoints every time
The form result of business generation, when checking history report, using each form result of Asynchronous Request, reads the form number generated
According to being encapsulated as grid column model and data volume, adopting form component is showed.
The configuration of the network data form and generation method, for the analysis of Telecommunication network equipment data sheet.
Each Sheet pages of mode using What You See Is What You Get in this method.
Every kind of form defines report style using XML configuration constraints condition, and constraints can be changed as needed,
In the case of the page need not being changed so that table style is automatically updated on the page, it is possible to the new table of flexible expansion as needed
Lattice pattern, reduces development amount.
In the present invention, task scheduling is realized using Quartz frameworks.
In the present invention, user can inquire about form historical results at any time, can be carried with multiple old version correction datas
The high maintenance efficiency of data sheet.
Preferably, the configuration of the network data form and generation method are mainly included the following steps that:
S1:Page layout
Page division, using the streaming layout of simulation Excel file, is from high to low Sheet according to scope by page layout
Page, ranks and element, the page have multiple Sheet pages, and each Sheet pages is divided into some row and columns, and often row has multiple elements,
I.e. one form;
S2:Report style is configured
The a variety of table styles of system intialization, definition tables pattern is carried out using XML configuration constraint conditions, report data it is basic
Key element includes network element, index and time;
S3:Form element arrangements
During form configuration page initialization, defined good all table styles are read, in page presentation sample figure, selection
After a kind of form, network element, index and time data are configured, and the content of configuration is packaged into the serial data of JSON forms, is preserved
In variable;
S4:Report data is performed
When meeting task execution condition, report form template object is inquired according to report form template ID, according to form execution journal
ID and report form template ID create the storage catalogue of the report data file;
S5:Report data is presented
Based on step S4 data file, the recognizable data format of form is encapsulated as, when checking a history report,
System jumps to form result and interface, data file content and report where incoming form execution journal ID, report data is presented
Table template ID.
In step S1, every form is all independent, independent of other forms.
Preferably, in step S1, each Sheet pages often capable form quantity is unrestricted, often increases by one in a line
Form element, is arranged in order automatically from left to right, can be added as needed on new row.
Preferably, in step S2, XML configuration constraints condition includes title, type, NE quantity constraint, index
Number constraint, the element of table row storage, the element of grid column storage, the row that can be sorted, filter condition, sample figure path.
XML definition sample is as follows:
Preferably, in step S3, after the completion of configuration network element, index and time data, calling window Portlet to carry in advance
The JS methods of confession, the content of configuration are packaged into the serial data of JSON forms.
Preferably, in step S3, while the method for refreshing of adopting form component, the incoming JSON numbers for including configuration content
According to string, the content update that form is shown is result preview graph.
According to the business scenario of form, such as daily sheet, weekly return, moon sheet, the cycle of operation of configuration form is daily, often
Week, monthly, and configurable task execution when fiducial time.
Preferably, in step S4, after the storage catalogue for creating report data file, parsing each form element, encapsulation
For data query conditions object, data query service can be by the content transformation in querying condition object into XML character strings, and calls
Query engine is converted to some query SQLs and performed, and writes data file.
The inquiry of report data, in the form of services in running background, task tune is carried out using Quartz components with encapsulation
Degree.The data format that file is often gone is as follows:NE ID | the date | the time | NE type | desired value 1 | desired value 2 | ..., deposit in
Under assigned catalogue.
In step S5, the presentation of form is carried out in the following order:
1) synchronization request is sent, report form template information, including Sheet pages of number position and title, each form is obtained
Each Sheet pages is drawn out on the detailed configuration of element, the page.
2) layout information in first Sheet pages, draws each DIV, and initialize form component.
3) each form component initiates asynchronous data load request, obtains grid column model, i.e., the corresponding table when form is shown
The presentation information of head.Define JSON forms it is as follows, comprising column name, column data type, Lie Jingdu, column width, whether can sort,
Compound gauge outfit, row keyword:
4) each form component initiates asynchronous data load request, obtains list data body.Incoming form execution journal ID, root
The storage catalogue of the report data file is determined according to form execution journal ID, while determining Data Filename according to form element ID
Claim, both determine the data file location of a form jointly, then read file data, generate TableData objects;Adjust again
Serviced with data formatization, incoming TableData objects are converted to FormatedTableData objects.Data definition JSON lattice
Formula is as follows:
Finally JSON data return form component is presented.
Compared with prior art, the configuration of network data form of the invention and generation method have following prominent beneficial
Effect:The configuration of the network data form and generation method simulate the streaming layout of Excel file on the page, support addition
Multiple Sheet pages, a variety of report styles are configured on the same page, report style is defined using XML configuration constraints condition, can be with
Constraints is changed as needed, in the case where that need not change the page so that table style is automatically updated on the page, it is possible to
The new table style of flexible expansion as needed, reduces development amount;And user can inquire about form history at any time
As a result, the maintenance efficiency of data sheet can be improved with multiple old version correction datas.
Brief description of the drawings
Fig. 1 be network data form of the present invention configuration and generation method in intermodule Organization Chart.
Embodiment
Below in conjunction with drawings and examples, configuration and generation method to the network data form of the present invention make further
Describe in detail.
Embodiment
The configuration of the network data form of the present invention and generation method, the page of network data form is using simulation Excel
The streaming layout of file, supports to configure the form of a variety of patterns on multiple Sheet pages of addition, the same page, each form possesses solely
Vertical configuration and data;Report style is defined using XML configuration constraints condition, constraints is stored in database;Use
Task scheduling configures a variety of form timing generation tasks, and each implementing result of form is stored in locally;The page is listed appoints every time
The form result of business generation, when checking history report, using each form result of Asynchronous Request, reads the form number generated
According to being encapsulated as grid column model and data volume, adopting form component is showed, and specifically includes following steps:
S1:Page layout
Page division, using the streaming layout of simulation Excel file, is from high to low Sheet according to scope by page layout
Page, ranks and element, the page can have multiple Sheet pages, and each Sheet pages is divided into some row and columns, and often row has multiple members
The form of element, i.e., one, every form possesses independent pattern and data configuration, independent of other forms.It is each Sheet pages
Often capable form quantity is unrestricted, and user, which need not pay close attention to, often increases by one in the absolute position of each basic element, a line
Form element, is arranged in order automatically from left to right, can be added as needed on new row.
S2:Report style is configured
The fundamental of report data includes network element, index and time.The a variety of table styles of system intialization, are matched somebody with somebody using XML
Put constraints and carry out definition tables pattern.Configuration constraint includes title, type, NE quantity constraint, index quantity about
Beam, the element of table row storage, element, the row that can be sorted, filter condition, the sample figure path of grid column storage etc., XML definition
Sample is as follows:
S3:Form element arrangements
During form configuration page initialization, defined good all table styles are read, in page presentation sample figure, selection
After a kind of form, configuration network element, index and time data, after the completion of configuration, the JS side for calling window Portlet to be provided previously by
Method, the content of configuration is packaged into the serial data of JSON forms, is stored in variable, while the refreshing side of adopting form component
Method, the incoming JSON serial datas for including configuration content, the content update that form is shown is result preview graph.
According to the business scenario of form, the execution cycle of form is configured, such as daily sheet, weekly return, moon sheet configure form
The cycle of operation for daily, weekly, monthly, and fiducial time during configurable task execution.
S4:Report data is performed
The inquiry of report data, in the form of services in running background, task tune is carried out using Quartz components with encapsulation
Degree.When meeting task execution condition, report form template object is inquired according to report form template ID, according to form execution journal ID and
Report form template ID creates the storage catalogue of the report data file.Each form element therein is parsed, data query is encapsulated as
Conditional object, data query service can be by the content transformation in querying condition object into XML character strings, and calls query engine to turn
It is changed to some query SQLs and performs, writes data file.The data format that file is often gone is as follows:NE ID | the date | the time |
NE type | desired value 1 | desired value 2 | ..., deposit under assigned catalogue.
S5:Report data is presented
Based on step S4 data file, the recognizable data format of form is encapsulated as.When checking a history report,
System jumps to form result and interface, data file content and report where incoming form execution journal ID, report data is presented
Table template ID, carries out the displaying of form in the following order:
1) synchronization request is sent, report form template information, including Sheet pages of number position and title, each form is obtained
Each Sheet pages is drawn out on the detailed configuration of element, the page.
2) layout information in first Sheet pages, draws each DIV, and initialize form component.
3) each form component initiates asynchronous data load request, obtains grid column model, i.e., the corresponding table when form is shown
The presentation information of head.Define JSON data string formats it is as follows, comprising column name, column data type, Lie Jingdu, column width, whether
It can sort, be combined gauge outfit, row keyword:
4) each form component initiates asynchronous data load request, obtains list data body.Incoming form execution journal ID, root
The storage catalogue of the report data file is determined according to form execution journal ID, while determining Data Filename according to form element ID
Claim, both determine the data file location of a form jointly, then read file data, generate TableData objects;Adjust again
Serviced with data formatization, incoming TableData objects are converted to FormatedTableData objects.Data definition JSON numbers
It is as follows according to string format:
Finally JSON data return form component is presented.
In the present invention, report data configuration and generation are built based on J2EE frameworks, show logical layer as shown in figure 1, being divided into
With apply logical layer.Show logical layer comprising the configuration of Web page form and report data to show, table is rendered based on Html5 components
Lattice.Backstage form configuration service, data query service and report generation service are included using logical layer.Form timed task is independent
In running background, task scheduling, timing generation form result are carried out using Quartz frameworks.
The present invention the configuration of network data form and the detailed process of generation method be:
(1) system is disposed using the service containers of JBoss AS 7, and database is built using Oracle 11g.
(2) new report form template is created, acquiescence has one Sheet pages, increases multiple Sheet pages, deposits different business
Monitoring form.Configured in report style table after 6 kinds of table styles, when creating form element, 6 kinds of table styles are listed automatically
It is available, configure the network element of form element, index and after the time, sample figure is presented on the page.
(3) timed task is created, task execution time and the cycle of each report form template is specified.
(4) in report form template list, the historical data version generated of each template is checked, in new page wash with watercolours after click
Form is contaminated, many Sheet pages, the form result of multilist are showed on the same page.
Embodiment described above, is the present invention more preferably embodiment, those skilled in the art is at this
The usual variations and alternatives carried out in the range of inventive technique scheme all should be comprising within the scope of the present invention.