CN107844561A - A kind of data volume statistical method and device - Google Patents
A kind of data volume statistical method and device Download PDFInfo
- Publication number
- CN107844561A CN107844561A CN201711056050.1A CN201711056050A CN107844561A CN 107844561 A CN107844561 A CN 107844561A CN 201711056050 A CN201711056050 A CN 201711056050A CN 107844561 A CN107844561 A CN 107844561A
- Authority
- CN
- China
- Prior art keywords
- data
- database table
- row
- row data
- data volume
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2462—Approximate or statistical queries
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Probability & Statistics with Applications (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Fuzzy Systems (AREA)
- Computational Linguistics (AREA)
- Mathematical Physics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a kind of data volume statistical method and device, this method to include:Determine classification to be counted;In target database, the attribute information of each database table corresponding with the classification to be counted is obtained;According to acquired attribute information, data corresponding to each described database table are obtained;Data corresponding to database table each described are handled, determine data volume corresponding to each described database table;Data volume corresponding to each database table is collected, obtains data volume corresponding to the classification to be counted.Therefore, scheme provided by the invention can improve data volume statistical accuracy.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind of data volume statistical method and device.
Background technology
Under big data integration background, the data that a database includes may be from different departments.For logarithm
Effective operation management is carried out, it is necessary to the data volume of data included by staqtistical data base according to storehouse.
At present, in the data volume of some department included by staqtistical data base, it is necessary to be connected using database software is accessed
Database is connect, then database table included in database is counted in turn using accessing database software.Counted
Journey is manually completed by business personnel using database software is accessed, because the database table that database includes is numerous, and
Operating process is very dull and repeats.In such statistic processes, staff is easy to because tired under-enumeration database
Table.Therefore, existing mode, data volume statistical accuracy are relatively low.
The content of the invention
The embodiments of the invention provide a kind of data volume statistical method and device, can improve the accurate of data volume statistics
Property.
In a first aspect, the embodiments of the invention provide a kind of data volume statistical method, this method includes:
Determine classification to be counted;
In target database, the attribute information of each database table corresponding with the classification to be counted is obtained;
According to acquired attribute information, data corresponding to each described database table are obtained;
Data corresponding to database table each described are handled, determine number corresponding to each described database table
According to amount;
Data volume corresponding to each database table is collected, obtains data corresponding to the classification to be counted
Amount.
Preferably,
Attribute information acquired in the basis, data corresponding to each described database table are obtained, including:
Each acquired attribute information is encapsulated as a table object respectively, wherein, each described table pair
As being respectively present corresponding property value;
According to property value corresponding to each described table object, in all database tables corresponding to the classification to be counted
Obtain data corresponding to each described table object.
Preferably,
It is described that data corresponding to database table each described are handled, determine that each described database table is corresponding
Data volume, including:
It is performed both by for data corresponding to database table each described:
A1:Determine each row data corresponding to presently described data;
A2:The row data are selected in each row data;
A3:Selected row data are written in default formatted data template, and write selected row data pair
The data volume answered, wherein, data volume corresponding to selected row data adds for data volume corresponding to the row data of last write-in
1;
A4:Judge with the presence or absence of the row data of not selected mistake in each row data, if it is, performing A2;Otherwise,
Perform A5;
A5:By data volume corresponding to the row data of last time write-in, it is defined as number corresponding to presently described database table
According to amount.
Preferably,
It is described judge the row data of not selected mistake are not present in each row data after, and it is described will most
Quantity corresponding to the row data of write-once afterwards, is defined as before data volume corresponding to presently described tables of data, further comprises:
Attribute information corresponding to presently described database table is write into the formatted data template;
The formatted data mould of each row data, each data volume and the attribute information will be write
Plate, store in specified file.
Preferably,
It is described select the row data in each row data corresponding to presently described data after, and described
Before selected row data are written in default formatted data template, further comprise:
Judge with the presence or absence of the keyword that reports an error in selected row data, if it is, error information is generated, and described in execution
Selected row data are written to default formatted data template.
Preferably,
The attribute information includes at least one of English name, Chinese name, owning user and affiliated table space or more
Kind.
Second aspect, the embodiments of the invention provide a kind of data volume statistic device, the device includes:
Determining module, for determining classification to be counted;
Attribute acquisition module, in target database, obtaining the class to be counted determined with the determining module
The attribute information of each not corresponding database table;
Data acquisition module, for the attribute information according to acquired in the attribute acquisition module, obtain described in each
Data corresponding to database table;
Processing module, carried out for data corresponding to each described database table for being obtained to the data acquisition module
Processing, determines data volume corresponding to each described database table;
Summarizing module, converged for data volume corresponding to each database table for handling the processing module
Always, data volume corresponding to the classification to be counted is obtained.
Preferably,
The data acquisition module includes:Encapsulate submodule and data acquisition submodule;
The encapsulation submodule, for each acquired attribute information to be encapsulated as into a table object respectively,
Wherein, each described table object is respectively present corresponding property value;
The data acquisition submodule, for the property value according to corresponding to each described table object, described to be counted
Data corresponding to each described table object are obtained in all database tables corresponding to classification.
Preferably,
The processing module, for being performed both by A1 to A5 for data corresponding to database table each described:
A1:Determine each row data corresponding to presently described data;
A2:The row data are selected in each row data;
A3:Selected row data are written in default formatted data template, and write selected row data pair
The data volume answered, wherein, data volume corresponding to selected row data adds for data volume corresponding to the row data of last write-in
1;
A4:Judge with the presence or absence of the row data of not selected mistake in each row data, if it is, performing A2;Otherwise,
Perform A5;
A5:By data volume corresponding to the row data of last time write-in, it is defined as number corresponding to presently described database table
According to amount.
Preferably,
The processing module, it is further used for attribute information corresponding to presently described database table writing the form number
According to template;The formatted data template of each row data, each data volume and the attribute information will be write,
Store in specified file.
Preferably,
The processing module, it is further used for judging in selected row data with the presence or absence of the keyword that reports an error, if it is,
Error information is generated, and performs and described selected row data is written to default formatted data template.
The embodiments of the invention provide a kind of data volume statistical method and device, obtained out in target database with advance
The attribute information of each database table corresponding to the classification to be counted determined.According to acquired each attribute information, obtain
Data corresponding to each database table.Then data corresponding to each acquired tables of data are handled, so as to really
Make data volume corresponding to each database table.Finally data volume corresponding to each database table for determining is converged
Always, to obtain data volume corresponding to classification to be counted.By above-mentioned, believed in this programme by the attribute of each tables of data
Breath obtains data corresponding to each tables of data, and acquired data are handled, to obtain number corresponding to each tables of data
According to amount.And business personnel is not needed using the data volume for accessing each tables of data of inquiry of database software in turn.Therefore, this hair
The scheme that bright embodiment provides can improve data volume statistical accuracy.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are the present invention
Some embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis
These accompanying drawings obtain other accompanying drawings.
Fig. 1 is a kind of flow chart for data volume statistical method that one embodiment of the invention provides;
Fig. 2 is a kind of flow chart for data volume statistical method that another embodiment of the present invention provides;
Fig. 3 is a kind of hardware configuration of equipment where a kind of data volume statistic device that one embodiment of the invention provides
Figure;
Fig. 4 is a kind of structural representation for data volume statistic device that one embodiment of the invention provides;
Fig. 5 is a kind of structural representation for data volume statistic device that another embodiment of the present invention provides.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
Part of the embodiment of the present invention, rather than whole embodiments, based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained on the premise of creative work is not made, belongs to the scope of protection of the invention.
As shown in figure 1, the embodiments of the invention provide a kind of data volume statistical method, this method can include following step
Suddenly:
Step 101:Determine classification to be counted;
Step 102:In target database, the attribute of each database table corresponding with the classification to be counted is obtained
Information;
Step 103:According to acquired attribute information, data corresponding to each described database table are obtained;
Step 104:Data corresponding to database table each described are handled, determine each described database table
Corresponding data volume;
Step 105:Data volume corresponding to each database table is collected, it is corresponding to obtain the classification to be counted
Data volume.
Embodiment according to Fig. 1, obtained out in target database corresponding with predetermined classification to be counted
The attribute information of each database table.According to acquired each attribute information, number corresponding to each database table is obtained
According to.Then data corresponding to each acquired tables of data are handled, so that it is determined that it is corresponding to go out each database table
Data volume.Finally data volume corresponding to each database table for determining is collected, it is corresponding to obtain classification to be counted
Data volume.By above-mentioned, obtained in this programme by the attribute information of each tables of data corresponding to each tables of data
Data, and acquired data are handled, to obtain data volume corresponding to each tables of data.And business personnel's profit is not needed
With the data volume for accessing each tables of data of inquiry of database software in turn.Therefore, scheme provided in an embodiment of the present invention can be with
Improve data volume statistical accuracy.
In an embodiment of the invention, the classification to be counted involved by the step 101 in flow chart shown in above-mentioned Fig. 1 can
To be determined according to business need.Such as classification to be counted can be determined according to the pattern of database table, can be according to data
The effect of storehouse table is determined and can be determined according to the formation time of database table.
When classification to be counted is determined according to the pattern of tables of data, classification to be counted includes but is not limited to EXCEL types
Any one in formula, XML-style formula or JSON patterns.
When classification to be counted is determined according to the effect of database table, classification to be counted can be some department.Than
Such as department 1.
When classification to be counted is determined according to the formation time of database table, when classification to be counted can be some
Between.Such as in May, 2017.
Below using target database as government database, and classification to be counted be department A exemplified by illustrate:In government's number
According to all database tables corresponding with department A are determined in storehouse, the attribute information of each identified tables of data is then obtained.
In an embodiment of the invention, the specific pattern of data volume can determine according to business need.Such as data volume
It can be bar number.
In an embodiment of the invention, the attribute information involved by the step 102 in flow chart shown in above-mentioned Fig. 1 includes
At least one of English name, Chinese name, owning user and affiliated table space are a variety of.
In the present embodiment, the attribute information of each database table can include but is not limited to English name, Chinese name, institute
Belong at least one of user and affiliated table space or a variety of.
Illustrated below by taking database table A as an example:Obtaining database table A attribute information includes English name
" financial data ", Chinese name " financial data ", owning user " department A ", affiliated table space " table space 1 ".
In an embodiment of the invention, the step 103 in flow chart shown in above-mentioned Fig. 1 is believed according to acquired attribute
Breath, obtain each described database table corresponding to data, can include:
Each acquired attribute information is encapsulated as a table object respectively, wherein, each described table pair
As being respectively present corresponding property value;
According to property value corresponding to each described table object, in all database tables corresponding to the classification to be counted
Obtain data corresponding to each described table object.
In the present embodiment, when each attribute information being encapsulated as into table object, the method for packing used can be according to industry
Business requires to determine.For example use Javascript method for packing., can be by attribute after attribute information is encapsulated as into table object
The English name that information includes is defined as property value corresponding to table object.Then property value corresponding to table object is utilized, is waiting to unite
Data corresponding to each table object are obtained in all database tables corresponding to meter classification.
According to above-described embodiment, each attribute information is encapsulated as table object respectively, and be the determination pair of each table object
The property value answered.Obtain each database table corresponding to data when, can according to corresponding to each table object property value,
Obtain data corresponding to each database table.Due to obtaining data according to table object, therefore do not have to compile when obtaining data
Translate the code of complexity.Therefore data acquisition is more convenient.
In an embodiment of the invention, the step 104 in flow chart shown in above-mentioned Fig. 1 is to database table each described
Corresponding data are handled, determine each described database table corresponding to data volume, can include:
It is performed both by for data corresponding to database table each described:
A1:Determine each row data corresponding to presently described data;
A2:The row data are selected in each row data;
A3:Selected row data are written in default formatted data template, and write selected row data pair
The data volume answered, wherein, data volume corresponding to selected row data adds for data volume corresponding to the row data of last write-in
1;
A4:Judge with the presence or absence of the row data of not selected mistake in each row data, if it is, performing A2;Otherwise,
Perform A5;
A5:By data volume corresponding to the row data of last time write-in, it is defined as number corresponding to presently described database table
According to amount.
In the present embodiment, the specific pattern of formatted data template can determine according to business need.Such as formatted data
Chinese name project, English name project, table space project, data items and data volume project can be included in template.
Illustrated below by taking data A corresponding to current database Table A as an example:
Determine that row data corresponding to data A include " row data 1, row data 2 and row data 3 ".In " row data 1, line number
According to selection row data 1 in 2 and row data 3 ", then row data 1 are written in formatted data template corresponding to data items
On position.Due to the row data that row data 1 are first write-in, therefore data volume corresponding to row data 1 is 1, then is written to 1
In data volume project corresponding to row data 1.Due to " row data 2 and row data 3 " are also not selected, then " row data 2 and
Selection row data 2, row data 2 are written in formatted data template corresponding to data items on position in row data 3 ", due to
Row data 2 are not the row data of first write-in, therefore obtain data volume 1 corresponding to the row data 1 of last write-in, and by institute
The data volume 1 of acquisition plus 1, it is 2 to determine data volume corresponding to trip data 2, then is written to data volume corresponding to row data 2 by 2
In project.Similarly, because row data 3 are also not selected, then row data 3 is selected, row data 3 are written in formatted data template
Corresponding to data items on position, because row data 3 are not the row data of first write-in, therefore the row of last write-in is obtained
Data volume 3 corresponding to data 3, and acquired data volume 3 is added 1, it is 3 to determine data volume corresponding to trip data 3, then by 3
It is written in data volume project corresponding to row data 3.After row data 3 are written into formatted data template, data A is corresponding
Row data in non-selected row data are not present, then will last time write-in row data 3 corresponding to data volume 3, it is determined that
For data volume corresponding to database table A.As shown in Table-1, it is the write-in " lattice after row data 1, row data 2 and row data 3 "
Formula data template.
Table -1
According to above-described embodiment, by default formatted data template to corresponding to each database table at data
Reason, obtains data volume corresponding to each database table.Due to being obtained for each database table using formatted data template
Corresponding data volume.The probability for occurring leakage statistics amount accordingly, there exist database table is relatively low.
In an embodiment of the invention, after step A4 is performed, and judge to be not present in each row data
After the row data of not selected mistake, and step A5 will quantity corresponding to the row data of last time write-in, be defined as current
Before data volume corresponding to the tables of data, it may further include:
Attribute information corresponding to presently described database table is write into the formatted data template;
The formatted data mould of each row data, each data volume and the attribute information will be write
Plate, store in specified file.
In the present embodiment, by attribute information writing format data template corresponding to current database table, to utilize attribute
Data in writing format data template are identified information.For example attribute information corresponding to current database Table A includes English
Literary fame " financial data ", Chinese name " financial data ", affiliated table space " table space 1 ".It is then that attribute information is right respectively
That answers is written in the Chinese name project, English name project, table space project of table -1.Attribute information write-in after the completion of, by table-
1 is stored in specified file.Wherein the type of specified file can determine according to business need.Such as TXT files.
According to above-described embodiment, attribute information writing format data template corresponding to database table is believed with utilization attribute
Breath distinguishes that what is write in formatted data template is the data in which database table.Each row data, each data volume will be write
And the formatted data template of attribute information is stored into specified file, so that when data volume has problem, can utilize should
File quickly determines erroneous point.
In an embodiment of the invention, one is selected in each row data corresponding to presently described data in step A2
After the row data, and before selected row data are written in default formatted data template by step A3, enter one
Step includes:
Judge with the presence or absence of the keyword that reports an error in selected row data, if it is, error information is generated, and described in execution
Selected row data are written to default formatted data template.
In the present embodiment, judge selected row data exist report an error keyword when, generate error information so that
Business personnel can carry out operation management according to error information to data.The category of current data can be included wherein in error information
Property information, the identification information of selected row data.
In the present embodiment, the keyword that reports an error can determine according to business need, and including but not limited to mistak,
At least one of error, not found, failed or a variety of.
According to above-described embodiment, judge selected row data exist report an error keyword when, generate error information, with
Business personnel is set row data of problems quickly to be navigated to, according to error information so as to quickly enter to data
Row operation management.
Below using target database as government database, and classification to be counted is exemplified by department A.Expansion explanation data volume system
Meter method, as shown in Fig. 2 the data volume statistical method may include steps of:
Step 201:Determine classification to be counted.
In this step, it is department A to determine classification to be counted.
Step 202:In target database, the attribute letter of each database table corresponding with classification to be counted is obtained
Breath.
In this step, all database tables " number corresponding with department A is determined in target database " government database "
According to storehouse table 1, database table 2 and database table 3 ".Wherein, the attribute information for obtaining database table 1 includes English name
" financial data ", Chinese name " financial data ", owning user " department A ", affiliated table space " table space 1 ";Database
The attribute information of table 2 includes " English name " Household registration data ", Chinese name " household register data ", affiliated use
Family " department A ", affiliated table space " table space 1 ";The attribute information of database table 3 include English name " Property data ", in
Literary fame " house property data ", owning user " department A ", affiliated table space " table space 1 "
Step 203:Each acquired attribute information is encapsulated as a table object respectively, wherein, each table pair
As being respectively present corresponding property value.
In this step, the attribute information of database table 1 is encapsulated as table object 1, property value corresponding to table object 1 is
financial data.The attribute information of database table 2 is encapsulated as table object 2, property value corresponding to table object 2 is
Household registration data.The attribute information of database table 3 is encapsulated as table object 3, corresponding to table object 3
Property value is Property data.
Step 204:According to property value corresponding to each table object, in all database tables corresponding to classification to be counted
Obtain data corresponding to each table object.
In this step, the property value according to corresponding to table object 1, corresponding data 1 are got.According to the correspondence of table object 2
Property value, get corresponding to data 2.According to property value corresponding to table object 3, corresponding data 3 are got.
Step 205:In data corresponding to each database table, it is current number to select data corresponding to a database table
According to.
Step 206:Determine each row data corresponding to current data.
In this step, illustrated with data 1 corresponding to database table 1 for current data, determine the correspondence of data 1 " OK
Data 1, row data 2 and row data 3 ".
Step 207:A row data are selected in each row data.
In this step, " row data 1 are being selected in row data 1, row data 2 and row data 3 ".
Step 208:Judge with the presence or absence of the keyword that reports an error in selected row data, if it is, step 209 is performed, and
Perform step 210;Otherwise, step 210 is performed.
In this step, judge the keyword that reports an error is not present in row data 1, perform step 210.
Step 209:Generate error information.
Step 210:Selected row data are written in default formatted data template, and write selected line number
According to corresponding data volume, wherein, data volume corresponding to selected row data is data corresponding to the row data of last write-in
Amount plus 1.
In this step, formatted data template includes Chinese name project, English name project, table space project, data item
Mesh and data volume project.
In this step, when data of being expert at 1 are selected row data, row data 1 are written in formatted data template
Corresponding to data items on position.Due to the row data that row data 1 are first write-in, therefore data volume corresponding to row data 1
For 1, then 1 is written in data volume project corresponding to row data 1.
In this step, when data of being expert at 2 are selected row data, row data 2 are written in formatted data template
Corresponding to data items on position, because row data 2 are not the row data of first write-in, therefore the row of last write-in is obtained
Data volume 1 corresponding to data 1, and acquired data volume 1 is added 1, it is 2 to determine data volume corresponding to trip data 2, then by 2
It is written in data volume project corresponding to row data 2.
In this step, when data of being expert at 3 are selected row data, row data 3 are written in formatted data template
Corresponding to data items on position, because row data 3 are not the row data of first write-in, therefore the row of last write-in is obtained
Data volume 3 corresponding to data 3, and acquired data volume 3 is added 1, it is 3 to determine data volume corresponding to trip data 3, then by 3
It is written in data volume project corresponding to row data 3.
Step 211:Judge with the presence or absence of the row data of not selected mistake in each row data, if it is, performing step
207;Otherwise, step 212 is performed.
In this step, when selected row data are row data 1 or row data 2, step 207 is performed.Selected
Row data when being row data 3, perform step 212.
Step 212:By attribute information writing format data template corresponding to current database table.
In this step, illustrated with data 1 corresponding to database table 1 for current data, by corresponding to database table 1
Attribute information English name " financial data ", Chinese name " financial data ", owning user " department A ", affiliated table space " table
In the Chinese name project of writing format data template, English name project, table space project corresponding to the difference of space 1 ", formation table-
1。
Step 213:The formatted data template of each row data, each data volume and attribute information will be write, storage is arrived
In the file specified.
In this step, illustrated with data 1 corresponding to database table 1 for current data, will write each row data,
The formatted data template (as shown in Table-1) of each data volume and attribute information, store into the file 1 (TXT) specified.
In this step, similarly, handled to data 3 corresponding to data 2 corresponding to database table 2 and database table 3
After the completion of, also by the storage of corresponding formatted data template into the file 1 (TXT) specified.
Step 214:By data volume corresponding to the row data of last time write-in, it is defined as number corresponding to current database table
According to amount.
In this step, illustrated with data 1 corresponding to database table 1 for current data, by last time write-in
Data volume 3 corresponding to row data 3, is defined as data volume corresponding to current database table 1.
Step 215:Judge whether selected database table is last database table, if it is, performing step
216;Otherwise, step 205 is performed.
Step 216:Data volume corresponding to each database table is collected, obtains data corresponding to classification to be counted
Amount.
In this step, data volume corresponding to database table 1, database table 2 and database table 3 is collected, obtained
To classification to be counted " data volume corresponding to department A ".
For example database table 1, database table 2 and data volume corresponding to database table 3 are respectively 3,5,4.It is then to be counted
" data volume corresponding to department A " is 12 to classification.
In addition, in the present embodiment, involved data volume is bar number.
As shown in Figure 3, Figure 4, the embodiments of the invention provide a kind of data volume statistic device.Device embodiment can pass through
Software is realized, can also be realized by way of hardware or software and hardware combining.For hardware view, as shown in figure 3, being this
A kind of hardware structure diagram of equipment where the data volume statistic device that inventive embodiments provide, except the processor shown in Fig. 3, interior
Deposit, outside network interface and nonvolatile memory, it is hard that the equipment in embodiment where device can also generally include other
Part, such as it is responsible for the forwarding chip of processing message.Exemplified by implemented in software, as shown in figure 4, as on a logical meaning
Device, it is to be read corresponding computer program instructions in nonvolatile memory in internal memory by the CPU of equipment where it
What operation was formed.The data volume statistic device that the present embodiment provides, including:
Determining module 401, for determining classification to be counted;
Attribute acquisition module 402, treated in target database, obtaining with the described of the determining module 401 determination
Count the attribute information of each database table corresponding to classification;
Data acquisition module 403, for the attribute information according to acquired in the attribute acquisition module 402, obtain each
Data corresponding to the individual database table;
Processing module 404, for number corresponding to each described database table for being obtained to the data acquisition module 403
According to being handled, data volume corresponding to each described database table is determined;
Summarizing module 405, enter for data volume corresponding to each database table for handling the processing module 404
Row collects, and obtains data volume corresponding to the classification to be counted.
Embodiment according to Fig. 4, obtained out using attribute acquisition module in target database pre- with determining module
The attribute information of each database table corresponding to the classification to be counted first determined.Using data acquisition module according to acquired
Each attribute information, obtain data corresponding to each database table.Then using processing module to acquired each number
Handled according to data corresponding to table, so that it is determined that going out data volume corresponding to each database table.Finally utilize summarizing module
Data volume corresponding to each database table for determining is collected, to obtain data volume corresponding to classification to be counted.Pass through
It is above-mentioned to understand, data corresponding to each tables of data are obtained by the attribute information of each tables of data in this programme, and to being obtained
The data taken are handled, to obtain data volume corresponding to each tables of data.And do not need business personnel to utilize and access database
The data volume of each tables of data of inquiry of software in turn.Therefore, scheme provided in an embodiment of the present invention can improve data volume system
The accuracy of meter.
In an embodiment of the invention, as shown in figure 5, the data acquisition module 403 can include:Encapsulate submodule
501 and data acquisition submodule 502;
The encapsulation submodule 501, for each acquired attribute information to be encapsulated as into a table pair respectively
As, wherein, each described table object is respectively present corresponding property value;
The data acquisition submodule 502, for the property value according to corresponding to each described table object, wait to unite described
Data corresponding to each described table object are obtained in all database tables corresponding to meter classification.
In an embodiment of the invention, the processing module 404, for for corresponding to database table each described
Data are performed both by A1 to A5:
A1:Determine each row data corresponding to presently described data;
A2:The row data are selected in each row data;
A3:Selected row data are written in default formatted data template, and write selected row data pair
The data volume answered, wherein, data volume corresponding to selected row data adds for data volume corresponding to the row data of last write-in
1;
A4:Judge with the presence or absence of the row data of not selected mistake in each row data, if it is, performing A2;Otherwise,
Perform A5;
A5:By data volume corresponding to the row data of last time write-in, it is defined as number corresponding to presently described database table
According to amount.
In an embodiment of the invention, the processing module 404, it is further used for presently described database table is corresponding
Attribute information write the formatted data template;Each row data, each data volume and the category will be write
The formatted data template of property information, is stored in specified file.
In an embodiment of the invention, the processing module 404, be further used for judging be in selected row data
It is no exist report an error keyword, if it is, generation error information, and perform and described selected row data be written to default lattice
Formula data template.
A kind of computer-readable recording medium is provided in one embodiment of the invention, the computer-readable recording medium includes:Execute instruction, when storage is controlled
Described in the computing device of device processed during execute instruction, the storage control performs the data volume statistics side described in any of the above-described
Method.
A kind of storage control is provided in one embodiment of the invention, the storage control includes:Processor, memory
And bus;The memory is used to store execute instruction;The processor is connected with the memory by the bus;Work as institute
When stating storage control operation, the execute instruction of memory storage described in the computing device, so that the storage control
Device processed performs the data volume statistical method described in any of the above-described.
The contents such as the information exchange between each unit, implementation procedure in said apparatus, due to implementing with the inventive method
Example is based on same design, and particular content can be found in the narration in the inventive method embodiment, and here is omitted.
In summary, each embodiment of the present invention can at least realize following beneficial effect:
1st, in embodiments of the present invention, obtained out in target database corresponding with predetermined classification to be counted every
The attribute information of one database table.According to acquired each attribute information, data corresponding to each database table are obtained.
Then data corresponding to each acquired tables of data are handled, so that it is determined that going out number corresponding to each database table
According to amount.Finally data volume corresponding to each database table for determining is collected, to obtain number corresponding to classification to be counted
According to amount.By above-mentioned, data corresponding to each tables of data are obtained by the attribute information of each tables of data in this programme,
And acquired data are handled, to obtain data volume corresponding to each tables of data.And business personnel is not needed using visit
Ask the data volume of each tables of data of inquiry of database software in turn.Therefore, scheme provided in an embodiment of the present invention can improve
Data volume statistical accuracy.
2nd, in embodiments of the present invention, each attribute information is encapsulated as table object respectively, and it is true for each table object
Property value corresponding to fixed.When obtaining data corresponding to each database table, can be belonged to according to corresponding to each table object
Property value, obtains data corresponding to each database table.Due to obtaining data according to table object, therefore when obtaining data not
With the code that compiling is complicated.Therefore data acquisition is more convenient.
3rd, in embodiments of the present invention, data corresponding to each database table are entered by default formatted data template
Row processing, obtains data volume corresponding to each database table.Due to utilizing formatted data mould for each database table
Plate obtains corresponding data volume.The probability for occurring leakage statistics amount accordingly, there exist database table is relatively low.
4th, in embodiments of the present invention, by attribute information writing format data template corresponding to database table, belonged to utilizing
What is write in property information differentiating formatted data template is the data in which database table.Each row data, each number will be write
Stored according to amount and the formatted data template of attribute information into specified file, with when problem be present in data volume, Ke Yili
Erroneous point is quickly determined with this document.
5th, in embodiments of the present invention, judging that selected row data have that when reporting an error keyword, generation reports an error letter
Breath, so that business personnel can quickly navigate to row data of problems, so as to quick logarithm according to error information
According to progress operation management.
It should be noted that herein, such as first and second etc relational terms are used merely to an entity
Or operation makes a distinction with another entity or operation, and not necessarily require or imply and exist between these entities or operation
Any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant be intended to it is non-
It is exclusive to include, so that process, method, article or equipment including a series of elements not only include those key elements,
But also the other element including being not expressly set out, or also include solid by this process, method, article or equipment
Some key elements.In the absence of more restrictions, the key element limited by sentence " including one ", is not arranged
Except other identical factor in the process including the key element, method, article or equipment being also present.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above method embodiment can pass through
Programmed instruction related hardware is completed, and foregoing program can be stored in computer-readable storage medium, the program
Upon execution, the step of execution includes above method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or light
Disk etc. is various can be with the medium of store program codes.
It is last it should be noted that:Presently preferred embodiments of the present invention is the foregoing is only, is merely to illustrate the skill of the present invention
Art scheme, is not intended to limit the scope of the present invention.Any modification for being made within the spirit and principles of the invention,
Equivalent substitution, improvement etc., are all contained in protection scope of the present invention.
Claims (10)
- A kind of 1. data volume statistical method, it is characterised in that including:Determine classification to be counted;In target database, the attribute information of each database table corresponding with the classification to be counted is obtained;According to acquired attribute information, data corresponding to each described database table are obtained;Data corresponding to database table each described are handled, determine data corresponding to each described database table Amount;Data volume corresponding to each database table is collected, obtains data volume corresponding to the classification to be counted.
- 2. according to the method for claim 1, it is characterised in thatAttribute information acquired in the basis, data corresponding to each described database table are obtained, including:Each acquired attribute information is encapsulated as a table object respectively, wherein, each described table object point Cun not corresponding property value;According to property value corresponding to each described table object, obtained in all database tables corresponding to the classification to be counted Data corresponding to each described table object.
- 3. according to the method for claim 1, it is characterised in thatIt is described that data corresponding to database table each described are handled, determine number corresponding to each described database table According to amount, including:It is performed both by for data corresponding to database table each described:A1:Determine each row data corresponding to presently described data;A2:The row data are selected in each row data;A3:Selected row data are written in default formatted data template, and write corresponding to selected row data Data volume, wherein, data volume corresponding to selected row data adds 1 for data volume corresponding to the row data of last write-in;A4:Judge with the presence or absence of the row data of not selected mistake in each row data, if it is, performing A2;Otherwise, perform A5;A5:By data volume corresponding to the row data of last time write-in, it is defined as data volume corresponding to presently described database table.
- 4. according to the method for claim 3, it is characterised in thatIt is described judge the row data of not selected mistake are not present in each row data after, and described by last Quantity corresponding to the row data of secondary write-in, is defined as before data volume corresponding to presently described tables of data, further comprises:Attribute information corresponding to presently described database table is write into the formatted data template;The formatted data template of each row data, each data volume and the attribute information will be write, deposited Store up in specified file.
- 5. according to the method for claim 3, it is characterised in thatIt is described select the row data in each row data corresponding to presently described data after, and described by institute Before the row data of selection are written in default formatted data template, further comprise:Judge, with the presence or absence of the keyword that reports an error in selected row data, if it is, generating error information, and to perform described by institute The row data of selection are written to default formatted data template.
- 6. method according to any one of claims 1 to 5, it is characterised in thatThe attribute information includes at least one of English name, Chinese name, owning user and affiliated table space or a variety of.
- A kind of 7. data volume statistic device, it is characterised in that including:Determining module, for determining classification to be counted;Attribute acquisition module, in target database, obtaining the classification pair to be counted determined with the determining module The attribute information for each database table answered;Data acquisition module, for the attribute information according to acquired in the attribute acquisition module, obtain each described data Data corresponding to the table of storehouse;Processing module, at data corresponding to each described database table for being obtained to the data acquisition module Reason, determines data volume corresponding to each described database table;Summarizing module, collect for data volume corresponding to each database table for handling the processing module, obtain To data volume corresponding to the classification to be counted.
- 8. device according to claim 7, it is characterised in thatThe data acquisition module includes:Encapsulate submodule and data acquisition submodule;The encapsulation submodule, for each acquired attribute information to be encapsulated as into a table object respectively, wherein, Each described table object is respectively present corresponding property value;The data acquisition submodule, for the property value according to corresponding to each described table object, in the classification to be counted Data corresponding to each described table object are obtained in corresponding all database tables.
- 9. device according to claim 7, it is characterised in thatThe processing module, for being performed both by A1 to A5 for data corresponding to database table each described:A1:Determine each row data corresponding to presently described data;A2:The row data are selected in each row data;A3:Selected row data are written in default formatted data template, and write corresponding to selected row data Data volume, wherein, data volume corresponding to selected row data adds 1 for data volume corresponding to the row data of last write-in;A4:Judge with the presence or absence of the row data of not selected mistake in each row data, if it is, performing A2;Otherwise, perform A5;A5:By data volume corresponding to the row data of last time write-in, it is defined as data volume corresponding to presently described database table.
- 10. device according to claim 9, it is characterised in thatThe processing module, it is further used for attribute information corresponding to presently described database table writing the formatted data mould Plate;The formatted data template of each row data, each data volume and the attribute information will be write, is stored Into specified file;And/orThe processing module, it is further used for judging in selected row data with the presence or absence of the keyword that reports an error, if it is, generation Error information, and perform and described selected row data are written to default formatted data template.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711056050.1A CN107844561A (en) | 2017-11-01 | 2017-11-01 | A kind of data volume statistical method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711056050.1A CN107844561A (en) | 2017-11-01 | 2017-11-01 | A kind of data volume statistical method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107844561A true CN107844561A (en) | 2018-03-27 |
Family
ID=61681239
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711056050.1A Pending CN107844561A (en) | 2017-11-01 | 2017-11-01 | A kind of data volume statistical method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107844561A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019206302A1 (en) * | 2018-04-27 | 2019-10-31 | 杭州海康威视数字技术股份有限公司 | Method and device for acquiring database type |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102073701A (en) * | 2010-12-30 | 2011-05-25 | 浪潮集团山东通用软件有限公司 | Semantic definition-based multi-data source data querying method |
CN103942722A (en) * | 2014-03-14 | 2014-07-23 | 郁建林 | Networked data collaborative submission and statistical system and method based on workflow |
CN107220363A (en) * | 2017-06-07 | 2017-09-29 | 中国科学院信息工程研究所 | It is a kind of to support the global complicated cross-region querying method retrieved and system |
-
2017
- 2017-11-01 CN CN201711056050.1A patent/CN107844561A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102073701A (en) * | 2010-12-30 | 2011-05-25 | 浪潮集团山东通用软件有限公司 | Semantic definition-based multi-data source data querying method |
CN103942722A (en) * | 2014-03-14 | 2014-07-23 | 郁建林 | Networked data collaborative submission and statistical system and method based on workflow |
CN107220363A (en) * | 2017-06-07 | 2017-09-29 | 中国科学院信息工程研究所 | It is a kind of to support the global complicated cross-region querying method retrieved and system |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019206302A1 (en) * | 2018-04-27 | 2019-10-31 | 杭州海康威视数字技术股份有限公司 | Method and device for acquiring database type |
CN110427362A (en) * | 2018-04-27 | 2019-11-08 | 杭州海康威视数字技术股份有限公司 | A kind of method and device obtaining type of database |
CN110427362B (en) * | 2018-04-27 | 2022-03-08 | 杭州海康威视数字技术股份有限公司 | Method and device for acquiring database types |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8626702B2 (en) | Method and system for validation of data extraction | |
CN103810527B (en) | Data manipulation execution, data quality metric and data element coupling method and system | |
JP6680902B2 (en) | Settlement processing method, settlement processing device, terminal device and storage medium | |
CN110119395B (en) | Method for realizing association processing of data standard and data quality based on metadata in big data management | |
CN102232212A (en) | Mapping instances of a dataset within a data management system | |
US20210366055A1 (en) | Systems and methods for generating accurate transaction data and manipulation | |
US20140115012A1 (en) | Data model optimization using multi-level entity dependencies | |
CN107622103A (en) | Manage data query | |
CN109710237A (en) | A kind of online modification method of calibration and equipment based on customized two-dimentional report | |
CN106294128B (en) | A kind of automated testing method and device exporting report data | |
CN109656986A (en) | A kind of householder method that business datum summarizes, device and electronic equipment | |
US20220229854A1 (en) | Constructing ground truth when classifying data | |
CN106874484A (en) | The method and device that a kind of data are imported | |
US20230044288A1 (en) | Computer implemented system and method of enrichment of data for digital product definition in a heterogenous environment | |
CN109636303B (en) | Storage method and system for semi-automatically extracting and structuring document information | |
CN110378569A (en) | Industrial relations chain building method, apparatus, equipment and storage medium | |
CN112486989B (en) | Multi-source data granulation fusion and index classification and layering processing method | |
CN105447032A (en) | Method and system for processing message and subscription information | |
CN102707938A (en) | Table-form software specification manufacturing and supporting method and device | |
CN107844561A (en) | A kind of data volume statistical method and device | |
US20040205657A1 (en) | Method and system for linking project information | |
CN102902760B (en) | Method for detecting demand conflict relation | |
CN109324963A (en) | The method and terminal device of automatic test profitable result | |
WO2019004853A1 (en) | Method and apparatus for determining waiver applicability conditions and applying the conditions to multiple errors or warnings in physical verification tools | |
US7987203B2 (en) | Method of processing data for a system model |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180327 |