CN109800331A - Method for reading data and device, date storage method and device - Google Patents
Method for reading data and device, date storage method and device Download PDFInfo
- Publication number
- CN109800331A CN109800331A CN201811558961.9A CN201811558961A CN109800331A CN 109800331 A CN109800331 A CN 109800331A CN 201811558961 A CN201811558961 A CN 201811558961A CN 109800331 A CN109800331 A CN 109800331A
- Authority
- CN
- China
- Prior art keywords
- label
- father
- xml message
- data
- field
- 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
- 238000000034 method Methods 0.000 title claims abstract description 44
- 239000011159 matrix material Substances 0.000 claims abstract description 24
- 238000013500 data storage Methods 0.000 claims description 8
- 238000000605 extraction Methods 0.000 claims description 5
- 230000000694 effects Effects 0.000 abstract description 2
- 230000006870 function Effects 0.000 description 2
- 239000000470 constituent Substances 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of method for reading data, comprising: receives the keyword of the XML message to be read of user's input, and determines father's label of XML message according to keyword;Father's label is added to preset aiming field, inquires target matrix corresponding with aiming field in the database;The data content of the field item in target matrix is read, XML message is obtained.That is, for the XML message arbitrarily to be read, as long as determining his father's label, so that it may replace father's label, in order to be inquired in the database, to improve data-handling efficiency, reduce development amount with general aiming field.Correspondingly, a kind of reading data device, a kind of date storage method and device disclosed by the invention, similarly have above-mentioned technique effect.
Description
Technical field
The present invention relates to database technical fields, more specifically to a kind of method for reading data and device, a kind of number
According to storage method and device.
Background technique
In the prior art, when needing to read desired XML message from database, need technical staff according to data
Library directory is searched one by one, and since database object is numerous, search efficiency is slow, obtains not so as to cause data reading performance using redundancy
To raising.Alternatively, technical staff writes corresponding reading program according to the XML message currently to be read, the program write is utilized
Lookup reading is carried out, and when due to reading data every time, requiring technical staff is that the current data for wanting to read write reading
Program causes development amount to increase to increase the workload of technical staff, reduces reading efficiency.
Correspondingly, when needing to be stored in XML message, it is also desirable to which technical staff writes according to the XML message currently to be stored
Corresponding storage program, this equally also increases the workload of technical staff, development amount is caused to increase, and reduces storage effect
Rate.
Wherein, the expression of relationship and record between XML message support arbitrary data.Such as: in personal reference report XML, meeting
A personally identifiable information is recorded, and is associated with a plurality of credit operation information of this person, can be associated with again under every credit operation information
A plurality of refund records information, and final entry goes out a people and corresponds to multiple credit operation information, this information association gets up to be stored in data
Library, i.e. constituent relation type database.In relevant database, based on tables of data, different numbers are showed by the external key of table
One-to-one, many-one relationship between.Relevant database such as Mysql, Oracle, PostgreSQL, DB2 etc..
Therefore, data-handling efficiency how is improved, development amount is reduced, is that those skilled in the art need what is solved to ask
Topic.
Summary of the invention
The purpose of the present invention is to provide a kind of method for reading data and device, a kind of date storage method and device, with
Data-handling efficiency is improved, development amount is reduced.
To achieve the above object, the embodiment of the invention provides following technical solutions:
A kind of method for reading data, comprising:
The keyword of the XML message to be read of user's input is received, and determines father's label of XML message according to keyword;
Father's label is added to preset aiming field, inquires target data corresponding with aiming field in the database
Table;
The data content of the field item in target matrix is read, XML message is obtained.
Wherein, father's label of XML message is determined according to keyword, comprising:
Keyword is determined as to father's label of XML message.
Wherein, the data content for reading the field item in target matrix, obtains XML message, comprising:
Read the data content of the field item in target matrix;
Data content is added to preset FTL file, XML message is obtained by FTL file;
Wherein, the father's label and aiming field of XML message have been stored in advance in FTL file.
Wherein, XML message is obtained by FTL file, comprising:
FTL file is traversed, according to the transformational relation and data content of father's label and aiming field, generates XML message.
A kind of reading data device, comprising:
Receiving module, the keyword of the XML message to be read for receiving user's input, and XML is determined according to keyword
Father's label of message;
Enquiry module is inquired and aiming field pair in the database for father's label to be added to preset aiming field
The target matrix answered;
Read module obtains XML message for reading the data content of the field item in target matrix.
A kind of date storage method, comprising:
Obtain XML message to be stored;
The label of XML message is extracted, label includes: the subtab of father's label and father's label;
Father's label is determined as to the table name of tables of data, and subtab is determined as to the field item in tables of data;
The data content of subtab is stored into field item, and tables of data is stored in database.
Wherein, the data content of subtab is stored into field item, comprising:
The major key field of the data content of subtab and father's label is stored into field item.
Wherein, the major key field of the data content of subtab and father's label is stored into field item, comprising:
The major key field of the data content of subtab and father's label is stored into field item according to breadth-first algorithm.
Wherein, further includes:
When there are multiple father's labels or multiple subtabs, by marking multiple father's labels or multiple sons respectively from increasing number
Label.
A kind of data storage device, comprising:
Module is obtained, for obtaining XML message to be stored;
Extraction module, for extracting the label of XML message, label includes: the subtab of father's label and father's label;
Subtab for father's label to be determined as to the table name of tables of data, and is determined as the word in tables of data by determining module
Duan Xiang;
Tables of data for storing the data content of subtab into field item, and is stored in database by memory module.
By above scheme it is found that a kind of method for reading data provided in an embodiment of the present invention, comprising: receive user's input
XML message to be read keyword, and determine according to keyword father's label of XML message;Father's label is added to preset
Aiming field inquires target matrix corresponding with aiming field in the database;Read the field item in target matrix
Data content obtains XML message.
As it can be seen that method for reading data receive user input XML message to be read keyword when, according to keyword
Determine father's label of current XML message;And father's label is added to preset aiming field, it may be assumed that utilize general aiming field
Instead of father's label, and then target matrix corresponding with aiming field is inquired in the database;Read the word in target matrix
The data content of section item, to obtain the XML message for wanting to read.That is, for the XML message arbitrarily to be read, as long as
Determine his father's label, so that it may father's label is replaced with general aiming field, in order to be inquired in the database.I.e.
This method can use for the XML message for arbitrarily wanting to read and realize reading, improve data reading performance using redundancy, reduce out
Send out workload.
Correspondingly, the embodiment of the invention also provides a kind of data storage sides corresponding with a kind of above-mentioned method for reading data
Method, comprising: obtain XML message to be stored;The label of XML message is extracted, label includes: the son mark of father's label and father's label
Label;Father's label is determined as to the table name of tables of data, and subtab is determined as to the field item in tables of data;By the data of subtab
Content stores into field item, and tables of data is stored in database.As it can be seen that for the XML message for arbitrarily wanting deposit database,
As long as determining the father's label and subtab of XML message, so that it may current XML are stored in database in the form of tables of data, mentioned
The high versatility storage of data, improves storage efficiency, reduces development amount.
To sum up, a kind of method for reading data and device provided in an embodiment of the present invention, a kind of date storage method and device,
General database access operation can be realized for the XML message of different data structure, improved data-handling efficiency, reduced
Development amount.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of method for reading data flow chart disclosed by the embodiments of the present invention;
Fig. 2 is a kind of reading data schematic device disclosed by the embodiments of the present invention;
Fig. 3 is a kind of date storage method flow chart disclosed by the embodiments of the present invention;
Fig. 4 is a kind of data storage device schematic diagram disclosed by the embodiments of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
The embodiment of the invention discloses a kind of method for reading data and device, a kind of date storage method and device, to mention
High data-handling efficiency reduces development amount.
Referring to Fig. 1, a kind of method for reading data provided in an embodiment of the present invention, comprising:
S101, receive user's input XML message to be read keyword, and determine according to keyword the father of XML message
Label;
Wherein, father's label of XML message is determined according to keyword, comprising: mark the father that keyword is determined as XML message
Label.
S102, father's label is added to preset aiming field, inquires target corresponding with aiming field in the database
Tables of data;
S103, read target matrix in field item data content, obtain XML message.
Preferably, the data content for reading the field item in target matrix, obtains XML message, comprising: reads number of targets
According to the data content of the field item in table;Data content is added to preset FTL file, XML report is obtained by FTL file
Text;Wherein, the father's label and aiming field of XML message have been stored in advance in FTL file.
Wherein, XML message is obtained by FTL file, comprising: traversal FTL file, according to turn of father's label and aiming field
Relationship and data content are changed, XML message is generated.
As it can be seen that present embodiments providing a kind of method for reading data, this method is in the XML to be read for receiving user's input
When the keyword of message, father's label of current XML message is determined according to keyword;And father's label is added to preset target word
Section, it may be assumed that replace father's label using general aiming field, and then inquire target data corresponding with aiming field in the database
Table;The data content of the field item in target matrix is read, to obtain the XML message for wanting to read.That is, for appointing
It is intended to the XML message read, as long as determining his father's label, so that it may father's label is replaced with general aiming field, so as to
In being inquired in the database.This method can use for the XML message for arbitrarily wanting to read and realize reading, improve
Data reading performance using redundancy, reduces development amount.
A kind of reading data device provided in an embodiment of the present invention is introduced below, a kind of data described below are read
Take device can be cross-referenced with a kind of above-described method for reading data.
Referring to fig. 2, a kind of reading data device provided in an embodiment of the present invention, comprising:
Receiving module 201, the keyword of the XML message to be read for receiving user's input, and determined according to keyword
Father's label of XML message;
Enquiry module 202, for father's label to be added to preset aiming field, in the database inquiry and aiming field
Corresponding target matrix;
Read module 203 obtains XML message for reading the data content of the field item in target matrix.
Wherein, receiving module is specifically used for:
Keyword is determined as to father's label of XML message.
Wherein, read module includes:
Reading unit, for reading the data content of the field item in target matrix;
Adding unit obtains XML message by FTL file for data content to be added to preset FTL file;
Wherein, the father's label and aiming field of XML message have been stored in advance in FTL file.
Wherein, adding unit is specifically used for:
FTL file is traversed, according to the transformational relation and data content of father's label and aiming field, generates XML message.
As it can be seen that present embodiments providing a kind of reading data device, comprising: receiving module, enquiry module and reading mould
Block.The keyword of the XML message to be read of user's input is received by receiving module first, and XML message is determined according to keyword
Father's label;Then father's label is added to preset aiming field by enquiry module, in the database inquiry and aiming field pair
The target matrix answered;The data content for the field item that module is read in target matrix is last read, XML message is obtained.Such as
Share out the work and help one another between this modules, Each performs its own functions, to improve data reading performance using redundancy, reduces development amount.
The embodiment of the invention discloses a kind of date storage method, a kind of data of the present embodiment and above-described embodiment description
Read method is corresponding, therefore can be cross-referenced.
Referring to Fig. 3, a kind of date storage method provided in an embodiment of the present invention, comprising:
S301, XML message to be stored is obtained;
S302, the label for extracting XML message, label includes: the subtab of father's label and father's label;
S303, the table name that father's label is determined as to tables of data, and subtab is determined as to the field item in tables of data;
S304, the data content of subtab is stored into field item, and tables of data is stored in database.
Preferably, the data content of subtab is stored into field item, comprising: by the data content of subtab and father
The major key field of label is stored into field item.
Wherein, the major key field of the data content of subtab and father's label is stored into field item, comprising: according to width
Degree priority algorithm stores the major key field of the data content of subtab and father's label into field item.
It should be noted that further include: when there are multiple father's labels or multiple subtabs, by being marked respectively from increasing number
Remember multiple father's labels or multiple subtabs.
As it can be seen that present embodiments providing a kind of date storage method, method is reported for arbitrarily wanting the XML of deposit database
Text, as long as determining the father's label and subtab of XML message, so that it may current XML is stored in database in the form of tables of data,
The versatility for improving data storage, improves storage efficiency, reduces development amount.
A kind of data storage device provided in an embodiment of the present invention is introduced below, a kind of data described below are deposited
Storage device can be cross-referenced with a kind of above-described date storage method.
Referring to fig. 4, a kind of data storage device provided in an embodiment of the present invention, comprising:
Module 401 is obtained, for obtaining XML message to be stored;
Extraction module 402, for extracting the label of XML message, label includes: the subtab of father's label and father's label;
Determining module 403 is determined as in tables of data for father's label to be determined as to the table name of tables of data, and by subtab
Field item;
Tables of data for storing the data content of subtab into field item, and is stored in data by memory module 404
Library.
Wherein, memory module is specifically used for:
The major key field of the data content of subtab and father's label is stored into field item.
Wherein, memory module is specifically used for:
The major key field of the data content of subtab and father's label is stored into field item according to breadth-first algorithm.
Wherein, further includes:
Mark module, it is multiple by being marked respectively from increasing number for when there are multiple father's labels or multiple subtabs
Father's label or multiple subtabs.
As it can be seen that present embodiments providing a kind of data storage device, comprising: obtain module, extraction module determining module with
And memory module.XML message to be stored is obtained by acquisition module first;And then extraction module extracts the label of XML message, mark
Label include: the subtab of father's label and father's label;Then father's label is determined as the table name of tables of data by determining module, and by sub- mark
Sign the field item being determined as in tables of data;Last memory module stores the data content of subtab into field item, and will count
Database is stored according to table.Share out the work and help one another between such modules, Each performs its own functions, to improve storage efficiency, reduces out
Send out workload.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with other
The difference of embodiment, the same or similar parts in each embodiment may refer to each other.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention.
Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest scope of cause.
Claims (10)
1. a kind of method for reading data characterized by comprising
The keyword of the XML message to be read of user's input is received, and determines that the father of the XML message marks according to the keyword
Label;
Father's label is added to preset aiming field, inquires number of targets corresponding with the aiming field in the database
According to table;
The data content for reading the field item in the target matrix, obtains the XML message.
2. method for reading data according to claim 1, which is characterized in that described according to keyword determination
Father's label of XML message, comprising:
The keyword is determined as to father's label of the XML message.
3. method for reading data according to claim 1 or 2, which is characterized in that described to read in the target matrix
Field item data content, obtain the XML message, comprising:
Read the data content of the field item in the target matrix;
The data content is added to preset FTL file, the XML message is obtained by the FTL file;
Wherein, be stored in advance in the FTL file XML message father's label and the aiming field.
4. method for reading data according to claim 3, which is characterized in that it is described obtained by the FTL file it is described
XML message, comprising:
The FTL file is traversed, according to the transformational relation and the data content of father's label and the aiming field,
Generate the XML message.
5. a kind of reading data device characterized by comprising
Receiving module, the keyword of the XML message to be read for receiving user's input, and according to keyword determination
Father's label of XML message;
Enquiry module, for father's label to be added to preset aiming field, inquiry and the target word in the database
The corresponding target matrix of section;
Read module obtains the XML message for reading the data content of the field item in the target matrix.
6. a kind of date storage method characterized by comprising
Obtain XML message to be stored;
The label of the XML message is extracted, the label includes: the subtab of father's label and father's label;
Father's label is determined as to the table name of tables of data, and the subtab is determined as to the field item in the tables of data;
The data content of the subtab is stored into the field item, and the tables of data is stored in database.
7. date storage method according to claim 6, which is characterized in that the data content by the subtab is deposited
Storage is into the field item, comprising:
The major key field of the data content of the subtab and father's label is stored into the field item.
8. date storage method according to claim 7, which is characterized in that the data content by the subtab with
And the major key field of father's label is stored into the field item, comprising:
The major key field of the data content of the subtab and father's label is stored to described according to breadth-first algorithm
In field item.
9. according to date storage method described in claim 6-8 any one, which is characterized in that further include:
When there are multiple father's labels or multiple subtabs, by marking the multiple father's label or multiple sons respectively from increasing number
Label.
10. a kind of data storage device characterized by comprising
Module is obtained, for obtaining XML message to be stored;
Extraction module, for extracting the label of the XML message, the label includes: the son mark of father's label and father's label
Label;
Determining module is determined as the data for father's label to be determined as to the table name of tables of data, and by the subtab
Field item in table;
Memory module for storing the data content of the subtab into the field item, and the tables of data is stored in
Database.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811558961.9A CN109800331A (en) | 2018-12-19 | 2018-12-19 | Method for reading data and device, date storage method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811558961.9A CN109800331A (en) | 2018-12-19 | 2018-12-19 | Method for reading data and device, date storage method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109800331A true CN109800331A (en) | 2019-05-24 |
Family
ID=66557207
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811558961.9A Pending CN109800331A (en) | 2018-12-19 | 2018-12-19 | Method for reading data and device, date storage method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109800331A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114154020A (en) * | 2021-12-01 | 2022-03-08 | 南方电网深圳数字电网研究院有限公司 | Large-capacity data processing method and device based on dynamic label mapping |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103020318A (en) * | 2013-01-10 | 2013-04-03 | 北京锐安科技有限公司 | Method for maintenance of database tables in database |
WO2014187121A1 (en) * | 2013-05-23 | 2014-11-27 | 中国科学院计算机网络信息中心 | Multi-root peer analytic method for identifications in internet of things |
US20150293764A1 (en) * | 2014-04-10 | 2015-10-15 | Omprakash VISVANATHAN | Method and system to compose and execute business rules |
CN106021594A (en) * | 2016-06-06 | 2016-10-12 | 福建榕基软件股份有限公司 | Database table and XML message mapping processing method and system |
CN106126564A (en) * | 2016-06-17 | 2016-11-16 | 浙江万朋教育科技股份有限公司 | A kind of method rendered based on dynamic template language |
CN108062312A (en) * | 2016-11-07 | 2018-05-22 | 方正璞华软件(武汉)股份有限公司 | A kind of method for parsing FTL template elements |
CN108132925A (en) * | 2017-12-15 | 2018-06-08 | 中盈优创资讯科技有限公司 | A kind of report file generation method and device |
-
2018
- 2018-12-19 CN CN201811558961.9A patent/CN109800331A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103020318A (en) * | 2013-01-10 | 2013-04-03 | 北京锐安科技有限公司 | Method for maintenance of database tables in database |
WO2014187121A1 (en) * | 2013-05-23 | 2014-11-27 | 中国科学院计算机网络信息中心 | Multi-root peer analytic method for identifications in internet of things |
US20150293764A1 (en) * | 2014-04-10 | 2015-10-15 | Omprakash VISVANATHAN | Method and system to compose and execute business rules |
CN106021594A (en) * | 2016-06-06 | 2016-10-12 | 福建榕基软件股份有限公司 | Database table and XML message mapping processing method and system |
CN106126564A (en) * | 2016-06-17 | 2016-11-16 | 浙江万朋教育科技股份有限公司 | A kind of method rendered based on dynamic template language |
CN108062312A (en) * | 2016-11-07 | 2018-05-22 | 方正璞华软件(武汉)股份有限公司 | A kind of method for parsing FTL template elements |
CN108132925A (en) * | 2017-12-15 | 2018-06-08 | 中盈优创资讯科技有限公司 | A kind of report file generation method and device |
Non-Patent Citations (2)
Title |
---|
沙飞: "网络信息审计关键技术的研究与实现", 《中国优秀硕士学位论文全文数据库信息科技辑》 * |
耿晓君等: "Struts2下基于FreeMarker的XML数据输出与ExtJS的解析实现", 《江苏广播电视大学学报》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114154020A (en) * | 2021-12-01 | 2022-03-08 | 南方电网深圳数字电网研究院有限公司 | Large-capacity data processing method and device based on dynamic label mapping |
CN114154020B (en) * | 2021-12-01 | 2024-05-14 | 南方电网数字平台科技(广东)有限公司 | High-capacity data processing method and device based on dynamic label mapping |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103853820B (en) | Data processing method and data processing system | |
CN104536904B (en) | A kind of method of data management, equipment and system | |
CN104142954B (en) | A kind of tables of data based on frequency subregion compares update method and device | |
CN102982130A (en) | Synchronized method for not only structured query language (NOSQL) and relational database management system (RDBMS) database and system thereof | |
JP2004532478A5 (en) | ||
CN103336849A (en) | Method and device for increasing retrieval speed in database retrieval system | |
CN109213598A (en) | A kind of resource allocation methods, device and computer readable storage medium | |
CN106095964A (en) | A kind of method that data are carried out visualization filing and search | |
CN110196847A (en) | Data processing method and device, storage medium and electronic device | |
CN102129425A (en) | Method and device for accessing large-object set table in data warehouse | |
US9430473B1 (en) | Data table performance optimization | |
CN104281717B (en) | A kind of method for setting up magnanimity ID mapping relations | |
CN108269131A (en) | A kind of user information based on ASCII character is registered method and device | |
CN112100181B (en) | Data resource management method based on sand table | |
CN104951462A (en) | Method and system for managing data base | |
CN107886265B (en) | Method for realizing super BOM data management in product data management system | |
CN101963993B (en) | Method for fast searching database sheet table record | |
CN113722533B (en) | Information pushing method and device, electronic equipment and readable storage medium | |
CN109800331A (en) | Method for reading data and device, date storage method and device | |
CN103605797A (en) | Data storage and inquiry devices and data storage and inquiry methods | |
CN106296324A (en) | A kind of leasing system | |
CN107786633A (en) | Water meter querying method and Internet of things system based on compound Internet of Things | |
CN111190923A (en) | Electronic bill query method and device, storage medium and electronic equipment | |
CN103020107B (en) | The method of multifunctional certificate intellectual access management | |
CN102306247A (en) | Network customer service and pass management system based on doctor on-line interaction |
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 |
Application publication date: 20190524 |
|
RJ01 | Rejection of invention patent application after publication |