CN110020373A - The method and apparatus that static page is stored, browsed - Google Patents

The method and apparatus that static page is stored, browsed Download PDF

Info

Publication number
CN110020373A
CN110020373A CN201711455169.6A CN201711455169A CN110020373A CN 110020373 A CN110020373 A CN 110020373A CN 201711455169 A CN201711455169 A CN 201711455169A CN 110020373 A CN110020373 A CN 110020373A
Authority
CN
China
Prior art keywords
page
static
storage group
browsing
static page
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
Application number
CN201711455169.6A
Other languages
Chinese (zh)
Inventor
干天星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201711455169.6A priority Critical patent/CN110020373A/en
Publication of CN110020373A publication Critical patent/CN110020373A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions

Abstract

The invention discloses a kind of storages of static page, the method and apparatus of browsing, are related to field of computer technology.One specific embodiment of this method includes: the page info for obtaining static page, and the page info includes page ID;According to banking rule, page storage group corresponding with the page ID is obtained;The static page is stored to the page storage group.The embodiment is because of page ID and the banking rule according to static page, static page is stored, so overcoming the problem of prior art is not suitable for the big problem of page amount and heavy dependence Redis, it accesses the browsing of the magnanimity page to be isolated with upstream business interface, infrastructure service, greatly improves the stability of the browsing access of the magnanimity page.

Description

