CN106503038B - A kind of method and system of automatic buffer network request returned data - Google Patents
A kind of method and system of automatic buffer network request returned data Download PDFInfo
- Publication number
- CN106503038B CN106503038B CN201610830840.XA CN201610830840A CN106503038B CN 106503038 B CN106503038 B CN 106503038B CN 201610830840 A CN201610830840 A CN 201610830840A CN 106503038 B CN106503038 B CN 106503038B
- Authority
- CN
- China
- Prior art keywords
- data
- request
- label
- returned data
- returned
- 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.)
- Active
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/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
-
- 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/2228—Indexing structures
-
- 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/2453—Query optimisation
-
- 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/2455—Query execution
- G06F16/24552—Database cache management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Computer And Data Communications (AREA)
Abstract
The present invention relates to communication process field more particularly to a kind of method and system of automatic buffer network request returned data.The present invention is by distributing request label corresponding with network interface;The data that network request corresponding with the request label returns are obtained, initial data is obtained;The initial data is converted into the reference format that caching mechanism defines, obtains normal data;The normal data is parsed, the returned data of the network request is obtained;Create data cached table corresponding with the request label;The data cached table includes the first number and the returned data.Realize the returned data that the request of cache table buffer network is automatically created according to the structure of returned data.
Description
Technical field
The method of returned data is requested the present invention relates to communication process field more particularly to a kind of automatic buffer network and is
System.
Background technique
Internet application and development usually using http protocol to server-side request data, and need by data buffer storage this
It ground can be preferentially using local data when accessing identical data next time.There are two types of the scheme of caching is usual: one is
Using the buffer control technology of http protocol, is stated by the caching of protocol headers, cached automatically by HTTP client;It is another
It is the data structure relevant to business that developer provides according to network interface, designs client storage organization, number will be returned
According to being stored in local after parsing.
But the buffer control technology of above-mentioned http protocol, it is a kind of general caching technology, returned data cannot be parsed
Data structure can not polymerize the data of same-interface return so that inquiry operation can not be done according to the data field of return.
The above-mentioned mode that caching returned data method is designed by developer needs the distinct interface design caching for each server-side
Table, there are a large amount of overlapping development work, expend the time.
Summary of the invention
The technical problems to be solved by the present invention are: providing a kind of method of automatic buffer network request returned data and being
System realizes the returned data that the request of cache table buffer network is automatically created according to the structure of returned data.
In order to solve the above-mentioned technical problem, the technical solution adopted by the present invention are as follows:
The present invention provides a kind of method of automatic buffer network request returned data, comprising:
Distribute request label corresponding with network interface;
The data that network request corresponding with the request label returns are obtained, initial data is obtained;
The initial data is converted into the reference format that caching mechanism defines, obtains normal data;
The normal data is parsed, the returned data of the network request is obtained;
Create data cached table corresponding with the request label;The data cached table include first number and it is described
Returned data.
The present invention also provides a kind of systems of automatic buffer network request returned data, comprising:
Distribution module, for distributing request label corresponding with network interface;
First obtains module, and the data returned for obtaining network request corresponding with the request label obtain original
Beginning data;
Conversion module obtains normal data for the initial data to be converted into the reference format that caching mechanism defines;
Parsing module obtains the returned data of the network request for parsing the normal data;
First creation module, for creating data cached table corresponding with the request label;The data cached table
Including the first number and the returned data.
The beneficial effects of the present invention are: by distributing request label corresponding with network interface, be conducive to same
The data that there is the network interface of same request label to return for data cached table polymerization;Network request calls phase according to request label
The network interface answered;Foundation of the request marked as the returned data that converging network is requested in data cached table;Passing through will
The reference format that the same data conversion for requesting the corresponding network request of label to return is defined at caching mechanism, so as to parse
The data structure of normal data obtains the parameter name and parameter value of network request return;Certainly according to the data of network request return
It is dynamic to create data cached table corresponding with the request label, it can be according to network interface, required parameter and inquiry field in phase
Query statement is used in the data cached table answered, and inquires required data.
Detailed description of the invention
Fig. 1 is the flow diagram for the method that a kind of automatic buffer network of the present invention requests returned data;
Fig. 2 is the structural block diagram for the system that a kind of automatic buffer network of the present invention requests returned data;
Label declaration:
1, distribution module;2, first module is obtained;3, conversion module;4, parsing module;5, the first creation module.
Specific embodiment
To explain the technical content, the achieved purpose and the effect of the present invention in detail, below in conjunction with embodiment and cooperate attached
Figure is explained.
The most critical design of the present invention is: being automatically created slow by the data structure of parsing network request returned data
The returned data of deposit data table cache network request.
As shown in Figure 1, the present invention provides a kind of method of automatic buffer network request returned data, comprising:
Distribute request label corresponding with network interface;
The data that network request corresponding with the request label returns are obtained, initial data is obtained;
The initial data is converted into the reference format that caching mechanism defines, obtains normal data;
The normal data is parsed, the returned data of the network request is obtained;
Create data cached table corresponding with the request label;The data cached table include first number and it is described
Returned data.
Further, after creation data cached table corresponding with the request label, further includes:
Obtain configuration information;The configuration information includes major key field, sort field, index field and page turning control ginseng
Number;
The data cached table is configured according to the configuration information.
It seen from the above description, can Optimizing Queries operation by allocating cache tables of data, wherein can be by configuring major key
Field specifies the major key of data cached table;Data cached table can be that foundation is ranked up with sort field;For index field creation
Index, can accelerate inquiry velocity;Page turning control parameter includes current number of pages and every page of item number, and every page of item number may specify caching number
The record item number for including according to every page of table, can data record in the corresponding page of quick obtaining by current number of pages.
Further, further includes:
Obtain the effective time of the returned data;
Obtain the request time of network request;
According to the effective time and the request time, expired time is calculated;
Create global required list;The overall situation required list includes the name of the second number, the request label, network interface
Title, parameter name, the request time and the expired time.
Further, further includes:
Obtain the expired time of the returned data;
Create global required list;The overall situation required list includes the name of the second number, the request label, network interface
Title, parameter name, the request time and the expired time.
Seen from the above description, the expired time of network request returned data can be managed according to global required list, it is described complete
Office's required list includes the second number, can a record in unique identification overall situation required list;The overall situation required list further includes institute
Request label, the title of network interface, parameter name are stated, developer finds phase according to the title and parameter name of network interface
The request label answered, so as to carry out inquiry operation in data cached table corresponding with request label;The overall situation required list
It further include the request time, the request time can distinguish the multiple request to the identical network interface identical parameters;It is described complete
Office's required list further includes the expired time, when returned data is expired, is automatically deleted it from data cached table, can be automatic
Manage the life cycle of returned data.
Preferably, the expired time for obtaining the returned data has following two mode:
Mode one, the value for reading the parameter Cache-Control:max-age, max-age on http protocol response head are
The effective time of the returned data, unit are the second, and the expired time of returned data can be calculated since current time;
Mode two reads the parameter Expires on http protocol response head, and if there is setting, the value of the parameter is to return
The expired time of data;
Further, further includes:
Creation caching concordance list;The caching concordance list includes the label recorded in the global required list and asks with the overall situation
Seek the label for recording in table and recording in the corresponding data cached table.
Seen from the above description, caching concordance list records the record in global required list and the record in data cached table
Incidence relation can be quickly found out the returned data with certain network request recorded in global required list by caching concordance list.
Further, further includes:
Identical request label is distributed for the identical network interface of field and data structure of returned data.
Seen from the above description, it is distributed by field for returned data and the identical network interface of data structure identical
Label is requested, it can be achieved that the data that the network request of polymerization heterogeneous networks interface returns, are conducive to concentrate to returned data progress
Analysis and processing.Such as: existing Chinese language Course Examination score inquiry interface and mathematic subject total marks of the examination query interface, it is above-mentioned two
The field of the network request returned data of interface is identical as data structure, can by for Chinese language Course Examination score inquiry interface and
Mathematic subject total marks of the examination query interface distributes identical request label, realizes that the network request for polymerizeing above-mentioned two interface returns
Data, so as to carry out unified analysis and processing to returned data.
As shown in Fig. 2, the present invention also provides a kind of systems of automatic buffer network request returned data, comprising:
Distribution module 1, for distributing request label corresponding with network interface;
First obtains module 2, and the data returned for obtaining network request corresponding with the request label obtain original
Beginning data;
Conversion module 3 obtains criterion numeral for the initial data to be converted into the reference format that caching mechanism defines
According to;
Parsing module 4 obtains the returned data of the network request for parsing the normal data;
First creation module 5, for creating data cached table corresponding with the request label;The data cached table
Including the first number and the returned data.
Further, further includes:
Second obtains module, for obtaining configuration information;The configuration information includes major key field, sort field, index
Field and page turning control parameter;
Configuration module, for configuring the data cached table according to the configuration information.
Further, further includes:
Third obtains module, for obtaining the effective time of the returned data;
4th obtains module, for obtaining the request time of network request;
Computing module, for expired time to be calculated according to the effective time and the request time;
5th obtains module, for obtaining the expired time of the returned data;
Second creation module, for creating global required list;The overall situation required list includes the second number, request mark
Number, the title of network interface, parameter name, the request time and the expired time;
Third creation module, for creating caching concordance list;The caching concordance list includes remembering in the global required list
The label recorded in the label of record and the data cached table corresponding with being recorded in global required list.
Further, further includes:
Request label distribution module, for for returned data field and the identical network interface of data structure distribute it is identical
Request label.
The embodiment of the present invention one are as follows:
Distribute request label corresponding with network interface;
The data that network request corresponding with the request label returns are obtained, initial data is obtained;
The initial data is converted into the reference format that caching mechanism defines, obtains normal data;
The normal data is parsed, the returned data of the network request is obtained;
Create data cached table corresponding with the request label;The data cached table include first number and it is described
Returned data;
Obtain configuration information;The configuration information includes major key field, sort field, index field and page turning control ginseng
Number;
The data cached table is configured according to the configuration information;
Obtain the request time of network request;
Obtain the expired time of the returned data;
Create global required list;The overall situation required list includes the name of the second number, the request label, network interface
Title, parameter name, the request time and the expired time;
Creation caching concordance list;The caching concordance list includes the label recorded in the global required list and asks with the overall situation
Seek the label for recording in table and recording in the corresponding data cached table.
The embodiment of the present invention two are as follows:
Distribute request label IF1 corresponding with network interface host_name;
The data that network request corresponding with the request label IF1 returns are obtained, initial data is obtained, it is described original
Data are JSON data format, as follows:
" count ": 2, " items ": [
" id ": 1000, " name ": " app1_name ", " version ": " v1.0.0 ", " url ": " http: //
Down.host.com/app1.apk " },
" id ": 1001, " name ": " app2_name ", " version ": " v1.0.0 ", " url ": " http: //
down.host.com/app2.apk"}]};
The initial data is converted into the reference format that caching mechanism defines by resolver, obtains normal data, institute
It is as follows to state normal data;
GlobalValue={ " count ": 2 }
Data=[
" id ": 1000, " name ": " app1_name ", " version ": " v1.0.0 ", " url ": " http: //
Down.host.com/app1.apk " },
" id ": 1001, " name ": " app2_name ", " version ": " v1.0.0 ", " url ": " http: //
down.host.com/app2.apk”}
]
The normal data is parsed, the data of network request return, including parameter name and corresponding parameter value are obtained;
If current unlabelled data cached table identical with label IF1 is requested, creates data cached table, this is data cached
Table marked as IF1, the data cached table is as shown in table 1:
Table 1
First number | id | name | version | url |
1 | 1000 | app1_name | v1.0.0 | http://down.host.com/app1.apk |
2 | 1001 | app2_name | v1.0.0 | http://down.host.com/app2.apk |
The major key field for configuring data cached table marked as IF1 is id, sort field id, index field name,
Current number of pages in page turning control parameter is 1, and every page of item number is 5;According to above-mentioned configuration information, allocating cache tables of data, with id
For major key, and sorted from small to large according to id, can quick obtaining be less than the data record of default id value;Rope is established for name field
Draw, can be recorded accordingly according to name value quick obtaining;According to the setting in page turning control parameter, current cache tables of data is shown
Number of pages is first page, and at most five Xiang Jilu of display;
The relevant information of this network request is recorded in global required list, as shown in table 2:
Table 2
Caching concordance list such as table 3 corresponding with overall situation required list described in data cached table described in table 1 and table 2
It is shown:
Table 3
Second identifier | First identifier |
1 | 1 |
1 | 2 |
From the description of upper table it is found that the return of network request represented by the record that the second identifier in global required list is 1
It is 1 and 2 recorded data that data, which are the first identifiers in the data cached table marked as IF1,.
The embodiment of the present invention three are as follows:
Distribution module distributes request label corresponding with network interface;
First, which obtains module, obtains the data that network request corresponding with the request label returns, and obtains original number
According to;
The initial data is converted into the reference format that caching mechanism defines by conversion module, obtains normal data;
Parsing module parses the normal data, obtains the returned data of the network request;
First creation module creates data cached table corresponding with the request label;The data cached table includes the
One number and the returned data;
Second, which obtains module, obtains configuration information;The configuration information include major key field, sort field, index field and
Page turning control parameter;
Configuration module configures the data cached table according to the configuration information;
4th obtains the request time that module obtains network request;
5th acquisition module obtains the expired time of the returned data;
Second creation module creates global required list;The overall situation required list includes the second number, the request label, net
Title, parameter name, the request time and the expired time of network interface;
Third creation module creation caching concordance list;The caching concordance list includes the mark recorded in the global required list
Number and the data cached table corresponding with being recorded in global required list in the label that records.
In conclusion the present invention provides a kind of method and system of automatic buffer network request returned data, pass through distribution
Request label corresponding with network interface is conducive in same data cached table polymerization there is the network of same request label to connect
The data that mouth returns;Network request calls corresponding network interface according to request label;By the way that same request label is corresponding
The reference format that is defined at caching mechanism of data conversion that returns of network request, so as to parse the data knot of normal data
Structure obtains the parameter name and parameter value of network request return;The data creation returned according to network request and the request label
Corresponding data cached table can use in corresponding data cached table according to network interface, required parameter and inquiry field
Query statement inquires required data;It further, can Optimizing Queries operation by allocating cache tables of data;Further,
The life cycle of returned data can be managed automatically by global required list;Further, by cache concordance list be quickly found out with
The returned data of certain network request recorded in global required list;Further, polymerizable the identical network interface different parameters
Network request returned data.
The above description is only an embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalents made by bright specification and accompanying drawing content are applied directly or indirectly in relevant technical field, similarly include
In scope of patent protection of the invention.
Claims (10)
1. a kind of method of automatic buffer network request returned data characterized by comprising
Distribute request label corresponding with network interface;
The data that network request corresponding with the request label returns are obtained, initial data is obtained;
The initial data is converted into the reference format that caching mechanism defines, obtains normal data;
The normal data is parsed, the returned data of the network request is obtained;
Create data cached table corresponding with the request label;The data cached table includes the first number and the return
Data.
2. a kind of method of automatic buffer network request returned data according to claim 1, which is characterized in that creation with
After the corresponding data cached table of the request label, further includes:
Obtain configuration information;The configuration information includes major key field, sort field, index field and page turning control parameter;
The data cached table is configured according to the configuration information.
3. a kind of method of automatic buffer network request returned data according to claim 1, which is characterized in that also wrap
It includes:
Obtain the effective time of the returned data;
Obtain the request time of network request;
According to the effective time and the request time, expired time is calculated;
Create global required list;The overall situation required list includes the second number, the request label, the title of network interface, ginseng
Several titles, the request time and the expired time.
4. a kind of method of automatic buffer network request returned data according to claim 1, which is characterized in that also wrap
It includes:
Obtain the request time of network request;
Obtain the expired time of the returned data;
Create global required list;The overall situation required list includes the second number, the request label, the title of network interface, ginseng
Several titles, the request time and the expired time.
5. a kind of method of automatic buffer network request returned data according to claim 1, which is characterized in that also wrap
It includes:
Creation caching concordance list;The caching concordance list include the label recorded in global required list and with remember in global required list
Record the label recorded in the corresponding data cached table.
6. a kind of method of automatic buffer network request returned data according to claim 1, which is characterized in that also wrap
It includes:
Identical request label is distributed for the identical network interface of field and data structure of returned data.
7. a kind of system of automatic buffer network request returned data characterized by comprising
Distribution module, for distributing request label corresponding with network interface;
First obtains module, and the data returned for obtaining network request corresponding with the request label obtain original number
According to;
Conversion module obtains normal data for the initial data to be converted into the reference format that caching mechanism defines;
Parsing module obtains the returned data of the network request for parsing the normal data;
First creation module, for creating data cached table corresponding with the request label;The data cached table includes
First number and the returned data.
8. a kind of system of automatic buffer network request returned data according to claim 7, which is characterized in that also wrap
It includes:
Second obtains module, for obtaining configuration information;The configuration information includes major key field, sort field, index field
With page turning control parameter;
Configuration module, for configuring the data cached table according to the configuration information.
9. a kind of system of automatic buffer network request returned data according to claim 7, which is characterized in that also wrap
It includes:
Third obtains module, for obtaining the effective time of the returned data;
4th obtains module, for obtaining the request time of network request;
Computing module, for expired time to be calculated according to the effective time and the request time;
5th obtains module, for obtaining the expired time of the returned data;
Second creation module, for creating global required list;It is described the overall situation required list include the second number, the request label,
Title, parameter name, the request time and the expired time of network interface;
Third creation module, for creating caching concordance list;The caching concordance list includes recording in the global required list
The label recorded in label and the data cached table corresponding with being recorded in global required list.
10. a kind of system of automatic buffer network request returned data according to claim 7, which is characterized in that also wrap
It includes:
Request label distribution module, for for returned data field and the identical network interface of data structure distribute identical ask
Seek label.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610830840.XA CN106503038B (en) | 2016-09-19 | 2016-09-19 | A kind of method and system of automatic buffer network request returned data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610830840.XA CN106503038B (en) | 2016-09-19 | 2016-09-19 | A kind of method and system of automatic buffer network request returned data |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106503038A CN106503038A (en) | 2017-03-15 |
CN106503038B true CN106503038B (en) | 2019-10-11 |
Family
ID=58290297
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610830840.XA Active CN106503038B (en) | 2016-09-19 | 2016-09-19 | A kind of method and system of automatic buffer network request returned data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106503038B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106936921A (en) * | 2017-04-06 | 2017-07-07 | 福建新大陆软件工程有限公司 | A kind of network request buffered method and system |
CN107229699B (en) * | 2017-05-24 | 2020-06-30 | 四川长虹电器股份有限公司 | System and method for improving search experience of mobile terminal user |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102096712A (en) * | 2011-01-28 | 2011-06-15 | 深圳市五巨科技有限公司 | Method and device for cache-control of mobile terminal |
CN103955492A (en) * | 2014-04-17 | 2014-07-30 | 国网宁夏电力公司 | Method for storing data in electrical power system |
CN104580522A (en) * | 2015-01-30 | 2015-04-29 | 宁波凯智信息科技有限公司 | Client-server data synchronization method and system |
CN105933139A (en) * | 2016-03-30 | 2016-09-07 | 广东凯通软件开发有限公司 | Data processing method and device |
-
2016
- 2016-09-19 CN CN201610830840.XA patent/CN106503038B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN106503038A (en) | 2017-03-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3828723B1 (en) | Transparent discovery of semi-structured data schema | |
US8433724B2 (en) | System using content generator for dynamically regenerating one or more fragments of web page based on notification of content change | |
CN100596353C (en) | Method and system for providing log service | |
CN109670089A (en) | Knowledge mapping system and its figure server | |
CN102638584B (en) | Data distributing and caching method and data distributing and caching system | |
US20110022582A1 (en) | Indexing of Partitioned External Data Sources | |
CN103473234B (en) | A kind of method, apparatus and system from web-query system export report | |
US20090222454A1 (en) | Method and data processing system for restructuring web content | |
CN109151824B (en) | Library data service expansion system and method based on 5G architecture | |
EP1128277A3 (en) | Data processing method and system, program for realizing the method, and computer readable storage medium storing the program | |
CN107622055A (en) | A kind of quick method for realizing data, services issue | |
CN101098248A (en) | Method and system for implementing universal network management based on configuration describing document | |
CN101206648A (en) | Network service generating system and method | |
CN106648917B (en) | A kind of method and system that difference update is data cached | |
CN101464879B (en) | Method and system for implementing dynamic catalog based on regulation | |
DE10052313A1 (en) | Access regulation method of content producer's server in internet, involves changing initial uniform resource locators stored in server of content distributor based on requirement | |
CN106294826A (en) | A kind of company-data Query method in real time and system | |
CN109344122A (en) | A kind of distributed meta-data management method and system for creating strategy in advance based on file | |
CN109726004A (en) | A kind of data processing method and device | |
CN101256599A (en) | System for gathering data of distributing simulation platform based on grid | |
CN106919438A (en) | Workflow processing method and framework in a kind of virtualized environment | |
CN106503038B (en) | A kind of method and system of automatic buffer network request returned data | |
CN108733701A (en) | A kind of query page buffer control method applied to online education | |
CN106940715B (en) | A kind of method and apparatus of the inquiry based on concordance list | |
CN109753283B (en) | Authority control method and device for processing front-end page |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |