CN111061977A - Website updating method, device and system - Google Patents
Website updating method, device and system Download PDFInfo
- Publication number
- CN111061977A CN111061977A CN201811136715.4A CN201811136715A CN111061977A CN 111061977 A CN111061977 A CN 111061977A CN 201811136715 A CN201811136715 A CN 201811136715A CN 111061977 A CN111061977 A CN 111061977A
- Authority
- CN
- China
- Prior art keywords
- website
- version information
- version
- updating
- server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 77
- 238000010586 diagram Methods 0.000 description 12
- 238000004590 computer program Methods 0.000 description 11
- 230000008901 benefit Effects 0.000 description 7
- 230000006870 function Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000004397 blinking Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a method, a device and a system for updating a website, relates to the technical field of internet, and aims to solve the problems that in the prior art, when the website is updated, if the website is updated by modifying the name of a website configuration file, a large number of codes need to be modified, and if the name of the website configuration file is not modified, the content of the updated website cannot be obtained in time, so that the updating performance of the website is poor. The method of the invention comprises the following steps: a server receives a website access request sent by a front end, wherein the website access request carries first version information of a website, the first version information is used for identifying a website version cached by the front end, second version information of the website is stored in the server, and the second version information is the latest version information of the website; detecting whether the first version information and the second version information are the same; if not, sending an updating instruction so that the front end updates the cached website version. The invention is applied to website updating.
Description
Technical Field
The invention relates to the technical field of internet, in particular to a method, a device and a system for updating a website.
Background
With the increasing development of internet technology, networks have occupied various scenes in daily life, and merchants, enterprises and the like create websites so that users can know commodities, information and the like through the websites. In order to improve the response speed of the website, the webpage server accessed by the user generally caches the webpage analysis, so that the cached webpage can be directly returned for loading and displaying when the user accesses again.
In the process of implementing the invention, the inventor finds that in the prior art, when a website is updated, a file for loading the website needs to be renamed, so that when a user requests to access the website, the user cannot find a previously cached webpage and then reloads a new file for updating, but when a file name is modified, a webpage code needs to be manually modified, so that the website updating operation is relatively complicated and has a large workload. When the name of the website file is not modified, the website webpage can be directly loaded according to the cache data when the user accesses, so that the user cannot timely acquire the updated website content, and the website updating performance is poor.
Disclosure of Invention
In view of this, the method, the device and the system for updating a website provided by the present invention mainly aim to overcome the problem that when a website is updated, if a website configuration file is modified, a website code needs to be modified, so that the operation of updating the website is complicated, and if the website configuration file is not modified, a user cannot acquire the updated website content in time, so that the performance of updating the website is poor, thereby improving the performance of updating the website.
In order to solve the above problems, the present invention mainly provides the following technical solutions:
in a first aspect, the present invention provides a method for updating a website, including:
a server receives a website access request sent by a front end, wherein the website access request carries first version information of a website, the first version information is used for identifying a website version cached by the front end, second version information of the website is stored in the server, and the second version information is the latest version information of the website;
detecting whether the first version information and the second version information are the same;
if not, sending an updating instruction so that the front end updates the cached website version.
Optionally, after detecting that the first version information and the second version information are different, the method further includes:
outputting request error information, wherein the request error information is used for indicating that the first version information and the second version information are different; and/or the presence of a gas in the gas,
outputting the second version information so that the front end can update the cached website version according to the second version information; and/or the presence of a gas in the gas,
acquiring a website data packet corresponding to the second version information, wherein the website data packet is used for loading a website of a latest version;
and sending the website data packet to the front end so that the front end updates the cached website version according to the website data packet.
Optionally, the method further includes:
and if the first version information is the same as the second version information, acquiring website cache data corresponding to the first version information, and displaying the website cache data at the front end.
In a second aspect, the present invention provides a method for updating a website, including:
the method comprises the steps that a front end sends a website access request to a server, wherein the website access request carries first version information of a website, the first version information is used for identifying a website version cached by the front end, second version information of the website is stored in the server, and the second version information is the latest version information of the website;
receiving an update instruction sent by the server, wherein the update instruction is sent when the first version information and the second version information are inconsistent and is used for instructing the front end to update the cached website version;
and updating the website version cached at the front end according to the updating indication.
Optionally, the method further includes:
receiving a website data packet sent by the server so as to load the website of the latest version according to the website data packet;
the updating the website version cached at the front end according to the update indication includes:
and loading the website of the latest version according to the website data packet, and replacing the website cached at the front end with the website of the latest version.
Optionally, the front end further caches an update status identifier, and after the website version cached at the front end is updated according to the update instruction, the method further includes:
setting the update state identifier as an update to-be-read state; and/or the presence of a gas in the gas,
determining the updated content of the website according to the website of the latest version and the cached website;
the updated content of the website is displayed in a distinguishing way; and/or the presence of a gas in the gas,
and after the updated content of the website is read, setting the updated state identifier as an updated read state.
In a third aspect, the present invention provides a server, comprising:
a receiving unit, configured to receive a website access request sent by a front end, where the website access request carries first version information of a website, the first version information is used to identify a website version cached by the front end, and second version information of the website is stored in the server and is latest version information of the website;
a detecting unit configured to detect whether the first version information and the second version information are the same;
and the updating unit is used for sending an updating instruction if the first version information is different from the second version information so as to enable the front end to update the cached website version.
Optionally, the server further includes:
an output unit configured to output request error information indicating that the first version information and the second version information are different;
the output unit is further configured to output the second version information, so that the front end updates the cached website version according to the second version information;
an obtaining unit, configured to obtain a website data packet corresponding to the second version information, where the website data packet is used to load a website of a latest version;
and the sending unit is used for sending the website data packet to the front end so that the front end updates the cached website version according to the website data packet.
Optionally, the obtaining unit is further configured to obtain, if the first version information is the same as the second version information, website cache data corresponding to the first version information, and display the website cache data at the front end.
In a fourth aspect, the present invention provides a front end comprising:
a sending unit, configured to send a website access request to a server, where the website access request carries first version information of a website, the first version information is used to identify a website version cached at the front end, and second version information of the website is stored in the server and is latest version information of the website;
a receiving unit, configured to receive an update instruction sent by the server, where the update instruction is sent when the first version information and the second version information are inconsistent, and is used to instruct the front end to update the cached website version;
and the updating unit is used for updating the website version cached at the front end according to the updating indication.
Optionally, the receiving unit is further configured to receive a website data packet sent by the server, so as to load a website of a latest version according to the website data packet;
the updating unit is specifically configured to load a website of a latest version according to the website data packet, and replace the website cached at the front end with the website of the latest version.
Optionally, the front end further caches an update status identifier, and the front end further includes:
the setting unit is used for setting the update state identifier as an update to-be-read state;
the determining unit is configured to determine, according to the website of the latest version and the cached website, update content of the website;
the display unit is used for displaying the updated content of the website in a distinguishing manner;
the setting unit is further configured to set the update status flag to an updated read status after the update content of the website is read.
In a fifth aspect, the present invention provides a website update system, including: a server as described above and a head-end as described above.
In order to achieve the above object, according to a sixth aspect of the present invention, there is provided a storage medium including a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the above method for updating a website.
In order to achieve the above object, according to a seventh aspect of the present invention, there is provided a processor for executing a program, wherein the program executes to execute the above method for updating a website.
By the technical scheme, the technical scheme provided by the invention at least has the following advantages:
the invention provides a method, a device and a system for updating a website, wherein firstly, a front end sends a website access request to a server, then, after the server receives the website access request sent by the front end, the server compares whether first version information for identifying the website version cached by the front end and second version information for identifying the latest version information of the website carried in the website access request are the same or not, and finally, if the first version information is different from the second version information, an updating instruction is sent out to enable the front end to update the cached website version, so that the front end receives the updating instruction and updates the website. Compared with the prior art, the method and the device have the advantages that when the website is updated, the configuration file of the website is modified, the website code is required to be manually modified, the updated website content can be obtained when a user visits the website, so that the website updating operation is complicated, and when the website is updated, if the name of the website configuration file is not modified, the updated website content cannot be obtained in time.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart illustrating a first website updating method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a second website updating method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a third website updating method according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a fourth website updating method according to an embodiment of the present invention;
FIG. 5 is a block diagram illustrating a first server according to an embodiment of the present invention;
FIG. 6 is a block diagram illustrating a second server according to an embodiment of the present invention;
FIG. 7 is a block diagram illustrating components of a front end provided by an embodiment of the invention;
fig. 8 is a block diagram illustrating a website update system according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The embodiment of the present invention provides a first method for updating a website, where the method is applied to a server side, and as shown in fig. 1, the method includes:
101. and the server receives the website access request sent by the front end.
The website access request carries first version information of a website, the first version information is used for identifying a website version of the front-end cache, second version information of the website is stored in the server, and the second version information is latest version information of the website. The version information may be set according to different application scenarios, for example, regular numbers 01 and 02 may be used, or irregular characters may also be used, which is not specifically limited in the embodiment of the present invention. Specifically, this step may be to configure a version field in the front end, and attach version information in the request header each time the user requests to access the website.
It should be noted that, in this step, the first version information is a website version when the user accesses the website last time, and the cache data used for loading the website page in the server analyzes and stores the website page when the user accesses the website last time, that is, if the website is updated at this time, the cache data stored in the server and the version information carried in the access request this time are both before updating, so that by carrying the version information of the website every time the user requests, it can be determined whether the website is updated according to the version information, and further it is determined whether the website page is loaded and displayed by using the cache data.
It should be noted that when the website is updated, only the version information of the website stored in the server needs to be updated, so that the second version information in this step is always the latest information of the website version, and it is convenient to determine whether the cache data of the website is the data for loading the website of the latest version according to the information.
102. Detecting whether the first version information and the second version information are the same.
For the embodiment of the invention, whether the website version is updated can be judged by detecting the two versions of information, the name of the configuration file of the website is not required to be modified, the code part of the website is not required to be modified, and the judgment can be carried out according to the version information of the last access carried in the access request and the latest version information of the website stored in the server when a user accesses the website, so that the problems of complicated operation of website updating and untimely acquisition of the updated content are avoided, and the website updating performance is improved.
103. And if the first version information is different from the second version information, sending an updating instruction.
And further, the front end updates the cached website version.
In the prior art, if the name of the configuration file is not modified during website update, when a user requests to access the website, the website content is still loaded and displayed according to the cache data, so that the user cannot acquire the updated website content in time, and if the name of the website configuration file is modified during website update, the part of the code referring to the website name needs to be modified manually, so that the operation is complicated due to large workload.
In the embodiment of the invention, according to the version information of the last access website carried by a user when the user requests to access the website, namely the cache data in the server, the server compares the version information with the stored latest version information of the website, and when the two version information are different, the cache data for loading the website is still the data before updating due to the fact that the website is updated, an updating instruction is sent to the front end, so that the front end can obtain the updated website data while updating the cached website version information, instead of loading and displaying the website content by using the cache data, website codes are not required to be modified, the user can be ensured to obtain the updated website content in time, and the updating performance of the website is improved.
The method for updating the website comprises the steps that firstly, a front end sends a website access request to a server, then, after the server receives the website access request sent by the front end, whether first version information used for identifying a website version cached by the front end and second version information used for identifying the latest version information of the website carried in the website access request are the same or not is compared, and finally, if the first version information is different from the second version information, an updating instruction is sent out to enable the front end to update the cached website version, so that the front end receives the updating instruction and updates the website. Compared with the prior art, the method and the device have the advantages that when the website is updated, the configuration file of the website is modified, the website code is required to be manually modified, the updated website content can be obtained when a user visits the website, so that the website updating operation is complicated, and when the website is updated, if the name of the website configuration file is not modified, the updated website content cannot be obtained in time.
To be described in more detail below, an embodiment of the present invention provides a second method for updating a website, specifically as shown in fig. 2, the method includes:
201. and the server receives the website access request sent by the front end.
The website access request carries first version information of a website, the first version information is used for identifying a website version of the front-end cache, second version information of the website is stored in the server, and the second version information is latest version information of the website.
In the embodiment of the present invention, a version field may be configured in the front end in advance, and whenever the website version is updated, the version information stored in the front end is updated. Meanwhile, the server stops using the cache data to load the website, and generates new version cache data after using the updated data to load the website, that is, the version information carried in the access request sent by the user is always the same as the version of the cache data. Therefore, when the user sends an access request, the version information is carried in the request head, so that the server side can timely acquire the version information of the cache data which is currently stored and used for loading the website when the user accesses each time, and whether the website is updated or not can be further judged.
202. Detecting whether the first version information and the second version information are the same.
203a, if the first version information is the same as the second version information, obtaining website cache data corresponding to the first version information, and displaying at the front end.
It should be noted that when the version information carried in the website access request sent by the user is the same as the version information stored in the server, it indicates that the cache data stored in the server for loading the website webpage is the data of the latest version of the website, so that the cache data stored in the server before being analyzed can be directly sent to the front end and displayed in the front end.
And a step 203b, which is parallel to the step 203a, of issuing an update instruction if the first version information and the second version information are different.
And further, the front end updates the cached website version.
For the embodiment of the invention, whether the website is updated or not is determined by comparing the version information in the website access request, namely the version information of the cache data, with the latest version information of the website stored in the server, and the updating instruction is immediately triggered to be sent to the front end when the two version information are different, so that the front end updates the cached website version, simultaneously acquires the website data of the latest version and loads and displays the updated content, and when the two version information are the same, the website is not updated during the last access and the current access of the user, and at the moment, the website is loaded by using the previous cache data.
204b, outputting request error information.
Wherein the request error information is used to indicate that the first version information and the second version information are different.
In the embodiment of the present invention, when it is detected in step 203b that the version information carried in the access request sent by the user is different from the latest version information stored in the server, it indicates that the website is updated and the website data used for loading in the server is still the data before updating, so that the server does not perform the operation of extracting the cache data and sending the cache data to the front end at this time, but returns the cache data to the front end error information, so that the front end forcibly refreshes the website after receiving the error information.
205b, outputting the second version information so that the front end can update the cached website version according to the second version information.
For the embodiment of the invention, when detecting that the version information carried in the access request sent by the user is different from the latest version information stored in the server, the server sends error information to the front end and sends the latest version information of the website to the front end, so that the front end can store the latest version information and judge according to the updated version information in the next access.
206b, acquiring the website data packet corresponding to the second version information.
And the website data packet is used for loading the website of the latest version. It should be noted that, after the front end receives the request error information sent by the server in step 204b, the front end sends the access request again to facilitate obtaining the updated website data from the server, so that after the server sends the request error information to the front end, the server receives the access request sent by the front end again, and obtains the website data packet corresponding to the latest version information in this step to facilitate further sending the updated website data to the front end.
For the embodiment of the invention, when the website has update, the updated configuration file can be packaged and stored in the server, so that the configuration file can be directly extracted in the step. In addition, in order to improve the utilization rate of the storage area in the server, deletion of the previous cache data may be triggered after the updated website data packet is extracted, or the cache data may be deleted after the updated website data packet is stored in the server.
207b, sending the website data packet to the front end.
Furthermore, the front end updates the cached website version according to the website data packet. For the embodiment of the invention, when the website is updated, the staff can pack the updated data and store the data in the server, so that when the server receives the access request sent by the front end, the data packet is extracted and sent to the front end, and the front end can receive the data packet and analyze and load the website page. Of course, in this step, in the embodiment of the present invention, the data packet may be analyzed at the server and the analyzed website data is directly sent to the front end, so that the front end directly loads the received analyzed website data, which is not specifically limited in this embodiment of the present invention.
It should be noted that, when the website is updated, the server sends all the updated data of the website to the front end, so as to load and display the website, instead of sending part of the updated data to the front end, thereby avoiding the problem of disordered website page layout caused by the front end receiving part of the updated data, and improving the performance of website updating.
Further, an embodiment of the present invention further provides a third method for updating a website, where the method is applied to a front end side, as shown in fig. 3, and the method includes:
301. and sending a website access request to the server.
The website access request carries first version information of a website, the first version information is used for identifying a website version of the front-end cache, second version information of the website is stored in the server, and the second version information is latest version information of the website.
In the embodiment of the present invention, a version field may be configured in the front end in advance, and whenever the website version is updated, the version information identified by the version field stored in the front end is updated. Meanwhile, when the website version is updated, the server stops using the cache data to load the website, and generates cache data of a new version after the website is loaded with the updated data, that is, the version information carried in the access request sent by the user is always the same as the version of the cache data. Therefore, the version information is carried in the request header when the user sends the access request, so that the server can timely acquire the version information of the cache data which is currently stored and used for loading the website when the user accesses each time, and whether the website is updated or not can be further judged.
302. And receiving an updating indication sent by the server.
And sending the update indication when the first version information is inconsistent with the second version information, wherein the update indication is used for indicating the front end to update the cached website version. In the embodiment of the present invention, when the server detects that the first version information and the second version information are not consistent, the front end may receive request error information sent by the server in addition to the update indication sent by the server, and when the front end receives the request error information returned by the server, the front end performs forced refresh on the website, that is, sends the access request again through the interface, so that the server returns updated data to the front end after receiving the access request.
303. And receiving the website data packet sent by the server.
And further, loading the latest version of the website according to the website data packet.
Specifically, in this step, the updated website page may be loaded by using the data after receiving and analyzing the data packet sent by the server, or the website data packet corresponding to the second version information may be analyzed by the server and then sent to the front end, so that the front end directly loads and displays the analyzed website data packet after receiving the analyzed website data packet, which is not specifically limited in this embodiment of the present invention.
304. And loading the website of the latest version according to the website data packet, and replacing the website cached at the front end with the website of the latest version.
For the embodiment of the invention, when the website version is updated, the updated version information is used for replacing the last version information stored before the update, so that the version information stored in the front end is updated in time, and a user can accurately judge whether the website is updated or not according to the version information when visiting the website again, thereby improving the accuracy of judging whether the website is updated or not and further improving the accuracy of updating the website.
For the embodiment of the present invention, the method may further include: setting the update state identifier as an update to-be-read state; determining the updated content of the website according to the website of the latest version and the cached website; the updated content of the website is displayed in a distinguishing way; and after the updated content of the website is read, setting the updated state identifier as an updated read state. The distinguishing display may be a highlight display, a blinking display, and the like, which is not specifically limited in this embodiment of the present invention. For the embodiment of the invention, when the website content is updated, the user can easily and conveniently discover the updated content of the website by performing the differential display, so that the use experience of the user is greatly improved.
The foregoing embodiments have described the data transmission process between the website update server and the front end in detail, and the following provides an embodiment for explaining the data interaction relationship between the server and the front end in the website update process. As shown in fig. 4, fig. 4 illustrates a fourth website updating method according to an embodiment of the present invention, where the method includes:
401. the front end sends a website access request to a server, wherein the website access request carries first version information of a website, and the first version information is used for identifying the website version cached by the front end. .
402. The server receives the website access request sent by the front end, and second version information of the website is stored in the server, and the second version information is the latest version information of the website.
403. Detecting whether the first version information and the second version information are the same.
404. And if the first version information is different from the second version, sending an updating instruction so that the front end updates the cached website version.
405. And the front end receives an updating instruction sent by the server and updates the website version cached by the front end according to the updating instruction.
406. The server outputs request error information and second version information.
407. And the front end sends the website access request again.
408. And the front end receives the website data packet sent by the server and loads the website of the latest version according to the website data packet.
For the description of steps 401 to 408, please refer to the above detailed description, and the embodiments of the present invention are not repeated herein.
In order to achieve the above object, according to another aspect of the present invention, an embodiment of the present invention further provides a storage medium, where the storage medium includes a stored program, and when the program runs, the apparatus on which the storage medium is located is controlled to execute the above method for updating a website.
In order to achieve the above object, according to another aspect of the present invention, an embodiment of the present invention further provides a processor, where the processor is configured to execute a program, where the program executes the method for updating a website described above.
Further, as an implementation of the method shown in fig. 1 and fig. 2, another embodiment of the present invention further provides a server. The embodiment of the apparatus corresponds to the embodiment of the method, and for convenience of reading, details in the embodiment of the apparatus are not repeated one by one, but it should be clear that the apparatus in the embodiment can correspondingly implement all the contents in the embodiment of the method. The server is applied to improve the performance of website update, and specifically as shown in fig. 5, the server includes:
a receiving unit 51, configured to receive a website access request sent by a front end, where the website access request carries first version information of a website, the first version information is used to identify a website version cached by the front end, and second version information of the website is stored in the server and is the latest version information of the website;
a detecting unit 52, configured to detect whether the first version information and the second version information are the same;
a sending unit 53, configured to send an update instruction if the first version information is different from the second version information, so that the front end updates the cached website version.
Further, as shown in fig. 6, the server further includes: an acquisition unit 54.
The obtaining unit 54 is configured to obtain, if the first version information is the same as the second version information, website cache data corresponding to the first version information, and display the website cache data at the front end.
Further, the apparatus further comprises: and an output unit 55.
The output unit 55 is configured to output request error information, where the request error information is used to indicate that the first version information and the second version information are different.
The output unit 55 is further configured to output the second version information, so that the front end updates the cached website version according to the second version information.
The obtaining unit 54 is further configured to obtain a website data packet corresponding to the second version information, where the website data packet is used to load the website of the latest version.
The sending unit 53 is further configured to send the website data packet to the front end, so that the front end updates the cached website version according to the website data packet.
Further, as an implementation of the method shown in fig. 3, another embodiment of the present invention further provides a front end. The embodiment of the apparatus corresponds to the embodiment of the method, and for convenience of reading, details in the embodiment of the apparatus are not repeated one by one, but it should be clear that the apparatus in the embodiment can correspondingly implement all the contents in the embodiment of the method. The front end is applied to improve the performance of website update, and specifically as shown in fig. 7, the front end includes:
a sending unit 61, configured to send a website access request to a server, where the website access request carries first version information of a website, the first version information is used to identify a website version cached at the front end, and second version information of the website is stored in the server, where the second version information is latest version information of the website.
A receiving unit 62, configured to receive the update instruction sent by the server.
The receiving unit 62 is further configured to receive the website data packet sent by the server, so as to load the latest version of website according to the website data packet.
Further, the front end further comprises:
and a loading unit 63, configured to load the website of the latest version according to the website data packet.
A replacing unit 64, configured to replace the website cached in the front end with the website of the latest version.
Further, the front end further comprises: a setting unit 65, a determination unit 66, a display unit 67.
The setting unit 65 is configured to set the update status flag to the update to-be-read status.
The determining unit 66 is configured to determine the updated content of the website according to the website of the latest version and the cached website.
The display unit 67 is configured to perform differentiated display on the updated content of the website.
The setting unit 65 is further configured to set the update status flag to the update read status after the update content of the website is read.
Further, as an implementation of the method and an application of the server and the front end, an embodiment of the present invention further provides a system for updating a website, as shown in fig. 8, where the system includes: such as the server 801 shown in fig. 5 or 6 and the front end 802 shown in fig. 7.
The method, the device and the system for updating the website provided by the embodiment of the invention comprise the steps that firstly, a front end sends a website access request to a server, then, after the server receives the website access request sent by the front end, whether first version information used for identifying a website version cached by the front end and second version information used for identifying the latest version information of the website carried in the website access request are the same or not is compared, and finally, if the first version information is different from the second version information, an updating instruction is sent out so that the front end updates the cached website version, and the front end receives the updating instruction and updates the website. Compared with the prior art, the method and the device have the advantages that when the website is updated, the configuration file of the website is modified, the website code is required to be manually modified, the updated website content can be obtained when a user visits the website, so that the website updating operation is complicated, and when the website is updated, if the name of the website configuration file is not modified, the updated website content cannot be obtained in time.
The server comprises a processor and a memory, the receiving unit, the detecting unit, the sending unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The front end comprises a processor and a memory, the transmitting unit, the receiving unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and the performance of website updating is improved by adjusting kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium, on which a program is stored, and when the program is executed by a processor, the program implements the update method of the website described in any one of the above embodiments.
The embodiment of the invention provides a processor, wherein the processor is used for running a program, and the program executes the updating method of the website in any one of the above embodiments when running.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
a server receives a website access request sent by a front end, wherein the website access request carries first version information of a website, the first version information is used for identifying a website version cached by the front end, second version information of the website is stored in the server, and the second version information is the latest version information of the website;
detecting whether the first version information and the second version information are the same;
if not, sending an updating instruction so that the front end updates the cached website version.
The embodiment of the present invention further provides another device, where the device includes a processor, a memory, and a program stored in the memory and capable of running on the processor, and the processor implements the following steps when executing the program:
the method comprises the steps that a front end sends a website access request to a server, wherein the website access request carries first version information of a website, the first version information is used for identifying a website version cached by the front end, second version information of the website is stored in the server, and the second version information is the latest version information of the website;
receiving an update instruction sent by the server, wherein the update instruction is sent when the first version information and the second version information are inconsistent and is used for instructing the front end to update the cached website version;
and updating the website version cached at the front end according to the updating indication.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform program code for initializing the following method steps when executed on a data processing device: a server receives a website access request sent by a front end, wherein the website access request carries first version information of a website, the first version information is used for identifying a website version cached by the front end, second version information of the website is stored in the server, and the second version information is the latest version information of the website; detecting whether the first version information and the second version information are the same; if not, sending an updating instruction so that the front end updates the cached website version.
The present application further provides another computer program product adapted to perform program code for initializing the following method steps when executed on a data processing device: the method comprises the steps that a front end sends a website access request to a server, wherein the website access request carries first version information of a website, the first version information is used for identifying a website version cached by the front end, second version information of the website is stored in the server, and the second version information is the latest version information of the website; receiving an update instruction sent by the server, wherein the update instruction is sent when the first version information and the second version information are inconsistent and is used for instructing the front end to update the cached website version; and updating the website version cached at the front end according to the updating indication.
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 present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
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). The 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 identical elements in the 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 are merely examples of the present application and are 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.
Claims (11)
1. A method for updating a website, comprising:
a server receives a website access request sent by a front end, wherein the website access request carries first version information of a website, the first version information is used for identifying a website version cached by the front end, second version information of the website is stored in the server, and the second version information is the latest version information of the website;
detecting whether the first version information and the second version information are the same;
if not, sending an updating instruction so that the front end updates the cached website version.
2. The method of claim 1, wherein after detecting that the first version information and the second version information are different, the method further comprises:
outputting request error information, wherein the request error information is used for indicating that the first version information and the second version information are different; and/or the presence of a gas in the gas,
outputting the second version information so that the front end can update the cached website version according to the second version information; and/or the presence of a gas in the gas,
acquiring a website data packet corresponding to the second version information, wherein the website data packet is used for loading a website of a latest version;
and sending the website data packet to the front end so that the front end updates the cached website version according to the website data packet.
3. The method of claim 1, further comprising:
and if the first version information is the same as the second version information, acquiring website cache data corresponding to the first version information, and displaying the website cache data at the front end.
4. A method for updating a website, comprising:
the method comprises the steps that a front end sends a website access request to a server, wherein the website access request carries first version information of a website, the first version information is used for identifying a website version cached by the front end, second version information of the website is stored in the server, and the second version information is the latest version information of the website;
receiving an update instruction sent by the server, wherein the update instruction is sent when the first version information and the second version information are inconsistent and is used for instructing the front end to update the cached website version;
and updating the website version cached at the front end according to the updating indication.
5. The method of claim 4, further comprising:
receiving a website data packet sent by the server so as to load the website of the latest version according to the website data packet;
the updating the website version cached at the front end according to the update indication includes:
and loading the website of the latest version according to the website data packet, and replacing the website cached at the front end with the website of the latest version.
6. The method of claim 4, wherein the front-end further caches an update status flag, and after updating the website version cached by the front-end according to the update indication, the method further comprises:
setting the update state identifier as an update to-be-read state; and/or the presence of a gas in the gas,
determining the updated content of the website according to the website of the latest version and the cached website;
the updated content of the website is displayed in a distinguishing way; and/or the presence of a gas in the gas,
and after the updated content of the website is read, setting the updated state identifier as an updated read state.
7. A server, comprising:
a receiving unit, configured to receive a website access request sent by a front end, where the website access request carries first version information of a website, the first version information is used to identify a website version cached by the front end, and second version information of the website is stored in the server and is latest version information of the website;
a detecting unit configured to detect whether the first version information and the second version information are the same;
and the updating unit is used for sending an updating instruction if the first version information is different from the second version information so as to enable the front end to update the cached website version.
8. A front end, comprising:
a sending unit, configured to send a website access request to a server, where the website access request carries first version information of a website, the first version information is used to identify a website version cached at the front end, and second version information of the website is stored in the server and is latest version information of the website;
a receiving unit, configured to receive an update instruction sent by the server, where the update instruction is sent when the first version information and the second version information are inconsistent, and is used to instruct the front end to update the cached website version;
and the updating unit is used for updating the website version cached at the front end according to the updating indication.
9. A system for updating a website, the system comprising: a server according to claim 7 and a front end according to claim 8.
10. A storage medium, characterized in that the storage medium comprises a stored program, wherein when the program runs, a device where the storage medium is located is controlled to execute the website updating method according to any one of claims 1 to 3;
or, the method of updating the website of claims 4 to 6 is performed.
11. A processor, wherein the processor is configured to execute a program, wherein the program executes the method for updating a website according to any one of claims 1 to 3;
or, the method of updating the website of claims 4 to 6 is performed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811136715.4A CN111061977A (en) | 2018-09-28 | 2018-09-28 | Website updating method, device and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811136715.4A CN111061977A (en) | 2018-09-28 | 2018-09-28 | Website updating method, device and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111061977A true CN111061977A (en) | 2020-04-24 |
Family
ID=70296212
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811136715.4A Pending CN111061977A (en) | 2018-09-28 | 2018-09-28 | Website updating method, device and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111061977A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112199617A (en) * | 2020-10-19 | 2021-01-08 | 广州华多网络科技有限公司 | Business data refreshing and pushing method and device, equipment and medium thereof |
CN115102857A (en) * | 2022-05-31 | 2022-09-23 | 深圳市大头兄弟科技有限公司 | Method, device, equipment and storage medium for updating client configuration data |
CN115701042A (en) * | 2021-07-29 | 2023-02-07 | 华为技术有限公司 | Method, device, system and computer readable storage medium for updating configuration |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106202176A (en) * | 2016-06-27 | 2016-12-07 | 武汉斗鱼网络科技有限公司 | A kind of method and system realizing website version heat upgrading |
CN106489145A (en) * | 2015-12-28 | 2017-03-08 | 华为技术有限公司 | The access method of web site, device and Web site system |
US10013497B1 (en) * | 2013-12-20 | 2018-07-03 | Google Llc | Background reloading of currently displayed content |
-
2018
- 2018-09-28 CN CN201811136715.4A patent/CN111061977A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10013497B1 (en) * | 2013-12-20 | 2018-07-03 | Google Llc | Background reloading of currently displayed content |
CN106489145A (en) * | 2015-12-28 | 2017-03-08 | 华为技术有限公司 | The access method of web site, device and Web site system |
CN106202176A (en) * | 2016-06-27 | 2016-12-07 | 武汉斗鱼网络科技有限公司 | A kind of method and system realizing website version heat upgrading |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112199617A (en) * | 2020-10-19 | 2021-01-08 | 广州华多网络科技有限公司 | Business data refreshing and pushing method and device, equipment and medium thereof |
CN115701042A (en) * | 2021-07-29 | 2023-02-07 | 华为技术有限公司 | Method, device, system and computer readable storage medium for updating configuration |
CN115102857A (en) * | 2022-05-31 | 2022-09-23 | 深圳市大头兄弟科技有限公司 | Method, device, equipment and storage medium for updating client configuration data |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018223717A1 (en) | Webpage front-end testing method, device, system, apparatus and readable storage medium | |
US9740668B1 (en) | Plotting webpage loading speeds and altering webpages and a service based on latency and pixel density | |
CN111061977A (en) | Website updating method, device and system | |
CN109600272B (en) | Crawler detection method and device | |
EP3528474B1 (en) | Webpage advertisement anti-shielding methods and content distribution network | |
CN112579948A (en) | Webpage screenshot method and device, storage medium and electronic equipment | |
CN111783005A (en) | Method, apparatus and system for displaying web page, computer system and medium | |
CN107220260B (en) | Page display method and device | |
CN105354490B (en) | Method and equipment for processing hijacked browser | |
JP6505849B2 (en) | Generation of element identifier | |
CN110019974B (en) | Chart drill-down implementation method and device | |
CN110020297A (en) | A kind of loading method of web page contents, apparatus and system | |
US20230351095A1 (en) | Reducing data usage for rendering state changes | |
CN113297267A (en) | Data caching and task processing method, device, equipment and storage medium | |
WO2023209658A1 (en) | Platform independent session player | |
CN103106140A (en) | Intelligent display device testing information display method | |
CN111339380B (en) | Interface time-consuming data processing method and related device | |
CN108846141B (en) | Offline cache loading method and device | |
CN108228145A (en) | Data processing method, system and the mobile equipment of mixed type application program | |
CN110020906B (en) | Order information detection method and device | |
CN107766216A (en) | It is a kind of to be used to obtain the method and apparatus using execution information | |
CN111966557A (en) | Method and device for monitoring browser frame rate | |
CN110929184A (en) | Link display method, system, storage medium and processor | |
CN111104623A (en) | Webpage data caching method, device, server and storage medium | |
CN111125590A (en) | Method and device for drawing thermodynamic diagram |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200424 |
|
RJ01 | Rejection of invention patent application after publication |