CN106202244B - Webpage message returning method and webpage message returning system - Google Patents
Webpage message returning method and webpage message returning system Download PDFInfo
- Publication number
- CN106202244B CN106202244B CN201610496809.7A CN201610496809A CN106202244B CN 106202244 B CN106202244 B CN 106202244B CN 201610496809 A CN201610496809 A CN 201610496809A CN 106202244 B CN106202244 B CN 106202244B
- Authority
- CN
- China
- Prior art keywords
- page
- message
- stack information
- target page
- historical
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/954—Navigation, e.g. using categorised browsing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention provides a webpage message returning method and a webpage message returning system, wherein the webpage message returning method comprises the following steps: reading historical stack information of a source page and a target page according to a received service request; determining the service modification content requested by the service request according to the read historical stack information of the source page and the target page; and writing the service modification content into a preset message linked list of a webpage application program in a message form. By the technical scheme, the problem of transfer of jump messages among pages in the webpage application program can be solved, a user can obtain the navigation experience effect of the native application program, meanwhile, the problem of modification of webpage view controls among platforms and browsers of different terminals is solved by transferring the messages through the preset message list, the universality of a webpage message returning function is improved, and the cost is saved.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a webpage message returning method and a webpage message returning system.
Background
In the related art, web applications developed based on browsers or webviews (web views) can only prompt processing results of a current page by entering a new page and can only show operation results before the new page is displayed in interface navigation design. Meanwhile, the history of the browser or webview can only be increased continuously, and the browser or webview cannot automatically return to the main interface of the application after the prompt service is finished.
In addition, due to the security specification defined by w3c, the browser or webovew only allows Javascript (interpreted scripting language) to obtain the current history length, does not allow Javascript programs to obtain the content of each item in the system history, and further does not allow Javascript programs to modify the history length of the system. Therefore, the experience effect of mobile native application navigation cannot be achieved by the traditional webpage application design mode of the computer.
Moreover, data transmission between pages can only be transmitted forwards through url parameter transmission, if the pages return to the main interface in a backspacing mode, the browser or webview does not provide a relevant mechanism, and during design, if the web application uses the parameter transmission with strong service and does not have universality and expandability, the maintenance and the reuse of codes are not facilitated.
At present, both the returning event monitor and the reading of the system history record can be realized by changing the native code of the webview, but the processing cannot realize the transplantation of the functional module, different webview controls need to be modified under different terminal platforms, and the returning event monitor and the reading of the system history record are difficult to use on a general browser.
Therefore, how to provide a high-experience and low-cost return message transmission method between web pages becomes a technical problem to be solved urgently at present.
Disclosure of Invention
Based on the problems, the invention provides a new technical scheme, and can provide a return message transmission mode between webpages with high experience and low cost.
In view of this, an aspect of the present invention provides a method for returning a web page message, including: reading historical stack information of a source page and a target page according to a received service request; determining the service modification content requested by the service request according to the read historical stack information of the source page and the target page; and writing the service modification content into a preset message linked list of a webpage application program in a message form.
In the technical scheme, after a service request is received, a source page confirms a target page needing to be returned, the length of the returned target page is determined through historical stack information of the source page and the target page, information such as message types and message contents confirmed through the service request is inserted into a message queue of a preset message linked list, and a history. According to the technical scheme, the distance between the source page and the target page can be determined through the historical stack information of the source page and the target page, the distance is not the distance in the physical sense, but the source page generates the target page through the layers, the source page can be conveniently and quickly returned to the source page from the target page through the messages stored in the preset message chain table and the determined distance between the source page and the target page, user experience is improved, meanwhile, the problem that the webpage view control is modified between platforms and browsers of different terminals is solved through message list transmission through presetting, the universality of the webpage message returning function is improved, and cost is saved.
In the above technical solution, preferably, the source page is a source page of the target page; and after writing the service modification content into a preset message linked list of a webpage application program in a message form, the method further comprises the following steps: and reading and processing the message from the preset message linked list through the target page.
In the technical scheme, the source page can directly write the changed service content in the service request into the preset message linked list in a message form, and the target page can also directly read the message from the preset message linked list, so that the service content required to be changed by the service request is obtained, and corresponding processing is performed. By the technical scheme, the problem of returning and jumping message transmission among the pages in the webpage application program can be avoided, a user can obtain the navigation experience effect of the native application program, the user experience is improved, meanwhile, the problem of modifying the webpage view control among platforms and browsers of different terminals is also solved by transmitting the message through the preset message list, the universality of the webpage message returning function is improved, and the cost is saved. The content in the preset message linked list includes, but is not limited to, a message source page name, a message destination page name, a message type, and a message processing function.
In the above technical solution, preferably, the method further includes: according to the received recording command, recording historical stack information for each page of the webpage application program, and storing the historical stack information of each page into a session cache of the webpage application program.
In the technical scheme, the historical stack information of the webpage is stored in the session cache of the webpage application program, so that the historical stack information of the webpage can be conveniently read, the problem that the historical stack information of the webpage cannot be read or changed in the page returning process is solved, and the message returning and transmitting can be conveniently completed by combining the historical stack information of the webpage with the preset message linked list.
In the above technical solution, preferably, the reading the history stack information of the source page and the target page specifically includes: and detecting whether the source page and the target page both have the recorded historical stack information, wherein when the detection result is yes, the recorded historical stack information of the source page and the target page is read, and when the detection result is no, initial historical stack information is established for the page without the recorded historical stack information in the source page and the target page, and the initial historical stack information is stored in the session cache.
In the technical scheme, initial historical stack information can be established for the page without the recorded historical stack information, so that message return transmission is completed by combining the historical stack information of the page and a preset message linked list, and the universality of a webpage message return function is improved.
In the foregoing technical solution, preferably, the reading and processing the message from the preset message linked list through the target page includes: judging whether the length of the historical stack information of the target page is smaller than the system historical length or not so as to determine whether to update the historical stack information of the target page or not according to a judgment result; and traversing the preset message linked list according to the updated or non-updated historical stack information so as to read and process the message stored in the preset message linked list.
In the technical scheme, whether the historical stack information of the target page needs to be updated or not can be determined according to the actual situation so as to better adapt to the actual situation. In addition, after the latest historical stack information is obtained, all the messages in the preset message linked list can be subjected to the process of going through by combining the historical stack information and the preset message linked list so as to return to the source webpage.
In the foregoing technical solution, preferably, the determining whether to update the history stack information of the target page according to the determination result specifically includes: when the judgment result is yes, merging the name item of the target page to the historical stack information of the target page so as to update the historical stack information; and if the judging result is negative, acquiring the current system history length, deleting all items behind the name item of the target page when the stack top of the current system history length is the name item of the target page, and otherwise, combining the name item of the target page with the history stack information of the target page to update the history stack information.
According to the technical scheme, the specific mode for updating the historical stack information is provided, the target page is placed at the top of the stack, the page returning operation is enabled to be faster and simpler, if the historical stack information does not need to be updated, the name item of the target page can be directly merged into the historical stack information, the updating of the historical stack information is completed, the page returning operation is enabled to be faster and simpler, and the user experience is improved.
In the above technical solution, preferably, the type of the message includes a prompt type, a confirmation type, a parameter transmission type, or a semaphore type.
In the technical scheme, the types of the messages include but are not limited to a prompt type, a confirmation type, a parameter transmission type or a semaphore type, and the various types of the messages enable various ways of writing the service modification content into the preset message linked list of the web application program, so that the method is convenient to adapt to the actual requirements of users.
Another aspect of the present invention provides a web page message returning system, including: the reading unit is used for reading the historical stack information of the source page and the target page according to the received service request; the message determining unit is used for determining the service modification content requested by the service request according to the read historical stack information of the source page and the target page; and the linked list updating unit writes the service modification content into a preset message linked list of the webpage application program in a message form.
In the technical scheme, after a service request is received, a source page confirms a target page needing to be returned, the length of the returned target page is determined through historical stack information of the source page and the target page, information such as message types and message contents confirmed through the service request is inserted into a message queue of a preset message linked list, and a history. According to the technical scheme, the distance between the source page and the target page can be determined through the historical stack information of the source page and the target page, the distance is not the distance in the physical sense, but the source page generates the target page through the layers, the source page can be conveniently and quickly returned to the source page from the target page through the messages stored in the preset message chain table and the determined distance between the source page and the target page, user experience is improved, meanwhile, the problem that the webpage view control is modified between platforms and browsers of different terminals is solved through message list transmission through presetting, the universality of the webpage message returning function is improved, and cost is saved.
In the above technical solution, preferably, the source page is a source page of the target page; and the webpage message returning system further comprises: and the processing unit reads and processes the message from the preset message linked list through the target page after writing the service modification content into the preset message linked list of the webpage application program in a message form.
In the technical scheme, the source page can directly write the changed service content in the service request into the preset message linked list in a message form, and the target page can also directly read the message from the preset message linked list, so that the service content required to be changed by the service request is obtained, and corresponding processing is performed. By the technical scheme, the problem of returning and jumping message transmission among the pages in the webpage application program can be avoided, a user can obtain the navigation experience effect of the native application program, the user experience is improved, meanwhile, the problem of modifying the webpage view control among platforms and browsers of different terminals is also solved by transmitting the message through the preset message list, the universality of the webpage message returning function is improved, and the cost is saved. The content in the preset message linked list includes, but is not limited to, a message source page name, a message destination page name, a message type, and a message processing function.
In the above technical solution, preferably, the method further includes: and the recording unit is used for recording historical stack information for each page of the webpage application program according to the received recording command and storing the historical stack information of each page into a session cache of the webpage application program.
In the technical scheme, the historical stack information of the webpage is stored in the session cache of the webpage application program, so that the historical stack information of the webpage can be conveniently read, the problem that the historical stack information of the webpage cannot be read or changed in the page returning process is solved, and the message returning and transmitting can be conveniently completed by combining the historical stack information of the webpage with the preset message linked list.
In the foregoing technical solution, preferably, the reading unit is specifically configured to: and detecting whether the source page and the target page both have the recorded historical stack information, wherein when the detection result is yes, the recorded historical stack information of the source page and the target page is read, and when the detection result is no, initial historical stack information is established for the page without the recorded historical stack information in the source page and the target page, and the initial historical stack information is stored in the session cache.
In the technical scheme, initial historical stack information can be established for the page without the recorded historical stack information, so that message return transmission is completed by combining the historical stack information of the page and a preset message linked list, and the universality of a webpage message return function is improved.
In the above technical solution, preferably, the processing unit includes: the judging unit is used for judging whether the length of the historical stack information of the target page is smaller than the system historical length or not so as to determine whether to update the historical stack information of the target page according to a judging result; and the linked list traversal unit traverses the preset message linked list according to the updated or non-updated historical stack information so as to read and process the message stored in the preset message linked list.
In the technical scheme, whether the historical stack information of the target page needs to be updated or not can be determined according to the actual situation so as to better adapt to the actual situation. In addition, after the latest historical stack information is obtained, all the messages in the preset message linked list can be subjected to the process of going through by combining the historical stack information and the preset message linked list so as to return to the source webpage.
In the foregoing technical solution, preferably, the determining unit is specifically configured to: and when the judgment result is yes, merging the name item of the target page into the historical stack information of the target page to update the historical stack information, and when the judgment result is no, acquiring the current system historical length, deleting all items behind the name item of the target page when the stack top of the current system historical length is the name item of the target page, otherwise, merging the name item of the target page into the historical stack information of the target page to update the historical stack information.
According to the technical scheme, the specific mode for updating the historical stack information is provided, the target page is placed at the top of the stack, the page returning operation is enabled to be faster and simpler, if the historical stack information does not need to be updated, the name item of the target page can be directly merged into the historical stack information, the updating of the historical stack information is completed, the page returning operation is enabled to be faster and simpler, and the user experience is improved.
In the above technical solution, preferably, the type of the message includes a prompt type, a confirmation type, a parameter transmission type, or a semaphore type.
In the technical scheme, the types of the messages include but are not limited to a prompt type, a confirmation type, a parameter transmission type or a semaphore type, and the various types of the messages enable various ways of writing the service modification content into the preset message linked list of the web application program, so that the method is convenient to adapt to the actual requirements of users.
By the technical scheme, the problem of transfer of jump messages among pages in the webpage application program can be avoided, a user can obtain the navigation experience effect of the native application program, the user experience is improved, the problem that the webpage view control is modified among platforms and browsers of different terminals is solved by transferring the messages through the preset message list, the universality of the webpage message returning function is improved, and the cost is saved.
Drawings
FIG. 1 illustrates a flow diagram of a method for web page message return according to one embodiment of the invention;
FIG. 2 illustrates a flow diagram of a method for web page message return according to another embodiment of the invention;
FIG. 3 illustrates a flow diagram of a source page initiating message return according to one embodiment of the invention;
FIG. 4 illustrates a flow diagram for target page processing message return according to one embodiment of the invention;
FIG. 5 shows a block diagram of a web page message return system, according to one embodiment of the invention.
Detailed Description
In order that the above objects, features and advantages of the present invention can be more clearly understood, a more particular description of the invention will be rendered by reference to the appended drawings. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, however, the present invention may be practiced in other ways than those specifically described herein, and therefore the scope of the present invention is not limited by the specific embodiments disclosed below.
Fig. 1 shows a flowchart of a web page message return method according to an embodiment of the present invention.
As shown in fig. 1, a method for returning a web page message according to an embodiment of the present invention includes:
and 102, reading historical stack information of a source page and a target page according to the received service request.
And 104, determining the service modification content requested by the service request according to the read historical stack information of the source page and the target page.
And 106, writing the service modification content into a preset message linked list of the webpage application program in a message form.
In the technical scheme, after a service request is received, a source page confirms a target page needing to be returned, the length of the returned target page is determined through historical stack information of the source page and the target page, information such as message types and message contents confirmed through the service request is inserted into a message queue of a preset message linked list, and a history. According to the technical scheme, the distance between the source page and the target page can be determined through the historical stack information of the source page and the target page, the distance is not the distance in the physical sense, but the source page generates the target page through the layers, the source page can be conveniently and quickly returned to the source page from the target page through the messages stored in the preset message chain table and the determined distance between the source page and the target page, user experience is improved, meanwhile, the problem that the webpage view control is modified between platforms and browsers of different terminals is solved through message list transmission through presetting, the universality of the webpage message returning function is improved, and cost is saved.
In the above technical solution, preferably, the source page is a source page of the target page; and after step 106, further comprising: and reading and processing the message from the preset message linked list through the target page.
In the technical scheme, the source page can directly write the changed service content in the service request into the preset message linked list in a message form, and the target page can also directly read the message from the preset message linked list, so that the service content required to be changed by the service request is obtained, and corresponding processing is performed. By the technical scheme, the problem of returning and jumping message transmission among the pages in the webpage application program can be avoided, a user can obtain the navigation experience effect of the native application program, the user experience is improved, meanwhile, the problem of modifying the webpage view control among platforms and browsers of different terminals is also solved by transmitting the message through the preset message list, the universality of the webpage message returning function is improved, and the cost is saved. The content in the preset message linked list includes, but is not limited to, a message source page name, a message destination page name, a message type, and a message processing function.
In the above technical solution, preferably, the method further includes: according to the received recording command, recording historical stack information for each page of the webpage application program, and storing the historical stack information of each page into a session cache of the webpage application program.
In the technical scheme, the historical stack information of the webpage is stored in the session cache of the webpage application program, so that the historical stack information of the webpage can be conveniently read, the problem that the historical stack information of the webpage cannot be read or changed in the page returning process is solved, and the message returning and transmitting can be conveniently completed by combining the historical stack information of the webpage with the preset message linked list.
In the above technical solution, preferably, reading history stack information of the source page and the target page specifically includes: and detecting whether the source page and the target page both have recorded historical stack information, wherein when the detection result is yes, the recorded historical stack information of the source page and the target page is read, and when the detection result is no, initial historical stack information is established for the page without the recorded historical stack information in the source page and the target page, and the initial historical stack information is stored in a session cache.
In the technical scheme, initial historical stack information can be established for the page without the recorded historical stack information, so that message return transmission is completed by combining the historical stack information of the page and a preset message linked list, and the universality of a webpage message return function is improved.
In the foregoing technical solution, preferably, the reading and processing the message from the preset message linked list through the target page includes: judging whether the length of the historical stack information of the target page is smaller than the system historical length or not so as to determine whether the historical stack information of the target page is updated or not according to the judgment result; and traversing the preset message linked list according to the updated or non-updated historical stack information so as to read and process the messages stored in the preset message linked list.
In the technical scheme, whether the historical stack information of the target page needs to be updated or not can be determined according to the actual situation so as to better adapt to the actual situation. In addition, after the latest historical stack information is obtained, all the messages in the preset message linked list can be subjected to the process of going through by combining the historical stack information and the preset message linked list so as to return to the source webpage.
In the foregoing technical solution, preferably, determining whether to update the history stack information of the target page according to the determination result specifically includes: when the judgment result is yes, merging the name item of the target page into the historical stack information of the target page to update the historical stack information; and if not, acquiring the current system history length, deleting all items behind the name item of the target page when the stack top of the current system history length is the name item of the target page, and otherwise, merging the name item of the target page into the history stack information of the target page to update the history stack information.
According to the technical scheme, the specific mode for updating the historical stack information is provided, the target page is placed at the top of the stack, the page returning operation is enabled to be faster and simpler, if the historical stack information does not need to be updated, the name item of the target page can be directly merged into the historical stack information, the updating of the historical stack information is completed, the page returning operation is enabled to be faster and simpler, and the user experience is improved.
In the above technical solution, preferably, the type of the message includes a prompt type, a confirmation type, a parameter transmission type, or a semaphore type.
In the technical scheme, the types of the messages include but are not limited to a prompt type, a confirmation type, a parameter transmission type or a semaphore type, and the various types of the messages enable various ways of writing the service modification content into the preset message linked list of the web application program, so that the method is convenient to adapt to the actual requirements of users.
Fig. 2 illustrates a flowchart of a web page message return method according to another embodiment of the present invention.
As shown in fig. 2, a method for returning a web page message according to another embodiment of the present invention includes:
step 202, a page history stack is established, and each time a page is entered, the page needs to maintain the stack. The STACK content can be obtained by a hidden STACK.
Step 204, establishing an inter-page message transmission linked list, wherein the page (source page) sending the message needs to add the message to the message transmission linked list so as to receive the page (target page) receiving the message.
Step 206, when the target page is initialized, the message sent by the source page is responded after unified processing according to the information such as the message to be monitored, the message transmission linked list between the pages, the page history stack and the like.
In step 208, the history stack and the inter-page message transmission linked list data are refreshed by the target page.
Specifically, if mHistoryStack does not exist, mHistoryStack is newly created and the current page is added as a child item to mHistoryStack and written into the session using sessionstorage.
If the mHistoryStack exists, the length n of the current system history record needs to be obtained through a webview system interface such as a window, a history, a length m of the mHistoryStack, the sizes of the m and the n are compared, if the m is larger than the n, the page is proved to be a return page instead of a newly-entered page, the mHistoryStack is set to be equal to the length n, and otherwise, the current page is put into a stack mHistoryStack.
When reading the message queue linked list, if the linked list mMsgLink is null, the processing is not carried out, if not null, the linked list is traversed, and whether each msgItem. If the message is equal to the message, the message is the current page, the current page processes the message, and user information is prompted according to the msgItem.
When the page sends a message to the page to be returned, the name of the page to be returned is confirmed according to the service, the mHistroayStack is read, and the length n required to be returned is determined according to the page name of each item of the mHistoayStack and the page to be returned by the service.
In addition, a new message item msgItem is required, the type and content of the msgItem item, msgItem.type and msgItem.data and a message processing handle msgItem.handle content are set, and the msgItem.handle content is inserted into the mMessageLink. And writing the mMessageLink into a session cache, and finally returning to the history page by using a history.
By the technical scheme, the problem of transfer of skip messages among pages in the webpage application program can be avoided, a user can obtain the navigation experience effect of the native application program, the user experience is improved, meanwhile, the problem of modifying the webpage view control between platforms and browsers of different terminals is also avoided by transferring messages through the preset message list, the universality of the webpage message returning function is improved, and the cost is saved.
FIG. 3 illustrates a flow diagram of a source page initiation message return according to one embodiment of the invention.
As shown in fig. 3, the flow of the source page initiation message return according to an embodiment of the present invention includes:
step 302, according to the service requirement, confirming the return page (target page).
Step 304, reading the history stack and confirming the length of the returned page.
Step 306, according to the service modification requested in the service requirement, confirming the message type and message content to be sent to the target file.
Step 308, inserting the message with the determined message type and message content into the message notification queue, and calling a history.
FIG. 4 illustrates a flow diagram for target page processing message return according to one embodiment of the invention.
As shown in fig. 4, the process of processing message return by the target page according to an embodiment of the present invention includes:
at step 402, the historyTask (history stack) is read.
And step 404, judging whether the historyTask is smaller than the historical length of the system, if so, entering step 406, and if not, entering step 408.
In step 410, whether the value of the nth item of the history stack is equal to the current page name or not is judged, and if so, the step 412 is entered, and if not, the step 406 is entered.
The message is read and processed, step 416.
The following describes in detail a web page message return method according to an embodiment of the present invention with reference to fig. 2 to 4, which mainly includes:
recording historical stack information of the page, wherein the page stack information is stored in a sessionStorage (session cache) of webview; recording message transmission information between pages, deleting the message record on a message list after the information is processed, and storing the message information in a sessionStorage of webview; entering a new page or returning the page, after the page is loaded, maintaining historical stack information, if no historical stack exists, building a new historical stack, and writing the new historical stack into sessionStorage; entering a new page or returning the page, after the page is loaded, traversing the message list, processing the page message, if no message exists, not processing the page message, and updating the page message linked list, wherein the message comprises: prompting the user for a message, executing next operation confirmation information, prompting the user for confirmation information, and the like. In addition, if the current page needs to return to the page of the history stack, the message to be sent needs to be written into the message transfer linked list between the pages.
Secondly, in the whole service process, a recording stack of a page name needs to be maintained, the stack content information is stored in sessionStorage, and the page is pressed into the stack according to the name of the page during initialization; the maintenance of the page history stack needs to distinguish two situations of a new entering page and a return from the previous page to the current page, and the two situations are processed differently, wherein the page history stack storage method is first-in last-out, and the content of the page history stack sub-item includes but is not limited to the page name.
In the whole service process, a message transmission linked list between pages needs to be maintained, and the linked list content includes but is not limited to: the message source page name, the message target page name, the message type and the processing function body of the message. The message list is stored in sessionStorage, for example, the message can be produced and consumed, the producer needs to determine the name and type of the message sent to the target page, and if the target page needs to execute the method, the message body needs to contain the implementation of the processing method. In addition, the message types include a prompt type, an acknowledgement type, a parameter delivery type, a semaphore type, and the like.
When the target page is initialized, a received message processing method needs to be initialized, then traversal processing of the message list is carried out, and if the message is processed (consumed), the target page needs to update a message queue of sessionStorage and delete the message.
Distinguishing a new entering page and a return page, and performing different processing on a page history stack; and acquiring the page history record length of the current system by using a browser or a webview system interface such as a window, history, length and the like.
According to the length, the name of the current page and the history stack in the sessionStorage, whether the current page is a first-time entering page or a returning page can be distinguished, if the current page is a new entering page, the current page needs to be stacked into the history record stack of the sessionStorage, if the current page is a returning page, all pages with the system length removed from the history record stack in the sessionStorage need to be stacked, the current page is ensured to be positioned at the top of the stack, and the history record length of the system is ensured to be equal to the length of the history record stack in the sessionStorage.
The message type of the message transmission linked list between the web pages can expand the data type, the source page name is added, and the message processing method is reloaded, so that the message processing is carried out after the source page and the target page are judged to be consistent with the source page and the target page parameters of the message to be processed of the current page, and the message processing is stricter.
The source page can obtain the content of the history stack, so that which target page needs to be returned can be clear, and a message chain table can be used for transmitting messages for the returned page; the target page may prompt the user, alert the user, or process results of previous pages according to the message type. Therefore, the operation mode of the traditional browser is avoided, only the message can be prompted forward, page loading is carried out continuously, the system history records are increased continuously, and when the application needs to be quitted, a user needs to press the return key continuously, so that poor user experience is caused.
When the source page returns to any target page in the stack, the history stack information can be read from the sessionStorage, the position of the target page in the stack is returned according to the length of the current stack, the length required to be returned is calculated, and the rollback is performed by using a webview system interface mode of history.
When the target page is started, the attribute of the target page can be obtained, whether the target page is a new starting page or a return page is determined, and if the target page is a return interface, a processing message exists. The target page firstly acquires a history stack, acquires source page information and current page information, and refreshes the history stack to enable the current page to be positioned at the top of the stack; and traversing the message linked list, reading the message body, deleting the corresponding item in the linked list, and executing the action according to the type of the message body.
FIG. 5 shows a block diagram of a web page message return system, according to one embodiment of the invention.
As shown in fig. 5, a web page message return system 500 according to an embodiment of the present invention includes: a reading unit 502, configured to read historical stack information of a source page and a target page according to a received service request; a message determining unit 504, configured to determine, according to the read history stack information of the source page and the target page, service modification content requested by the service request; and a linked list updating unit 506, which writes the service modification content into a preset message linked list of the web application program in a message form.
In the technical scheme, after a service request is received, a source page confirms a target page needing to be returned, the length of the returned target page is determined through historical stack information of the source page and the target page, information such as message types and message contents confirmed through the service request is inserted into a message queue of a preset message linked list, and a history. According to the technical scheme, the distance between the source page and the target page can be determined through the historical stack information of the source page and the target page, the distance is not the distance in the physical sense, but the source page generates the target page through the layers, the source page can be conveniently and quickly returned to the source page from the target page through the messages stored in the preset message chain table and the determined distance between the source page and the target page, user experience is improved, meanwhile, the problem that the webpage view control is modified between platforms and browsers of different terminals is solved through message list transmission through presetting, the universality of the webpage message returning function is improved, and cost is saved.
In the above technical solution, preferably, the source page is a source page of the target page; and the web page message return system 500 further comprises: the processing unit 508, after writing the service modification content into a preset message linked list of a web application in a form of a message, reads and processes the message from the preset message linked list through the target page.
In the technical scheme, the source page can directly write the changed service content in the service request into the preset message linked list in a message form, and the target page can also directly read the message from the preset message linked list, so that the service content required to be changed by the service request is obtained, and corresponding processing is performed. By the technical scheme, the problem of returning and jumping message transmission among the pages in the webpage application program can be avoided, a user can obtain the navigation experience effect of the native application program, the user experience is improved, meanwhile, the problem of modifying the webpage view control among platforms and browsers of different terminals is also solved by transmitting the message through the preset message list, the universality of the webpage message returning function is improved, and the cost is saved. The content in the preset message linked list includes, but is not limited to, a message source page name, a message destination page name, a message type, and a message processing function.
In the above technical solution, preferably, the method further includes: the recording unit 510 records history stack information for each page of the web application according to the received recording command, and stores the history stack information of each page in a session cache of the web application.
In the technical scheme, the historical stack information of the webpage is stored in the session cache of the webpage application program, so that the historical stack information of the webpage can be conveniently read, the problem that the historical stack information of the webpage cannot be read or changed in the page returning process is solved, and the message returning and transmitting can be conveniently completed by combining the historical stack information of the webpage with the preset message linked list.
In the foregoing technical solution, preferably, the reading unit 502 is specifically configured to: and detecting whether the source page and the target page both have recorded historical stack information, wherein when the detection result is yes, the recorded historical stack information of the source page and the target page is read, and when the detection result is no, initial historical stack information is established for the page without the recorded historical stack information in the source page and the target page, and the initial historical stack information is stored in a session cache.
In the technical scheme, initial historical stack information can be established for the page without the recorded historical stack information, so that message return transmission is completed by combining the historical stack information of the page and a preset message linked list, and the universality of a webpage message return function is improved.
In the above technical solution, preferably, the processing unit 508 includes: the judging unit 5082 is configured to judge whether the length of the historical stack information of the target page is smaller than the system historical length, so as to determine whether to update the historical stack information of the target page according to a judgment result; the linked list traversal unit 5084 traverses the preset message linked list according to the updated or non-updated historical stack information, so as to read and process the messages stored in the preset message linked list.
In the technical scheme, whether the historical stack information of the target page needs to be updated or not can be determined according to the actual situation so as to better adapt to the actual situation. In addition, after the latest historical stack information is obtained, all the messages in the preset message linked list can be subjected to the process of going through by combining the historical stack information and the preset message linked list so as to return to the source webpage.
In the foregoing technical solution, preferably, the judging unit 5082 is specifically configured to: and when the judging result is negative, acquiring the current system history length, deleting all items behind the name item of the target page when the stack top of the current system history length is the name item of the target page, otherwise, merging the name item of the target page to the history stack information of the target page to update the history stack information.
According to the technical scheme, the specific mode for updating the historical stack information is provided, the target page is placed at the top of the stack, the page returning operation is enabled to be faster and simpler, if the historical stack information does not need to be updated, the name item of the target page can be directly merged into the historical stack information, the updating of the historical stack information is completed, the page returning operation is enabled to be faster and simpler, and the user experience is improved.
In the above technical solution, preferably, the type of the message includes a prompt type, a confirmation type, a parameter transmission type, or a semaphore type.
In the technical scheme, the types of the messages include but are not limited to a prompt type, a confirmation type, a parameter transmission type or a semaphore type, and the various types of the messages enable various ways of writing the service modification content into the preset message linked list of the web application program, so that the method is convenient to adapt to the actual requirements of users.
The technical scheme of the invention is described in detail in combination with the attached drawings, and through the technical scheme, the problem of transfer of skip messages between pages in a webpage application program can be solved, so that a user can obtain the navigation experience effect of a native-like application program, the user experience is improved, meanwhile, the problem of modifying webpage view controls between platforms and browsers of different terminals is solved by transferring messages through a preset message list, the universality of a webpage message returning function is improved, and the cost is saved.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (8)
1. A method for returning a web page message is characterized by comprising the following steps:
reading historical stack information of a source page and a target page according to a received service request;
determining the service modification content requested by the service request according to the read historical stack information of the source page and the target page;
writing the service modification content into a preset message linked list of a webpage application program in a message form;
the source page is a source page of the target page; and
after the writing the service modification content into a preset message linked list of a web application program in a message form, the method further includes:
reading and processing the message from the preset message linked list through the target page;
according to the received recording command, recording historical stack information for each page of the webpage application program, and storing the historical stack information of each page into a session cache of the webpage application program;
the reading of the historical stack information of the source page and the target page specifically includes:
detecting whether the source page and the target page both have the recorded history stack information, wherein,
when the detection result is yes, reading the recorded historical stack information of the source page and the target page,
and when the detection result is negative, establishing initial history stack information for the pages which do not have the recorded history stack information in the source page and the target page, and storing the initial history stack information into the session cache.
2. The method for returning webpage messages according to claim 1, wherein the reading and processing the messages from the preset message chain table through the target page comprises:
judging whether the length of the historical stack information of the target page is smaller than the system historical length or not so as to determine whether to update the historical stack information of the target page or not according to a judgment result;
and traversing the preset message linked list according to the updated or non-updated historical stack information so as to read and process the message stored in the preset message linked list.
3. The method for returning a web page message according to claim 2, wherein the determining whether to update the history stack information of the target page according to the determination result specifically includes:
when the judgment result is yes, merging the name item of the target page to the historical stack information of the target page so as to update the historical stack information;
and if the judging result is negative, acquiring the current system history length, deleting all items behind the name item of the target page when the stack top of the current system history length is the name item of the target page, and otherwise, combining the name item of the target page with the history stack information of the target page to update the history stack information.
4. The web page message return method according to claim 1, wherein the type of the message includes a prompt type, an acknowledgement type, a parameter delivery type, or a semaphore type.
5. A web page message return system, comprising:
the reading unit is used for reading the historical stack information of the source page and the target page according to the received service request;
the message determining unit is used for determining the service modification content requested by the service request according to the read historical stack information of the source page and the target page;
the linked list updating unit writes the service modification content into a preset message linked list of a webpage application program in a message form;
the source page is a source page of the target page; and
the web page message return system further includes:
the processing unit is used for reading and processing the message from the preset message linked list through the target page after the business modification content is written into the preset message linked list of the webpage application program in a message form;
the recording unit is used for recording historical stack information for each page of the webpage application program according to the received recording command and storing the historical stack information of each page into a session cache of the webpage application program;
the reading unit is specifically configured to:
and detecting whether the source page and the target page both have the recorded historical stack information, wherein when the detection result is yes, the recorded historical stack information of the source page and the target page is read, and when the detection result is no, initial historical stack information is established for the page without the recorded historical stack information in the source page and the target page, and the initial historical stack information is stored in the session cache.
6. The web page message return system according to claim 5, wherein the processing unit comprises:
the judging unit is used for judging whether the length of the historical stack information of the target page is smaller than the system historical length or not so as to determine whether to update the historical stack information of the target page according to a judging result;
and the linked list traversal unit traverses the preset message linked list according to the updated or non-updated historical stack information so as to read and process the message stored in the preset message linked list.
7. The system for returning a web page message according to claim 6, wherein the determining unit is specifically configured to:
and when the judgment result is yes, merging the name item of the target page into the historical stack information of the target page to update the historical stack information, and when the judgment result is no, acquiring the current system historical length, deleting all items behind the name item of the target page when the stack top of the current system historical length is the name item of the target page, otherwise, merging the name item of the target page into the historical stack information of the target page to update the historical stack information.
8. A webpage message return system according to claim 5, wherein the type of the message comprises a prompt type, an acknowledgement type, a parameter delivery type or a semaphore type.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610496809.7A CN106202244B (en) | 2016-06-28 | 2016-06-28 | Webpage message returning method and webpage message returning system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610496809.7A CN106202244B (en) | 2016-06-28 | 2016-06-28 | Webpage message returning method and webpage message returning system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106202244A CN106202244A (en) | 2016-12-07 |
CN106202244B true CN106202244B (en) | 2020-01-21 |
Family
ID=57463181
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610496809.7A Expired - Fee Related CN106202244B (en) | 2016-06-28 | 2016-06-28 | Webpage message returning method and webpage message returning system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106202244B (en) |
Families Citing this family (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108345479A (en) * | 2017-01-22 | 2018-07-31 | 北京优朋普乐科技有限公司 | A kind of page returns and the method and system of mark stacking |
CN110020274A (en) * | 2017-08-21 | 2019-07-16 | 北京国双科技有限公司 | Page returning method and device under browser environment are applied in mixing |
CN107844583A (en) * | 2017-11-13 | 2018-03-27 | 深圳峰创智诚科技有限公司 | The implementation method and device that the application program page returns |
CN109460524B (en) * | 2018-09-21 | 2020-04-17 | 北京三快在线科技有限公司 | Page returning method, device, storage medium and client |
CN109657177A (en) * | 2018-10-31 | 2019-04-19 | 深圳壹账通智能科技有限公司 | The generation method of the page, device, storage medium and computer equipment after upgrading |
CN113228596B (en) * | 2018-12-04 | 2024-04-02 | 香港星辰科技有限公司 | Method and device for transmitting list information |
CN109684569B (en) * | 2018-12-19 | 2022-05-31 | 贵阳朗玛信息技术股份有限公司 | Interface control method and device |
CN110362761B (en) * | 2019-06-27 | 2023-02-07 | 上海淇馥信息技术有限公司 | Webpage address monitoring-based webpage skipping method and device and electronic equipment |
CN110633443B (en) * | 2019-08-30 | 2023-08-08 | 腾讯科技(深圳)有限公司 | Method, device, equipment and medium for intra-page data communication |
CN112214697B (en) * | 2020-09-16 | 2024-09-06 | 金医慧通科技有限公司 | Webpage processing method, webpage processing device, computer equipment and storage medium |
CN113326015A (en) * | 2021-06-23 | 2021-08-31 | 北京字跳网络技术有限公司 | Information display method and device and electronic equipment |
CN117194819B (en) * | 2023-07-20 | 2025-09-09 | 北京达佳互联信息技术有限公司 | Page display method, page display device, electronic equipment and storage medium |
Family Cites Families (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7584267B2 (en) * | 2005-08-22 | 2009-09-01 | Yahoo! Inc. | Scalable specification of page flows |
CN101335762A (en) * | 2007-06-25 | 2008-12-31 | 株式会社日立制作所 | Method for reflecting historical usage behavior of webpage, and server, terminal and system |
CN101132413B (en) * | 2007-09-18 | 2010-10-06 | 中兴通讯股份有限公司 | ActiveX component multiplexing method based on Web application |
CN101571800A (en) * | 2008-04-29 | 2009-11-04 | 中兴通讯股份有限公司 | Method and device for processing activex relation in control interface |
US20090327809A1 (en) * | 2008-06-26 | 2009-12-31 | Microsoft Corporation | Domain-specific guidance service for software development |
CN101739277A (en) * | 2009-12-08 | 2010-06-16 | 南京联创科技集团股份有限公司 | Self-defined script mode-based method for managing service monitoring system |
CN102479354B (en) * | 2010-11-29 | 2015-10-07 | 平安科技(深圳)有限公司 | A kind of data processing method based on workflow and system |
CN102761456B (en) * | 2011-04-29 | 2016-01-20 | 腾讯科技(深圳)有限公司 | A kind of method, Apparatus and system obtaining browser of mobile terminal performance parameter |
CN103106196B (en) * | 2011-11-09 | 2016-06-01 | 腾讯科技(深圳)有限公司 | A kind of method and apparatus recovering browsing device net page |
CN102521266A (en) * | 2011-11-18 | 2012-06-27 | 深圳中兴网信科技有限公司 | Method for realizing dynamic compression and combination of JavaScript file |
CN102567125B (en) * | 2011-12-28 | 2014-11-05 | 中标软件有限公司 | Method for realizing communication between browser pages |
CN102902805B (en) * | 2012-10-15 | 2017-06-27 | 东软集团股份有限公司 | A kind of page access method and apparatus |
CN103838747B (en) * | 2012-11-22 | 2017-07-07 | 富士通株式会社 | Network service construction method and equipment and webpage data extracting method and equipment |
CN103885992A (en) * | 2012-12-24 | 2014-06-25 | 腾讯科技(武汉)有限公司 | Method and device for controlling page display |
CN103177115B (en) * | 2013-04-03 | 2016-06-29 | 北京奇虎科技有限公司 | A kind of method and apparatus extracting Webpage link |
CN103246739B (en) * | 2013-05-16 | 2017-02-08 | 百度在线网络技术(北京)有限公司 | Web browsing control method of multiple Web Views and browser |
CN103873597B (en) * | 2014-04-15 | 2017-10-10 | 厦门市美亚柏科信息股份有限公司 | Distributed webpage download method and system |
CN105391615B (en) * | 2014-09-09 | 2018-09-25 | 北京金山安全软件有限公司 | Instant messaging method, device and system based on business requirements |
CN104615697B (en) * | 2015-01-26 | 2018-04-24 | 南京信息工程大学 | A kind of webpage level remembers return method |
CN105306587B (en) * | 2015-11-13 | 2019-04-12 | 网易(杭州)网络有限公司 | Processing method, device and the system of business datum |
-
2016
- 2016-06-28 CN CN201610496809.7A patent/CN106202244B/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN106202244A (en) | 2016-12-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106202244B (en) | Webpage message returning method and webpage message returning system | |
US10417319B1 (en) | Real-time document sharing and editing | |
CN107665303B (en) | Retrieving content from a website through a sandbox | |
US20130086001A1 (en) | Automatic file version verification within electronic mail | |
US9081757B2 (en) | Systems and methods for tracking and updating hosted applications | |
US20150254475A1 (en) | Private browsing mode access for developers | |
WO2014036142A2 (en) | Systems and methods for tracking and updating hosted applications | |
US20120166522A1 (en) | Supporting intelligent user interface interactions | |
WO2013032743A1 (en) | System and method for providing offline access in a hosted document service | |
KR20080039393A (en) | Copy and update files | |
JP2014056319A (en) | Information processor, program, and control method | |
CN107968841B (en) | Dynamic routing method, device, storage medium and client of network page | |
US20170270106A1 (en) | Methods and apparatuses for storing file path and accessing local file | |
CN114265639B (en) | Leaving locally deleted content at a storage service | |
KR20080007320A (en) | Providing travel log integration for browser-hosted objects | |
JP2011096191A (en) | Help information providing apparatus and help information providing method | |
CN104428787A (en) | Providing consistent security information | |
CN113204401A (en) | Browser rendering method, terminal and storage medium | |
TWI609274B (en) | System and method for navigating paginated item results and machine-readable-medium | |
JP2008186147A5 (en) | ||
CN107886008B (en) | File management method, system, device and computer readable storage medium | |
CN116501344A (en) | Page updating method and device | |
CN104253835A (en) | User behavior data acquisition method and system | |
WO2020060634A1 (en) | Indication of updates to a cached version of a document | |
US8413057B2 (en) | Remote controller supporting system and method for handling event in web environment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20200121 |
|
CF01 | Termination of patent right due to non-payment of annual fee |