Routing process management methods, devices, equipment and storage media
By building a webpage cache list in SessionStorage and listening for changes in webpage request URLs, and using a progress control strategy to manage the routing process, the problem of incorrect page rollback judgment in hybrid app development was solved, improving the user experience and data accuracy of medical apps.
Patent Information
- Application Number
- CN202310854287.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-12
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2043-07-12
AI Technical Summary
In hybrid app development, the inability to accurately determine whether the current page is the first page when going back to the previous page leads to data retrieval errors, poor user experience, and affects the accuracy and integrity of medical data in medical apps.
By building a webpage cache list through SessionStorage, monitoring changes in webpage request URLs and their duration, and using preset progress control strategies for routing process management, precise control over webpage changes can be achieved.
It improves the accuracy of the medical system's control over webpage changes, ensures that users can quickly return to the designated interface, reduces data loss and display inconsistencies, and enhances user experience and the accuracy of medical data.
Smart Images

Figure CN116881584B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of UI design and digital healthcare technology, and in particular to a routing process management method, apparatus, device, and computer-readable storage medium for managing the routing process of a medical system front-end interface. Background Technology
[0002] In hybrid app development, it's common to need to determine if the current page is the first page when navigating back to the previous page, and then decide whether to close the WebView container. A common industry solution is to use the browser's `history.length` method to get the number of pages in the current page. However, this approach has flaws. For example, when a patient opens a medical app to book an online consultation, they might first open page A, then navigate to page B, and then return to page A. Page A should still be the first page, but `history.length` might return as 2, leading to an incorrect determination and potentially preventing the patient's electronic medical records from being accessed.
[0003] Medical apps, limited by the needs of their usage scenarios, require maximum responsiveness and ease of use for patients or operators. If users cannot quickly return to the designated interface, it may affect the user experience and, in severe cases, have a detrimental impact on patients with acute illnesses. In addition, if the page refresh process misjudges whether the current page is the first page, it may also lead to inconsistent or lost data display, affecting the accuracy and completeness of medical data. Summary of the Invention
[0004] This invention provides a routing process management method, apparatus, device, and storage medium. Its main purpose is to achieve routing process management through SessionStorage, thereby increasing the accuracy of the medical system's control over webpage changes.
[0005] To achieve the above objectives, the present invention provides a routing process management method, comprising:
[0006] Use SessionStorage to build a webpage cache list, and use the webpage cache list to store historical webpage links and current webpage links in sequence;
[0007] The webpage request URL of the current page is monitored using a network library. When the webpage request URL changes or the duration of the webpage request URL exceeds the preset rated refresh time, the webpage cache list is updated. The changes of the webpage cache list before and after the update are recorded to obtain the cache list before the update and the cache list after the update.
[0008] Identify the length of the table array before the update, the latest link in the table before the update, and the second new link in the table before the update of the cache list before the update; and identify the length of the table array after the update and the latest link in the table after the update of the cache list after the update.
[0009] Based on the preset progress control strategy, the length of the table array before the update, the latest link in the table before the update, the second new link in the table before the update, the length of the table array after the update, and the latest link in the table after the update, the pending loading operation of the current webpage is determined.
[0010] Using the loading operation, based on the cache list before update and the cache list after update, perform webpage operations on the current page and obtain the updated webpage cache list.
[0011] Optionally, determining the pending loading operation of the current webpage based on a preset progress control strategy, the length of the table array before the update, the latest link in the table before the update, the second new link in the table before the update, the length of the table array after the update, and the latest link in the table after the update includes:
[0012] According to the preset progress control strategy, when the length of the updated table array is greater than the length of the pre-update table array, the operation to be loaded is determined to be a preset jump service.
[0013] If the length of the updated table array is equal to the length of the original table array, and the latest link in the original table is the same as the latest link in the updated table, then the operation to be loaded is determined to be a preset refresh service.
[0014] If the length of the updated table array is equal to the length of the original table array, and the second new link in the original table is the same as the latest link in the updated table, then the operation to be loaded is determined to be a preset rollback service.
[0015] If the length of the updated table array and the latest links in the updated table do not meet the conditional statements of any of the jump service, refresh service, and rollback service, the operation to be loaded is determined to be a preset replacement service.
[0016] Optionally, the step of using the loading operation to perform webpage operations on the current page according to the cache list before update and the cache list after update, and obtaining the updated webpage cache list, includes:
[0017] Retrieve the latest links in the updated table from the updated cache list;
[0018] When the operation to be loaded is a redirect service, the current webpage is redirected to the webpage corresponding to the latest link in the updated table, and the latest link in the updated table is inserted into the cache list before the update to obtain the updated webpage cache list;
[0019] When the operation to be loaded is a service replacement or refresh service, the current webpage is redirected to the webpage corresponding to the latest link in the updated table, and the latest link in the cache list before the update is replaced with the latest link in the updated table to obtain the updated webpage cache list;
[0020] When the operation to be loaded is a rollback service, the current webpage is redirected to the webpage corresponding to the latest link in the updated table, and the latest link in the pre-update cache list is deleted to obtain the updated webpage cache list.
[0021] Optionally, the step of constructing a webpage cache list using SessionStorage includes:
[0022] Based on the pre-configured array construction strategy, determine whether the webpage cache list exists in the SessionStorage;
[0023] When the webpage cache list does not exist, an array list is constructed and defined as the webpage cache list, and the push() method is called to add the current webpage link of the current page to the end of the webpage cache list;
[0024] According to the pre-configured first page identification strategy, the array length of the webpage cache list is obtained, and it is determined whether the array length is 1. When the array length is 1, the current page is determined to be the first page.
[0025] According to the pre-configured clearing policy, the pre-built webpage WebView container is monitored, and when an instruction to close the webpage WebView container is received, the webpage cache list is cleared.
[0026] Optionally, the step of using a network library to listen for the webpage request URL of the current page includes:
[0027] Using a network library, retrieve the access counter for the requested URL of the webpage to obtain the duration of the current webpage;
[0028] The API interface in the network library is used to parse the web page request URL in real time, obtain the parsing result, and determine whether the key access information in the parsing result has changed.
[0029] To address the above problems, the present invention also provides a routing process management device, the device comprising:
[0030] The process management initialization module is used to construct a webpage cache list using SessionStorage, and to store historical webpage links and current webpage links sequentially using the webpage cache list;
[0031] The webpage update module is used to monitor the webpage request URL of the current page using a network library. When the webpage request URL changes or the duration of the webpage request URL exceeds the preset rated refresh time, the webpage cache list is updated, and the changes of the webpage cache list before and after the update are recorded to obtain the cache list before the update and the cache list after the update.
[0032] The operation recognition module is used to recognize the length of the pre-update table array, the latest link in the pre-update table, and the second new link in the pre-update table of the pre-update cache list, and to recognize the length of the post-update table array and the latest link in the post-update cache list. Based on the preset progress control strategy, the length of the pre-update table array, the latest link in the pre-update table, the second new link in the pre-update table, the length of the post-update table array, and the latest link in the post-update table, the module determines the pending loading operation of the current webpage.
[0033] The process management update module is used to perform web page operations on the current page based on the cache list before update and the cache list after update, using the operation to be loaded, and to obtain the updated web page cache list.
[0034] Optionally, determining the pending loading operation of the current webpage based on a preset progress control strategy, the length of the table array before the update, the latest link in the table before the update, the second new link in the table before the update, the length of the table array after the update, and the latest link in the table after the update includes:
[0035] According to the preset progress control strategy, when the length of the updated table array is greater than the length of the pre-update table array, the operation to be loaded is determined to be a preset jump service.
[0036] If the length of the updated table array is equal to the length of the original table array, and the latest link in the original table is the same as the latest link in the updated table, then the operation to be loaded is determined to be a preset refresh service.
[0037] If the length of the updated table array is equal to the length of the original table array, and the second new link in the original table is the same as the latest link in the updated table, then the operation to be loaded is determined to be a preset rollback service.
[0038] If the length of the updated table array and the latest links in the updated table do not meet the conditional statements of any of the jump service, refresh service, and rollback service, the operation to be loaded is determined to be a preset replacement service.
[0039] Optionally, the step of using the loading operation to perform webpage operations on the current page according to the cache list before update and the cache list after update, and obtaining the updated webpage cache list, includes:
[0040] Retrieve the latest links in the updated table from the updated cache list;
[0041] When the operation to be loaded is a redirect service, the current webpage is redirected to the webpage corresponding to the latest link in the updated table, and the latest link in the updated table is inserted into the cache list before the update to obtain the updated webpage cache list;
[0042] When the operation to be loaded is a service replacement or refresh service, the current webpage is redirected to the webpage corresponding to the latest link in the updated table, and the latest link in the cache list before the update is replaced with the latest link in the updated table to obtain the updated webpage cache list;
[0043] When the operation to be loaded is a rollback service, the current webpage is redirected to the webpage corresponding to the latest link in the updated table, and the latest link in the pre-update cache list is deleted to obtain the updated webpage cache list.
[0044] To address the above problems, the present invention also provides an electronic device, the electronic device comprising:
[0045] at least one processor; and,
[0046] A memory communicatively connected to the at least one processor; wherein,
[0047] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the routing process management method described above.
[0048] To address the aforementioned problems, the present invention also provides a computer-readable storage medium storing at least one computer program, which is executed by a processor in an electronic device to implement the routing process management method described above.
[0049] This invention first constructs a webpage cache list in SessionStorage to manage the routing process of the medical system's front-end interface. SessionStorage, a web storage mechanism provided by HTML5, is used to temporarily store data on the browser side. Its lightweight storage reduces data resource consumption and facilitates data transfer and sharing between different pages in the browser. Then, by monitoring changes in webpage request URLs and their duration, the invention obtains a cache list before and after the update. Based on a preset progress control strategy, the webpage cache list is updated using array updates based on redirects, refreshes, replacements, and rollbacks when monitoring webpage request URLs, achieving more precise routing process management. Therefore, this invention provides a routing process management method, apparatus, device, and storage medium that utilizes SessionStorage to manage routing processes, increasing the accuracy of the medical system's control over webpage changes. Attached Figure Description
[0050] Figure 1 This is a flowchart illustrating a routing process management method according to an embodiment of the present invention.
[0051] Figure 2 This is a detailed flowchart illustrating one step of a routing process management method provided in an embodiment of the present invention;
[0052] Figure 3 This is a detailed flowchart illustrating one step of a routing process management method provided in an embodiment of the present invention;
[0053] Figure 4 This is a functional block diagram of a routing process management device provided in an embodiment of the present invention;
[0054] Figure 5 This is a schematic diagram of the structure of an electronic device that implements the routing process management method according to an embodiment of the present invention.
[0055] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0056] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0057] This application provides a routing process management method. In this application, the executing entity of the routing process management method includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application: a server, a terminal, etc. In other words, the routing process management method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0058] Reference Figure 1 The diagram shown is a flowchart of a routing process management method according to an embodiment of the present invention. In this embodiment, the routing process management method includes steps S1 to S5:
[0059] S1. Use SessionStorage to build a webpage cache list, and use the webpage cache list to store historical webpage links and current webpage links in sequence.
[0060] In this embodiment of the invention, SessionStorage is a web storage mechanism provided by HTML5, used to temporarily store data on the browser side. The scope of SessionStorage is the current session, that is, all pages in the same browser tab or window share the same SessionStorage. When the session ends (the tab or window is closed), the data in SessionStorage is also cleared. In addition, the storage capacity of SessionStorage is small, for example, 5MB, which can save computing resources and facilitate the increase of response speed for routing process management.
[0061] In detail, in this embodiment of the invention, the step of constructing a webpage cache list using SessionStorage includes:
[0062] Based on the pre-configured array construction strategy, determine whether the webpage cache list exists in the SessionStorage;
[0063] When the webpage cache list does not exist, an array list is constructed and defined as the webpage cache list, and the push() method is called to add the current webpage link of the current page to the end of the webpage cache list;
[0064] According to the pre-configured first page identification strategy, the array length of the webpage cache list is obtained, and it is determined whether the array length is 1. When the array length is 1, the current page is determined to be the first page.
[0065] According to the pre-configured clearing policy, the pre-built webpage WebView container is monitored, and when an instruction to close the webpage WebView container is received, the webpage cache list is cleared.
[0066] In this embodiment of the invention, an array is constructed in the SessionStorage as a webpage cache list, historyList, and preset array construction strategies, first-page identification strategies, and clearing strategies are configured. The array construction strategy is used for constructing and adding / removing elements from historyList; the first-page identification strategy is used to define the first page of the webpage; and the clearing strategy is used to promptly clear and release digital resources from historyList. The WebView container can completely exit the application, releasing resources; it can return to the previous page by closing the container, similar to the browser's back button; and it can close pop-ups, improving user experience. In short, closing the WebView container provides a better user experience, protects user security, and optimizes system performance.
[0067] In this embodiment of the invention, after obtaining the webpage cache list historyList, the webpage cache list includes historical webpage links, current webpage links, and the loading order of each link, such as [medical APP homepage, disease and department selection page, doctor list information page for this type of department, doctor details page, appointment start page, etc.].
[0068] S2. Use a network library to monitor the webpage request URL of the current page. When the webpage request URL changes or the duration of the webpage request URL exceeds the preset rated refresh time, update the webpage cache list, record the changes of the webpage cache list before and after the update, and obtain the cache list before the update and the cache list after the update.
[0069] The network library is a software library or framework for handling network communication. It provides a set of APIs and tools to simplify the operation and management of network communication. This embodiment of the invention uses the network library to listen for webpage request URLs.
[0070] In detail, in this embodiment of the invention, the step of using a network library to monitor the webpage request URL of the current page includes: using the network library to retrieve the access counter of the webpage request URL to obtain the duration of the current webpage; using the API interface in the network library to parse the webpage request URL in real time to obtain the parsing result, and determining whether the key access information in the parsing result has changed.
[0071] This invention monitors webpage request URLs in two ways. First, by parsing the webpage request URL, the parsing result may include the request address, request content, and request time. The request content can serve as key access information to determine whether the request has been modified. Second, embodiments of this invention can also monitor access time; when the access time expires, a refresh operation can be performed.
[0072] It should be understood that in traditional routing monitoring, if page A [Medical APP Homepage] is opened first, then redirected to page B [Disease and Department Selection Page], and then page B returns to page A, page A should still be the first page [Medical APP Homepage]. However, the number of elements in the webpage cache list obtained by `history.length` should be 2, which will cause a judgment error. To change this situation, in this embodiment of the invention, `history.length` is recalculated. Therefore, it is necessary to record the changes in the webpage cache list before and after the update, obtaining the cache list before the update and the cache list after the update, for example, [1, Medical APP Homepage, 2, Disease and Department Selection Page, 3, Medical APP Homepage].
[0073] S3. Identify the length of the pre-update table array, the latest link in the pre-update table, and the second new link in the pre-update table of the pre-update cache list, and identify the length of the post-update table array and the latest link in the post-update cache list.
[0074] In this embodiment of the invention, the cache list before the update and the cache list after the update are obtained, and location.href is defined as the latest link in the updated table, history.length is defined as the length of the table array after the update, SessionStorage.historyList.1 / SessionStorage.historyList.2 are defined as the latest link in the table before the update and the second new link in the table before the update, and SessionStorage.historyLength is defined as the length of the table array before the update.
[0075] S4. Based on the preset progress control strategy, the length of the table array before the update, the latest link in the table before the update, the second new link in the table before the update, the length of the table array after the update, and the latest link in the table after the update, determine the loading operation of the current webpage.
[0076] In this embodiment of the invention, the progress control strategy refers to determining the function of page changes based on the length of links and arrays in the cache list before and after the update, and determining them as jump services, replacement services, refresh services, and rollback services.
[0077] For details, please refer to the following: Figure 2 As shown, in this embodiment of the invention, the operation of S4 includes steps S41 to S45:
[0078] S41. Determine the type of operation to be loaded based on the preset progress control strategy;
[0079] S42. When the length of the updated table array is greater than the length of the table array before the update, it is determined that the operation to be loaded is a preset redirect service.
[0080] S43. When the length of the updated table array is equal to the length of the original table array, and the latest link in the original table is the same as the latest link in the updated table, then the operation to be loaded is determined to be a preset refresh service.
[0081] S44. When the length of the updated table array is equal to the length of the original table array, and the second new link in the original table is the same as the latest link in the updated table, then the operation to be loaded is determined to be a preset rollback service.
[0082] S45. When the length of the updated table array and the latest link in the updated table do not meet the condition statement of any of the jump service, refresh service and rollback service, the operation to be loaded is determined to be the preset replacement service.
[0083] Specifically, when the page loads in this invention, the lengths of the table arrays before and after the update, the latest links within the table before the update, the second newest links within the table before the update, and the latest links within the table after the update are compared to determine whether the operation triggering the page load is a redirect, refresh, replacement, or rollback. When `history.length` is greater than `SessionStorage.historyLength`, it is determined to be a redirect; when `history.length` equals `SessionStorage.historyLength` && `location.href` equals `SessionStorage.historyList.1`, it is determined to be a refresh; when `history.length` equals `SessionStorage.historyLength` && `location.href` equals `SessionStorage.historyList.2`, it is determined to be a rollback; when the length of the updated table array and the latest links within the updated table do not meet the conditional statements of any of the redirect, refresh, or rollback services, the operation to be loaded is determined to be a preset replacement service.
[0084] For example, if the history.length of [1. Medical App Homepage, 2. Disease and Department Selection Page, 3. Medical App Homepage] is 3, which is greater than the SessionStorage.historyLength of [1. Medical App Homepage, 2. Disease and Department Selection Page] is 2, then it is determined to be a redirect;
[0085] If `history.length` = 3 in [1. Medical App Homepage, 2. Disease and Department Selection Page, 3. Disease and Department Selection Page], and `location.href "3. Disease and Department Selection Page"` is equal to `SessionStorage.historyList.1 "2. Disease and Department Selection Page"` in [1. Medical App Homepage, 2. Disease and Department Selection Page], then it is determined to be a refresh.
[0086] S5. Using the loading operation, perform webpage operations on the current page according to the cache list before update and the cache list after update, and obtain the updated webpage cache list.
[0087] For details, please refer to the following: Figure 3 As shown, in this embodiment of the invention, the operation of S5 includes steps S51 to S55:
[0088] S51. Obtain the latest link in the updated table from the updated cache list;
[0089] S52. Determine the type of the operation to be loaded;
[0090] When the operation to be loaded is a redirect service, S53, redirect the current webpage to the webpage corresponding to the latest link in the updated table, and insert the latest link in the updated table into the cache list before the update to obtain the updated webpage cache list;
[0091] When the operation to be loaded is a replacement service or a refresh service, S54, the current webpage is redirected to the webpage corresponding to the latest link in the updated table, and the latest link in the cache list before the update is replaced with the latest link in the updated table to obtain the updated webpage cache list;
[0092] When the operation to be loaded is a rollback service, S55, the current webpage is redirected to the webpage corresponding to the latest link in the updated table, and the latest link in the pre-update cache list is deleted to obtain the updated webpage cache list.
[0093] Specifically, in this embodiment of the invention, in addition to redirecting the webpage, the webpage cache list is also updated. For example: Redirect: Insert location.href into SessionStorage.historyList; Replace / Refresh: Change the last element in SessionStorage.historyList to location.href; Rollback: Delete the last element in SessionStorage.historyList to obtain the updated webpage cache list.
[0094] This invention first constructs a webpage cache list in SessionStorage to manage the routing process of the medical system's front-end interface. SessionStorage, a web storage mechanism provided by HTML5, is used to temporarily store data on the browser side. Its lightweight storage reduces data resource consumption and facilitates data transfer and sharing between different pages in the browser. Then, by monitoring changes in webpage request URLs and their duration, this invention obtains a cache list before and after the update. Based on a preset progress control strategy, the webpage cache list is updated using array updates based on redirects, refreshes, replacements, and rollbacks when monitoring webpage request URLs, achieving more precise routing process management. Therefore, this invention provides a routing process management method that utilizes SessionStorage to increase the accuracy of the medical system's control over webpage changes.
[0095] like Figure 4The diagram shown is a functional block diagram of a routing process management device provided in an embodiment of the present invention.
[0096] The routing process management device 100 of this invention can be installed in an electronic device. Depending on the functions implemented, the routing process management device 100 may include a process management initialization module 101, a webpage update module 102, an operation identification module 103, and a process management update module 104. The module described in this invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and which are stored in the memory of the electronic device.
[0097] In this embodiment, the functions of each module / unit are as follows:
[0098] The process management initialization module 101 is used to construct a webpage cache list using SessionStorage, and to store historical webpage links and current webpage links sequentially using the webpage cache list.
[0099] The webpage update module 102 is used to monitor the webpage request URL of the current page using a network library. When the webpage request URL changes or the duration of the webpage request URL exceeds the preset rated refresh time, the webpage cache list is updated, and the changes of the webpage cache list before and after the update are recorded to obtain the cache list before the update and the cache list after the update.
[0100] The operation recognition module 103 is used to recognize the length of the pre-update table array, the latest link in the pre-update table, and the second new link in the pre-update table of the pre-update cache list, and to recognize the length of the post-update table array and the latest link in the post-update cache list. Based on the preset progress control strategy, the length of the pre-update table array, the latest link in the pre-update table, the second new link in the pre-update table, the length of the post-update table array, and the latest link in the post-update table, the operation to be loaded on the current webpage is determined.
[0101] The process management update module 104 is used to perform web page operations on the current page based on the cache list before update and the cache list after update, using the loading operation, and to obtain the updated web page cache list.
[0102] In detail, the modules in the routing process management device 100 described in this application embodiment adopt the same methods as described above when in use. Figures 1 to 3 The method uses the same technical means as the routing process management method described in the article and can produce the same technical effect, so it will not be repeated here.
[0103] like Figure 5The diagram shown is a structural schematic of an electronic device 1 that implements a routing process management method according to an embodiment of the present invention.
[0104] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program, such as a routing process management program, stored in the memory 11 and capable of running on the processor 10.
[0105] In some embodiments, the processor 10 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device 1, connecting various components of the electronic device through various interfaces and lines. It executes programs or modules stored in the memory 11 (e.g., executing routing process management programs) and calls data stored in the memory 11 to perform various functions of the electronic device and process data.
[0106] The memory 11 includes at least one type of readable storage medium, including flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a portable hard drive. In other embodiments, the memory 11 can be an external storage device of the electronic device, such as a plug-in portable hard drive, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. Furthermore, the memory 11 can include both internal and external storage units of the electronic device. The memory 11 can be used not only to store application software and various types of data installed on the electronic device, such as the code of a routing process management program, but also to temporarily store data that has been output or will be output.
[0107] The communication bus 12 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable communication between the memory 11 and at least one processor 10, etc.
[0108] The communication interface 13 is used for communication between the electronic device 1 and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, Bluetooth interface, etc.), typically used to establish communication connections between the electronic device and other electronic devices. The user interface may be a display, an input unit (such as a keyboard), or, optionally, a standard wired or wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device and to display a visual user interface.
[0109] Figure 5 Only electronic devices with components are shown; it will be understood by those skilled in the art that... Figure 5 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0110] For example, although not shown, the electronic device 1 may also include a power supply (such as a battery) to power various components. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, thereby enabling functions such as charging management, discharging management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.
[0111] It should be understood that the embodiments described are for illustrative purposes only and are not limited to this structure in the scope of the patent application.
[0112] The routing process management program stored in the memory 11 of the electronic device 1 is a combination of multiple instructions, which, when run in the processor 10, can achieve the following:
[0113] Use SessionStorage to build a webpage cache list, and use the webpage cache list to store historical webpage links and current webpage links in sequence;
[0114] The webpage request URL of the current page is monitored using a network library. When the webpage request URL changes or the duration of the webpage request URL exceeds the preset rated refresh time, the webpage cache list is updated. The changes of the webpage cache list before and after the update are recorded to obtain the cache list before the update and the cache list after the update.
[0115] Identify the length of the table array before the update, the latest link in the table before the update, and the second new link in the table before the update of the cache list before the update; and identify the length of the table array after the update and the latest link in the table after the update of the cache list after the update.
[0116] Based on the preset progress control strategy, the length of the table array before the update, the latest link in the table before the update, the second new link in the table before the update, the length of the table array after the update, and the latest link in the table after the update, the pending loading operation of the current webpage is determined.
[0117] Using the loading operation, based on the cache list before update and the cache list after update, perform webpage operations on the current page and obtain the updated webpage cache list.
[0118] Specifically, the specific implementation method of the processor 10 for the above instructions can be referred to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, and will not be repeated here.
[0119] Furthermore, if the modules / units integrated in the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).
[0120] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor of an electronic device, can perform the following:
[0121] Use SessionStorage to build a webpage cache list, and use the webpage cache list to store historical webpage links and current webpage links in sequence;
[0122] The webpage request URL of the current page is monitored using a network library. When the webpage request URL changes or the duration of the webpage request URL exceeds the preset rated refresh time, the webpage cache list is updated. The changes of the webpage cache list before and after the update are recorded to obtain the cache list before the update and the cache list after the update.
[0123] Identify the length of the table array before the update, the latest link in the table before the update, and the second new link in the table before the update of the cache list before the update; and identify the length of the table array after the update and the latest link in the table after the update of the cache list after the update.
[0124] Based on the preset progress control strategy, the length of the table array before the update, the latest link in the table before the update, the second new link in the table before the update, the length of the table array after the update, and the latest link in the table after the update, the pending loading operation of the current webpage is determined.
[0125] Using the loading operation, based on the cache list before update and the cache list after update, perform webpage operations on the current page and obtain the updated webpage cache list.
[0126] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.
[0127] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0128] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0129] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0130] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.
[0131] The blockchain referred to in this invention is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.
[0132] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0133] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A routing process management method, characterized in that, The method includes: Use SessionStorage to build a webpage cache list, and use the webpage cache list to store historical webpage links and current webpage links in sequence; The webpage request URL of the current page is monitored using a network library. When the webpage request URL changes or the duration of the webpage request URL exceeds the preset rated refresh time, the webpage cache list is updated. The changes of the webpage cache list before and after the update are recorded to obtain the cache list before the update and the cache list after the update. Identify the length of the table array before the update, the latest link in the table before the update, and the second new link in the table before the update of the cache list before the update; and identify the length of the table array after the update and the latest link in the table after the update of the cache list after the update. Based on the preset progress control strategy, the length of the table array before the update, the latest link in the table before the update, the second new link in the table before the update, the length of the table array after the update, and the latest link in the table after the update, the pending loading operation of the current webpage is determined. Using the loading operation, based on the cache list before update and the cache list after update, perform webpage operations on the current page and obtain the updated webpage cache list.
2. The routing process management method as described in claim 1, characterized in that, The step of determining the pending loading operation of the current webpage based on the preset progress control strategy, the length of the table array before the update, the latest link in the table before the update, the second new link in the table before the update, the length of the table array after the update, and the latest link in the table after the update includes: According to the preset progress control strategy, when the length of the updated table array is greater than the length of the pre-update table array, the operation to be loaded is determined to be a preset jump service. If the length of the updated table array is equal to the length of the original table array, and the latest link in the original table is the same as the latest link in the updated table, then the operation to be loaded is determined to be a preset refresh service. If the length of the updated table array is equal to the length of the original table array, and the second new link in the original table is the same as the latest link in the updated table, then the operation to be loaded is determined to be a preset rollback service. If the length of the updated table array and the latest links in the updated table do not meet the conditional statements of any of the jump service, refresh service, and rollback service, the operation to be loaded is determined to be the preset replacement service.
3. The routing process management method as described in claim 2, characterized in that, The step of utilizing the loading operation, performing webpage operations on the current page based on the pre-update cache list and the post-update cache list, and obtaining the updated webpage cache list includes: Retrieve the latest links in the updated table from the updated cache list; When the operation to be loaded is a redirect service, the current webpage is redirected to the webpage corresponding to the latest link in the updated table, and the latest link in the updated table is inserted into the cache list before the update to obtain the updated webpage cache list; When the operation to be loaded is a service replacement or refresh service, the current webpage is redirected to the webpage corresponding to the latest link in the updated table, and the latest link in the cache list before the update is replaced with the latest link in the updated table to obtain the updated webpage cache list; When the operation to be loaded is a rollback service, the current webpage is redirected to the webpage corresponding to the latest link in the updated table, and the latest link in the pre-update cache list is deleted to obtain the updated webpage cache list.
4. The routing process management method as described in claim 1, characterized in that, The method of building a webpage cache list using SessionStorage includes: Based on the pre-configured array construction strategy, determine whether the webpage cache list exists in the SessionStorage; When the webpage cache list does not exist, an array list is constructed and defined as the webpage cache list, and the push() method is called to add the current webpage link of the current page to the end of the webpage cache list; According to the pre-configured first page identification strategy, the array length of the webpage cache list is obtained, and it is determined whether the array length is 1. When the array length is 1, the current page is determined to be the first page. According to the pre-configured clearing policy, the pre-built webpage WebView container is monitored, and when an instruction to close the webpage WebView container is received, the webpage cache list is cleared.
5. The routing process management method as described in claim 1, characterized in that, The method of using a network library to listen to the URL of the web page request for the current page includes: Using a network library, retrieve the access counter for the requested URL of the webpage to obtain the duration of the current webpage; The API interface in the network library is used to parse the web page request URL in real time, obtain the parsing result, and determine whether the key access information in the parsing result has changed.
6. A routing process management device, characterized in that, The device includes: The process management initialization module is used to construct a webpage cache list using SessionStorage, and to store historical webpage links and current webpage links sequentially using the webpage cache list; The webpage update module is used to monitor the webpage request URL of the current page using a network library. When the webpage request URL changes or the duration of the webpage request URL exceeds the preset rated refresh time, the webpage cache list is updated, and the changes of the webpage cache list before and after the update are recorded to obtain the cache list before the update and the cache list after the update. The operation recognition module is used to recognize the length of the pre-update table array, the latest link in the pre-update table, and the second new link in the pre-update table of the pre-update cache list, and to recognize the length of the post-update table array and the latest link in the post-update cache list. Based on the preset progress control strategy, the length of the pre-update table array, the latest link in the pre-update table, the second new link in the pre-update table, the length of the post-update table array, and the latest link in the post-update table, the module determines the pending loading operation of the current webpage. The process management update module is used to perform web page operations on the current page based on the cache list before update and the cache list after update, using the operation to be loaded, and to obtain the updated web page cache list.
7. The routing process management device as described in claim 6, characterized in that, The step of determining the pending loading operation of the current webpage based on the preset progress control strategy, the length of the table array before the update, the latest link in the table before the update, the second new link in the table before the update, the length of the table array after the update, and the latest link in the table after the update includes: According to the preset progress control strategy, when the length of the updated table array is greater than the length of the pre-update table array, the operation to be loaded is determined to be a preset jump service. If the length of the updated table array is equal to the length of the original table array, and the latest link in the original table is the same as the latest link in the updated table, then the operation to be loaded is determined to be a preset refresh service. If the length of the updated table array is equal to the length of the original table array, and the second new link in the original table is the same as the latest link in the updated table, then the operation to be loaded is determined to be a preset rollback service. If the length of the updated table array and the latest links in the updated table do not meet the conditional statements of any of the jump service, refresh service, and rollback service, the operation to be loaded is determined to be the preset replacement service.
8. The routing process management device as described in claim 7, characterized in that, The step of utilizing the loading operation, performing webpage operations on the current page based on the pre-update cache list and the post-update cache list, and obtaining the updated webpage cache list includes: Retrieve the latest links in the updated table from the updated cache list; When the operation to be loaded is a redirect service, the current webpage is redirected to the webpage corresponding to the latest link in the updated table, and the latest link in the updated table is inserted into the cache list before the update to obtain the updated webpage cache list; When the operation to be loaded is a service replacement or refresh service, the current webpage is redirected to the webpage corresponding to the latest link in the updated table, and the latest link in the cache list before the update is replaced with the latest link in the updated table to obtain the updated webpage cache list; When the operation to be loaded is a rollback service, the current webpage is redirected to the webpage corresponding to the latest link in the updated table, and the latest link in the pre-update cache list is deleted to obtain the updated webpage cache list.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the routing process management method as described in any one of claims 1 to 5.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the routing process management method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Third-party H5 page loading method and device and computer-readable storage medium
CN111753232A
Interactive sub-webpage starting method and device, equipment and storage medium
CN115080899A