Summary of the invention
Goal of the invention of the present invention has been to provide a kind of storage, extracting method and system of Excel tables of data.In order to improve developer's development efficiency.
According to an aspect of the present invention, provide a kind of storage means of Excel tables of data, described method comprises:
For Excel tables of data to be stored, the content in the data field of this Excel tables of data is stored in the data field tables of data being associated with the table name of this Excel tables of data in database; And
If determine, this Excel tables of data has horizontal gauge outfit, the content of each cell in described horizontal gauge outfit is added in the each respective nodes in the horizontal gauge outfit tree structure that mixes gauge outfit tree structure template; And the data of the each node in described horizontal gauge outfit tree structure are stored in the horizontal gauge outfit tables of data being associated with the table name of this Excel tables of data;
If determine, this Excel tables of data has vertical gauge outfit, the content of each cell in described vertical gauge outfit is added in the each respective nodes in the vertical gauge outfit tree structure of described mixing gauge outfit tree structure template; And the data of the each node in described vertical gauge outfit tree structure are stored in the vertical gauge outfit tables of data being associated with the table name of this Excel tables of data.
Further, the described content by each cell in described horizontal gauge outfit is added in the each respective nodes in the horizontal gauge outfit tree structure that mixes gauge outfit tree structure template; And the data of the each node in described horizontal gauge outfit tree structure are stored into the horizontal gauge outfit tables of data being associated with the table name of this Excel tables of data, specifically comprise:
By capable i in described horizontal gauge outfit by a left side content from right j cell, be i as described horizontal gauge outfit tree structure middle rank alias, sequence number is the content of the node of j, and records the mark of the corresponding node of higher level's cell that is designated this cell of the father node of this node; Wherein, the natural number that i is 1~m; M is total line number of cell in described horizontal gauge outfit; J is the natural number of 1~n; N is the sum of the capable cell of i in described horizontal gauge outfit; And
By the data of the each node in described horizontal gauge outfit tree structure, store into respectively in each row of described horizontal gauge outfit tables of data;
Wherein, the each node in described horizontal gauge outfit tree structure, the data of this node comprise: the level alias of the mark of the mark of this node, the father node of this node, the content of this node, this node, the sequence number of this node in the brother of node.
Further, the described content by each cell in described vertical gauge outfit is added in the each respective nodes in the vertical gauge outfit tree structure of described mixing gauge outfit tree structure template; And the data of the each node in described vertical gauge outfit tree structure are stored in the vertical gauge outfit tables of data being associated with the table name of this Excel tables of data, specifically comprise:
X in described vertical gauge outfit is listed as by the upper content from lower y cell, be x as described vertical gauge outfit tree structure middle rank alias, sequence number is the content of the node of y, and records the mark of the corresponding node of higher level's cell that is designated this cell of the father node of this node; Wherein, the natural number that x is 1~a; A is total columns of cell in described vertical gauge outfit; Y is the natural number of 1~b; B is the sum of x column unit lattice in described vertical gauge outfit; And
By the data of the each node in described vertical gauge outfit tree structure, store into respectively in each row of described vertical gauge outfit tables of data;
Wherein, each node in described vertical gauge outfit tree structure, the data of this node comprise: the level alias of the mark of the mark of this node, the father node of this node, the content of this node, this node, the sequence number of this node in the brother of node.
Further, after the described data field tables of data being associated with the table name of this Excel tables of data in storing the content in the data field of this Excel tables of data into database, also comprise:
Receive after the table name of Excel tables of data of user's input, the data field tables of data being associated with the table name of this Excel tables of data from database extracts the data field of this Excel tables of data;
If find the horizontal gauge outfit tables of data being associated with the table name of this Excel tables of data from described database, determine after the content of each cell in the horizontal gauge outfit of this Excel tables of data according to the data of each node in the horizontal gauge outfit tree structure recording in described horizontal gauge outfit tables of data, mix gauge outfit tree structure template, each cell in the horizontal gauge outfit of determining is spliced mutually with the data field extracting;
If find the vertical gauge outfit tables of data being associated with the table name of this Excel tables of data from described database, determine after the content of each cell in the vertical gauge outfit of this Excel tables of data according to the data of each node in the vertical gauge outfit tree structure of mixing gauge outfit tree structure template that record in described vertical gauge outfit tables of data, described, each cell in the vertical gauge outfit of determining is spliced mutually with described data field.
According to another aspect of the present invention, also provide a kind of extracting method of Excel tables of data, described method comprises:
Receive after the table name of Excel tables of data of user's input, the data field tables of data being associated with the table name of this Excel tables of data from database extracts the data field of this Excel tables of data;
If find the horizontal gauge outfit tables of data being associated with the table name of this Excel tables of data from described database, determine after the content of each cell in the horizontal gauge outfit of this Excel tables of data according to the data of each node in the horizontal gauge outfit tree structure recording in described horizontal gauge outfit tables of data, mix gauge outfit tree structure template, each cell in the horizontal gauge outfit of determining is spliced mutually with the data field extracting;
If find the vertical gauge outfit tables of data being associated with the table name of this Excel tables of data from described database, determine after the content of each cell in the vertical gauge outfit of this Excel tables of data according to the data of each node in the vertical gauge outfit tree structure of mixing gauge outfit tree structure template that record in described vertical gauge outfit tables of data, described, each cell in the vertical gauge outfit of determining is spliced mutually with described data field.
Further, the described data according to each node in the horizontal gauge outfit tree structure recording in described horizontal gauge outfit tables of data, mix gauge outfit tree structure template are determined the content of each cell in the horizontal gauge outfit of this Excel tables of data, specifically comprise:
Be that c, sequence number are the content of the node of d according to the level alias recording in described horizontal gauge outfit tables of data, determine that c in the horizontal gauge outfit of this Excel tables of data is capable, content by a left side in right d cell, and according to the content of the father node of this node, determine the content of higher level's cell of the cell that this node is corresponding;
Wherein, the natural number that c is 2~e; E is the maximum level alias of node in the horizontal gauge outfit tree structure recording in described horizontal gauge outfit tables of data, mix gauge outfit tree structure template; D is the natural number of 1~f; F is the maximum sequence number of the horizontal gauge outfit tree structure middle rank alias that records in described horizontal gauge outfit tables of data, the mix gauge outfit tree structure template node that is c; And
The described data according to each node in the vertical gauge outfit tree structure recording in described vertical gauge outfit tables of data, mix gauge outfit tree structure template are determined the content of each cell in the vertical gauge outfit of this Excel tables of data, specifically comprise:
Be g according to the level alias recording in described vertical gauge outfit tables of data, sequence number is the content of the node of h, determine g row in the vertical gauge outfit of this Excel tables of data, by upper content in lower h cell, and according to the content of the father node of this node, determine the content of higher level's cell of the cell that this node is corresponding;
Wherein, the natural number that g is 1~p; P is the maximum level alias of node in the vertical gauge outfit tree structure recording in described vertical gauge outfit tables of data, mix gauge outfit tree structure template; H is the natural number of 1~q; Q is the maximum sequence number of the vertical gauge outfit tree structure middle rank alias that records in described vertical gauge outfit tables of data, the mix gauge outfit tree structure template node that is g.
According to another aspect of the present invention, also provide a kind of storage system of Excel tables of data, described system comprises:
Data area stores module, for storing the content of the data field of the Excel tables of data of reception in the data field tables of data being associated with the table name of this Excel tables of data in database;
Gauge outfit memory module, if for determining that described Excel tables of data has horizontal gauge outfit, add the content of each cell in described horizontal gauge outfit in the each respective nodes in the horizontal gauge outfit tree structure that mixes gauge outfit tree structure template; And the data of the each node in described horizontal gauge outfit tree structure are stored in the horizontal gauge outfit tables of data being associated with the table name of this Excel tables of data; If determine, this Excel tables of data has vertical gauge outfit, the content of each cell in described vertical gauge outfit is added in the each respective nodes in the vertical gauge outfit tree structure of described mixing gauge outfit tree structure template; And the data of the each node in described vertical gauge outfit tree structure are stored in the vertical gauge outfit tables of data being associated with the table name of this Excel tables of data.
Preferably, described system also comprises:
Title memory module, for being recorded to the title of described Excel tables of data the title data table of described database corresponding to the table name of this Excel tables of data;
Memory module is described, for being recorded to data of description table before the table of described database by describing before the table of described Excel tables of data corresponding to the table name of this Excel tables of data before table;
Table tail is described memory module, for the table tail of described Excel tables of data being described to the table tail data of description table that is recorded to described database corresponding to the table name of this Excel tables of data.
According to another aspect of the present invention, also provide a kind of extraction system of Excel tables of data, described system comprises:
Data field extraction module, for according to the table name of the Excel tables of data of user input, the data field tables of data being associated with the table name of this Excel tables of data from database extracts the data field of this Excel tables of data;
Gauge outfit extraction module, be used for according to the table name of described Excel tables of data, if find the horizontal gauge outfit tables of data being associated with the table name of this Excel tables of data from database, determine the content of each cell in the horizontal gauge outfit of this Excel tables of data according to the data of each node in the horizontal gauge outfit tree structure recording in described horizontal gauge outfit tables of data, mix gauge outfit tree structure template; If find the vertical gauge outfit tables of data being associated with the table name of this Excel tables of data from described database, determine the content of each cell in the vertical gauge outfit of this Excel tables of data according to the data of each node in the vertical gauge outfit tree structure recording in described vertical gauge outfit tables of data, mix gauge outfit tree structure template;
Concatenation module, for splicing mutually in the gauge outfit cell that described gauge outfit extraction module is determined and the data field that described data field extraction module extracts.
Preferably, described system also comprises:
Title extraction module, for according to the table name of the Excel tables of data of user input, the title data table from database extracts the title corresponding to this Excel tables of data of the table name record of this Excel tables of data;
Before table, describe extraction module, for according to the table name of the Excel tables of data of user input, before the table from database, data of description table is described before extracting the table corresponding to this Excel tables of data of the table name record of this Excel tables of data;
Table tail is described extraction module, and for according to the table name of the Excel tables of data of user input, the table tail data of description table from database extracts corresponding to the table tail of this Excel tables of data of the table name record of this Excel tables of data and describes.
In the technical scheme of the embodiment of the present invention, for Excel tables of data to be stored, content in the data field of this Excel tables of data is stored in the data field tables of data being associated with the table name of this Excel tables of data in database, and the content of each cell in the horizontal stroke of this Excel tables of data (indulging) gauge outfit is added in the each respective nodes in horizontal stroke (indulging) the gauge outfit tree structure that mixes gauge outfit tree structure template, and the data of the each node in horizontal (indulging) gauge outfit tree structure are stored in horizontal stroke (indulging) the gauge outfit tables of data being associated with the table name of this Excel tables of data.Afterwards, in the time need to extracting the tables of data of storage, according to the table name of the Excel tables of data of the required extraction of user's input, the data field tables of data being associated with the table name of this Excel tables of data from database extracts the data field of this Excel tables of data, and determine in gauge outfit after each cell according to the gauge outfit tables of data being associated with the table name of this Excel tables of data from database, gauge outfit cell, data field are stitched together.Like this, all can use the method to carry out gauge outfit identification for the gauge outfit of various forms of Excel tables of data, and then all can adopt Same Way (program) to identify and store to the various gauge outfits of Excel tables of data, without being every corresponding gauge outfit recognizer of Excel Data Sheet Design, improve developer's development efficiency.
Embodiment
For making object of the present invention, technical scheme and advantage clearer, referring to accompanying drawing and enumerate preferred embodiment, the present invention is described in more detail.But, it should be noted that, many details of listing in instructions are only used to make reader to have a thorough understanding to one or more aspects of the present invention, even if do not have these specific details also can realize these aspects of the present invention.
The terms such as " module " used in this application, " system " are intended to comprise the entity relevant to computing machine, such as but not limited to hardware, firmware, combination thereof, software or executory software.For example, module can be, but be not limited in: thread, program and/or the computing machine of the process moved on processor, processor, object, executable program, execution.For instance, the application program of moving on computing equipment and this computing equipment can be modules.One or more modules can be positioned at an executory process and/or thread, and module also can and/or be distributed on a computing machine between two or more computing machines.
In technical scheme of the present invention, the data field of the gauge outfit of Excel tables of data and Excel tables of data is stored respectively, in the time extracting, gauge outfit and the data field of storage are respectively spliced, thereby recover Excel tables of data;
And, inventor also finds that the gauge outfit of Excel tables of data can be summarized as three types conventionally: horizontal gauge outfit (gauge outfit is in the upper end of tables of data), vertical gauge outfit (gauge outfit is at the left end of tables of data), and mix gauge outfit (the gauge outfit while is at upper end and the left end of tables of data); And mix horizontal stroke (indulging) the gauge outfit part of gauge outfit default after, just can be indulged (horizontal stroke) gauge outfit.Therefore, consider and set up mixing gauge outfit tree structure template to be applicable to various types of gauge outfits.For Excel tables of data to be stored, the content of each cell in horizontal (indulging) gauge outfit is added in the each respective nodes in horizontal stroke (indulging) the gauge outfit tree structure that mixes gauge outfit tree structure template, and the data of the each node in horizontal (indulging) gauge outfit tree structure are stored in horizontal stroke (indulging) the gauge outfit tables of data being associated with the table name of this Excel tables of data.Simultaneously, the title of this Excel tables of data is recorded in the title data table of database corresponding to the table name of this Excel tables of data, and the content in the data field of this Excel tables of data is stored in the data field tables of data being associated with the table name of this Excel tables of data in database.
Afterwards, in the time need to extracting the tables of data of storage, according to the table name of the Excel tables of data of the required extraction of user's input, the data field tables of data being associated with the table name of this Excel tables of data from database extracts the data field of this Excel tables of data, and determine in gauge outfit after each cell according to the gauge outfit tables of data being associated with the table name of this Excel tables of data from database, gauge outfit cell, data field are stitched together.Like this, all can use the method to carry out gauge outfit identification for the gauge outfit of various forms of Excel tables of data, and then all can adopt Same Way (program) to identify and store to the various gauge outfits of Excel tables of data, without being every corresponding gauge outfit recognizer of Excel Data Sheet Design, improve developer's development efficiency.
Describe in detail below below in conjunction with accompanying drawing and describe technical scheme of the present invention in detail.
The flow process of the storage means of the Excel tables of data that the embodiment of the present invention provides, as shown in Figure 1, comprises the steps:
S101: for Excel tables of data to be stored, the content in the data field of this Excel tables of data is stored in the data field tables of data being associated with the table name of these Excel data in database.
In this step, for Excel tables of data to be stored, according to line number and the columns of data field cell in this Excel tables of data, the data field tables of data being associated with the table name of this Excel tables of data at database initialize.Afterwards, for this each cell in Excel tables of data data field, the content in this cell is converted to after JSON character string, added in cell corresponding in the data field tables of data that is associated corresponding with the table name of this Excel tables of data in database.
Wherein, can, in the time of the tables of data of database initialize data field, in the table name of data field tables of data, carry the table name of this Excel tables of data, and then realization is associated with the table name of this Excel tables of data.In addition, can also in database, create after the tables of data of corresponding data field for every Excel tables of data, create a corresponding data table, in the record of the table name corresponding to every Excel tables of data, record the title of the data field tables of data of this Excel tables of data.
S102: determine whether this Excel tables of data has horizontal gauge outfit; If yes, perform step S103; Otherwise, execution step S105.
In this step, determine whether Excel tables of data to be stored has horizontal gauge outfit.There is horizontal gauge outfit if determine this Excel tables of data, perform step S103; Do not there is horizontal gauge outfit if determine this Excel tables of data, perform step S105.
S103: the content of each cell in the horizontal gauge outfit of determining is added in the each respective nodes in the horizontal gauge outfit tree structure that mixes gauge outfit tree structure template.
In fact, mixing gauge outfit tree structure template definition has horizontal stroke, vertical gauge outfit two to overlap tree structure.Wherein, the tree structure of horizontal, vertical gauge outfit all as shown in Figure 2, is made up of to common w level node and a root node of lowermost layer (w level, w is more than or equal to 1 natural number) top (1 grade).And, the data of each node comprise: this node ID(Identification, mark), the ID(of the father node of this node is called for short PID), node content (being called for short Name), this node rank number (being called for short OrderID), the sequence of this node in the brother of node number (being called for short SortID).Wherein, the ID of each node is unique; The content of Name for storing the gauge outfit cell corresponding with this node; The rank of OrderID for storing this node, for example, this node is 3 grades of nodes, OrderID is 3.In addition in the data of node, also can comprise: data type (be called for short Type), width (being called for short Width), highly (be called for short Heigth).Wherein, Type is for storing the type of the gauge outfit form field corresponding with this node; Width is for storing the width of the gauge outfit cell corresponding with this node; Heigth is for storing the height of the gauge outfit cell corresponding with this node.
In this step, by capable i in the horizontal gauge outfit of this Excel tables of data by a left side content from right j cell, be i as the horizontal gauge outfit tree structure middle rank alias that mixes gauge outfit tree structure template, sequence number is the content of j node, and records the mark of the corresponding node of higher level's cell that is designated this cell of the father node of this node.Particularly, in the time of i=1, record the mark that is designated root node of the father node of this node; In the time of i>1, record the mark of the corresponding node of higher level's cell that is designated this cell of the father node of this node.Like this, according to each cell in horizontal gauge outfit, and higher level's cell of this cell is determined each branch in the horizontal gauge outfit tree structure that mixes gauge outfit tree structure template.Wherein, the natural number that i is 1~m; M is total line number of cell in the horizontal gauge outfit of this Excel tables of data; J is the natural number of 1~n; N is the sum of the capable cell of i in the horizontal gauge outfit of this Excel tables of data.
For example, Excel tables of data to be stored is to have after the tables of data (concrete structure refers to following table 1) of mixing gauge outfit, the content of each cell in the horizontal gauge outfit of determining is added to after the horizontal gauge outfit tree structure that mixes gauge outfit tree structure template, it is default that this horizontal gauge outfit tree structure middle rank alias is greater than the data of 2 node, level alias is 1, sequence number be the son node number of 1 node according to for default, the son node number of each node that level alias is 2 is according to for default, concrete structure as shown in Figure 3 a.Wherein, level alias is 1, each node that sequence number is arranged by ascending order, and the Name in its data is respectively: field A, field B, field C; Level alias is 2, each node that sequence number is arranged by ascending order, and the Name in its data is respectively: field B1, field B2, field C1, field C2.
Table 1
S104: the data of the each node in horizontal gauge outfit tree structure are stored in the horizontal gauge outfit tables of data being associated with the table name of this Excel tables of data.
In this step, the data (ID, PID, Name, OrderID, SortID) of the each node in above-mentioned horizontal gauge outfit tree structure are stored into respectively in each row of the horizontal gauge outfit tables of data being associated with the table name of this Excel tables of data.
S105: determine whether this Excel tables of data has vertical gauge outfit; If yes, perform step S106; Otherwise, jump to step S108.
In this step, determine whether Excel tables of data to be stored has vertical gauge outfit.There is vertical gauge outfit if determine this Excel tables of data, perform step S106; Otherwise, jumping to step S108, process ends, completes the storage to this Excel tables of data.
S106: the content of each cell in the vertical gauge outfit of determining is added in the each respective nodes in the vertical gauge outfit tree structure that mixes gauge outfit tree structure template.
In this step, x in the vertical gauge outfit of this Excel tables of data is listed as by the upper content from lower y cell, be x as the rank number of being in the vertical gauge outfit tree structure to mixing gauge outfit tree structure template, sequence number is the content of the node of y, and records the mark of the corresponding node of higher level's cell that is designated this cell of the father node of this node.Particularly, in the time of x=1, record the mark that is designated root node of the father node of this node; In the time of x>1, record the mark of the corresponding node of higher level's cell that is designated this cell of the father node of this node.Like this, according to each cell in vertical gauge outfit, and higher level's cell of this cell is determined each branch in the vertical gauge outfit tree structure that mixes gauge outfit tree structure template.Wherein, the natural number that x is 1~a; A is total columns of cell in the vertical gauge outfit of this Excel tables of data; Y is the natural number of 1~b; Y is the sum of x column unit lattice in the vertical gauge outfit of this Excel tables of data.
For example, Excel tables of data to be stored is to have after the tables of data (concrete structure refers to table 1) of mixing gauge outfit, the content of each cell in the vertical gauge outfit of determining is added to after the vertical gauge outfit tree structure that mixes gauge outfit tree structure template, it is default that this vertical gauge outfit tree structure middle rank alias is greater than the data of node of 2 grades, and concrete structure as shown in Figure 3 b.Wherein, level alias is 1, each node that sequence number is arranged by ascending order, and the Name in its data is respectively: field D, field E, field F.Level alias is 2, each node that sequence number is arranged by ascending order, and the Name in its data is respectively: field D1, field D2, field D3, field E1, field E2, field E3, field F1, field F2, field F3.
In fact, mix gauge outfit tree structure template and can tackle various forms of gauge outfits.In the time that Excel tables of data has horizontal gauge outfit, can, by default the data of all nodes of the vertical gauge outfit tree structure of mixing gauge outfit tree structure template, in subsequent extracted, just can only extract horizontal gauge outfit.In the time that Excel tables of data has vertical gauge outfit, can, by default the data of all nodes of the horizontal gauge outfit tree structure of mixing gauge outfit tree structure template, in subsequent extracted, just can only extract vertical gauge outfit.Without for every Excel Data Sheet Design gauge outfit recognizer, alleviate developer's development effort like this, improved developer's development efficiency.
S107: the data of the each node in vertical gauge outfit tree structure are stored in the vertical gauge outfit tables of data being associated with the table name of this Excel tables of data.
In this step, by vertical gauge outfit tree structure the data (ID, PID, Name, OrderID, SortID) of each node store into respectively in each row of the vertical gauge outfit tables of data being associated with the table name of this Excel tables of data.
S108: complete the storage to this Excel tables of data.
For ease of the follow-up extraction to Excel tables of data, for Excel tables of data to be stored, the title of this Excel tables of data can be recorded in the title data table of database corresponding to the table name of this Excel tables of data.Can also be recorded to before the table of database in data of description table describing before the table of this Excel tables of data corresponding to the table name of this Excel tables of data.The table tail of this Excel tables of data can also be described and is recorded in the table tail data of description table of database corresponding to the table name of this Excel tables of data.
The flow process of the extracting method of the Excel tables of data that the embodiment of the present invention provides, as shown in Figure 4, comprises the steps:
S401: receive after the table name of Excel tables of data of user's input, the data field tables of data being associated with the table name of this Excel tables of data from database extracts the data field of this Excel tables of data.
S402: search the gauge outfit tables of data being associated with the table name of this Excel tables of data from database.
S403: determine whether to find horizontal gauge outfit tables of data; If yes, perform step S404; Otherwise, execution step S406.
In this step, determine whether to search the horizontal gauge outfit tables of data being associated with the table name of this Excel tables of data from database.If determine and find the horizontal gauge outfit tables of data being associated with the table name of this Excel tables of data, perform step S404; Otherwise, perform step S406.
S404: the content of determining each cell in the horizontal gauge outfit of this Excel tables of data according to the data of the each node recording in horizontal gauge outfit tables of data.
In this step, determine the content of each cell in the horizontal gauge outfit of this Excel tables of data according to the data of each node in the horizontal gauge outfit tree structure recording in horizontal gauge outfit tables of data, mix gauge outfit tree structure template.
Particularly, be that c, sequence number are the content of the node of d according to the level alias recording in horizontal gauge outfit tables of data, determine that c in the horizontal gauge outfit of this Excel tables of data is capable, content by a left side in right d cell, according to the content of the father node of this node, determine the content of higher level's cell of the cell that this node is corresponding.Particularly, in the time of c=1, higher level's cell of the cell that this node is corresponding is default; In the time of c>1, according to the content of the father node of this node, determine the content of higher level's cell of the cell that this node is corresponding.Wherein, the natural number that c is 1~e; E is the maximum level alias of node in the horizontal gauge outfit tree structure recording in horizontal gauge outfit tables of data, mix gauge outfit tree structure template; D is the natural number of 1~f; F is the maximum sequence number of the horizontal gauge outfit tree structure middle rank alias that records in horizontal gauge outfit tables of data, the mix gauge outfit tree structure template node that is r.
S405: each cell in the horizontal gauge outfit of determining is spliced mutually with the data field extracting.
In this step, will in horizontal gauge outfit form, be more than or equal to 1 natural number by upper from lower last column u(u) joined from u cell of lower the first row by upper in individual cell and data field.
S406: determine whether to find vertical gauge outfit tables of data; If yes, perform step S407; Otherwise, jump to step S409.
In this step, determine whether to search the vertical gauge outfit tables of data being associated with the table name of this Excel tables of data from database.If determine and find the vertical gauge outfit tables of data being associated with the table name of this Excel tables of data, perform step S407; Otherwise, jumping to step S409, process ends, completes the extraction to this Excel tables of data.
S407: the content of determining each cell in the vertical gauge outfit of this Excel tables of data according to the data of the each node recording in vertical gauge outfit tables of data.
In this step, determine the content of each cell in the vertical gauge outfit of this Excel tables of data according to the data of each node in the vertical gauge outfit tree structure recording in vertical gauge outfit tables of data, mix gauge outfit tree structure template.
Particularly, be g according to the level alias recording in vertical gauge outfit tables of data, sequence number is the content of the node of h, determine g row in the vertical gauge outfit of this Excel tables of data, by upper content in lower h cell, according to the content of the father node of this node, determine the content of higher level's cell of the cell that this node is corresponding.Particularly, in the time of g=1, higher level's cell of the cell that this node is corresponding is default; In the time of g>1, according to the content of the father node of this node, determine the content of higher level's cell of the cell that this node is corresponding.Wherein, the natural number that g is 1~p; P is the maximum level alias of node in the vertical gauge outfit tree structure recording in vertical gauge outfit tables of data, mix gauge outfit tree structure template; H is the natural number of 1~q; Q is the maximum sequence number of indulging the node that vertical gauge outfit tree structure middle rank alias that record in gauge outfit tables of data, mixing gauge outfit tree structure template is g.
S408: each cell in the vertical gauge outfit of determining is spliced mutually with the data field extracting.
In this step, be more than or equal to 1 natural number by being listed as v(v by a left side from right last in vertical gauge outfit cell) joined from v cell of right first row by a left side in individual cell and the data field extracting.
S409: complete the extraction to this Excel tables of data.
According to the method for the storage of above-mentioned Excel tables of data, the structure of the storage system of the Excel tables of data that the embodiment of the present invention provides, as shown in Figure 5, comprising: data area stores module 501 and gauge outfit memory module 502.
Data area stores module 501 is for storing the content of the data field of Excel tables of data to be stored in the data field tables of data being associated with the table name of this Excel tables of data in database into.
If gauge outfit memory module 502, for determining that Excel tables of data to be stored has horizontal gauge outfit, is added the content of each cell in the horizontal gauge outfit of this Excel tables of data in the each respective nodes in the horizontal gauge outfit tree structure that mixes gauge outfit tree structure template; And the data of the each node in this horizontal gauge outfit tree structure are stored in the horizontal gauge outfit tables of data being associated with the table name of this Excel tables of data; If determine, Excel tables of data to be stored has vertical gauge outfit, the content of each cell in the vertical gauge outfit of this Excel tables of data is added in the each respective nodes in the vertical gauge outfit tree structure that mixes gauge outfit tree structure template; And the data of the each node in this vertical gauge outfit tree structure are stored in the vertical gauge outfit tables of data being associated with the table name of this Excel tables of data.Wherein, gauge outfit memory module 502 concrete functions can be with reference to above-mentioned steps S103 to the content in step S106.
The storage system of the Excel tables of data that further, the embodiment of the present invention provides also comprises: before title memory module (not marking in figure), table, describe memory module (not marking in figure) and show tail and describe memory module (not marking in figure).
Title memory module is for being recorded to the title of Excel tables of data to be stored the title data table of database corresponding to the table name of this Excel tables of data.
Memory module is described for being recorded to data of description table before the table of database by describing before the table of Excel tables of data to be stored corresponding to the table name of this Excel tables of data before table.
Table tail is described memory module for the table tail of Excel tables of data to be stored being described to the table tail data of description table that is recorded to database corresponding to the table name of this Excel tables of data.
According to the method for the extraction of above-mentioned Excel tables of data, the structure of the extraction system of the Excel tables of data that the embodiment of the present invention provides, as shown in Figure 6, comprising: data field extraction module 601, gauge outfit extraction module 602, concatenation module 603.
Data field extraction module 601, for according to the table name of the Excel tables of data of user input, the data field tables of data being associated with the table name of this Excel tables of data from database extracts the data field of this Excel tables of data.
Gauge outfit extraction module 602, be used for according to the table name of the Excel tables of data of user's input, if find the horizontal gauge outfit tables of data being associated with the table name of this Excel tables of data from database, determine the content of each cell in the horizontal gauge outfit of this Excel tables of data according to the data of each node in the horizontal gauge outfit tree structure recording in this horizontal gauge outfit tables of data, mix gauge outfit tree structure template; If find the vertical gauge outfit tables of data being associated with the table name of this Excel tables of data from database, determine the content of each cell in the vertical gauge outfit of this Excel tables of data according to the data of each node in the vertical gauge outfit tree structure recording in this vertical gauge outfit tables of data, mix gauge outfit tree structure template.Wherein, gauge outfit extraction module 602 concrete functions can be with reference to above-mentioned steps S403 to the content in step S406.
Concatenation module 603, for splicing gauge outfit cell definite gauge outfit extraction module 602 and the data field that data field extraction module 601 extracts mutually.
Further, the extraction system of the Excel tables of data that the embodiment of the present invention provides, also comprises: before title extraction module (not marking in figure), table, description extraction module (not marking in figure), table tail are described extraction module (not marking in figure).
Title extraction module is used for according to the table name of the Excel tables of data of user's input, and the title data table from database extracts the title corresponding to this Excel tables of data of the table name record of this Excel tables of data.
Before table, describe extraction module for according to the table name of the Excel tables of data of user input, before the table from database, data of description table is described before extracting the table corresponding to this Excel tables of data of the table name record of this Excel tables of data.
Table tail is described extraction module for according to the table name of the Excel tables of data of user input, and the table tail data of description table from database extracts corresponding to the table tail of this Excel tables of data of the table name record of this Excel tables of data and describes.
In the technical scheme that the embodiment of the present invention provides, for Excel tables of data to be stored, content in the data field of this Excel tables of data is stored in the data field tables of data being associated with the table name of this Excel tables of data in database, and the content of each cell in the horizontal stroke of this Excel tables of data (indulging) gauge outfit is added in the each respective nodes in horizontal stroke (indulging) the gauge outfit tree structure that mixes gauge outfit tree structure template, and the data of the each node in horizontal (indulging) gauge outfit tree structure are stored in horizontal stroke (indulging) the gauge outfit tables of data being associated with the table name of this Excel tables of data.Afterwards, in the time need to extracting the tables of data of storage, according to the table name of Excel tables of data of required extraction that receives user input, the data field tables of data being associated with the table name of this Excel tables of data from database extracts the data field of this Excel tables of data, and determine in gauge outfit after each cell according to the gauge outfit tables of data being associated with the table name of this Excel tables of data from database, gauge outfit cell, data field are stitched together.Like this, all can use the method to carry out gauge outfit identification for the gauge outfit of various forms of Excel tables of data, and then all can adopt Same Way (program) to identify and store to the various gauge outfits of Excel tables of data, without being every corresponding gauge outfit recognizer of Excel Data Sheet Design, improve developer's development efficiency.
The foregoing is only preferred embodiment of the present invention, not for limiting the scope of the invention.Within the spirit and principles in the present invention all, any modification of doing, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.