CN103049478B - Double-way buffering mechanism design method for Web services - Google Patents
Double-way buffering mechanism design method for Web services Download PDFInfo
- Publication number
- CN103049478B CN103049478B CN201210475846.1A CN201210475846A CN103049478B CN 103049478 B CN103049478 B CN 103049478B CN 201210475846 A CN201210475846 A CN 201210475846A CN 103049478 B CN103049478 B CN 103049478B
- Authority
- CN
- China
- Prior art keywords
- xml
- data
- cache
- caching
- way
- 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
- 230000007246 mechanism Effects 0.000 title claims abstract description 68
- 238000000034 method Methods 0.000 title claims abstract description 53
- 230000003139 buffering effect Effects 0.000 title abstract 10
- 230000008569 process Effects 0.000 claims abstract description 38
- 230000003068 static effect Effects 0.000 claims abstract description 9
- 238000007726 management method Methods 0.000 claims description 33
- 238000000151 deposition Methods 0.000 claims description 6
- 238000003860 storage Methods 0.000 claims description 6
- 230000008859 change Effects 0.000 claims description 4
- 238000012217 deletion Methods 0.000 claims description 4
- 230000037430 deletion Effects 0.000 claims description 4
- 230000006870 function Effects 0.000 claims description 3
- 238000004321 preservation Methods 0.000 claims description 3
- 238000013500 data storage Methods 0.000 claims description 2
- 230000001934 delay Effects 0.000 claims description 2
- 230000015572 biosynthetic process Effects 0.000 claims 1
- 230000001360 synchronised effect Effects 0.000 abstract 1
- 230000009471 action Effects 0.000 description 2
- 238000005192 partition Methods 0.000 description 2
- 230000009897 systematic effect Effects 0.000 description 2
- 238000002679 ablation Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000008717 functional decline Effects 0.000 description 1
- 239000004615 ingredient Substances 0.000 description 1
- 230000004899 motility Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Abstract
The invention provides a double-way buffering mechanism design method for Web services. Two buffering mechanisms based on dynamic pages and static pages perform double-way reading and writing through a database and an xml buffering file, synchronous operation is performed to trigger updated buffering mechanisms, an xml buffering module is used as a using library when a user accesses, a database in an application system is used as a standby library, and reading and writing operations of data are finished in the xml buffering file; and the design content comprises a management process, a reading process and a write-in process of a double-way buffering mechanism. The double-way buffering mechanism design method has the advantages that by means of the dynamic and static combined double-way buffering mechanism, timeliness and accuracy of a system in mass data processing can be improved to a large extent, and performances and service qualities of a Web server are improved.
Description
Technical field
The present invention relates to Computer Applied Technology field, specific saying is a kind of two-way caching mechanism of Web service
Method for designing.
Background technology
Due to traditional based on B/S(Browser/Server)The Web application systems of framework do not adopt load balancing machine
System, system of the application system that especially that large user's amount is accessed in peak period is accessed easily brings web information system thing
Business request response time extends, and handling capacity is reduced, the not high performance issue of resource utilization.Therefore, people are constantly looking for one
A little optimization methods are improving the performance of web information system.
At this stage, following shortcoming is primarily present based on the cache technology of the Web application systems of B/S frameworks:
1st, the characteristics of dynamic page for primarily now using is cached is that the content that Jing frequentations are asked is put in internal memory, and next time visits
The content in dynamic load internal memory is only needed to when asking, so as to alleviate the access pressure of application system.This caching mechanism shortcoming
It is too to be easily caused systematic function decline using internal memory, inefficient, caching is to take certain internal storage location, big data quantity
Access can take substantial amounts of internal storage location.So may result in data frequently to be loaded, it is possible to cause cache invalidation, and
Once release of the internal memory using excessive caching not in time, can cause server memory resource exhaustion, Web application systems can be caused to go out
Existing seemingly-dead phenomenon.
2nd, the characteristics of static page for primarily now using is cached is, using precompile mould plate technique, to be changed using data
Trigger mechanism, generates the static page with regard to data content, directly access generated static page during user accesses data and not
It is to access data base.The shortcoming of this mechanism is to be difficult to change again for the content of previously generated static page, and this just leads
Cause the reusability of this method poor, it is difficult to accomplish to change upgrading in time for data.
The content of the invention
The present invention proposes a kind of the double of Web service for the weak point of the caching technology presence of current Web application systems
Road caching mechanism method for designing.
The present invention is combined based on two kinds of caching mechanisms of dynamic page and static page, and a kind of two-way caching for proposing
Mechanism, the caching mechanism are to solve the technical problem as follows:Two-way is carried out by data base and xml cache files
Read-write, simultaneously operating triggering update caching mechanism, using xml cache modules as user access when use storehouse, application system
In data base as standby storehouse, the read-write operation of data is completed in xml cache files;The design content of the caching mechanism
It is made up of the write flow process of the management process of two-way caching mechanism, the reading flow process of two-way caching mechanism and two-way caching mechanism.
Below each ingredient of the two-way caching mechanism of the present invention is illustrated:
The management process of the two-way caching mechanism is:For the management of xml cachings and page cache is delayed by system
Deposit what management module unification was carried out, with regard to page cache module, for the page cache information not accessed within a certain period of time
Can be deleted, releasing memory;For xml is cached, the subregion storage tube data cached to carry out xml is specially established
Reason, the erasing time for xml are the marginal values that an xml cache file number is set according to the scale of application system, work as xml
When the xml document number of caching reaches threshold values, the managing process of caching management module can trigger the deletion of xml cache modules
Mechanism.This mechanism is deleted according to the principle that maximum duration is never called, and it can be ranked up according to access time first,
The xml document of the marginal value 10% not accessed by maximum duration carries out deletion action.
The reading flow process of the two-way caching mechanism is:When user carries out the read operation of data, application system first
Caching management module call managing process, judge in the xml cache modules of application system with the presence or absence of accessed data
Xml document, if existing, is directly read this file in xml cache modules, then parses data, returned in html modes
Back to user;If not existing, managing process is needed to remove the cache information for checking whether to there are the data in page cache, if depositing
, then these information are incorporated in xml cachings, then the treatment mechanism further according to xml goes the use for providing user, if not depositing
Then need managing process that the data table information of correlation is called from data base, then carry out the preservation of page cache.
The write flow process of the two-way caching mechanism is:When user carry out be registration etc. data typing operate when, use
Family can call cache management process after the page has filled in data message, then, and data are stored in data base, while in page cache
It is data cached with storage one in xml cachings;If there is the cache information of the data in page cache and xml cachings,
This is updated then data cached.
Additionally, the Web service two-way caching mechanism of the present invention can be expanded and be set according to the portfolio of Web service
It is fixed, with larger motility.The xml mechanism can meet cross-platform application demand, with good transplantability.
A kind of beneficial effect of two-way caching mechanism method for designing of Web service of the present invention is:The Web service two-way delays
The two-way caching mechanism that the mechanism of depositing is association of activity and inertia can largely improve application system server performance, improve system to magnanimity
The real-time and accuracy of data processing, mitigates the access pressure of application system server, improves the service quality to user.
Description of the drawings
Reading flow chart of the accompanying drawing 1 for the two-way caching mechanism of the Web service;
Write flow chart of the accompanying drawing 2 for the two-way caching mechanism of the Web service.
Specific embodiment
Below in conjunction with the accompanying drawings a kind of two-way caching mechanism method for designing of Web service of the present invention is made further specifically
It is bright.
The present invention is combined based on two kinds of caching mechanisms of dynamic page and static page, and a kind of two-way caching for proposing
Mechanism, is to carry out two-way read-write by data base and xml cache files, and the caching mechanism that simultaneously operating triggering updates is slow with xml
Use storehouse when storing module is accessed as user, the data base in application system exist as standby storehouse, the read-write operation of data
Complete in xml cache files;Its design content by the management process of two-way caching mechanism, the reading flow process of two-way caching mechanism and
Three part of the write flow process composition of two-way caching mechanism.
The technical characteristic of the caching mechanism is further appreciated that by embodiment of the present invention:
First, where in Web application systems, one subregion of establishment is used as xml cache module data storages, this
The size of individual subregion needs according to the real data yield of the system to set, certainly, can not be too big, user can be caused empty
Between waste, the establishment of this xml spatial cache the change of size and the establishment of xml cache files, deletes and management has
Caching management module carries out unified management.
Secondly, caching management module creates dynamic page caching mechanism using array, first defines an one-dimension array, array
Two elements of middle placement, first element is data cached for depositing, and second element is to represent that this is data cached
Jing existence times.First element is the loaded and displayed in data call, first has to judge that this data cached is when showing
No expired, this operation is judged mainly by the time of second element of element, and expired is not loaded with the buffer unit
It is expired just to delete the data, it is read out from data base again, and introduces cache function, when generates data cached and mark
Between.
Again, for two-way caching management process be by the unified scheduling of the caching management module of system and management, it is right
In page cache module, for the page cache information that certain hour is not accessed can be deleted, because what xml cachings took
It is not memory information but partition space, therefore in the design of the present invention, the erasing time for xml does not do strict rule
It is fixed, but the marginal value of an xml document number is established according to the size of the scale i.e. data volume of application system, when
When xml document in xml cache modules reaches a certain number of, in this programme, for the space that xml caches occupancy is done
The maximum amount of estimation, i.e., the maximum amount of cache contents only account for the 60%-80% of whole cache partitions, this ensure that the caching of xml
The stable operation of module, eliminates space and takes the danger for causing xml cache invalidations.When the xml document number of xml cachings reaches valve
When value, the managing process of caching management module can trigger the deleting mechanism of xml cache modules, and this mechanism is according to most long
The principle that time never calls is deleted, and it can be ranked up according to access time first, maximum duration do not access it is critical
The xml document of value 10% carries out deletion action, this ensures that theres the guarantor of the utilization of maximum space and the maximum quantity of xml cachings
Deposit, eliminate internal memory and constantly convert the problem that the systematic function for causing declines, improve the efficiency of user's access.
Additionally, as shown in figure 1, the reading flow process of two-way caching mechanism of the present invention is as follows:When user carries out the reading of data
During operation, the management module of application system can call managing process first, and thus process goes to judge that the xml in application system is cached
Whether there is the xml document of accessed data in module, if it does, this file in xml cache modules is just directly read,
Then data are parsed, user is returned in html modes;If in xml cache modules not existing data are accessed
Xml document, this is accomplished by the cache information that managing process goes to check whether to there are the data in page cache, if there is with regard to needing
These information are incorporated in xml cachings, then the treatment mechanism further according to xml goes the use for providing user, if do not deposited
, the data table information that managing process calls correlation from data base is at this time accomplished by, the preservation of page cache is then carried out,
With access of the user after facilitating to the information.
As shown in Fig. 2 the write flow process of two-way caching mechanism of the present invention is as follows:If what user was carried out is the data such as registration
Typing operation, user can call cache management process after the page has filled in data message, and thus process goes to judge that XML is slow
Whether there is the cache information of the data in depositing, if it does, content and the time of the data is just updated, if it does not, just
Write the data in XML cachings;Cache management process is called to go to judge delaying with the presence or absence of the data in page cache again
Information is deposited, if it does, content and the time of the data are just updated, if it does not, page cache is just write the data into, most
Data are stored in data base at last, and whole ablation process ensures the concordance of user data, are checked and are used with user friendly.
In addition to technical characteristic described in description, the known technology of those skilled in the art is.
Claims (4)
1. the two-way caching mechanism method for designing of a kind of Web service, it is characterised in that the caching mechanism be based on dynamic page and
Two kinds of caching mechanisms of static page combine, a kind of two-way caching mechanism of formation, are entered by data base and xml cache files
Row two-way read and write, simultaneously operating triggering update caching mechanism, using xml cache modules as user accesses when use storehouse, answer
With the data base in system as standby storehouse, the read-write operation of data is completed in xml cache files;The caching mechanism sets
Write flow process of the meter content by the management process of two-way caching mechanism, the reading flow process of two-way caching mechanism and two-way caching mechanism
Three parts constitute;
The process of realizing of the caching mechanism is:
First, where in Web application systems, one subregion of establishment is used as xml cache module data storages, this point
The size in area is set by the real data yield of Web application systems, the establishment of this xml spatial cache, the change of size
And establishment, deletion and the management of xml cache files all carry out unified management by caching management module;
Secondly, caching management module creates dynamic page caching mechanism using array, first defines an one-dimension array, puts in array
Put two elements, first element is data cached for depositing, and second element is to represent that this data cached has been deposited
In the time;First element is the loaded and displayed in data call, and the time represented by second element is used for judging that this delays
Whether deposit data expired, do not have it is expired be loaded with that this is data cached, it is expired just to delete the data, read from data base again
Take, and introduce cache function, generate data cached and tag time;
Again, unified scheduling and management are carried out to the management process that two-way is cached by the caching management module of system.
2. caching mechanism method for designing according to claim 1, it is characterised in that the management of the two-way caching mechanism
Journey is as follows:
Xml cachings and page cache are managed collectively by system cache management module, with regard to face cache module, in certain hour
The interior page cache information for not having to access can be deleted, releasing memory;For xml is cached, a subregion is specially established
The data cached storage managements of xml are carried out, and the erasing time for xml is an xml to be set according to the scale of application system to delay
The marginal value of file number is deposited, when the xml document number of xml cachings reaches threshold values, the management of caching management module is entered
Journey can trigger the deleting mechanism of xml cache modules.
3. caching mechanism method for designing according to claim 1, it is characterised in that the reading flow of the two-way caching mechanism
Journey is as follows:
When user carries out the read operation of data, the caching management module of application system first calls managing process, judges
Whether there is the xml document of accessed data in the xml cache modules of application system, if existing, directly read xml caching moulds
This file in block, then parses data, returns to user in html modes;If not existing, managing process is needed to go
Check whether there is the cache information of the data in page cache, if existing, these information are incorporated in xml cachings, so
Treatment mechanism further according to xml goes the use for providing user afterwards, if not existing, needs managing process that phase is called from data base
The data table information of pass, then carries out the preservation of page cache.
4. caching mechanism method for designing according to claim 1, it is characterised in that the write stream of the two-way caching mechanism
Journey is as follows:
When user carry out be log-on data typing operate when, user can call slow after the page has filled in data message, then
Managing process is deposited, data are stored in into data base, while storage one is data cached in page cache and xml cachings;If in page
There is the cache information of the data during face caches and xml is cached, then updated this data cached.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210475846.1A CN103049478B (en) | 2012-11-22 | 2012-11-22 | Double-way buffering mechanism design method for Web services |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210475846.1A CN103049478B (en) | 2012-11-22 | 2012-11-22 | Double-way buffering mechanism design method for Web services |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103049478A CN103049478A (en) | 2013-04-17 |
CN103049478B true CN103049478B (en) | 2017-05-03 |
Family
ID=48062119
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210475846.1A Active CN103049478B (en) | 2012-11-22 | 2012-11-22 | Double-way buffering mechanism design method for Web services |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103049478B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104281668A (en) * | 2014-09-28 | 2015-01-14 | 墨仕(厦门)电子商务有限公司 | Data processing method |
CN109582895A (en) * | 2018-12-04 | 2019-04-05 | 山东浪潮通软信息科技有限公司 | A kind of cache implementing method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6542967B1 (en) * | 1999-04-12 | 2003-04-01 | Novell, Inc. | Cache object store |
CN101154230A (en) * | 2006-09-30 | 2008-04-02 | 中兴通讯股份有限公司 | Responding method for large data volume specified searching web pages |
CN102081650A (en) * | 2010-12-29 | 2011-06-01 | 上海网达软件有限公司 | Method for rapidly displaying user interface of embedded type platform |
CN102184236A (en) * | 2011-05-16 | 2011-09-14 | 复旦大学 | Distance-based adaptive webpage replacement method in spatial database |
CN102609364A (en) * | 2012-02-14 | 2012-07-25 | 华中科技大学 | Cache exchange method |
-
2012
- 2012-11-22 CN CN201210475846.1A patent/CN103049478B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6542967B1 (en) * | 1999-04-12 | 2003-04-01 | Novell, Inc. | Cache object store |
CN101154230A (en) * | 2006-09-30 | 2008-04-02 | 中兴通讯股份有限公司 | Responding method for large data volume specified searching web pages |
CN102081650A (en) * | 2010-12-29 | 2011-06-01 | 上海网达软件有限公司 | Method for rapidly displaying user interface of embedded type platform |
CN102184236A (en) * | 2011-05-16 | 2011-09-14 | 复旦大学 | Distance-based adaptive webpage replacement method in spatial database |
CN102609364A (en) * | 2012-02-14 | 2012-07-25 | 华中科技大学 | Cache exchange method |
Also Published As
Publication number | Publication date |
---|---|
CN103049478A (en) | 2013-04-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103856567B (en) | Small file storage method based on Hadoop distributed file system | |
CN101493826B (en) | Database system based on WEB application and data management method thereof | |
CN100437590C (en) | Method for prefetching object | |
CN108810041A (en) | A kind of data write-in of distributed cache system and expansion method, device | |
US8818942B2 (en) | Database system with multiple layer distribution | |
CN109240946A (en) | The multi-level buffer method and terminal device of data | |
CN105701219B (en) | A kind of implementation method of distributed caching | |
CN104935648A (en) | High-cost-performance CDN system, and file pre-push and fragment buffer memory methods | |
CN101388824B (en) | File reading method and system under sliced memory mode in cluster system | |
CN103379156B (en) | Realize the mthods, systems and devices of memory space dynamic equalization | |
CN103678172A (en) | Local data cache management method and device | |
CN103237046A (en) | Distributed file system supporting mixed cloud storage application and realization method thereof | |
CN101329686A (en) | System for implementing network search caching and search method | |
CN103312624A (en) | Message queue service system and method | |
CN109344157A (en) | Read and write abruption method, apparatus, computer equipment and storage medium | |
CN110188080A (en) | Telefile Research of data access performance optimization based on client high-efficiency caching | |
CN108920616A (en) | A kind of metadata access performance optimization method, system, device and storage medium | |
CN107179878A (en) | The method and apparatus of data storage based on optimizing application | |
US20150281390A1 (en) | Intelligent File Pre-Fetch Based on Access Patterns | |
CN111209364A (en) | Mass data access processing method and system based on crowdsourcing map updating | |
CN112162846B (en) | Transaction processing method, device and computer readable storage medium | |
CN101217449B (en) | A remote call management procedure | |
CN109767274B (en) | Method and system for carrying out associated storage on massive invoice data | |
CN106777085A (en) | A kind of data processing method, device and data query system | |
CN107368608A (en) | The HDFS small documents buffer memory management methods of algorithm are replaced based on ARC |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |