Summary of the invention
The object of the present invention is to provide a kind of parsing of BPA electric network data and management method and system based on EXCEL, the method and system are conducive to improve the efficiency of data management in electrical network analysis process.
For achieving the above object, technical scheme of the present invention is: a kind of BPA electric network data based on EXCEL is resolved and management method, comprises the following steps:
S1, based on EXCEL character string bit manipulation function fast resolving format BPA electric network data;
S2, the Automatic Function generation method of employing based on secondary row column information, realize the automatic filling of data card and automatically calculate;
S3, carry out the Classification Management of BPA electric network data based on method for fast searching;
S4, BPA data card generation technique based on Formatting Output, be converted into BPA data layout automatically by the data after resolving, and output format BPA data.
Further, in step S1, adopt the MIDB function of application EXCEL to extract the data of character string given position, and in conjunction with the conditional function such as IF, AND, SUBSTITUTE character replacement function and LEN string length discriminant function judge whether respective field has and fill in radix point and carry out the parsing of data, realize the structuring of BPA data card is resolved.
Further, in step S2, EXCEL supports the relative position pattern of formula, based on this feature, adopt table name definitely to apply and carry out charging formula with the mode of the corresponding use of ranks for the position of data, be combined in the extension position and the accuracy requirement that in secondary row, mark corresponding field simultaneously, realize the Data Analysis of realizing a kind of card with a formula, and utilize the principle of the relative position automatic filling in the automatic filling process of EXCEL, the parsing that has realized a kind of data card only needs line code, the function of remaining element lattice is automatically produced and calculates by automatic filling and secondary row column information.
Further, in step S3, data card classification based on supplementary column realizes the large electric network data automatic classification based on EXCEL and gathers, first according to data card type analysis result, all data cards are numbered to processing, generate a group index according to each data card type, finally apply INDIRECT, ADDRESS, tri-functions of VLOOKUP retrieve corresponding grouped data card and extract from overall file according to order; Adopt quick binary search method, realize fast large-scale data automatic classification and gather.
Further, in step S4, the Formatting Output method of data after the parsing specifying according to data layout, has realized the rear data of parsing and has automatically been converted into data card and gathers output, the BPA file that generation can directly be calculated.
The present invention also provides a kind of BPA electric network data based on EXCEL to resolve administrating system, at least comprises:
Data input cell, for importing and the classification of BPA electric network data;
Data Analysis unit, resolves corresponding data card for classifying;
Formatting Output unit, for carrying out Formatting Output to the electric network data after adjusting.
Further, said system also comprises: Data Management Unit, and for electric network data is carried out to retrieval and inquisition and batch modification.
A kind of parsing of BPA electric network data and management method and system based on EXCEL that provide is provided, the method and system realize the fast resolving processing of large scale electric network data based on EXCEL function, rapid adjustment is resolved content and batch data adjustment according to demand, and derivation can be directly used in the BPA formatted data of calculating, realize the high efficient and flexible of BPA electric network data and resolved and process, effectively raised the efficiency of data management in electrical network analysis process.
Embodiment
Below in conjunction with drawings and the specific embodiments, the present invention is described in further detail.
The BPA electric network data that the present invention is based on EXCEL is resolved and management method, as shown in Figure 1, comprises the following steps:
S1, based on EXCEL character string bit manipulation function fast resolving format BPA electric network data.
Because the BPA data layout of electrical network is division using the numbered positions of data rows as data card field location (uses number from data card to be listed as how many row and define a field), use the floating number data layout of fortran (in the character string for a given length, to specify the form of F*.* as floating number as data layout simultaneously, first * represents data length, second * represents precision, in data, do not add radix point if filled in, forced to think need to be by the data of being filled in divided by 10 precision power to obtain last data), in addition because Chinese takies 2 eight bit character width, and because different names is accustomed to Chinese length and number of words be can not determine.The parsing that solves data card by the technology of tradition programming has two difficult points, one, because the string processing function of main flow programming language (as C series) is more loaded down with trivial details in processing Chinese character string step-by-step parsing, amendment trouble (need to consider the processing of Chinese word length); Two, due to power system technology progress, the new model of new forms of energy and direct current continues to bring out, and the development data card of BPA software is in continuous upgrading, occurs that new data card just need to again write and compile program, easily makes mistakes, and actual effect is also poor.The MIDB function that for this reason the present invention proposes a kind of EXCEL of application (is realized the extraction of character string given position data, press eight bit character length), and in conjunction with IF, the conditional functions such as AND, SUBSTITUTE character replacement function (being used for replacing radix point) and LEN(string length discriminant function) judge whether respective field has and fill in radix point and carry out the parsing of data, realize the structuring of BPA data card is resolved to (the parameter that related function adopts, can apply the parameter relatively and when absolute reference is related to that automatic filling does not need to consider to programme of EXCEL for data, only need to formulate position length and the precision information of character string, therefore resolve different field or more only need the descriptive information of adjusting respective field just can reuse all codes when change card).
S2, the Automatic Function generation method of employing based on secondary row column information, realize the automatic filling of data card and automatically calculate.
EXCEL supports the relative position pattern of formula, based on this feature, adopt table name definitely to apply and carry out charging formula with the mode of the corresponding use of ranks for the position of data, be combined in the extension position and the accuracy requirement that in secondary row, mark corresponding field simultaneously, realize the Data Analysis of realizing a kind of card with a formula, and utilize the principle of the relative position automatic filling in the automatic filling process of EXCEL, the parsing that has realized a kind of data card only needs line code, the function of remaining element lattice is automatically produced and calculates by automatic filling and secondary row column information, improve greatly the efficiency of programming efficiency and test and debugging.
S3, carry out the Classification Management of BPA electric network data based on method for fast searching.
Because electric network data scale data card line number may reach 100,000 row ranks, dissimilar data card is staggered filling in often, in the time resolving, need to classify to data card.For traditional programming technique, what conventionally adopt is all data card of traversal, and then dynamic statistics and grouped data Card Type carry out Data Analysis.This method deal with data most effective, but need again again related content to be write and compiled when newly-increased data card, can not adapt to the flexible processing of data, the efficiency of program response changes in demand is low.And if the employing automatic screening of EXCEL or the function of sequence are classified, need a large amount of manual operations, execution efficiency is very low, also easily introduces mistake.The present invention proposes a kind of classification of the data card based on supplementary column and realizes the large electric network data automatic classification based on EXCEL and gather, first according to data card type analysis result, all data cards are numbered to processing, generate a group index (for the numbering round numbers that meets corresponding data card according to each data card type, for incongruent intermediate value of getting upper and lower two load data cards numbering, one side of index is the numbering of such data card of correspondence, one side is this card line number at place hereof), finally apply INDIRECT(and utilize address search data), ADDRESS(utilizes table name, OK, row calculated address), VLOOKUP(searches for qualified record range position) three functions retrieve corresponding grouped data card and extract from overall file according to order.Because EXCEL retrieval functions is built-in, cannot carry out embedded amendment, searching of each corresponding record all needs all data to retrieve, for large-scale data, accurate recall precision is very low, therefore the present invention has adopted corresponding quick binary search method, and in data number process, introduce a little data deviation to have avoided the problem of the retrieve position deviation in EXCEL fuzzy search process, finally realize fast large-scale data automatic classification and gathered.The method of this patent has effectively been utilized the principle of changing the time with space, pass through cumulative index, with sequential index technology and two points of quick-searchings, effectively realize the quick-searching of mass data, utilize again the reliability of built-in function and the feature of the improved dirigibility of program simultaneously.
S4, BPA data card generation technique based on Formatting Output, be converted into BPA data layout automatically by the data after resolving, and output format BPA data.
The Formatting Output method of data after the parsing specifying according to data layout, has realized the rear data of parsing and has automatically been converted into data card and gathers output, the BPA file that generation can directly be calculated.
The present invention also provides a kind of BPA electric network data based on EXCEL to resolve administrating system, as shown in Figure 2, comprising:
Data input cell 1, for importing and the classification of BPA electric network data.
Data Analysis unit 2, resolves corresponding data card for classifying.
Formatting Output unit 3, for carrying out Formatting Output to the electric network data after adjusting.Be formatted as BPA data card and concentrate output, the file that generation can directly be calculated by the electric network data after amendment is adjusted; The mode that adopts string formatization output is by revising data after adjustment through practical personnel and be converted into BPA data card form and gather and be output as the BPA file that can directly calculate after resolving.
Data Management Unit 4, for carrying out retrieval and inquisition and batch modification to electric network data.For data card is classified, field is item by item resolved, and realize retrieval and inquisition and the batch modification of electric network data, the bookkeepings such as screening, system is resolved related data card according to the data card type classification of BPA, the analysis program of each data card is by the function that realization is set only writes a cell of supplementary, and other cells are realized by the mode of automatic filling, can realize the parallel high-speed processing of Data Analysis based on EXCEL platform.
Be more than preferred embodiment of the present invention, all changes of doing according to technical solution of the present invention, when the function producing does not exceed the scope of technical solution of the present invention, all belong to protection scope of the present invention.