The method and apparatus that static page is stored, browsed
Technical field
The present invention relates to field of computer technology more particularly to the method and apparatus of a kind of storage of static page, browsing.
Background technique
Present internet development is more and more rapider, higher and higher to the performance requirement of website, when the feelings for high concurrent number occur Condition will affect the normal access of the page if program, upstream business interface, database etc. break down.It is visited to solve the page The Dependence Problem asked carries out whole page static to the page in advance in the prior art, then the content of pages is pushed directly to and is answered With under the hard disk catalogue of service;When page browsing requests to reach, the static page directly read under specified directory is returned. Or using above-mentioned similar method page push into Redis storage system, page browsing request reach when, directly from It is read in Redis.
In realizing process of the present invention, at least there are the following problems in the prior art for inventor's discovery:
1. hard-disk capacity is limited, the prior art is not suitable for the big situation of page amount.
2. heavy dependence Redis, once Redis breaks down, all pages all can not be accessed normally.
3. in the prior art just carry out real-time rendering after reading the page under specified directory, if being lost in this way in caching In the case where effect, a large amount of processing in real time will lead to the collapse of server.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of method and apparatus that static page is stored, browsed, it can be according to quiet Page ID and the banking rule of the state page, store static page, are browsed, and are not suitable for so overcoming the prior art The big problem of page amount and the problem of heavy dependence Redis, accesses the browsing of the magnanimity page and upstream business interface, basis (such as database) isolation is serviced, the stability of the browsing access of the magnanimity page is greatly improved.
To achieve the above object, according to an aspect of an embodiment of the present invention, a kind of side for storing static page is provided Method, comprising: obtain the page info of static page, the page info includes page ID;According to banking rule, obtain with The corresponding page storage group of the page ID;The static page is stored to the page storage group.
Optionally, the page ID includes the random number started with English alphabet or Arabic numerals;The banking Rule includes: the one-to-one relationship of page group Yu page storage group;The page group includes: the English started according to random number Letter or Arabic numerals, are divided into N number of page group for page ID, N is positive integer.
Optionally, the page storage group includes application server hard disk;The static page is stored to the page Storage group, comprising: use Message Digest 5, message digest value is obtained according to the page info of static page;In the application Using last position of message digest value as first class catalogue name in server hard disc, file is established under the first class catalogue;It will The title of the message digest value penultimate and antepenulatimate as file;The static page is stored to file In folder, and using the message digest value as the filename of the static page.
Optionally, the page storage group includes Q application server hard disk, is deposited in the Q application server hard disk Contain identical static page;Q is positive integer, Q > 1.
Optionally, before the page info for obtaining static page, comprising: obtain page data from database;Root The page is rendered according to the page data, obtains the page info of static page.
To achieve the above object, according to an embodiment of the present invention in another aspect, provide a kind of static page browsing method, Include: reception browse request, includes page ID in the browse request;According to banking rule, obtain and the page ID Corresponding page storage group;Static page corresponding with the page ID is obtained from the page storage group, realizes the page Browsing;Wherein, the static page is using the method for the storage static page as described in any of the above-described stores.
Optionally, after the reception browse request, comprising: judge to whether there is and the page ID in shared drive Corresponding static page;If it is present obtaining static page corresponding with the page ID from shared drive, the page is realized Browsing, terminate;If it does not exist, then executing according to banking rule, page storage corresponding with the page ID is obtained The step of group;It include using M static page of lru algorithm caching in the shared drive, M is positive integer.
Optionally, the page storage group includes packetized memory;It obtains from the page storage group and believes with the page Cease corresponding static page, comprising: judge in packetized memory with the presence or absence of static page corresponding with the page ID;If In the presence of then obtaining corresponding with page ID static page from packetized memory;If it does not exist, then hard from application server Static page corresponding with the page ID is obtained in disk;It include the P storage using lru algorithm caching in the packetized memory In the static page of the page storage group, P is positive integer.
To achieve the above object, according to an embodiment of the present invention in another aspect, provide it is a kind of store static page dress It sets, comprising: data obtaining module, grouping module, memory module;The data obtaining module, is used for: obtaining the page of static page Face information, the page info include page ID;The grouping module, is used for: according to banking rule, obtaining and the page The corresponding page storage group of face ID;The memory module, is used for: the static page is stored to the page storage group.
Optionally, the page ID includes the random number started with English alphabet or Arabic numerals;The banking Rule includes: the one-to-one relationship of page group Yu page storage group;The page group includes: the English started according to random number Letter or Arabic numerals, are divided into N number of page group for page ID, N is positive integer.
Optionally, the memory module, is used for: page storage group includes application server hard disk;It is calculated using eap-message digest Method obtains message digest value according to the page info of static page;With message digest value in the application server hard disk File is established under the first class catalogue as first class catalogue name in last position;By the message digest value penultimate and Title of the antepenulatimate as file;The static page is stored into file, and the message digest value is made For the filename of the static page.
It optionally, include Q application server hard disk in the page storage group, in the Q application server hard disk It is stored with identical static page;Q is positive integer, Q > 1.
Optionally, described device further include: rendering module;The rendering module, is used for: page number is obtained from database According to;The page is rendered according to the page data, obtains the page info of static page.
To achieve the above object, according to an embodiment of the present invention in another aspect, provide a kind of static page browsing apparatus, It include: to receive request module, obtain grouping module, browsing module;The reception request module, is used for: receiving browse request, institute Stating includes page ID in browse request;The acquisition grouping module, is used for: according to banking rule, obtaining and the page The corresponding page storage group of ID;The browsing module, is used for: obtaining from the page storage group corresponding with the page ID Static page realizes the browsing of the page;Wherein, the static page be using as described in any of the above-described store static page Device storage.
Optionally, the browsing module, is used for: judging in shared drive with the presence or absence of corresponding with the page ID quiet The state page;If it is present obtaining static page corresponding with the page ID from shared drive, the browsing of the page is realized, Terminate;If it does not exist, then executing according to banking rule, the step of page storage group corresponding with the page ID is obtained Suddenly;It include using M static page of lru algorithm caching in the shared drive, M is positive integer.
Optionally, the page storage group includes packetized memory;The browsing module, is used for: judging in packetized memory With the presence or absence of static page corresponding with the page ID;If it is present being obtained and the page ID pair from packetized memory The static page answered;If it does not exist, then obtaining static page corresponding with the page ID from application server hard disk;Institute Stating includes the static page that the page storage group is stored in using P of lru algorithm caching in packetized memory, and P is positive integer.
To achieve the above object, according to an embodiment of the present invention in another aspect, providing a kind of electronic equipment, comprising: one A or multiple processors;Storage device, for storing one or more programs, when one or more of programs are one Or multiple processors execute, so that one or more of processors realize the side of storage static page provided by the present invention Method, static page browsing method.
To achieve the above object, according to an embodiment of the present invention in another aspect, provide a kind of computer-readable medium, On be stored with computer program, realized when described program is executed by processor it is provided by the present invention storage static page side Method, static page browsing method.
One embodiment in foregoing invention has the following advantages that or the utility model has the advantages that because of the page ID according to static page With banking rule, static page is stored, is browsed, so overcoming the prior art is not suitable for the big problem of page amount And the problem of heavy dependence Redis, it accesses the browsing of the magnanimity page and is isolated with upstream business interface, infrastructure service, greatly Improve the magnanimity page browsing access stability.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the method schematic diagram that the prior art solves page access Dependence Problem;
Fig. 2 is the another method schematic diagram that the prior art solves page access Dependence Problem;
Fig. 3 is the schematic diagram of the basic procedure of the method for storage static page according to an embodiment of the present invention;
Fig. 4 is the schematic diagram of the preferred flow of the method for storage static page according to an embodiment of the present invention;
Fig. 5 is that the grouping of the method for storage static page according to an embodiment of the present invention calculates schematic diagram;
Fig. 6 is the schematic diagram of the basic procedure of static page browsing method according to an embodiment of the present invention;
Fig. 7 is the schematic diagram of the preferred flow of static page browsing method according to an embodiment of the present invention;
Fig. 8 is the schematic diagram of the basic module of the device of storage static page according to an embodiment of the present invention;
Fig. 9 is the schematic diagram of the basic module of static page browsing apparatus according to an embodiment of the present invention;
Figure 10 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Figure 11 is adapted for showing for the structure of the computer system of the terminal device or server of realizing the embodiment of the present invention It is intended to.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
The explanation of nouns of the technical terms occurred in text:
Redis is a key-value key-value storage system.
Content Management System, CMS system are Content Management Systems, are used in the technical solution of the present invention In the content for updating the modification page.
Nginx is a high performance Reverse Proxy.
Message Digest 5 is that random length is inputted algorithm that is soft and generating the fixed pseudorandom input of length.
Docker is the application container engine of an open source, and developer can be packaged their application and rely on packet and arrives In one transplantable container, it also may be implemented to virtualize.It can be understood as a virtual clothes in the technical solution of the present invention Business device.
Least Recently Used, lru algorithm are a kind of page replacement algorithms of memory management.
Fig. 1 is the method schematic diagram that the prior art solves page access Dependence Problem;As shown in Figure 1, utilizing CMS system The content for updating the modification page carries out whole page static to the page, it is hard that the content of pages is then pushed directly to application service Under disk catalogue.When browse request reaches, the static page under application server specified directory is directly read by Nginx, is returned Returning the static page can be browsed.Since content of pages is by static to hard disk, page browsing service is eliminated the reliance on The stability of up-stream system and infrastructure service, the page greatly enhances, but since hard-disk capacity is limited, and this mode is not suitable for magnanimity The fast and stable of the page accesses.
Fig. 2 is the another method schematic diagram that the prior art solves page access Dependence Problem;As shown in Fig. 2, using with it is upper State the similar method of content, in page finished system carry out new added pages, update modification content of pages operation, to the page into The whole page static of row is simultaneously pushed to Redis.When page browsing request reaches, directly read from Redis.The page in this method Browsing service only relies on Redis, and any Upstream Interface and infrastructure service in addition to Redis go wrong all will not be clear to the page It lookes at and has an impact.If Upstream Interface and infrastructure service are broken down, existing active page and shop browsing are still normal, only It cannot increase and modify content of pages newly.But the prior art heavy dependence Redis, all pages once Redis breaks down Face all can not normally access.
Fig. 3 is the schematic diagram of the basic procedure of the method for storage static page according to an embodiment of the present invention;Such as Fig. 3 institute Show, the embodiment of the invention provides a kind of methods for storing static page, may include:
Step S301: obtaining the page info of static page, and the page info includes page ID;
Step S302: according to banking rule, page storage group corresponding with the page ID is obtained;
Step S303: the static page is stored to the page storage group.
Page ID can include but is not limited to: the random number started with English alphabet or Arabic numerals or Roman number; Banking rule can refer to the corresponding relationship between page ID and page storage group, can also refer to page group and page storage group One-to-one relationship;Page group is the English alphabet or Arabic numerals or Roman number according to random number beginning, by the page What ID was divided, i.e., page ID is divided into N number of page by the English alphabet or Arabic numerals started according to random number Group, N are positive integer.When being grouped according to the English alphabet of beginning, there can also be situations such as case sensitive, case-insensitive. Step S302 may include: the English alphabet or Arabic numerals started according to page ID, obtain the page corresponding with page ID Group;According to page group, page storage group is obtained.
The embodiment of the present invention stores static page, institute according to page ID and the banking rule of static page To overcome the problem of prior art is not suitable for the big problem of page amount and heavy dependence Redis, make the browsing of the magnanimity page Access is isolated with upstream business interface, infrastructure service, greatly improves the stability of the browsing access of the magnanimity page.
In the embodiment of the present invention, the page storage group may include application server hard disk;The static page is deposited Storage may include: to be obtained message using Message Digest 5 according to the page info of static page and plucked to the page storage group It is worth;Using last position of message digest value as first class catalogue name in the application server hard disk, in the first class catalogue Under establish file;Using the message digest value penultimate and antepenulatimate as the title of file;It will be described quiet The state page is stored into file, and using the message digest value as the filename of the static page.
The embodiment of the present invention can solve the too many problem of the file number stored under the same hard disk catalogue, reduces and deposits The network inputs and output consumption when the page are taken, are browsed accurately to obtain the page.
In the embodiment of the present invention, the page storage group may include Q application server hard disk, the Q application clothes Identical static page is stored in business device hard disk;Q is positive integer, Q > 1.The embodiment of the present invention is in multiple application server hard disks It is middle to store identical static page, in the case where the failure of one of application server hard disk occurs, can cut automatically It changes on other same any one application server hard disks, prevents Single Point of Faliure.
It may include: that page data is obtained from database before the page info for obtaining static page;According to institute The page data rendering page is stated, static page is obtained;By the static page rendered store to it is globally shared caching (such as Redis)。
The embodiment of the present invention just renders the page before storing static page, solves in the prior art because reading Just carry out real-time rendering after taking specified page, caused by the case where cache invalidation, occur in a large amount of processing in real time The problem of server crash, stores the static page rendered to globally shared caching, can be in the hard of storage static page When disk breaks down, static page is read from globally shared caching, improves the stabilization of storage, the browsing access of the magnanimity page Property.
Fig. 4 is the schematic diagram of the preferred flow of the method for storage static page according to an embodiment of the present invention;Such as Fig. 4 institute Show, component finishing fitted up by the page and builds the page, can with new added pages, modification content of pages, delete the page, and generation Page info storage sends page rendering request or page removal request to database.Page rendering is carried out, if receiving page Face render request, then obtain the page from database, renders to the page, and the static page content push rendered is arrived In Redis.Then calculating is grouped according to page link rule, calculates the static page and should be stored in N number of page and deposits Which of storage group, such as page storage group 1.Static page should be stored in hard disk specified directory in page storage group In, and be synchronized in packetized memory (such as Nginx memory).If receiving page removal request, associated traffic data is deleted; It is grouped calculating according to page link rule, the static page should be stored in N number of page storage group which is calculated It is a, such as page storage group 1.By static page from being deleted in hard disk specified directory in the page storage group, and from packetized memory It is deleted in (such as Nginx memory).
With the page link in the page info that is generated after the page is fitted up for " http://sale.jd.com/act/ For Zn28vOXewkF5NAE1CBD.html ", to illustrate how to be grouped calculating, wherein the page ID of the static page is " Zn28vOXewkF5NAE1CBD " is grouped according to banking rule according to the first English alphabet of page ID.For example, Page ID is that the static page of " Zn28vOXewkF5NAE1CBD " is assigned to " page storage group 10 ".Fig. 5 is real according to the present invention The grouping for applying the method for the storage static page of example calculates schematic diagram;As shown in fig. 5, it is assumed that have 30 Docker, every 3 Docker is as 1 page storage group, 10 page storage groups altogether, it is desirable that 3 Docker in each page storage group are deposited Put the content of pages of same page link.It can be according to for increasing or decreasing page storage group of the reasonable quantity of static page Number.When static page to be stored in the application server hard disk of " page storage group 10 ", with page link be " http: // For sale.jd.com/act/Zn28vOXewkF5NAE1CBD.html ": using Message Digest 5 to "/act/ Zn28vOXewkF5NAE1CBD.html " is calculated, and message digest value is obtained " eb68e1ce4e01b132b4395d01862c73d6 ", using this message digest value as filename;Take message digest value Three are divided into two-stage catalogue "/6/3d " afterwards, then the storage position of the last page of the static page are as follows: "/6/3d/ eb68e1ce4e01b132b4395d01862c73d6”。
Fig. 6 is the schematic diagram of the basic procedure of static page browsing method according to an embodiment of the present invention;As shown in fig. 6, The embodiment of the invention provides a kind of static page browsing methods, may include:
Step S601: receiving browse request, includes page ID in the browse request;
Step S602: according to banking rule, page storage group corresponding with the page ID is obtained;
Step S603: static page corresponding with the page ID is obtained from the page storage group, realizes the page Browsing.
Wherein, the static page is using the method for the storage static page as described in any of the above-described stores.
The embodiment of the present invention browses static page, institute according to page ID and the banking rule of static page To overcome the problem of prior art is not suitable for the big problem of page amount and heavy dependence Redis, make the browsing of the magnanimity page Access is isolated with upstream business interface, infrastructure service, greatly improves the stability of the browsing access of the magnanimity page.
It may include: to judge to whether there is in shared drive after the reception browse request in the embodiment of the present invention Static page corresponding with the page ID;If it is present obtaining static state corresponding with the page ID from shared drive The page realizes the browsing of the page, terminates;If it does not exist, then executing according to banking rule, obtain and the page ID pair The step of page storage group answered;It include using M static page of lru algorithm caching in the shared drive, M is positive whole Number.
It, can be by popular static page the embodiment of the invention provides the static page cached in shared drive is used It stores into shared drive, extracts static page in browsing access Shi Xiancong shared drive, when preventing hot issue, height is simultaneously Server crash caused by the browse request quantity of hair, while also improving the browsing access speed of the page.
In the embodiment of the present invention, the page storage group includes packetized memory;Acquisition and institute from the page storage group The corresponding static page of page info is stated, may include: to judge in packetized memory with the presence or absence of corresponding with the page ID Static page;If it is present obtaining static page corresponding with the page ID from packetized memory;If it does not exist, then Static page corresponding with the page ID is obtained from application server hard disk;After obtaining the static page, by the static page Face is updated in packetized memory;It include being stored in the page storage group using P of lru algorithm caching in the packetized memory Static page, P are positive integer.If application server hard disk breaks down, can be obtained from globally shared caching and the page The corresponding static page of face ID.
The embodiment of the invention provides using the static page for caching several storages and the banking in packetized memory Face, browsing can first extract static page when accessing from packetized memory, improve the browsing access speed of the page.It is quiet storing When the hard disk of the state page breaks down, static page is read from globally shared caching, improves storage, the browsing of the magnanimity page The stability of access.
Fig. 7 is the schematic diagram of the preferred flow of static page browsing method according to an embodiment of the present invention;As shown in fig. 7, After above-mentioned storage method stores static page, magnanimity static page is dispersed in each page storage group, asks when receiving browsing After asking, also need to obtain the page storage where the static page according to the page ID and banking rule of static page Group.Here before being grouped calculating, one layer " Nginx front end processor " can also be added before application server, judges that this is quiet The state page whether there is in shared drive (such as Nginx), and it is quiet to obtain this from " Nginx " shared drive if there is directly The state page;If there is no being grouped calculating again.1000 can be cached most using lru algorithm in " Nginx " shared drive The page of often browsing access.Here banking rule has hereinbefore been recorded, and which is not described herein again.Calculate the static state After page storage group where the page, browse request can be forwarded on any one Docker in the page storage group. After receiving request, judge that the static page whether there is in the packetized memory (such as Nginx) of the Docker, if there is Directly obtained from packetized memory;If there is no being obtained again into the application server hard disk of the Docker, found in hard disk The mode of file position and the side that second-level directory storage static page is generated using Message Digest 5 above recorded Formula is identical, and which is not described herein again.It, can be from global sharing memory (such as Redis) when application server hard disk breaks down The middle acquisition static storage page, and packetized memory is updated, facilitate request next time directly to obtain from packetized memory.Pass through the page Process is browsed, may be implemented that specified static page can be got when page request reaches, the final browsing for realizing the magnanimity page It is completely isolated with Upstream Interface and infrastructure service, as long as network normally externally provides page access service.
Fig. 8 is the schematic diagram of the basic module of the device of storage static page according to an embodiment of the present invention;The present invention is real It applies example and provides a kind of device 800 for storing static page, may include: data obtaining module 801, grouping module 802, storage Module 803;The data obtaining module 801, can be used for: obtain the page info of static page, the page info includes Page ID;The grouping module 802, can be used for: according to banking rule, obtaining the page corresponding with the page ID and deposits Storage group;The memory module 803, can be used for: the static page is stored to the page storage group.
Page ID may include the random number started with English alphabet or Arabic numerals;Banking rule can refer to page Corresponding relationship between face ID and page storage group can also refer to the one-to-one relationship of page group Yu page storage group;The page Group is the English alphabet or Arabic numerals started according to random number, page ID is divided, i.e., according to random number Page ID is divided into N number of page group by the English alphabet or Arabic numerals of beginning, and N is positive integer.According to the English words of beginning When mother stock group, there can also be situations such as case sensitive, case-insensitive.Grouping module 802 can be used for: according to page ID The English alphabet or Arabic numerals of beginning obtain page group corresponding with page ID;According to page group, page storage is obtained Group.
The embodiment of the present invention stores static page, institute according to page ID and the banking rule of static page To overcome the problem of prior art is not suitable for the big problem of page amount and heavy dependence Redis, make the browsing of the magnanimity page Access is isolated with upstream business interface, infrastructure service, greatly improves the stability of the browsing access of the magnanimity page.
In the embodiment of the present invention, the memory module can be used for: page storage group includes application server hard disk;It adopts With Message Digest 5, message digest value is obtained according to the page info of static page;In the application server hard disk with File is established under the first class catalogue as first class catalogue name in last position of message digest value;By the message digest value The title of penultimate and antepenulatimate as file;The static page is stored into file, and will be described Filename of the message digest value as the static page.
The embodiment of the present invention can solve the too many problem of the file number stored under the same hard disk catalogue, reduces and deposits The network inputs and output consumption when the page are taken, are browsed accurately to obtain the page.
It include Q application server hard disk, the Q application service in the page storage group in the embodiment of the present invention Identical static page is stored in device hard disk;Q is positive integer, Q > 1.The embodiment of the present invention is in multiple application server hard disks Identical static page is stored, in the case where the failure of one of application server hard disk occurs, can be automatically switched On any one application server hard disk same to other, Single Point of Faliure is prevented.
In the embodiment of the present invention, described device can also include: rendering module;The rendering module, can be used for: from number According to obtaining page data in library;The page is rendered according to the page data, obtains the page info of static page.By what is rendered Static page is stored to globally shared caching (such as Redis).The embodiment of the present invention is before storing static page just to the page Rendered, solved in the prior art because just carrying out real-time rendering after reading specified page, caused by cache invalidation In the case where, the problem of the server crash occurred in a large amount of processing in real time, the static page rendered is stored to the overall situation Shared buffer memory can read static page from globally shared caching, improve when the hard disk for storing static page breaks down The stability of the storage of the magnanimity page, browsing access.
Fig. 9 is the schematic diagram of the basic module of static page browsing apparatus according to an embodiment of the present invention;As shown in figure 9, It may include: to receive request module 901, obtain grouping mould the embodiment of the invention provides a kind of static page browsing apparatus 900 Block 902, browsing module 903;The reception request module 901, can be used for: receiving browse request, wraps in the browse request Include page ID;The acquisition grouping module 902, can be used for: according to banking rule, obtain corresponding with the page ID Page storage group;The browsing module 903, can be used for: obtain from the page storage group corresponding with the page ID Static page realizes the browsing of the page.
Wherein, the static page is using the device of the storage static page as described in any of the above-described stores.
The embodiment of the present invention browses static page, institute according to page ID and the banking rule of static page To overcome the problem of prior art is not suitable for the big problem of page amount and heavy dependence Redis, make the browsing of the magnanimity page Access is isolated with upstream business interface, infrastructure service, greatly improves the stability of the browsing access of the magnanimity page.
In the embodiment of the present invention, the browsing module 903 can be used for: judge to whether there is and institute in shared drive State the corresponding static page of page ID;If it is present static page corresponding with the page ID is obtained from shared drive, It realizes the browsing of the page, terminates;If it does not exist, then executing according to banking rule, obtain corresponding with the page ID The step of page storage group;It include using M static page of lru algorithm caching in the shared drive, M is positive integer.
It, can be by popular static page the embodiment of the invention provides the static page cached in shared drive is used It stores into shared drive, extracts static page in browsing access Shi Xiancong shared drive, when preventing hot issue, height is simultaneously Server crash caused by the browse request quantity of hair, while also improving the browsing access speed of the page.
In the embodiment of the present invention, the page storage group includes packetized memory;The browsing module 903, can be used for: sentencing Break in packetized memory with the presence or absence of static page corresponding with the page ID;If it is present being obtained from packetized memory Static page corresponding with the page ID;If it does not exist, then being obtained and the page ID pair from application server hard disk The static page answered;It include the static page that the page storage group is stored in using P of lru algorithm caching in the packetized memory Face, P are positive integer.If application server hard disk breaks down, can be obtained from globally shared caching and the page ID pair The static page answered.
The embodiment of the invention provides using the static page for caching several storages and the banking in packetized memory Face, browsing can first extract static page when accessing from packetized memory, improve the browsing access speed of the page.It is quiet storing When the hard disk of the state page breaks down, static page is read from globally shared caching, improves storage, the browsing of the magnanimity page The stability of access.
Figure 10 is shown can deposit using the static page storage of the embodiment of the present invention, the method for browsing or static page It stores up, the exemplary system architecture 1000 of the square device of browsing.
As shown in Figure 10, system architecture 1000 may include terminal device 1001,1002,1003, network 1004 and service Device 1005.Network 1004 between terminal device 1001,1002,1003 and server 1005 to provide Jie of communication link Matter.Network 1004 may include various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 1001,1002,1003 and be interacted by network 1004 with server 1005, to receive Or send message etc..Various telecommunication customer end applications, such as shopping class can be installed on terminal device 1001,1002,1003 (only show using, web browser applications, searching class application, instant messaging tools, mailbox client, social intercourse system software etc. Example).
Terminal device 1001,1002,1003 can be the various electronic equipments with display screen and supported web page browsing, Including but not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 1005 can be to provide the server of various services, for example, to user using terminal device 1001,1002, The 1003 shopping class websites browsed provide the back-stage management server (merely illustrative) supported.Back-stage management server can be right The data such as the information query request received analyze etc. processing, and by processing result (such as target push information, production Product information -- merely illustrative) feed back to terminal device.
It should be noted that static page provided by the embodiment of the present invention stores, the method for browsing is generally by server 1005 execute, and correspondingly, static page storage, browsing apparatus are generally positioned in server 1005.
It should be understood that the number of terminal device, network and server in Figure 10 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
According to an embodiment of the invention, additionally providing a kind of electronic equipment and a kind of readable storage medium storing program for executing.
The electronic equipment of the embodiment of the present invention includes: one or more processors;Storage device, for storing one or more A program, when one or more of programs are executed by one or more of processors, so that one or more of processing Device realizes the method that static page provided by the present invention is stored, browsed.
The computer-readable medium of the embodiment of the present invention, is stored thereon with computer program, and described program is held by processor The method that static page provided by the present invention is stored, browsed is realized when row.
The structure that Figure 11 shows the computer system 1100 for being suitable for the terminal device for being used to realize the embodiment of the present invention is shown It is intended to.Terminal device shown in Figure 11 is only an example, should not function to the embodiment of the present invention and use scope bring Any restrictions.
As shown in figure 11, computer system 1100 include central processing unit (CPU) 1101, can according to be stored in only It reads the program in memory (ROM) 1102 or is loaded into random access storage device (RAM) 1103 from storage section 1108 Program and execute various movements appropriate and processing.In RAM 1103, also it is stored with system 1100 and operates required various journeys Sequence and data.CPU 1101, ROM 1102 and RAM 1103 are connected with each other by bus 1104.Input/output (I/O) interface 1105 are also connected to bus 1104.
I/O interface 1105 is connected to lower component: the importation 1106 including keyboard, mouse etc.;Including such as cathode The output par, c 1107 of ray tube (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section including hard disk etc. 1108;And the communications portion 1109 of the network interface card including LAN card, modem etc..Communications portion 1109 passes through Communication process is executed by the network of such as internet.Driver 1110 is also connected to I/O interface 1105 as needed.It is detachable to be situated between Matter 1111, such as disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 1110, so as to In being mounted into storage section 1108 as needed from the computer program read thereon.
Particularly, disclosed embodiment, the process described above with reference to flow chart may be implemented as counting according to the present invention Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer Computer program on readable medium, the computer program include the program code for method shown in execution flow chart.? In such embodiment, which can be downloaded and installed from network by communications portion 1109, and/or from can Medium 1111 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 1101, executes and of the invention be The above-mentioned function of being limited in system.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor packet Include data obtaining module, grouping module, memory module.Wherein, the title of these modules is not constituted to this under certain conditions The restriction of module itself, for example, data obtaining module is also described as " obtaining the module of the page info of static page ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes Obtaining the equipment includes: step S301: obtaining the page info of static page, the page info includes page ID;Step S302: According to banking rule, page storage group corresponding with the page ID is obtained;Step S303: the static page is stored To the page storage group;Step S601: receiving browse request, includes page ID in the browse request;Step S602: according to Banking rule, obtains page storage group corresponding with the page ID;Step S603: it is obtained from the page storage group Static page corresponding with the page ID, realizes the browsing of the page.
Technical solution according to an embodiment of the present invention, according to the page ID of static page and banking rule, to static state The page is stored, is browsed, so overcoming the prior art is not suitable for asking for the big problem and heavy dependence Redis of page amount Topic accesses the browsing of the magnanimity page and is isolated with upstream business interface, infrastructure service, greatly improves the browsing of the magnanimity page The stability of access.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (18)

1. a method of storage static page characterized by comprising
The page info of static page is obtained, the page info includes page ID;
According to banking rule, page storage group corresponding with the page ID is obtained;
The static page is stored to the page storage group.
2. the method according to claim 1, wherein the page ID includes with English alphabet or Arabic numerals The random number of beginning;
The banking rule includes: the one-to-one relationship of page group Yu page storage group;
The page group includes: the English alphabet or Arabic numerals started according to random number, and page ID is divided into N number of page Group, N are positive integer.
3. the method according to claim 1, wherein the page storage group includes application server hard disk;
The static page is stored to the page storage group, comprising:
Using Message Digest 5, message digest value is obtained according to the page info of static page;
Using last position of message digest value as first class catalogue name in the application server hard disk, under the first class catalogue Establish file;
Using the message digest value penultimate and antepenulatimate as the title of file;
The static page is stored into file, and using the message digest value as the filename of the static page.
4. according to the method described in claim 3, it is characterized in that, the page storage group includes Q application server hard disk, Identical static page is stored in the Q application server hard disk;Q is positive integer, Q > 1.
5. the method according to claim 1, wherein before the page info for obtaining static page, comprising:
Page data is obtained from database;
The page is rendered according to the page data, obtains the page info of static page.
6. a kind of static page browsing method characterized by comprising
Browse request is received, includes page ID in the browse request;
According to banking rule, page storage group corresponding with the page ID is obtained;
Static page corresponding with the page ID is obtained from the page storage group, realizes the browsing of the page;
Wherein, the static page is stored using method a method as claimed in any one of claims 1 to 5.
7. according to the method described in claim 6, including in the browse request it is characterized in that, the reception browse request After page ID, comprising:
Judge in shared drive with the presence or absence of static page corresponding with the page ID;
If it is present obtaining static page corresponding with the page ID from shared drive, the browsing of the page is realized, tie Beam;
If it does not exist, then the step of executing according to banking rule, obtaining page storage group corresponding with the page ID;
It include using M static page of lru algorithm caching in the shared drive, M is positive integer.
8. according to the method described in claim 6, it is characterized in that, the page storage group includes packetized memory;From the page Static page corresponding with the page info is obtained in face storage group, comprising:
Judge in packetized memory with the presence or absence of static page corresponding with the page ID;
If it is present obtaining static page corresponding with the page ID from packetized memory;
If it does not exist, then obtaining static page corresponding with the page ID from application server hard disk;
It include the static page that the page storage group is stored in using P of lru algorithm caching in the packetized memory, P is positive Integer.
9. a kind of device for storing static page characterized by comprising data obtaining module, grouping module, memory module;
The data obtaining module, is used for: obtaining the page info of static page, the page info includes page ID;
The grouping module, is used for: according to banking rule, obtaining page storage group corresponding with the page ID;
The memory module, is used for: the static page is stored to the page storage group.
10. device according to claim 9, which is characterized in that the page ID includes with English alphabet or Arabic number The random number of word beginning;
The banking rule includes: the one-to-one relationship of page group Yu page storage group;
The page group includes: the English alphabet or Arabic numerals started according to random number, and page ID is divided into N number of page Group, N are positive integer.
11. device according to claim 9, which is characterized in that the memory module is used for: page storage group includes answering Use server hard disc;
Using Message Digest 5, message digest value is obtained according to the page info of static page;
Using last position of message digest value as first class catalogue name in the application server hard disk, under the first class catalogue Establish file;
Using the message digest value penultimate and antepenulatimate as the title of file;
The static page is stored into file, and using the message digest value as the filename of the static page.
12. device according to claim 11, which is characterized in that include Q application server in the page storage group Hard disk is stored with identical static page in the Q application server hard disk;Q is positive integer, Q > 1.
13. device according to claim 9, which is characterized in that described device further include: rendering module;
The rendering module, is used for:
Page data is obtained from database;
The page is rendered according to the page data, obtains the page info of static page.
14. a kind of device of static page browsing characterized by comprising receive request module, obtain grouping module, browsing Module;
The reception request module, is used for: receiving browse request, includes page ID in the browse request;
The acquisition grouping module, is used for: according to banking rule, obtaining page storage group corresponding with the page ID;
The browsing module, is used for: obtaining static page corresponding with the page ID from the page storage group, realizes page The browsing in face;
Wherein, the static page is using the device as described in claim 9-13 is any stores.
15. device according to claim 14, which is characterized in that the browsing module is used for:
Judge in shared drive with the presence or absence of static page corresponding with the page ID;
If it is present obtaining static page corresponding with the page ID from shared drive, the browsing of the page is realized, tie Beam;
If it does not exist, then the step of executing according to banking rule, obtaining page storage group corresponding with the page ID;
It include using M static page of lru algorithm caching in the shared drive, M is positive integer.
16. device according to claim 14, which is characterized in that the page storage group includes packetized memory;
The browsing module, is used for:
Judge in packetized memory with the presence or absence of static page corresponding with the page ID;
If it is present obtaining static page corresponding with the page ID from packetized memory;
If it does not exist, then obtaining static page corresponding with the page ID from application server hard disk;
It include the static page that the page storage group is stored in using P of lru algorithm caching in the packetized memory, P is positive Integer.
17. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now such as method described in any one of claims 1-8.
18. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor Such as method described in any one of claims 1-8 is realized when row.
CN201711455169.6A 2017-12-28 2017-12-28 The method and apparatus that static page is stored, browsed Pending CN110020373A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711455169.6A CN110020373A (en) 2017-12-28 2017-12-28 The method and apparatus that static page is stored, browsed

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711455169.6A CN110020373A (en) 2017-12-28 2017-12-28 The method and apparatus that static page is stored, browsed

Publications (1)

Publication Number Publication Date
CN110020373A true CN110020373A (en) 2019-07-16

Family

ID=67187085

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711455169.6A Pending CN110020373A (en) 2017-12-28 2017-12-28 The method and apparatus that static page is stored, browsed

Country Status (1)

Country Link
CN (1) CN110020373A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112506582A (en) * 2020-12-18 2021-03-16 北京百度网讯科技有限公司 Applet data packet processing method, apparatus, device and medium
WO2023045862A1 (en) * 2021-09-23 2023-03-30 华为云计算技术有限公司 Application page development method and apparatus, and system, computing device and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7139814B2 (en) * 2000-12-01 2006-11-21 Intel Corporation Dynamic content delivery to static page in non-application capable environment
WO2007129660A1 (en) * 2006-05-08 2007-11-15 Torus Co., Ltd. Static web page generation method, program, recording medium, and static web page generation management system
CN102368258A (en) * 2011-09-30 2012-03-07 广州市动景计算机科技有限公司 Webpage page caching management method and system
CN103064932A (en) * 2012-12-24 2013-04-24 乐视网信息技术(北京)股份有限公司 System and method for processing static page
CN104182425A (en) * 2013-05-28 2014-12-03 北京信威通信技术股份有限公司 Static page generation method for multi-language website
CN105447166A (en) * 2015-12-03 2016-03-30 沈文策 Keyword based information search method and system
CN106412054A (en) * 2016-09-27 2017-02-15 网宿科技股份有限公司 Naming method for converting dynamic network address into static network address, system and application thereof

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7139814B2 (en) * 2000-12-01 2006-11-21 Intel Corporation Dynamic content delivery to static page in non-application capable environment
WO2007129660A1 (en) * 2006-05-08 2007-11-15 Torus Co., Ltd. Static web page generation method, program, recording medium, and static web page generation management system
CN102368258A (en) * 2011-09-30 2012-03-07 广州市动景计算机科技有限公司 Webpage page caching management method and system
CN103064932A (en) * 2012-12-24 2013-04-24 乐视网信息技术(北京)股份有限公司 System and method for processing static page
CN104182425A (en) * 2013-05-28 2014-12-03 北京信威通信技术股份有限公司 Static page generation method for multi-language website
CN105447166A (en) * 2015-12-03 2016-03-30 沈文策 Keyword based information search method and system
CN106412054A (en) * 2016-09-27 2017-02-15 网宿科技股份有限公司 Naming method for converting dynamic network address into static network address, system and application thereof

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112506582A (en) * 2020-12-18 2021-03-16 北京百度网讯科技有限公司 Applet data packet processing method, apparatus, device and medium
CN112506582B (en) * 2020-12-18 2024-04-09 北京百度网讯科技有限公司 Method, device, equipment and medium for processing small program data packet
WO2023045862A1 (en) * 2021-09-23 2023-03-30 华为云计算技术有限公司 Application page development method and apparatus, and system, computing device and storage medium

Similar Documents

Publication Publication Date Title
US11194882B1 (en) Behavior based optimization for content presentation
US8868637B2 (en) Page rendering for dynamic web pages
US11017152B2 (en) Optimizing loading of web page based on aggregated user preferences for web page elements of web page
CN110019350A (en) Data query method and apparatus based on configuration information
CN110019211A (en) The methods, devices and systems of association index
CN109413127A (en) A kind of method of data synchronization and device
CN110334145A (en) The method and apparatus of data processing
US9578012B2 (en) Restricted content publishing with search engine registry
CN110019062A (en) Method of data synchronization and system
CN110020304A (en) A kind of method and apparatus of loading page
CN110427304A (en) O&M method, apparatus, electronic equipment and medium for banking system
CN108694215A (en) Method, apparatus, electronic equipment and the computer-readable medium of web cache preheating
US20210182491A1 (en) Summary generation method and apparatus
CN110110184B (en) Information inquiry method, system, computer system and storage medium
CN110020373A (en) The method and apparatus that static page is stored, browsed
CN109086414B (en) Method, apparatus and storage medium for searching blockchain data
CN109885593A (en) Method and apparatus for handling information
CN110020271A (en) Method and system for cache management
WO2017074710A1 (en) Search system
EP4080383A1 (en) Method and apparatus for presenting information, electronic device, storage medium, and program product
CN109710604A (en) Data processing method, device, system, computer readable storage medium
EP4220446A1 (en) Resource pre-fetch using age threshold
CN115374078A (en) Data storage and reading system and working method thereof
CN112711572B (en) Online capacity expansion method and device suitable for database and table division
CN109491830A (en) The method and system in switch data source

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190716