Local updating method and system for webpage
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and a system for locally updating a web page.
Background
The navigation page is a home page of the browser, and the content of the navigation page can be dynamically configured and flexibly displayed, which directly affects the display rate of the operation content and the use viscosity of the user.
In the prior art, when the navigation page content is displayed, a WebView control (a control) is usually used to control the navigation page content to be displayed on the navigation page in the form of an Html (hypertext markup language) page. Or the navigation page content is presented in a list form by using a listView control (a type of control).
The two modes are the most common two navigation page content display modes at present due to the flexible display mode. Besides the navigation page content needs to be displayed, if the navigation page content is changed, updating the navigation page content is also involved. However, the current navigation page content update is inefficient.
Disclosure of Invention
The invention provides a method and a system for locally updating a webpage, which aim to solve the technical problem that the content of the current navigation page does not support local updating.
The invention discloses a local updating method of a webpage, which comprises the following steps:
the client extracts card identifications of all current navigation cards used for updating the webpage from the index file sent by the server, compares the card identifications of all original navigation cards forming the webpage, and acquires the navigation cards needing to be updated;
the client side extracts the card name of the navigation card to be updated from the index file based on the navigation card to be updated;
the client further extracts the card content of the navigation card to be updated based on the card name of the navigation card to be updated;
and the client replaces the corresponding card content of the original navigation card with the card content of the navigation card to be updated, so as to realize the local update of the webpage.
Optionally, before the client extracts card identifiers of all current navigation cards used for updating the web page from the index file and compares the card identifiers of all original navigation cards forming the web page, and acquires a navigation card to be updated, the method further includes:
the client sends a configuration request for requesting to update the webpage to the server;
the client acquires an index file returned by the server based on the configuration request; the index file at least comprises the card identifications of all the current navigation cards, the card names of all the current navigation cards and the card contents of all the current navigation cards.
Optionally, the method for obtaining the navigation card to be updated by comparing the card identifiers of all current navigation cards extracted from the index file by the client and the card identifiers of all original navigation cards forming the web page includes:
the client compares the card identifications of all the current navigation cards with the card identifications of all the original navigation cards to judge the current navigation card with the changed card identification;
and the client determines the current navigation card with the changed card identification as the navigation card to be updated.
Optionally, after the client replaces the card content of the corresponding original navigation card with the card content of the navigation card to be updated, the method further includes:
the client acquires a corresponding display style based on the card name of the navigation card to be updated;
and the client displays the card content of the navigation card to be updated according to the corresponding display style.
Optionally, the displaying, by the client, the card content of the navigation card to be updated according to a corresponding display style includes:
the client acquires a corresponding data format based on the card name of the navigation card to be updated;
the client restricts the card content of the navigation card to be updated into a corresponding data object according to a corresponding data format;
and the client displays the data object corresponding to the card content of the navigation card to be updated according to the corresponding display style.
Optionally, after the client displays the card content of the navigation card to be updated according to the corresponding display style, the method further includes:
the client side obtains a new card name of the navigation card to be updated based on the index file;
the client acquires a corresponding new display style based on the new card name of the navigation card to be updated;
and the client displays the card content of the navigation card to be updated according to the corresponding new display style.
Optionally, after the client displays the card content of the navigation card to be updated according to the corresponding display style, the method further includes:
the client sends an acquisition request for acquiring a new card name of the navigation card to be updated to the server;
the client obtains a new card name of the navigation card to be updated, which is returned by the server;
the client acquires a corresponding new display style based on the new card name of the navigation card to be updated;
and the client displays the card content of the navigation card to be updated according to the corresponding new display style.
Optionally, the client replaces the corresponding card content of the original navigation card with the card content of the navigation card to be updated, and after the local update of the webpage is implemented, the method further includes:
the client side obtains a mode switching request; the mode switching request is used for requesting to switch the current display mode of the webpage into a target display mode;
the client side obtains the target display mode based on the mode switching request;
the client side obtains the display style of each navigation card forming the webpage and the arrangement mode of each navigation card forming the webpage based on the parameters of the target display mode;
and the client displays the navigation cards forming the webpage according to the display style of the navigation cards forming the webpage and the arrangement mode among the navigation cards forming the webpage.
The invention discloses a local updating method of a webpage, which comprises the following steps:
the server sends an index file to the client, so that the client extracts card identifications of all current navigation cards used for updating the webpage from the index file and compares the card identifications of all original navigation cards forming the webpage to obtain the navigation cards needing to be updated; then the client side extracts the card name of the navigation card to be updated from the index file based on the navigation card to be updated; then the client further updates the card content of the navigation card to be updated based on the card name of the navigation card to be updated; and then the client replaces the corresponding card content of the original navigation card with the card content of the navigation card to be updated, so as to realize the local update of the webpage.
Optionally, before the server sends the index file to the client, the method further includes:
the server carries out independent configuration on all the current navigation cards by utilizing respective independent configuration inlets to obtain card names of all the current navigation cards, card identifications of all the current navigation cards and card contents of all the current navigation cards;
and configuring the card names of all the current navigation cards, the card identifications of all the current navigation cards and the card contents of all the current navigation cards into an index file.
Optionally, the configuring, as an index file, card names of all current navigation cards, card identifiers of all current navigation cards, and card contents of all current navigation cards includes:
determining the current navigation card of which the card content needs to be changed from all the current navigation cards;
the method comprises the steps that the independent configuration inlets of the current navigation card needing to change the card content are utilized, so that the original card content of the current navigation card needing to change the card content is replaced by the new card content of the current navigation card needing to change the card content;
obtaining a card identifier of the current navigation card needing to change the card content based on the new card content of the current navigation card needing to change the card content;
and configuring the card identification of the current navigation card needing to change the card content, the new card content of the current navigation card needing to change the card content and the card name of the current navigation card needing to change the card content as the index file.
The invention discloses a client, comprising:
the comparison unit is used for extracting card identifiers of all current navigation cards used for updating the webpage from the index file sent by the server, comparing the card identifiers of all original navigation cards forming the webpage and acquiring the navigation cards needing to be updated;
the first extraction unit is used for extracting the card name of the navigation card to be updated from the index file based on the navigation card to be updated;
the second extraction unit is used for further extracting the card content of the navigation card to be updated based on the card name of the navigation card to be updated;
and the updating unit is used for replacing the corresponding card content of the original navigation card with the card content of the navigation card to be updated so as to realize the local updating of the webpage.
Optionally, the client further includes:
the first sending unit is further used for sending a configuration request for requesting to update the webpage to the server;
a first obtaining unit, configured to obtain, based on the configuration request, an index file returned by the server, where the index file includes at least card identifiers of all current navigation cards and card names of all current navigation cards;
the obtaining unit is further configured to at least include the card identifiers of all the current navigation cards and the card names of all the current navigation cards from the index file.
Optionally, the comparison unit includes:
the comparison subunit is used for comparing the card identifiers of all the current navigation cards with the card identifiers of all the original navigation cards by the client side, and judging the current navigation card with the changed card identifier;
and the determining unit is used for determining the current navigation card with the changed card identification as the navigation card to be updated.
Optionally, the client further includes:
the second acquisition unit is used for acquiring a corresponding display style based on the card name of the navigation card to be updated;
and the first display unit is used for displaying the card content of the navigation card to be updated according to the corresponding display style.
Optionally, the client further includes:
the second obtaining unit is further configured to obtain a corresponding data format based on the card name of the navigation card to be updated;
the constraint unit is used for constraining the card content of the navigation card to be updated into a corresponding data object according to a corresponding data format;
the first display unit is further configured to display the data object corresponding to the card content of the navigation card to be updated according to the corresponding display style.
Optionally, the second obtaining unit is further configured to obtain a new card name of the navigation card to be updated based on the index file;
the second obtaining unit is further configured to obtain a corresponding new presentation style based on the new card name of the navigation card to be updated;
the first display unit is further configured to display the card content of the navigation card to be updated according to the corresponding new display style.
Optionally, the client further includes:
a second sending unit, configured to send, to the server, an acquisition request for acquiring a new card name of the navigation card to be updated;
the second obtaining unit is further configured to obtain a new card name of the navigation card to be updated, which is returned by the server;
the second obtaining unit is further configured to obtain a corresponding new presentation style based on the new card name of the navigation card to be updated;
the first display unit is further configured to display the card content of the navigation card to be updated according to the corresponding new display style.
Optionally, the client further includes:
an obtaining unit, configured to obtain a mode switching request; the mode switching request is used for requesting to switch the current display mode of the webpage into a target display mode; obtaining the target display mode based on the mode switching request; obtaining the display style of each navigation card forming the webpage and the arrangement mode among the navigation cards forming the webpage based on the parameters of the target display mode;
and the second display unit is also used for displaying the navigation cards forming the webpage according to the display styles of the navigation cards forming the webpage and the arrangement mode among the navigation cards forming the webpage.
The invention discloses a server, comprising:
the sending module is used for sending the index file to the client, so that the client extracts card identifiers of all current navigation cards used for updating the webpage from the index file and compares the card identifiers of all original navigation cards forming the webpage to obtain the navigation cards needing to be updated; then the client side extracts the card name of the navigation card to be updated from the index file based on the navigation card to be updated; then the client further updates the card content of the navigation card to be updated based on the card name of the navigation card to be updated; and then the client replaces the corresponding card content of the original navigation card with the card content of the navigation card to be updated, so as to realize the local update of the webpage.
Optionally, the server further includes:
the acquisition module is used for carrying out independent configuration on all the current navigation cards by utilizing respective independent configuration inlets to acquire the card names of all the current navigation cards, the card identifications of all the current navigation cards and the card contents of all the current navigation cards;
and the configuration module is used for configuring the card names of all the current navigation cards, the card identifications of all the current navigation cards and the card contents of all the current navigation cards into an index file.
Optionally, the determining module is configured to determine, from among all the current navigation cards, a current navigation card whose card content needs to be changed;
the replacement module is used for replacing the original card content of the current navigation card needing to change the card content with the new card content of the current navigation card needing to change the card content by utilizing the independent configuration inlets of the current navigation card needing to change the card content;
the obtaining module is further used for obtaining a card identifier of the current navigation card of which the card content needs to be changed based on the new card content of the current navigation card of which the card content needs to be changed;
the configuration module is further configured to configure the card identifier of the current navigation card whose card content needs to be changed, the new card content of the current navigation card whose card content needs to be changed, and the card name of the current navigation card whose card content needs to be changed as the index file.
The invention discloses a local updating method of a webpage, which comprises the following steps:
the client extracts card identifications of all current navigation cards used for updating the webpage from an index file sent by the server, compares the card identifications of all original navigation cards forming the webpage, and acquires the navigation cards needing to be updated;
the client side extracts the card name of the navigation card to be updated from the index file based on the navigation card to be updated;
the client further extracts the card content of the navigation card to be updated based on the card name of the navigation card to be updated;
and the client replaces the corresponding card content of the original navigation card with the card content of the navigation card to be updated, so as to realize the local update of the webpage.
Optionally, before the client extracts card identifiers of all current navigation cards used for updating the web page from the index file sent by the server, and compares the card identifiers with card identifiers of all original navigation cards forming the web page, and acquires a navigation card to be updated, the method further includes:
the client sends a configuration request for requesting to update the webpage to the server;
the server acquires an index file based on the configuration request and sends the index file to the client; the index file at least comprises the card identifications of all the current navigation cards, the card names of all the current navigation cards and the card contents of all the current navigation cards.
Optionally, the method for obtaining the navigation card to be updated by comparing the card identifiers of all current navigation cards extracted from the index file by the client and the card identifiers of all original navigation cards forming the web page includes:
the client compares the card identifications of all the current navigation cards with the card identifications of all the original navigation cards to judge the current navigation card with the changed card identification;
and the client determines the current navigation card with the changed card identification as the navigation card to be updated.
Optionally, after the client replaces the card content of the corresponding original navigation card with the card content of the navigation card to be updated, the method further includes:
the client acquires a corresponding display style based on the card name of the navigation card to be updated;
and the client displays the card content of the navigation card to be updated according to the corresponding display style.
Optionally, the displaying, by the client, the card content of the navigation card to be updated according to a corresponding display style includes:
the client acquires a corresponding data format based on the card name of the navigation card to be updated;
the client restricts the card content of the navigation card to be updated into a corresponding data object according to a corresponding data format;
and the client displays the data object corresponding to the card content of the navigation card to be updated according to the corresponding display style.
Optionally, after the client displays the card content of the navigation card to be updated according to the corresponding display style, the method further includes:
the client side obtains a new card name of the navigation card to be updated based on the index file;
the client acquires a corresponding new display style based on the new card name of the navigation card to be updated;
and the client displays the card content of the navigation card to be updated according to the corresponding new display style.
Optionally, after the client displays the card content of the navigation card to be updated according to the corresponding display style, the method further includes:
the client sends an acquisition request for acquiring a new card name of the navigation card to be updated to the server;
the server obtains a new card name of the navigation card to be updated based on the acquisition request;
the server sends the new card name of the navigation card to be updated to the client;
the client acquires a corresponding new display style based on the new card name of the navigation card to be updated;
and the client displays the card content of the navigation card to be updated according to the corresponding new display style.
Optionally, the client replaces the corresponding card content of the original navigation card with the card content of the navigation card to be updated, and after the local update of the webpage is implemented, the method further includes:
the client side obtains a mode switching request; the mode switching request is used for requesting to switch the current display mode of the webpage into a target display mode;
the client side obtains the target display mode based on the mode switching request;
the client side obtains the display style of each navigation card forming the webpage and the arrangement mode of each navigation card forming the webpage based on the parameters of the target display mode;
and the client displays the navigation cards forming the webpage according to the display style of the navigation cards forming the webpage and the arrangement mode among the navigation cards forming the webpage.
The invention discloses a local updating system of a webpage, which comprises:
the client is used for extracting card identifiers of all current navigation cards used for updating the webpage from the sent index file, comparing the card identifiers with the card identifiers of all original navigation cards forming the webpage, and acquiring the navigation cards needing to be updated;
the client is used for extracting the card name of the navigation card to be updated from the index file based on the navigation card to be updated;
the server is used for further extracting the card content of the navigation card to be updated based on the card name of the navigation card to be updated;
and the client is used for replacing the corresponding card content of the original navigation card with the card content of the navigation card to be updated, so as to realize local updating of the webpage.
Optionally, the method includes:
the client is used for sending a configuration request for requesting to update the webpage to the server;
the server is used for acquiring an index file based on the configuration request and sending the index file to the client; the index file at least comprises the card identifications of all the current navigation cards, the card names of all the current navigation cards and the card contents of all the current navigation cards.
Optionally, the client is configured to compare the card identifiers of all current navigation cards with the card identifiers of all original navigation cards, and determine a current navigation card with a changed card identifier;
and the client is used for determining the current navigation card with the changed card identification as the navigation card to be updated.
Optionally, the client is configured to obtain a corresponding presentation style based on the card name of the navigation card to be updated;
and the client is used for displaying the card content of the navigation card to be updated according to the corresponding display style.
Optionally, the client is configured to obtain a corresponding data format based on the card name of the navigation card to be updated;
the client is used for constraining the card content of the navigation card to be updated into a corresponding data object according to a corresponding data format;
and the client is used for displaying the data object corresponding to the card content of the navigation card to be updated according to the corresponding display style.
Optionally, the client is configured to obtain a new card name of the navigation card to be updated based on the index file;
the client is used for acquiring a corresponding new display style based on the new card name of the navigation card needing to be updated;
and the client is used for displaying the card content of the navigation card to be updated according to the corresponding new display style.
Optionally, the client is configured to send an obtaining request for obtaining a new card name of the navigation card to be updated to the server;
the server is used for obtaining a new card name of the navigation card to be updated based on the acquisition request;
the server is used for sending the new card name of the navigation card to be updated to the client;
the client acquires a corresponding new display style based on the new card name of the navigation card to be updated;
and the client is used for displaying the card content of the navigation card to be updated according to the corresponding new display style.
Optionally, the client is configured to obtain a mode switching request; the mode switching request is used for requesting to switch the current display mode of the webpage into a target display mode;
the client is used for obtaining the target display mode based on the mode switching request;
the client is used for obtaining the display style of each navigation card forming the webpage and the arrangement mode of each navigation card forming the webpage based on the parameters of the target display mode;
and the client is used for displaying the navigation cards forming the webpage according to the display styles of the navigation cards forming the webpage and the arrangement mode among the navigation cards forming the webpage.
Through one or more technical schemes of the invention, the invention has the following beneficial effects or advantages:
the invention provides a local updating method and a local updating system of a webpage, when the webpage needs to be updated, a client extracts card identifications of all current navigation cards used for updating the webpage from an index file sent by a server, compares the card identifications of all original navigation cards forming the webpage, and acquires the navigation cards needing to be updated; then based on the navigation card to be updated, extracting the card name of the navigation card to be updated from the index file, and further obtaining the card content of the navigation card to be updated; and then replacing the corresponding card content of the original navigation card with the card content of the navigation card to be updated, thereby realizing the local update of the webpage. Because the webpage of the invention is composed of the navigation cards, when the local updating is realized, the local updating can be finished only by finding out the navigation card to be updated and replacing the corresponding card content of the original navigation card with the card content of the navigation card to be updated, and the updating of the navigation cards is not influenced mutually. Therefore, the webpage local updating scheme only needs to update one part of the webpage, so that the updating process is fast, the required operation cost is low, and the updating efficiency of the webpage is far higher than the whole updating efficiency of the existing webpage.
Drawings
FIG. 1 is an architecture diagram of a local update system for a web page in an embodiment of the present invention;
FIG. 2 is a flowchart of a method for local updating of a web page according to an embodiment of the present invention;
FIG. 3 is a process diagram of another method for partial update of a client-side web page according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a client according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art to which the present application pertains will more clearly understand the present application, 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 first embodiment is as follows:
before describing the method embodiment of the present invention, a local update system architecture of a web page in the embodiment of the present invention is described, as shown in fig. 1, the system includes: a client 101 and a server 102. As shown in fig. 1, the server 102 may be in communication connection with N clients 101, where N is a natural number, where a communication mode between the client 101 and the server 102 may be wired communication or wireless communication, and the client 101 may specifically be a smart phone, a tablet computer, an intelligent wearable device, and the like, which is not limited in this application.
The main interactive process of the client and the server of the local updating method of the webpage comprises the following steps:
the client extracts card identifications of all current navigation cards used for updating the webpage from an index file sent by the server, compares the card identifications of all original navigation cards forming the webpage, and acquires the navigation cards needing to be updated;
the client side extracts the card name of the navigation card to be updated from the index file based on the navigation card to be updated;
the client further extracts the card content of the navigation card to be updated based on the card name of the navigation card to be updated;
and the client replaces the corresponding card content of the original navigation card with the card content of the navigation card to be updated, so as to realize the local update of the webpage.
The invention divides the web page into a plurality of navigation cards, the web page includes but is not limited to navigation page, other web pages are also suitable for the invention. When the local updating is realized, the local updating can be completed only by finding out the navigation card to be updated and replacing the card content of the navigation card to be updated, all the navigation cards can be dynamically updated, and the updating of the navigation cards is not influenced by each other.
Before the latest update is not made, the webpage of the invention is actually composed of all the original navigation cards which are configured and sent to the client end through the server and are used for forming the navigation card of the webpage.
When the web page needs to be updated, the server will configure the navigation card again to update the web page, which is referred to as the current navigation card. In all the configured current navigation cards, some current navigation cards are the same as the original navigation cards, and some current navigation cards are changed.
Please refer to fig. 2, which is a block diagram of a method for updating a local portion of a web page according to the present invention.
S1, when the client needs to update the web page, the client first sends a configuration request for requesting to update the web page to the server.
S2, after receiving the configuration request, the server obtains the index file based on the configuration request.
The index file is configured by a server and at least comprises card identifications of all current navigation cards, card names of all current navigation cards and card contents of all current navigation cards.
S3, the server sends the index file to the client. And then the client acquires the index file returned by the server.
And S4, the client extracts the card identifiers of all current navigation cards used for updating the webpage from the index file sent by the server.
And S5, the client compares the card identifications of all the current navigation cards with the card identifications of all the original navigation cards forming the webpage to obtain the navigation cards needing to be updated.
In a specific implementation process, after receiving an index file sent by a server, a client extracts card identifiers of all current navigation cards used for updating a webpage from the index file, compares the card identifiers with card identifiers of all original navigation cards forming the webpage, and judges the current navigation card with the changed card identifier. And the client determines the current navigation card with the changed card identification as the navigation card to be updated.
Specifically, after the two are compared, it can be known which navigation cards have changed card identifiers, and the card identifiers change to represent that the card contents change, so that the card contents of the navigation cards need to be updated, and the navigation cards with changed card contents are named as: a navigation card to be updated.
And S6, the client extracts the card name of the navigation card to be updated from the index file based on the navigation card to be updated.
And S7, the client further extracts the card content of the navigation card to be updated based on the card name of the navigation card to be updated.
And S8, the client replaces the corresponding card content of the original navigation card with the card content of the navigation card to be updated, so as to realize the local update of the webpage.
In another alternative embodiment, after the original navigation card is updated, the client will also display the card content of the updated navigation card on the web page. And when the navigation card is displayed, the client acquires the corresponding display style based on the card name of the navigation card to be updated. And the client displays the card content of the navigation card to be updated according to the corresponding display style. Namely, the client displays the navigation cards differently according to the card names of the navigation cards.
Specifically, the client acquires a corresponding data format based on the card name of the navigation card to be updated; the client restricts the card content of the navigation card to be updated into a corresponding data object according to a corresponding data format; and the client displays the data object corresponding to the card content of the navigation card to be updated according to the corresponding display style.
For example, when a navigation card needs to be displayed after being updated, the card content of the navigation card is firstly analyzed, and a data object operable by the client is generated in a corresponding data format. And then displaying the data object according to the display style corresponding to the card name.
The navigation cards forming the webpage have different display styles no matter the navigation cards need to be updated or the original navigation cards which are not updated, the display style of other navigation cards cannot be influenced by the display of a single navigation card, the client side can perform different display processing according to different card names, the expansion flexibility can be improved, the display of the navigation cards cannot be influenced by each other, further excessive coupling with other navigation cards is not needed, and the card expansion cost is reduced.
Of course, each navigation card may have more than a single presentation style, and each navigation card may correspond to multiple presentation styles. The triggering mechanism for triggering the navigation card to change the display style can receive the triggering of an instruction sent by a user for switching the display style of the webpage, and can also trigger the client to change the display style of the webpage at regular time.
If the display style of the navigation card is to be changed, the name of the navigation card can be directly changed to change the display style, and the content of the navigation card is kept unchanged. Furthermore, the invention can adjust different showing styles for the same card content, thereby realizing low-cost operation.
In a specific implementation process, the new card name of the navigation card has two acquisition modes.
The first method is that when the server sends the index file to the client, the index file already carries the new card name of the navigation card. Therefore, when the display style needs to be changed, the client obtains a new card name of the navigation card needing to be updated based on the index file; the client acquires a corresponding new display style based on the new card name of the navigation card to be updated; and the client displays the card content of the navigation card to be updated according to the corresponding new display style.
The second method is that the client sends an acquisition request to the server again, and the server sends a new card name of the navigation card to the client. In a specific implementation process, the client sends an acquisition request for acquiring a new card name of the navigation card to be updated to the server; the server obtains a new card name of the navigation card to be updated based on the acquisition request; the client obtains a new card name of the navigation card to be updated, which is returned by the server; the client acquires a corresponding new display style based on the new card name of the navigation card to be updated; and the client displays the card content of the navigation card to be updated according to the corresponding new display style.
The above is the client side presentation process for the navigation card.
In an alternative embodiment, the web page may be displayed in a plurality of modes, such as a no-picture mode, a night mode, a normal mode, and the like. If the web page is switched from one display mode to another, see the following implementation.
The client obtains a mode switch request. The mode switching request is used for requesting to switch the current display mode of the webpage into a target display mode. The current display mode and the destination display mode are two different display modes.
And the client acquires the target display mode based on the mode switching request. Under different display modes, the navigation cards forming the webpage all have respective display styles and have specific arrangement modes among the navigation cards forming the webpage. On the basis of realizing local webpage updating, the navigation cards forming the webpage at present comprise the navigation card needing to be updated and the original navigation card which is not updated and is left after being replaced by the navigation card needing to be updated.
The client side obtains the display style of each navigation card forming the webpage and the arrangement mode of each navigation card forming the webpage based on the parameters of the target display mode;
and the client displays the navigation cards forming the webpage according to the display style of the navigation cards forming the webpage and the arrangement mode among the navigation cards forming the webpage.
The above is a specific implementation process of the method for local update of the web page. Based on the same inventive concept, the following embodiments introduce a system for partial update of a web page.
Example two:
in an embodiment of the invention, a system for local updating of a web page is introduced.
The client is used for extracting card identifiers of all current navigation cards used for updating the webpage from the sent index file, comparing the card identifiers with the card identifiers of all original navigation cards forming the webpage, and acquiring the navigation cards needing to be updated;
the client is used for extracting the card name of the navigation card to be updated from the index file based on the navigation card to be updated;
the server is used for further extracting the card content of the navigation card to be updated based on the card name of the navigation card to be updated;
and the client is used for replacing the corresponding card content of the original navigation card with the card content of the navigation card to be updated, so as to realize local updating of the webpage.
In a further alternative embodiment of the method,
the client is used for sending a configuration request for requesting to update the webpage to the server;
the server is used for acquiring an index file based on the configuration request and sending the index file to the client; the index file at least comprises card identifications of all current navigation cards, card names of all current navigation cards and card contents of all current navigation cards;
in a further alternative embodiment of the method,
the client is used for comparing the card identifications of all the current navigation cards with the card identifications of all the original navigation cards and judging the current navigation card with changed card identifications;
and the client is used for determining the current navigation card with the changed card identification as the navigation card to be updated.
In a further alternative embodiment of the method,
the client is used for acquiring a corresponding display style based on the card name of the navigation card to be updated;
and the client is used for displaying the card content of the navigation card to be updated according to the corresponding display style.
In a further alternative embodiment of the method,
the client is used for acquiring a corresponding data format based on the card name of the navigation card to be updated;
the client is used for constraining the card content of the navigation card to be updated into a corresponding data object according to a corresponding data format;
and the client is used for displaying the data object corresponding to the card content of the navigation card to be updated according to the corresponding display style.
In a further alternative embodiment of the method,
the client is used for obtaining a new card name of the navigation card to be updated based on the index file;
the client is used for acquiring a corresponding new display style based on the new card name of the navigation card needing to be updated;
and the client is used for displaying the card content of the navigation card to be updated according to the corresponding new display style.
In a further alternative embodiment of the method,
the client is used for sending an acquisition request for acquiring a new card name of the navigation card to be updated to the server;
the server is used for obtaining a new card name of the navigation card to be updated based on the acquisition request;
the server is used for sending the new card name of the navigation card to be updated to the client;
the client acquires a corresponding new display style based on the new card name of the navigation card to be updated;
and the client is used for displaying the card content of the navigation card to be updated according to the corresponding new display style.
In a further alternative embodiment of the method,
the client is used for obtaining a mode switching request; the mode switching request is used for requesting to switch the current display mode of the webpage into a target display mode;
the client is used for obtaining the target display mode based on the mode switching request;
the client is used for obtaining the display style of each navigation card forming the webpage and the arrangement mode of each navigation card forming the webpage based on the parameters of the target display mode;
and the client is used for displaying the navigation cards forming the webpage according to the display styles of the navigation cards forming the webpage and the arrangement mode among the navigation cards forming the webpage.
Example three:
the embodiment provides a method for local update of a web page, which is applied to a client side, and as shown in fig. 3, the method includes:
s301, the client extracts card identifiers of all current navigation cards used for updating the webpage from the index file sent by the server, compares the card identifiers of all original navigation cards forming the webpage, and obtains the navigation cards needing to be updated.
Before the latest update is not made, the webpage of the invention is actually composed of all the original navigation cards which are configured and sent to the client end through the server and are used for forming the navigation card of the webpage.
When the web page needs to be updated, the server will configure the navigation card again to update the web page, which is referred to as the current navigation card. In all the configured current navigation cards, some current navigation cards are the same as the original navigation cards, and some current navigation cards are changed.
Before executing S301, the embodiment of the present invention further has the following steps:
the client sends a configuration request for requesting to update the webpage data to the server;
and the client acquires the index file returned by the server based on the configuration request.
Specifically, the index file is configured by the server and sent to the client.
Each current navigation card is provided with an independent configuration entrance, and the server mainly utilizes the independent configuration entrance to configure when configuring each current navigation card.
After the current navigation card is configured, the index file is configured based on the current navigation card:
and obtaining the card names of all the current navigation cards, the card identifications of all the current navigation cards and the card contents of all the current navigation cards. And then configuring the card names of all the current navigation cards, the card identifications of all the current navigation cards and the card contents of all the current navigation cards into an index file.
Furthermore, the index file at least comprises the card identification of the current navigation card, the card name of the current navigation card and the card content of the current navigation card.
For a specific configuration process, please refer to the server-side embodiment, which is not described herein.
And for the current navigation cards, each current navigation card has its own card identification (e.g., card ID) and card content. If the card content changes, the card identification also changes. And the client extracts all the card identifications of the current navigation card from the index file, compares the card identifications with all the card identifications of the original navigation card, and judges the current navigation card with the changed card identification. The card identification changes, that is, the representative card content changes, so that the card content of the original navigation card needs to be replaced by the card content of the current navigation card for updating.
The client determines the current navigation card with the changed card identification as follows: a navigation card to be updated.
S302, the client extracts the card name of the navigation card to be updated from the index file based on the navigation card to be updated.
The card name of the navigation card to be updated is used for searching the corresponding card content.
And S303, the client further extracts the card content of the navigation card to be updated based on the card name of the navigation card to be updated.
S304, the client replaces the corresponding card content of the original navigation card with the card content of the navigation card to be updated, and local updating of the webpage is achieved.
After the client replaces the corresponding card content of the original navigation card with the card content of the navigation card to be updated, the card content of the navigation card to be updated is required to be displayed on the webpage.
Specifically, the client acquires the corresponding presentation style based on the card name of the navigation card to be updated. And then displaying the card content of the navigation card to be updated according to the corresponding display style.
Further, the client acquires a corresponding data format based on the card name of the navigation card to be updated;
the client restricts the card content of the navigation card to be updated into a corresponding data object according to a corresponding data format;
and the client displays the data object corresponding to the card content of the navigation card to be updated according to the corresponding display style.
For example, after a navigation card replaces the original navigation card for updating and needs to be displayed, the client analyzes the card content of the navigation card and generates a data object operable by the client in a corresponding data format. And then displaying the data object according to the display style corresponding to the card name.
The navigation cards forming the webpage have different display styles no matter the navigation cards need to be updated or the original navigation cards which are not updated, the display style of other navigation cards cannot be influenced by the display of a single navigation card, the client side can perform different display processing according to different card names, the expansion flexibility can be improved, the display of the navigation cards cannot be influenced by each other, further excessive coupling with other navigation cards is not needed, and the card expansion cost is reduced.
Furthermore, the card name of the navigation card can be changed, when the card name is changed, the corresponding card data format is also changed correspondingly, and the presentation style based on the card data format is also changed correspondingly, but even if the card name is changed, the card content is kept unchanged. Furthermore, the invention can adjust different showing styles for the same card content, thereby realizing low-cost operation.
In a specific implementation process, the new card name of the navigation card has two acquisition modes.
The first method is that when the server sends the index file to the client, the index file already carries the new card name of the navigation card. Therefore, when the display style needs to be changed, the client obtains a new card name of the navigation card needing to be updated based on the index file; the client acquires a corresponding new display style based on the new card name of the navigation card to be updated; and the client displays the card content of the navigation card to be updated according to the corresponding new display style.
The second method is that the client sends an acquisition request to the server again, and the server sends a new card name of the navigation card to the client. In a specific implementation process, the client sends an acquisition request for acquiring a new card name of the navigation card to be updated to the server; the server obtains a new card name of the navigation card to be updated based on the acquisition request; the client obtains a new card name of the navigation card to be updated, which is returned by the server; the client acquires a corresponding new display style based on the new card name of the navigation card to be updated; and the client displays the card content of the navigation card to be updated according to the corresponding new display style.
The above is the client side presentation process for the navigation card.
In an alternative embodiment, the web page may be displayed in a plurality of modes, such as a no-picture mode, a night mode, a normal mode, and the like. When the client manages the navigation cards, all the cards of the navigation screen are managed in a unified mode.
The client can package the public attributes of the navigation card, including the display position, the card name, the card type and the like, and can also package the method for operating the navigation card, including preloading, updating (such as calling of night mode and non-image mode state) and the like. Because different navigation cards have different display styles but the same behavior (e.g., performing a display process, performing an update process, etc.). The display style of the navigation card is packaged according to product requirements in a distinguishing manner, and corresponding reality logics such as a night mode, a non-image mode and the like can be processed according to different local settings.
For example, when managing the navigation card, the client manages the navigation card in a list form, and encapsulates the display position of the navigation card, the card name, and the like. See table 1.
TABLE 1
In addition, the client encapsulates the behavior of processing the card.
These are all co-linear arrangements of navigation cards.
Of course, there are different display locations, display styles, etc. for different cards. These specific display locations and presentation styles (e.g., style one, style two) are packaged differently.
When the navigation card needs to be called, the corresponding package can be untied for calling.
The navigation content is uniformly managed and the cards are displayed differently in a mode of packaging different card types, uniform abstraction and respective packaging.
In addition, the card display is realized through the client, so that the card display is convenient to get through with the client setting style, and the problem of setting compatibility is solved.
If the web page is switched from one display mode to another, see the following implementation.
The client obtains a mode switch request. The mode switching request is used for requesting to switch the current display mode of the webpage into a target display mode. The current display mode and the destination display mode are two different display modes.
And the client acquires the target display mode based on the mode switching request. Under different display modes, the navigation cards forming the webpage all have respective display styles and have specific arrangement modes among the navigation cards forming the webpage. On the basis of realizing local webpage updating, the navigation cards forming the webpage at present comprise the navigation card needing to be updated and the original navigation card which is not updated and is left after being replaced by the navigation card needing to be updated.
The client side obtains the display style of each navigation card forming the webpage and the arrangement mode of each navigation card forming the webpage based on the parameters of the target display mode;
and the client displays the navigation cards forming the webpage according to the display style of the navigation cards forming the webpage and the arrangement mode among the navigation cards forming the webpage.
The above is a specific implementation process of the method for local update of the web page.
Example four:
in an embodiment of the present invention, a client is provided, and with reference to fig. 4, includes:
a comparison unit 401, configured to extract card identifiers of all current navigation cards used for updating the web page from the index file sent by the server, compare the card identifiers of all original navigation cards forming the web page, and obtain a navigation card to be updated;
a first extracting unit 402, configured to extract, based on the navigation card to be updated, a card name of the navigation card to be updated from the index file;
a second extracting unit 403, configured to further extract the card content of the navigation card to be updated based on the card name of the navigation card to be updated;
and the updating unit 404 is configured to replace the card content of the corresponding original navigation card with the card content of the navigation card to be updated, so as to implement local updating of the web page.
As an optional embodiment, the client further includes:
the first sending unit is further used for sending a configuration request for requesting to update the webpage to the server;
a first obtaining unit, configured to obtain, based on the configuration request, an index file returned by the server, where the index file includes at least card identifiers of all current navigation cards and card names of all current navigation cards;
the obtaining unit is further configured to at least include the card identifiers of all the current navigation cards and the card names of all the current navigation cards from the index file.
As an alternative embodiment, the comparison unit 401 includes:
the comparison subunit is used for comparing the card identifiers of all the current navigation cards with the card identifiers of all the original navigation cards by the client side, and judging the current navigation card with the changed card identifier;
and the determining unit is used for determining the current navigation card with the changed card identification as the navigation card to be updated.
As an optional embodiment, the client further includes:
the second acquisition unit is used for acquiring a corresponding display style based on the card name of the navigation card to be updated;
and the first display unit is used for displaying the card content of the navigation card to be updated according to the corresponding display style.
As an optional embodiment, the client further includes:
the second obtaining unit is further configured to obtain a corresponding data format based on the card name of the navigation card to be updated;
the constraint unit is used for constraining the card content of the navigation card to be updated into a corresponding data object according to a corresponding data format;
the first display unit is further configured to display the data object corresponding to the card content of the navigation card to be updated according to the corresponding display style.
As an optional embodiment, the second obtaining unit is further configured to obtain a new card name of the navigation card to be updated based on the index file;
the second obtaining unit is further configured to obtain a corresponding new presentation style based on the new card name of the navigation card to be updated;
the first display unit is further configured to display the card content of the navigation card to be updated according to the corresponding new display style.
As an optional embodiment, the client further includes: the second sending unit is further used for sending an acquisition request for acquiring a new card name of the navigation card to be updated to the server;
the second obtaining unit is further configured to obtain a new card name of the navigation card to be updated, which is returned by the server;
the second obtaining unit is further configured to obtain a corresponding new presentation style based on the new card name of the navigation card to be updated;
the first display unit is further configured to display the card content of the navigation card to be updated according to the corresponding new display style.
As an optional embodiment, the client further includes:
an obtaining unit, configured to obtain a mode switching request; the mode switching request is used for requesting to switch the current display mode of the webpage into a target display mode; obtaining the target display mode based on the mode switching request; obtaining the display style of each navigation card forming the webpage and the arrangement mode among the navigation cards forming the webpage based on the parameters of the target display mode;
and the second display unit is also used for displaying the navigation cards forming the webpage according to the display styles of the navigation cards forming the webpage and the arrangement mode among the navigation cards forming the webpage.
Example five:
in the embodiment of the invention, a method for locally updating a webpage is disclosed, and the method is applied to a server side and comprises the following steps:
the server sends an index file to the client, so that the client extracts card identifications of all current navigation cards used for updating the webpage from the index file and compares the card identifications of all original navigation cards forming the webpage to obtain the navigation cards needing to be updated; then the client side extracts the card name of the navigation card to be updated from the index file based on the navigation card to be updated; then the client further updates the card content of the navigation card to be updated based on the card name of the navigation card to be updated; and then the client replaces the corresponding card content of the original navigation card with the card content of the navigation card to be updated, so as to realize the local update of the webpage.
Before implementing the above steps, the server configures the current navigation card and configures the index file based on the current navigation card.
The following is a specific analysis.
Before the latest update is not made, the webpage of the invention is actually composed of all the original navigation cards which are configured and sent to the client end through the server and are used for forming the navigation card of the webpage.
When the web page needs to be updated, the server will configure the navigation card again to update the web page, which is referred to as the current navigation card. In all the configured current navigation cards, some current navigation cards are the same as the original navigation cards, and some current navigation cards are changed.
Each current navigation card contains: card name, presentation style, card content, card identification.
The card name influences the display style of the current navigation card on the webpage. The card names are different, and the display styles of the card contents in the webpage are different. In addition, the card names correspond to respective card data formats, and the card names are different and the card data formats are different. Each current navigation card can simultaneously have a plurality of card names, and further simultaneously have a plurality of display styles.
When the client displays the current navigation card, the current navigation card is restricted to be an operation object according to the respective card name of the single current navigation card and the corresponding data format, and then the card content is displayed on the webpage according to the corresponding display style.
The card content and the card identification are in one-to-one correspondence, the card content recorded on each current navigation card is the specific content of the webpage, some card contents are several fields, some card contents are several arrays, some card contents are several sections of multi-arrays, and the field meanings are different.
Each current navigation card has a unique card identification (e.g., card ID), but the card identification may vary as the contents of the card vary. When the server updates the card content of the current navigation card, the MD5 value of the card content is calculated (the card identification is represented by using the MD5 value), and the card identification is obtained. Therefore, if the card content changes, the card identifier also changes, and the client determines that the basis for the current navigation card to change is that the card identifier changes.
The current navigation card of the present invention has a respective data format.
Take the data format of Json (a data format) as an example. Json (javascript Object notification) is a lightweight data exchange format, employing a text format that is completely language independent, but also using conventions similar to the C language family (including C, C + +, Java, etc.). These properties make JSON an ideal data exchange language. Easy to read and write by humans, and also easy to parse and generate by machines (typically used to increase network transmission rates).
The Json is standard in comparison, after the server and the client have defined the data format, the server can develop a visual interface to configure the current navigation card aiming at the specific data format, an operator only needs to fill the required content in the required position, and then the current navigation card of the Json data format is generated according to the standard, so that the configuration is simple and the safety of the data format can be ensured.
In a specific configuration process, the server makes a contract with the client about which data format (for example, the Json data format) to configure and transmit data before configuring the current navigation card. And then, the data configuration management of the current navigation card is satisfied by using a 'packaging mode of different navigation cards by adopting different Json data formats'.
Each current navigation card is provided with a respective independent configuration inlet, and when the current navigation card is configured, the server performs independent configuration on all the current navigation cards by using the respective independent configuration inlets to obtain card names of all the current navigation cards, card identifications of all the current navigation cards and card contents of all the current navigation cards. And then configuring the card names of all the current navigation cards, the card identifications of all the current navigation cards and the card contents of all the current navigation cards into an index file.
Current navigation cards are distinguished with a 'card name' dimension. Because each current navigation card is independently configured and updated, the configuration and the update of a single current navigation card do not influence the configuration and the update of other current navigation cards, the local flexible configuration and the local flexible update of the webpage content can be ensured, the configuration and the update among the current navigation cards do not influence each other, further excessive coupling with other current navigation cards is not needed, the card expansion cost is reduced, and the configuration and operation cost is low. In contrast, when a single original navigation card is updated by the client, the current navigation card is replaced by the corresponding original navigation card without influencing other original navigation cards, all the updated navigation cards are displayed according to different display styles in a distinguishing mode without influencing each other, and therefore excessive coupling with other displayed navigation cards is not needed, and the card extension cost is reduced.
In the actual processing process, there are two configuration modes for configuring the current navigation card.
The first configuration is to reconfigure all current navigation cards.
First, the server determines the number of current navigation cards that need to be configured.
Secondly, the server divides the webpage content into data with corresponding number based on the number of the current navigation cards;
secondly, each current navigation card has an independent configuration entrance, so the server uses each configuration entrance to place each data forming the web page into the corresponding current navigation card, and each current navigation card has its own card content.
And secondly, packaging the current navigation cards by using the corresponding data formats.
Thirdly, calculating the MD5 value of the card content of the current navigation card to obtain the corresponding card identification.
The above is a configuration mode of the current navigation card, that is, all data constituting the web page are respectively configured into the current navigation cards with corresponding numbers.
Since the server has actually configured the original navigation card. If the webpage is changed, the navigation card needing to be updated can be directly configured, the residual original navigation card which is not updated can be directly called, and the residual original navigation card and the navigation card needing to be updated are jointly used as the current navigation card.
The second configuration mode only needs to configure the navigation card to be updated, and the specific implementation process is as follows:
determining the current navigation card of which the card content needs to be changed from all the current navigation cards;
the method comprises the steps that the independent configuration inlets of the current navigation card needing to change the card content are utilized, so that the original card content of the current navigation card needing to change the card content is replaced by the new card content of the current navigation card needing to change the card content;
and obtaining the card identification of the current navigation card needing to change the card content based on the new card content of the current navigation card needing to change the card content. Specifically, after placing the alteration data (i.e., new card content) into the card content, the server recalculates the MD5 value for the card content to obtain the corresponding card identification.
And configuring the card identification of the current navigation card needing to change the card content, the new card content of the current navigation card needing to change the card content and the card name of the current navigation card needing to change the card content as the index file.
After configuration, each current navigation card has its own card name, card identification, card content, presentation style, and the like.
And then the server obtains three parameters including but not limited to the card name of all the current navigation cards, the card identification of all the current navigation cards and the card content of all the current navigation cards. And then configuring the card names of all the current navigation cards, the card identifications of all the current navigation cards and the card contents of all the current navigation cards into an index file.
Because each current navigation card corresponds to a plurality of card names and presentation styles. And then when the server configures the index file, all the card names and all the presentation styles corresponding to each current navigation card can be configured into the index file, and when the presentation styles are replaced, the client can directly call the index file to obtain new card names and obtain the new presentation styles for presentation. The method does not need to be in data communication with the server again, and can support the client to change the presentation style offline.
Of course, the server may also send only one card name and the corresponding presentation style of each current navigation card, and the remaining card names are stored in the server, and when the presentation style is changed by the client, the server may send the acquisition request. And the server sends the corresponding new card name and the new display style to the client for displaying. The data volume transmitted by the method is small, the corresponding data is transmitted when the client sends the request, the large data redundancy at the client side can be avoided, the requested data is less and more targeted, the flow is convenient to save, and the burden of the client is reduced.
Example six:
in an embodiment of the present invention, there is provided a server, including:
the sending module is used for sending the index file to the client, so that the client extracts card identifiers of all current navigation cards used for updating the webpage from the index file and compares the card identifiers of all original navigation cards forming the webpage to obtain the navigation cards needing to be updated; then the client side extracts the card name of the navigation card to be updated from the index file based on the navigation card to be updated; then the client further updates the card content of the navigation card to be updated based on the card name of the navigation card to be updated; and then the client replaces the corresponding card content of the original navigation card with the card content of the navigation card to be updated, so as to realize the local update of the webpage.
As an alternative to the above-described embodiment,
the server further comprises:
the acquisition module is used for carrying out independent configuration on all the current navigation cards by utilizing respective independent configuration inlets to acquire the card names of all the current navigation cards, the card identifications of all the current navigation cards and the card contents of all the current navigation cards;
and the configuration module is used for configuring the card names of all the current navigation cards, the card identifications of all the current navigation cards and the card contents of all the current navigation cards into an index file.
As an alternative to the above-described embodiment,
the determining module is used for determining the current navigation card of which the card content needs to be changed in all the current navigation cards;
the replacement module is used for replacing the original card content of the current navigation card needing to change the card content with the new card content of the current navigation card needing to change the card content by utilizing the independent configuration inlets of the current navigation card needing to change the card content;
the obtaining module is further used for obtaining a card identifier of the current navigation card of which the card content needs to be changed based on the new card content of the current navigation card of which the card content needs to be changed;
the configuration module is further configured to configure the card identifier of the current navigation card whose card content needs to be changed, the new card content of the current navigation card whose card content needs to be changed, and the card name of the current navigation card whose card content needs to be changed as the index file.
Through one or more embodiments of the present invention, the present invention has the following advantageous effects or advantages:
the invention discloses a local updating method and a system of a webpage, when the webpage needs to be updated, a client extracts card identifiers of all current navigation cards used for updating the webpage from an index file sent by a server, compares the card identifiers of all original navigation cards forming the webpage, and acquires the navigation cards needing to be updated; then based on the navigation card to be updated, extracting the card name of the navigation card to be updated from the index file, and further obtaining the card content of the navigation card to be updated; and then replacing the corresponding card content of the original navigation card with the card content of the navigation card to be updated, thereby realizing the local update of the webpage. Because the webpage of the invention is composed of the navigation cards, when the local updating is realized, the local updating can be finished only by finding out the navigation card to be updated and replacing the corresponding card content of the original navigation card with the card content of the navigation card to be updated, and the updating of the navigation cards is not influenced mutually. Therefore, the webpage local updating scheme only needs to update one part of the webpage, so that the updating process is fast, the required operation cost is low, and the updating efficiency of the webpage is far higher than the whole updating efficiency of the existing webpage.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components of a gateway, proxy server, system according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The invention discloses a1 local updating method of a webpage, which is characterized by comprising the following steps:
the client extracts card identifications of all current navigation cards used for updating the webpage from the index file sent by the server, compares the card identifications of all original navigation cards forming the webpage, and acquires the navigation cards needing to be updated;
the client side extracts the card name of the navigation card to be updated from the index file based on the navigation card to be updated;
the client further extracts the card content of the navigation card to be updated based on the card name of the navigation card to be updated;
and the client replaces the corresponding card content of the original navigation card with the card content of the navigation card to be updated, so as to realize the local update of the webpage.
A2, the method according to claim a1, wherein before the card identifiers of all current navigation cards extracted from the index file by the client for updating the web page are compared with the card identifiers of all original navigation cards constituting the web page, and the navigation card to be updated is obtained, the method further comprises:
the client sends a configuration request for requesting to update the webpage to the server;
the client acquires an index file returned by the server based on the configuration request; the index file at least comprises the card identifications of all the current navigation cards, the card names of all the current navigation cards and the card contents of all the current navigation cards.
A3, the method according to claim a1, wherein the client obtains the navigation card to be updated by comparing the card identifiers of all current navigation cards extracted from the index file and all original navigation cards constituting the web page, and the method includes:
the client compares the card identifications of all the current navigation cards with the card identifications of all the original navigation cards to judge the current navigation card with the changed card identification;
and the client determines the current navigation card with the changed card identification as the navigation card to be updated.
A4, the method of claim a1, wherein after the client replaces the card content of the corresponding original navigation card with the card content of the navigation card to be updated, the method further comprises:
the client acquires a corresponding display style based on the card name of the navigation card to be updated;
and the client displays the card content of the navigation card to be updated according to the corresponding display style.
A5, the method of claim A4, wherein the client displays the card contents of the navigation card to be updated according to the corresponding display style, and the method comprises:
the client acquires a corresponding data format based on the card name of the navigation card to be updated;
the client restricts the card content of the navigation card to be updated into a corresponding data object according to a corresponding data format;
and the client displays the data object corresponding to the card content of the navigation card to be updated according to the corresponding display style.
A6, the method of claim A4, wherein after the client displays the card contents of the navigation card to be updated according to the corresponding display style, the method further comprises:
the client side obtains a new card name of the navigation card to be updated based on the index file;
the client acquires a corresponding new display style based on the new card name of the navigation card to be updated;
and the client displays the card content of the navigation card to be updated according to the corresponding new display style.
A7, the method of claim A4, wherein after the client displays the card contents of the navigation card to be updated according to the corresponding display style, the method further comprises:
the client sends an acquisition request for acquiring a new card name of the navigation card to be updated to the server;
the client obtains a new card name of the navigation card to be updated, which is returned by the server;
the client acquires a corresponding new display style based on the new card name of the navigation card to be updated;
and the client displays the card content of the navigation card to be updated according to the corresponding new display style.
A8, the method of claim A1, wherein the client replaces the card content of the corresponding original navigation card with the card content of the navigation card to be updated, and after the local update of the web page is implemented, the method further comprises:
the client side obtains a mode switching request; the mode switching request is used for requesting to switch the current display mode of the webpage into a target display mode;
the client side obtains the target display mode based on the mode switching request;
the client side obtains the display style of each navigation card forming the webpage and the arrangement mode of each navigation card forming the webpage based on the parameters of the target display mode;
and the client displays the navigation cards forming the webpage according to the display style of the navigation cards forming the webpage and the arrangement mode among the navigation cards forming the webpage.
B9, a method for locally updating a web page, comprising:
the server sends an index file to the client, so that the client extracts card identifications of all current navigation cards used for updating the webpage from the index file and compares the card identifications of all original navigation cards forming the webpage to obtain the navigation cards needing to be updated; then the client side extracts the card name of the navigation card to be updated from the index file based on the navigation card to be updated; then the client further updates the card content of the navigation card to be updated based on the card name of the navigation card to be updated; and then the client replaces the corresponding card content of the original navigation card with the card content of the navigation card to be updated, so as to realize the local update of the webpage.
B10, the method of claim B9, wherein before the server sends the index file to the client, the method further comprises:
the server carries out independent configuration on all the current navigation cards by utilizing respective independent configuration inlets to obtain card names of all the current navigation cards, card identifications of all the current navigation cards and card contents of all the current navigation cards;
and configuring the card names of all the current navigation cards, the card identifications of all the current navigation cards and the card contents of all the current navigation cards into an index file.
B11, the method according to claim B10, wherein the configuring the card names of all the current navigation cards, the card identifications of all the current navigation cards, and the card contents of all the current navigation cards as an index file includes:
determining the current navigation card of which the card content needs to be changed from all the current navigation cards;
the method comprises the steps that the independent configuration inlets of the current navigation card needing to change the card content are utilized, so that the original card content of the current navigation card needing to change the card content is replaced by the new card content of the current navigation card needing to change the card content;
obtaining a card identifier of the current navigation card needing to change the card content based on the new card content of the current navigation card needing to change the card content;
and configuring the card identification of the current navigation card needing to change the card content, the new card content of the current navigation card needing to change the card content and the card name of the current navigation card needing to change the card content as the index file.
C12, a client, comprising:
the comparison unit is used for extracting card identifiers of all current navigation cards used for updating the webpage from the index file sent by the server, comparing the card identifiers of all original navigation cards forming the webpage and acquiring the navigation cards needing to be updated;
the first extraction unit is used for extracting the card name of the navigation card to be updated from the index file based on the navigation card to be updated;
the second extraction unit is used for further extracting the card content of the navigation card to be updated based on the card name of the navigation card to be updated;
and the updating unit is used for replacing the corresponding card content of the original navigation card with the card content of the navigation card to be updated so as to realize the local updating of the webpage.
C13, the client of claim C12, wherein the client further comprises:
the first sending unit is further used for sending a configuration request for requesting to update the webpage to the server;
a first obtaining unit, configured to obtain, based on the configuration request, an index file returned by the server, where the index file includes at least card identifiers of all current navigation cards and card names of all current navigation cards;
the obtaining unit is further configured to at least include the card identifiers of all the current navigation cards and the card names of all the current navigation cards from the index file.
C14, the client of claim C12, wherein the comparing unit comprises:
the comparison subunit is used for comparing the card identifiers of all the current navigation cards with the card identifiers of all the original navigation cards by the client side, and judging the current navigation card with the changed card identifier;
and the determining unit is used for determining the current navigation card with the changed card identification as the navigation card to be updated.
C15, the client of claim C12, wherein the client further comprises:
the second acquisition unit is used for acquiring a corresponding display style based on the card name of the navigation card to be updated;
and the first display unit is used for displaying the card content of the navigation card to be updated according to the corresponding display style.
C16, the client of claim C15, wherein the client further comprises:
the second obtaining unit is further configured to obtain a corresponding data format based on the card name of the navigation card to be updated;
the constraint unit is used for constraining the card content of the navigation card to be updated into a corresponding data object according to a corresponding data format;
the first display unit is further configured to display the data object corresponding to the card content of the navigation card to be updated according to the corresponding display style.
C17, the client of claim C15,
the second obtaining unit is further configured to obtain a new card name of the navigation card to be updated based on the index file;
the second obtaining unit is further configured to obtain a corresponding new presentation style based on the new card name of the navigation card to be updated;
the first display unit is further configured to display the card content of the navigation card to be updated according to the corresponding new display style.
C18, the client of claim C15, wherein the client further comprises:
a second sending unit, configured to send, to the server, an acquisition request for acquiring a new card name of the navigation card to be updated;
the second obtaining unit is further configured to obtain a new card name of the navigation card to be updated, which is returned by the server;
the second obtaining unit is further configured to obtain a corresponding new presentation style based on the new card name of the navigation card to be updated;
the first display unit is further configured to display the card content of the navigation card to be updated according to the corresponding new display style.
C19, the client of claim C12, wherein the client further comprises:
an obtaining unit, configured to obtain a mode switching request; the mode switching request is used for requesting to switch the current display mode of the webpage into a target display mode; obtaining the target display mode based on the mode switching request; obtaining the display style of each navigation card forming the webpage and the arrangement mode among the navigation cards forming the webpage based on the parameters of the target display mode;
and the second display unit is also used for displaying the navigation cards forming the webpage according to the display styles of the navigation cards forming the webpage and the arrangement mode among the navigation cards forming the webpage.
D20, a server, comprising:
the sending module is used for sending the index file to the client, so that the client extracts card identifiers of all current navigation cards used for updating the webpage from the index file and compares the card identifiers of all original navigation cards forming the webpage to obtain the navigation cards needing to be updated; then the client side extracts the card name of the navigation card to be updated from the index file based on the navigation card to be updated; then the client further updates the card content of the navigation card to be updated based on the card name of the navigation card to be updated; and then the client replaces the corresponding card content of the original navigation card with the card content of the navigation card to be updated, so as to realize the local update of the webpage.
The server of claim D20, D21, further comprising:
the acquisition module is used for carrying out independent configuration on all the current navigation cards by utilizing respective independent configuration inlets to acquire the card names of all the current navigation cards, the card identifications of all the current navigation cards and the card contents of all the current navigation cards;
and the configuration module is used for configuring the card names of all the current navigation cards, the card identifications of all the current navigation cards and the card contents of all the current navigation cards into an index file.
D22, the server of claim D21,
the determining module is used for determining the current navigation card of which the card content needs to be changed in all the current navigation cards;
the replacement module is used for replacing the original card content of the current navigation card needing to change the card content with the new card content of the current navigation card needing to change the card content by utilizing the independent configuration inlets of the current navigation card needing to change the card content;
the obtaining module is further used for obtaining a card identifier of the current navigation card of which the card content needs to be changed based on the new card content of the current navigation card of which the card content needs to be changed;
the configuration module is further configured to configure the card identifier of the current navigation card whose card content needs to be changed, the new card content of the current navigation card whose card content needs to be changed, and the card name of the current navigation card whose card content needs to be changed as the index file.
E23, a method for updating a local webpage, the method comprising:
the client extracts card identifications of all current navigation cards used for updating the webpage from an index file sent by the server, compares the card identifications of all original navigation cards forming the webpage, and acquires the navigation cards needing to be updated;
the client side extracts the card name of the navigation card to be updated from the index file based on the navigation card to be updated;
the client further extracts the card content of the navigation card to be updated based on the card name of the navigation card to be updated;
and the client replaces the corresponding card content of the original navigation card with the card content of the navigation card to be updated, so as to realize the local update of the webpage.
E24, the method of claim E23, wherein before the client extracts card identifiers of all current navigation cards for updating the web page from the index file sent by the server, and compares the extracted card identifiers with card identifiers of all original navigation cards constituting the web page, and obtains a navigation card to be updated, the method further comprises:
the client sends a configuration request for requesting to update the webpage to the server;
the server acquires an index file based on the configuration request and sends the index file to the client; the index file at least comprises the card identifications of all the current navigation cards, the card names of all the current navigation cards and the card contents of all the current navigation cards.
E25, the method according to claim E23, wherein the step of the client comparing the card identifiers of all current navigation cards extracted from the index file for updating the web page with the card identifiers of all original navigation cards constituting the web page to obtain the navigation card to be updated includes:
the client compares the card identifications of all the current navigation cards with the card identifications of all the original navigation cards to judge the current navigation card with the changed card identification;
and the client determines the current navigation card with the changed card identification as the navigation card to be updated.
E26, the method of claim E23, wherein after the client replaces the card content of the corresponding original navigation card with the card content of the navigation card to be updated, the method further comprises:
the client acquires a corresponding display style based on the card name of the navigation card to be updated;
and the client displays the card content of the navigation card to be updated according to the corresponding display style.
E27, the method of claim E26, wherein the client displays the card contents of the navigation card to be updated according to the corresponding display style, including:
the client acquires a corresponding data format based on the card name of the navigation card to be updated;
the client restricts the card content of the navigation card to be updated into a corresponding data object according to a corresponding data format;
and the client displays the data object corresponding to the card content of the navigation card to be updated according to the corresponding display style.
E28, the method of claim E26, wherein after the client displays the card contents of the navigation card to be updated according to the corresponding display style, the method further comprises:
the client side obtains a new card name of the navigation card to be updated based on the index file;
the client acquires a corresponding new display style based on the new card name of the navigation card to be updated;
and the client displays the card content of the navigation card to be updated according to the corresponding new display style.
E29, the method of claim E26, wherein after the client displays the card contents of the navigation card to be updated according to the corresponding display style, the method further comprises:
the client sends an acquisition request for acquiring a new card name of the navigation card to be updated to the server;
the server obtains a new card name of the navigation card to be updated based on the acquisition request;
the server sends the new card name of the navigation card to be updated to the client;
the client acquires a corresponding new display style based on the new card name of the navigation card to be updated;
and the client displays the card content of the navigation card to be updated according to the corresponding new display style.
E30, the method of claim E22, wherein the client replaces the card content of the corresponding original navigation card with the card content of the navigation card to be updated, and after the local update of the web page is implemented, the method further comprises:
the client side obtains a mode switching request; the mode switching request is used for requesting to switch the current display mode of the webpage into a target display mode;
the client side obtains the target display mode based on the mode switching request;
the client side obtains the display style of each navigation card forming the webpage and the arrangement mode of each navigation card forming the webpage based on the parameters of the target display mode;
and the client displays the navigation cards forming the webpage according to the display style of the navigation cards forming the webpage and the arrangement mode among the navigation cards forming the webpage.
F31, a local update system for web pages, comprising:
the client is used for extracting card identifiers of all current navigation cards used for updating the webpage from the sent index file, comparing the card identifiers with the card identifiers of all original navigation cards forming the webpage, and acquiring the navigation cards needing to be updated;
the client is used for extracting the card name of the navigation card to be updated from the index file based on the navigation card to be updated;
the server is used for further extracting the card content of the navigation card to be updated based on the card name of the navigation card to be updated;
and the client is used for replacing the corresponding card content of the original navigation card with the card content of the navigation card to be updated, so as to realize local updating of the webpage.
F32, the system according to claim F31, comprising:
the client is used for sending a configuration request for requesting to update the webpage to the server;
the server is used for acquiring an index file based on the configuration request and sending the index file to the client; the index file at least comprises the card identifications of all the current navigation cards, the card names of all the current navigation cards and the card contents of all the current navigation cards.
F33, the system according to claim F31,
the client is used for comparing the card identifications of all the current navigation cards with the card identifications of all the original navigation cards and judging the current navigation card with changed card identifications;
and the client is used for determining the current navigation card with the changed card identification as the navigation card to be updated.
F34, the system according to claim F31,
the client is used for acquiring a corresponding display style based on the card name of the navigation card to be updated;
and the client is used for displaying the card content of the navigation card to be updated according to the corresponding display style.
F35, the system according to claim F34,
the client is used for acquiring a corresponding data format based on the card name of the navigation card to be updated;
the client is used for constraining the card content of the navigation card to be updated into a corresponding data object according to a corresponding data format;
and the client is used for displaying the data object corresponding to the card content of the navigation card to be updated according to the corresponding display style.
F36, the system according to claim F34,
the client is used for obtaining a new card name of the navigation card to be updated based on the index file;
the client is used for acquiring a corresponding new display style based on the new card name of the navigation card needing to be updated;
and the client is used for displaying the card content of the navigation card to be updated according to the corresponding new display style.
F37, the system according to claim F34,
the client is used for sending an acquisition request for acquiring a new card name of the navigation card to be updated to the server;
the server is used for obtaining a new card name of the navigation card to be updated based on the acquisition request;
the server is used for sending the new card name of the navigation card to be updated to the client;
the client acquires a corresponding new display style based on the new card name of the navigation card to be updated;
and the client is used for displaying the card content of the navigation card to be updated according to the corresponding new display style.
F38, the system according to claim F31,
the client is used for obtaining a mode switching request; the mode switching request is used for requesting to switch the current display mode of the webpage into a target display mode;
the client is used for obtaining the target display mode based on the mode switching request;
the client is used for obtaining the display style of each navigation card forming the webpage and the arrangement mode of each navigation card forming the webpage based on the parameters of the target display mode;
and the client is used for displaying the navigation cards forming the webpage according to the display styles of the navigation cards forming the webpage and the arrangement mode among the navigation cards forming the webpage.