Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is an information display process provided in an embodiment of the present application, which specifically includes the following steps:
s101: a page request is sent to the server.
In the embodiment of the present application, sending a page request to a server is completed by a client, where the page request includes a page parameter (e.g., a web page address) and a client parameter (e.g., version information of the client), and is mainly used to retrieve information to be displayed.
For example, when a user clicks a client of a commodity website, the client sends a page request carrying a home page web address to a server to obtain a home page.
S102: and receiving variable information returned by the server according to the page request.
In the embodiment of the application, after receiving a page request sent by a client, a server can determine variable information in a page corresponding to the page request according to the page request and return the variable information to the client. Specifically, the server may determine a page corresponding to the page request according to the page request, and then determine which of the pages are variable information according to the identifier of each piece of information in the page. The variable information in the embodiment of the present application refers to information that is sent to be changed according to an actual situation (for example, weather information in a page, where weather may change according to different time). Besides the variable information, the page also includes some fixed information, such as the LOGO of the website (i.e. page fixed information), a page template (i.e. page structure, e.g. location of LOGO of the website in the page, location of weather information, effect of clicking characters, etc.), and the fixed information is information in the page that generally does not change with the actual situation. The identification is used for determining which information is variable and which information is fixed, the identification can be added in each webpage information stored in the server by a server maintenance person, and the server returns the determined variable information to the client.
Continuing to use the above example, after receiving a page request carrying a main page web address, the server can determine all information contained in the main page according to the web address, then determine that commodity information and time information in the main page are variable information according to the identifier, and determine that LOGO, the contact information of the commodity website and the like are page fixed information, and at the same time, can also determine a page template corresponding to the main page, and the server returns the variable information to the client, that is, the client receives the variable information sent by the server according to the page request.
S103: and generating and displaying a page according to the received variable information and the pre-stored fixed information.
In the embodiment of the application, after receiving the variable information sent by the server, the client can acquire the pre-stored page template, and add the received variable information and the pre-stored page fixed information to the page template to generate the page.
Continuing the above example, after receiving the pushed commodity information and the time information (i.e., the variable information) sent by the server, the client may obtain a pre-stored page template (as shown in fig. 2), a LOGO of the website, and a contact manner of the website (i.e., the page fixed information) in the local storage area, add the received variable information and the page fixed information to the page template, generate a main page (as shown in fig. 3), and display the generated main page to the user.
By the method, when a user frequently uses services provided by a network service provider, the fixed information is stored in the local storage area where the client is located in each interaction between the client and the server, so that the server only needs to return the variable information to the client, the fixed information and the variable information do not need to be returned to the client together, the client calls the fixed information in the local storage area, the variable information and the fixed information are combined together to generate a page, and the page is displayed to the user, so that the waste of network resources is reduced.
In practical application, a page of a website is gradually upgraded according to an actual situation, and in the upgrading process, a page structure of the page may change, and at the same time, a new page template corresponding to a main page is formed, that is, the page template stored in a local storage area cannot be used continuously, so that the page template stored in advance needs to be updated (that is, a server sends the new page template to a client and stores the new page template in the local storage area), and when the page template stored in the local storage area is updated, regardless of whether a user acquires a page of the website, the stored page template can be updated in the following two ways, specifically, a first way: receiving and storing a page template sent by a server when the page template is updated; and the second method comprises the following steps: and acquiring the page template from the server according to a set time interval and storing the page template, wherein the set time interval can be determined according to the time interval of the past page template updating and is adjusted according to the actual situation.
For example, assuming that the page template in the local storage area is updated in the first manner, the main page of a certain commodity website is updated at the present time, the updated main page is as shown in fig. 4, and the main page before updating is as shown in fig. 3, it is obvious that the main page has a changed structure compared with the previous main page, after the server updates the page of the main page, the page template corresponding to the main page of the new version is formed at the same time, and the formed page template is sent to the client, and after the client receives the page template of the new version, the page template of the new version is stored in the local storage area.
Assuming that the page template in the local storage area is updated by the second method, the set time interval is 2 days, the client sends a page template update request to the server every 2 days, if the server has an update of the page template within the 2 days, the server returns the updated page template to the client after receiving the page template update request, if the server has no update of the page template within the 2 days, the server does not return any page template to the client after receiving the page template update request, assuming that the main page of a certain commodity website is updated within the two days, the updated main page is as shown in fig. 4, and the main page before the update is as shown in fig. 3, when the client sends the page template update request to the server, the server returns the page template (as shown in fig. 5) corresponding to the updated main page to the client, after the client receives the page template of the new version, the client stores the page template of the new version in the local storage area
In addition, the template updating method does not consider whether the user obtains the page of the website, and another template updating method is that the client receives the variable information returned by the server and also receives the identifier of the page template returned by the server, specifically, after the client sends a page request to the server, the server receives the page request sent by the client, determines the page corresponding to the page request according to the page request, determines which is the variable information, which is the page fixed information and which is the page template according to the identifier of each information in the page, and the server returns the determined variable information and the identifier of the page template to the client and returns the variable information and the identifier of the page template to the client.
It should be noted that the identifier of each page template corresponds to a unique page template, and not only the identifiers of the page templates corresponding to the page templates of different pages are different, but also the identifiers of the page templates corresponding to the page templates of different versions of the same page are different, and the identifier of the page template may specifically be the version number of the page template.
After receiving the identification of the page template returned by the server, the client firstly judges whether the identification of the received page template is the same as the identification of the pre-stored page template, if so, the received variable information and the pre-stored page fixed information are added into the pre-stored page template to generate a page, otherwise, the client acquires the page template from the server, updates the pre-stored page template by adopting the acquired page template, and adds the received variable information and the pre-stored page fixed information into the updated page template to generate the page.
For example, assuming that a main page of a certain commodity website is upgraded, the upgraded main page is as shown in fig. 4, and a page template corresponding to the upgraded main page is as shown in fig. 5, the identifier of the page template corresponding to the page template is V2, and the identifier of the page template corresponding to the page template pre-stored in the local storage area is V1, assuming that a user clicks the client of the certain commodity website when using the client, the client sends a page request carrying a main page address to the server, the server determines a page corresponding to the page request after receiving the page request, determines pushed commodity information and time information according to the identifiers of the information in the page, determines V2 as the identifier of the page template, the server returns the determined variable information and the identifier V2 of the page template to the client, and after the client receives the information of the user, the LOGO of the website, the contact mode of the website (namely, the page fixed information) and the identifier V1 of the page template are called from the local storage area, the identifier V2 of the page template is compared with the identifier V1 of the page template stored in advance, obviously, if the two are different, the client sends a calling request to the server, obtains the page template corresponding to the identifier V2 of the page template (as shown in fig. 5), adds the page fixed information and the variable information to the updated page template, generates a display main page (as shown in fig. 4), displays the display main page to the user, replaces the obtained page template shown in fig. 5 with the original page template stored locally at the client, that is, the page template shown in fig. 5 is stored locally at the client as the updated page template.
In addition, there is an update condition (e.g. a contact way of a website) in the page fixed information, so that the page fixed information is checked while the information is presented to the user, so as to ensure that the server can present the updated page fixed information to the user in time, a fifth version (MD 5) Algorithm of an information summarization Algorithm can be used when the page fixed information is checked, specifically, the page fixed information in the page stored in the server can be sorted in sequence to form an integral data, an MD5 value corresponding to the data is calculated and sent to the client, after the client receives the MD5 value, the client retrieves the MD5 value corresponding to the page fixed information pre-stored in the local storage area, compares the MD5 value with the received MD5 value to determine whether the MD5 value and the MD5 value are consistent, if so, directly calling the page fixed information pre-stored in the local storage area and adding the page fixed information to the page template, if not, sending a calling request to the server, simultaneously storing the received MD5 value in the local storage area of the client, after acquiring the page fixed information corresponding to the page template in the server, adding the acquired page fixed information to the page template, and updating the page fixed information in the local storage area.
In continuation of the above example, it is assumed that the server performs MD5 calculation on the page fixed information (i.e., the LOGO of the website and the contact way of the website) in the main page of the server, the calculated MD5 value is 66, and the MD5 value corresponding to the page fixed information (i.e., the LOGO of the website and the contact way of the website) which is called by the client and is pre-stored in the local storage area is 66, and obviously, the two are identical, which indicates that the page fixed information in the main page in the server is not updated, therefore, the LOGO of the website, the contact way of the website, the pushed commodity information, and the time information are added to the page template, and the displayed main page is shown as 4.
Based on the same idea, the information display method provided in the embodiment of the present application further provides an information display device, as shown in fig. 6 and 7.
Fig. 6 is a schematic structural diagram of an information display apparatus provided in an embodiment of the present application, including:
a sending request module 601, configured to send a page request to a server;
a receiving module 602, configured to receive variable information returned by the server according to the page request;
the displaying module 603 is configured to generate a page according to the received variable information and the pre-stored fixed information, and display the page.
The fixed information comprises page fixed information and a page template.
The presentation module 603 is specifically configured to obtain a pre-stored page template, and add the received variable information and pre-stored page fixed information to the page template to generate a page.
The presentation module 603 is specifically configured to obtain and store a page template from a server according to a set time interval, or receive and store a page template sent by the server when the page template is updated.
The receiving module 602 is specifically configured to receive variable information and an identifier of a page template returned by the server according to the page request, and generate a page according to the received variable information and pre-stored fixed information, and specifically includes: and judging whether the identification of the received page template is the same as that of the pre-stored page template or not, if so, adding the received variable information and the pre-stored page fixed information into the pre-stored page template to generate a page, otherwise, acquiring the page template from the server, updating the pre-stored page template by adopting the acquired page template, and adding the received variable information and the pre-stored page fixed information into the updated page template to generate the page.
The apparatus shown in fig. 6 may be located in a terminal, and specifically may be located in a client within the terminal.
Fig. 7 is a schematic structural diagram of an information display apparatus provided in an embodiment of the present application, including:
a receiving module 701, configured to receive a page request sent by a client;
a determining module 702, configured to determine, according to a page request, variable information in a page corresponding to the page request;
a returning module 703, configured to return the determined variable information to the client.
The determining module 702 is specifically configured to determine, according to the page request, variable information corresponding to the page request and an identifier of a pre-established page template, and return the determined variable information to the client, and specifically includes: and returning the determined variable information and the identifier of the page template to the client.
In particular, the apparatus shown in fig. 7 may be located in a server.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.