Method and apparatus for ensuring high availability of mobile application pages
Patent Information
- Application Number
- CN202211041022.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-29
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2042-08-29
AI Technical Summary
但该方案在JS与Native的通信上经常会出现性能瓶颈,导致应用卡顿、白屏等问题
[0016] As can be seen from the above technical solution, this application automatically degrades to accessing the corresponding web page when the client environment is abnormal or the request for bundle resources fails, thereby avoiding client crashes that would render the application unusable and achieving high availability for the client.
Smart Images

Figure CN115391698B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mobile application development technology, and can be used in the financial sector. In particular, it relates to a method and apparatus for ensuring high availability of mobile application pages. Background Technology
[0002] Currently, the mainstream mobile application (APP) development models mainly include three types: native APP development, web APP development, and hybrid APP development. Native development primarily refers to using platform-supported programming languages and tools on mobile platforms such as Android and iOS to directly call the platform's provided API functions. Web APP development utilizes the mobile WebView control to embed a website within the APP; this development can be completed by a web front-end engineer. Hybrid development generally combines native and HTML5 development technologies, selecting the technology used based on the specific business requirements.
[0003] Taking native Android app development as an example, the general app development process is as follows: the compiler converts the source code and dependent modules into an executable file on the Android device; the packaging tool combines the executable file and compiled resources into an APK package according to certain rules; the application is signed using a key pair; and the APK package is released to the public.
[0004] Hybrid development primarily utilizes frameworks like Weex and React Native. Weex is a cross-platform UI framework for building mobile applications, while React Native (RN) is also a cross-platform mobile development framework. Taking RN as an example, the typical app development process involves using build tools like Metro to parse, transform, and generate RN code into bundles. A bundle is a folder containing compiled executable code and its required resources, organized according to a specific hierarchical structure. The Android directory is then packaged into an APK file, and the iOS directory into an IPA file.
[0005] For native app development, natively developed applications generally offer a better user experience and higher performance. However, for some niche device models or older device versions, it is often difficult to achieve full compatibility, which may lead to client crashes, app freezes, and other issues, resulting in the loss of some users. In addition, when serious bugs occur in natively developed applications, the only way to release an update is for developers to fix the bugs, rebuild and repackage the app, and submit it to the app store for review. This process often takes several days, resulting in low timeliness of problem fixing.
[0006] The advantage of the hybrid development solution described above is that it supports hot updates; new versions can be directly packaged and released, and the client can download the bundle to its local machine when a new version is detected. However, this solution often encounters performance bottlenecks in the communication between JS and Native, leading to application lag, blank screens, and other issues. Additionally, this solution generates a large number of network requests, placing high demands on the client's network environment. Summary of the Invention
[0007] In view of this, the present invention provides a method and apparatus for ensuring high availability of mobile application pages to solve at least one of the aforementioned problems.
[0008] To achieve the above objectives, the present invention adopts the following solution:
[0009] According to a first aspect of the present invention, a method for ensuring high availability of a mobile application page is provided, the method comprising: receiving a mobile application page access request from a user; loading bundle resources of the mobile application page according to the access request; displaying the mobile application page to the user in response to successful loading of the bundle resources of the mobile application page; obtaining the network address of the mobile application page in response to failed loading of the bundle resources of the mobile application page; requesting static resources of the mobile application page from a web server according to the network address and caching them locally on the client, and displaying the mobile application page to the user.
[0010] According to a second aspect of the present invention, an application packaging and building method for ensuring high availability of mobile application pages is provided. The method includes: building a cross-platform application development project into a mobile bundle package and a web bundle package respectively; generating a mapping list for recording the mapping relationship between the mobile bundle package and the web network address; exporting the mobile bundle package and offline resources into an iOS IPA package and an Android APK package respectively using a packaging tool; and deploying the web bundle package to a web server.
[0011] According to a third aspect of the present invention, an apparatus for ensuring high availability of mobile application pages is provided. The apparatus includes: a request receiving unit for receiving a mobile application page access request from a user; a resource loading unit for loading bundle resources of the mobile application page according to the access request; a network address acquisition unit for acquiring the network address of the mobile application page in response to a failure to load the bundle resources of the mobile application page; a static resource request unit for requesting static resources of the mobile application page from a web server according to the network address and transferring them to the local machine of the client; and a page display unit for displaying the mobile application page to the user in response to a successful loading of the bundle resources of the mobile application page, and displaying the mobile application page to the user after the static resource request unit has acquired the static resources.
[0012] According to a fourth aspect of the present invention, an application packaging and building apparatus for ensuring high availability of mobile application pages is provided. The apparatus includes: a cross-platform building unit for building a cross-platform application development project into a mobile bundle package and a web bundle package respectively; a mapping list generation unit for generating a mapping list for recording the mapping relationship between the mobile bundle and the web network address; an export unit for exporting the mobile bundle package and offline resources into an iOS IPA package and an Android APK package respectively using a packaging tool; and a web deployment unit for deploying the web bundle package to a web server.
[0013] According to a fifth aspect of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.
[0014] According to a sixth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0015] According to a seventh aspect of the present invention, a computer program product is provided, comprising a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.
[0016] As can be seen from the above technical solution, this application automatically degrades to accessing the corresponding web page when the client environment is abnormal or the request for bundle resources fails, thereby avoiding client crashes that would render the application unusable and achieving high availability for the client. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0018] Figure 1 This is a flowchart illustrating a method for ensuring high availability of mobile application pages, provided in an embodiment of this application.
[0019] Figure 2 This is a sequence diagram of a page request mechanism to ensure high availability of mobile application pages, provided in an embodiment of this application.
[0020] Figure 3 This is a flowchart illustrating a method for ensuring high availability of mobile application pages according to another embodiment of this application;
[0021] Figure 4 This is a flowchart illustrating a method for ensuring high availability of mobile application pages according to another embodiment of this application;
[0022] Figure 5 This is a timing diagram of a page request mechanism provided in an embodiment of this application;
[0023] Figure 6 This is a flowchart illustrating an application packaging and building method for ensuring high availability of mobile application pages, provided in an embodiment of this application.
[0024] Figure 7 This is a flowchart illustrating the construction process of a React Native cross-platform application development project, as provided in an embodiment of this application.
[0025] Figure 8 This is a schematic diagram of the structure of a device for ensuring high availability of mobile application pages provided in an embodiment of this application;
[0026] Figure 9 This is a schematic diagram of an application packaging and building device that ensures high availability of mobile application pages, provided in an embodiment of this application.
[0027] Figure 10 This is a schematic block diagram of the system configuration of the electronic device provided in the embodiments of this application. Detailed Implementation
[0028] This invention provides a method and apparatus for ensuring high availability of mobile application pages, which can be used in the financial field and other fields. It should be noted that the method and apparatus for ensuring high availability of mobile application pages of this invention can be used in the financial field, or in any field other than the financial field. This invention does not limit the application field of the method and apparatus for ensuring high availability of mobile application pages.
[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0030] First, a brief explanation of some of the technical terms used in this application:
[0031] The term "Bundle" refers to a folder containing compiled executable code and the resources required by that code, organized in a hierarchical structure according to a specific standard.
[0032] The term "Webpack" refers to a static module bundler for modern JavaScript applications. When Webpack processes an application, it recursively builds a dependency graph containing every module the application needs, and then bundles all modules into one or more bundles.
[0033] The term "Weex" refers to a cross-platform UI framework for building mobile applications.
[0034] The term "React Native": React Native (RN for short) is a cross-platform mobile development framework.
[0035] The term "WebView" refers to a web page view, which is a browser engine-based control used to display and render web pages.
[0036] The term "CDN" stands for Content Delivery Network. A CDN is an intelligent virtual network built on top of existing networks. Relying on edge servers deployed in various locations, it uses a central platform's load balancing, content distribution, and scheduling modules to allow users to access content from the nearest server, reducing network congestion and improving user access response speed and hit rate.
[0037] like Figure 1The diagram shown is a flowchart illustrating a method for ensuring high availability of mobile application pages according to an embodiment of this application. This embodiment describes the application from the perspective of the application client installed on a mobile device. The mobile device includes, but is not limited to, mobile phones, tablets, smart wearable devices, etc., with iOS or Android systems installed. The method includes the following steps:
[0038] Step S101: Receive a mobile application page access request from the user.
[0039] Users can send page access requests to the application client by clicking on icons or text links within the application on their mobile devices. Upon receiving the page access request, the application client should immediately load and display the corresponding page to the user.
[0040] Step S102: Load the mobile device's bundle resources according to the access request.
[0041] Based on the above access request, the application client will first prioritize loading the bundle resources of the mobile client (i.e., iOS or Android client).
[0042] Step S103: Determine whether the bundle resources on the mobile device have been successfully loaded. If successful, proceed to step S104; otherwise, proceed to step S105.
[0043] Because bundle resources may fail to load, and even if a bundle is loaded, it may still encounter runtime errors, these are all considered unsuccessful loading situations.
[0044] Step S104: Display the mobile application page to the user.
[0045] After step 103, once the mobile bundle resources are successfully loaded, the requested mobile application page can be displayed to the user based on these bundle resources. This display process is existing technology and will not be described in detail here.
[0046] Step S105: Obtain the network address of the mobile application page.
[0047] If the mobile bundle resources fail to load after step 103, this application employs an automatic degradation mechanism to ensure high availability of the mobile page. This mechanism requests the corresponding static resources from the web server to restore normal page display. Therefore, it is first necessary to obtain the network address of the mobile page, i.e., the Uniform Resource Locator (URL) address.
[0048] Preferably, obtaining the network address of the mobile application page in this step may specifically include: obtaining the network address of the mobile application page according to a mapping list, wherein the mapping list records the mapping relationship between the mobile bundle and the webpage network address. That is, the mapping list is generated when the mobile application is packaged and built to record the mapping relationship between the mobile bundle and the webpage network address, and the calling logic is added. This allows the function of obtaining the webpage URL address through the mapping list when the mobile bundle resource fails to load.
[0049] Step S106: Request static resources of the mobile application page from the web server according to the network address and cache them locally on the client.
[0050] Step S107: Display the mobile application page to the user.
[0051] Preferably, after obtaining the static resources of the page, the client's built-in WebView can be used to parse the static resource content and render it to display the mobile application page to the user.
[0052] To explain the above steps more clearly, as follows: Figure 2 The diagram shown is a sequence diagram of a page request mechanism for ensuring high availability of mobile application pages according to an embodiment of this application. Figure 2 As can be seen, this application involves three entities: the user, the client app, and the web server, where the client app is installed on the user's mobile terminal. The page loading process of this application involves two aspects: client-side loading and web-side loading. Client-side loading has higher priority than web-side loading, which serves as a supplement to client-side loading to ensure the high availability of the client app's pages. When a user accesses a client page through the client app, if the client app successfully loads the page resources, it directly displays the page content to the user. If loading the page fails, it obtains the page's web URL, then requests and downloads static resources from the web server based on that web URL, and then displays the page content to the user.
[0053] As can be seen from the above, the method for ensuring high availability of mobile application pages provided in this application automatically degrades to accessing the corresponding web page when the client environment is abnormal or the request for bundle resources fails, thereby avoiding client crashes that would render the application unusable and thus achieving high availability for the client.
[0054] like Figure 3 This is a flowchart illustrating a method for ensuring high availability of mobile application pages, provided as another embodiment of this application. This embodiment also describes the application from the perspective of the application client installed on the mobile device. The method includes the following steps:
[0055] Step S301: Receive a mobile application page access request from the user.
[0056] Step S302: Load the mobile device's bundle resources according to the access request.
[0057] Step S303: Determine whether the bundle resources on the mobile device have been successfully loaded. If successful, proceed to step S304; otherwise, proceed to step S305.
[0058] Step S304: Display the mobile application page to the user.
[0059] Step S305: Obtain the static resources of the mobile application page from the cache of the local webpage view on the client.
[0060] In this embodiment, when it is determined in step S303 that the bundle resources on the mobile device have not been loaded successfully, static resources are obtained first from the cache of the local WebView on the client. This action does not depend on the client's network environment, that is, regardless of whether there is a network, as long as the application is cached locally, it can be used normally.
[0061] Step S306: Determine whether the static resource acquisition was successful. If successful, proceed to step S307; otherwise, proceed to step S308.
[0062] Step S307: Display the mobile application page to the user.
[0063] Step S308: Obtain the network address of the mobile application page.
[0064] If step S306 determines that retrieving static resources from the local WebView cache fails, the page can be displayed normally by requesting the corresponding static resources from the web server. Step S306 may fail to retrieve static resources due to reasons such as the client not having cached the aforementioned static resources locally, or the cached static resources having expired.
[0065] Step S309: Request static resources of the mobile application page from the web server according to the network address and cache them locally on the client.
[0066] Step S310: Display the mobile application page to the user.
[0067] As described above, the method for ensuring high availability of mobile application pages provided in this application automatically degrades to accessing the corresponding web page when the client environment is abnormal or when requesting bundle resources fails, thus preventing the application from becoming unusable due to client crashes and achieving high availability for the client. Furthermore, this application utilizes a local caching mechanism to increase resource loading speed, reduce the number of network requests, and improve user experience while ensuring high availability of the client application.
[0068] like Figure 4 This is a flowchart illustrating a method for ensuring high availability of mobile application pages, provided as another embodiment of this application. This embodiment also describes the application from the perspective of the application client installed on the mobile device. The method includes the following steps:
[0069] Step S401: Receive a mobile application page access request from the user.
[0070] Step S402: Load the mobile device's bundle resources according to the access request.
[0071] Step S403: Determine whether the bundle resources on the mobile device have been loaded successfully. If successful, proceed to step S404; otherwise, proceed to step S405.
[0072] Step S404: Display the mobile application page to the user.
[0073] Step S405: Obtain the static resources of the mobile application page from the cache of the local web page view on the client.
[0074] Step S406: Determine whether the static resource acquisition was successful. If successful, proceed to step S407; otherwise, proceed to step S408.
[0075] Step S407: Display the mobile application page to the user.
[0076] Step S408: Routing to the content delivery network to request the download of the static resource.
[0077] Step S409: Determine whether the download of static resources from the content delivery network was successful. If successful, proceed to step S410; otherwise, proceed to step S412.
[0078] Step S410: Download the static resources from the content delivery network and cache them locally on the client.
[0079] Step S411: Display the mobile application page to the user.
[0080] Step S412: Obtain the network address of the mobile application page.
[0081] If step S409 determines that downloading static resources from the content delivery network has failed, the page can be displayed normally by requesting the corresponding static resources from the web server. Step S409 may fail to retrieve static resources due to reasons such as the content delivery network not caching the static resources, or the cached static resources being expired.
[0082] Step S413: Request static resources of the mobile application page from the web server according to the network address and cache them locally on the client.
[0083] Step S414: Display the mobile application page to the user.
[0084] correspond Figure 4 In the embodiments described, the following can be obtained: Figure 5 The sequence diagram of the page request mechanism shown is composed of... Figure 5 As can be seen, this application involves three entities: the user, the client app, the local cache, the CDN provider, and the web server. The client app is installed on the user's mobile terminal, and the local cache is the cache stored on the user's mobile terminal. Following a priority order, the bundle resources are first loaded from the client app. If this fails, the static resources are requested from the local cache. If this also fails, the static resources are requested from the CDN provider. If this still fails, the static resources are finally requested from the web server.
[0085] As described above, the method for ensuring high availability of mobile application pages provided in this application does not require extensive compatibility testing, largely avoiding crashes and freezes caused by incompatibility between client applications on different devices and operating system versions. Through an automatic degradation mechanism, when the client environment is abnormal or requests for bundle resources fail, the application automatically degrades to accessing the corresponding web page, preventing client crashes from rendering the application unusable, thus achieving high availability for the client. Furthermore, this application utilizes a multi-level caching mechanism to increase resource loading speed, reduce network requests, and improve user experience while ensuring high availability of the client application.
[0086] like Figure 6 The diagram shown is a flowchart illustrating an application packaging and building method for ensuring high availability of mobile application pages according to an embodiment of this application. The method includes the following steps:
[0087] Step S601: Build the cross-platform application development project into a mobile bundle and a web bundle respectively.
[0088] Step S602: Generate a mapping list for recording the mapping relationship between the mobile terminal bundle and the web page network address.
[0089] Step S603: Export the mobile bundle and offline resources as an IPA package for iOS and an APK package for Android respectively using a packaging tool.
[0090] Step S604: Deploy the web page bundle to the web page server.
[0091] The following example, using a React Native cross-platform application development project, further illustrates the above application packaging and building methods. Figure 7 The diagram illustrates a build process for a React Native cross-platform application development project according to an embodiment of this application. Developers utilize a unified build platform built on webpack, leveraging webpack's multi-bundle bundling capabilities to build the RN project into mobile bundles and web bundles. Simultaneously, the build process generates a map manifest file (i.e., a mapping manifest) to maintain the mapping relationship between the mobile bundle and the web URL corresponding to each page, and allows specifying the priority of two loading modes. The mobile bundle and offline resources are exported as IPA packages for iOS and APK packages for Android using a bundling tool; the web bundle is deployed to a web server.
[0092] As can be seen from the above description, the application developed using this application packaging and building method can ensure high availability of the page when loading the page. For the specific loading process, please refer to the description of the aforementioned method embodiment.
[0093] like Figure 8 The diagram shown is a structural schematic of a device for ensuring high availability of mobile application pages according to an embodiment of this application. The device includes: a request receiving unit 810, a resource loading unit 820, a network address acquisition unit 830, a static resource request unit 840, and a page display unit 850. The resource loading unit 820 is connected to the request receiving unit 810, the network address acquisition unit 830, and the page display unit 850, respectively. The static resource request unit 840 is connected to the network address acquisition unit 830 and the page display unit 850, respectively.
[0094] The request receiving unit 810 is used to receive mobile application page access requests sent by users.
[0095] The resource loading unit 820 is used to load the bundle resources of the mobile terminal according to the access request.
[0096] The network address acquisition unit 830 is used to acquire the network address of the mobile application page in response to the failure of the bundle resource loading on the mobile terminal.
[0097] The static resource request unit 840 is used to request static resources of the mobile application page from the web server according to the network address and transfer them to the local client.
[0098] The page display unit 850 is used to display the mobile application page to the user in response to the successful loading of the bundle resources on the mobile device, and to display the mobile application page to the user after the static resource request unit obtains the static resources.
[0099] Preferably, the network address acquisition unit 830 is specifically used to: acquire the network address of the mobile application page according to the mapping list, wherein the mapping list records the mapping relationship between the mobile bundle and the web page network address.
[0100] Preferably, when the resource loading unit 820 fails to load the bundle resources of the mobile terminal, the static resource request unit 840 of this device first obtains the static resources of the mobile application page from the cache of the local web page view on the client, and displays the mobile application page to the user through the page display unit 850.
[0101] If the static resource is not cached locally on the client or the cache has expired, the network address acquisition unit 830 acquires the network address of the mobile application page. Then, the static resource request unit 840 requests the static resource of the mobile application page from the web server based on the network address and caches it locally on the client. Finally, the mobile application page is displayed to the user through the page display unit 850.
[0102] Preferably, when the resource loading unit 820 fails to load the bundle resources of the mobile terminal, the static resource request unit 840 of this device can also preferentially obtain the static resources of the mobile application page from the cache of the local webpage view on the client, and display the mobile application page to the user through the page display unit 850. If the static resources are not cached locally on the client or the cache has expired, the static resource request unit 840 routes to the content delivery network to download the static resources and caches them locally on the client, and then displays the mobile application page to the user through the page display unit 850. If the content delivery network does not cache the static resources or the cache has expired, the network address acquisition unit 830 obtains the network address of the mobile application page, then the static resource request unit 840 requests the static resources of the mobile application page from the web server according to the network address, and then the page display unit 850 displays the mobile application page to the user.
[0103] Preferably, the page display unit 850 is specifically used to: parse the static resource content using the webpage view built into the client and render it to display the mobile application page to the user.
[0104] As described above, the device for ensuring high availability of mobile application pages provided in this application does not require extensive compatibility testing, and largely avoids crashes and freezes caused by incompatibility between client applications on different devices and operating system versions. Through an automatic degradation mechanism, when the client environment is abnormal or a request for bundle resources fails, the application automatically degrades to accessing the corresponding web page, preventing client crashes from rendering the application unusable, thus achieving high availability for the client. Furthermore, this application, through a multi-level caching mechanism, can increase resource loading speed, reduce the number of network requests, and improve user experience while ensuring high availability of the client application.
[0105] like Figure 9 The diagram shows a structural schematic of an application packaging and building device for ensuring high availability of mobile application pages according to an embodiment of this application. The application packaging and building device includes: a cross-platform building unit 910, a mapping list generation unit 920, an export unit 930, and a web page deployment unit 940, wherein the cross-platform building unit 910 is connected to the mapping list generation unit 920, the export unit 930, and the web page deployment unit 940, respectively.
[0106] The cross-platform build unit 910 is used to build cross-platform application development projects into mobile bundle packages and web bundle packages respectively.
[0107] The mapping list generation unit 920 is used to generate a mapping list for recording the mapping relationship between the mobile terminal bundle and the web page network address.
[0108] The export unit 930 is used to export the mobile bundle package and offline resources into an IPA package for iOS and an APK package for Android respectively using a packaging tool.
[0109] The web page deployment unit 940 is used to deploy the web page bundle to the web page server.
[0110] As can be seen from the above description, the application developed using this application packaging and building device can ensure high availability of the page when loading the page. For the specific loading process, please refer to the description of the aforementioned method embodiment, which will not be repeated here.
[0111] This invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described method.
[0112] This invention also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the above-described method.
[0113] This invention also provides a computer-readable storage medium storing a computer program for performing the above-described methods.
[0114] like Figure 10 As shown, the electronic device 600 may also include: a communication module 110, an input unit 120, an audio processor 130, a display 160, and a power supply 170. It is worth noting that the electronic device 600 does not necessarily need to include these components. Figure 10 All components shown; in addition, the electronic device 600 may also include Figure 10 For components not shown, please refer to existing technologies.
[0115] like Figure 10 As shown, the central processing unit 100, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device. The central processing unit 100 receives inputs and controls the operation of various components of the electronic device 600.
[0116] The memory 140 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information, and also store a program for executing that information. The central processing unit 100 may execute the program stored in the memory 140 to perform information storage or processing, etc.
[0117] Input unit 120 provides input to central processing unit 100. Input unit 120 may be, for example, a keypad or touch input device. Power supply 170 provides power to electronic device 600. Display 160 displays images and text. Display may be, for example, an LCD display, but is not limited thereto.
[0118] The memory 140 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs. The memory 140 can also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application / function storage unit 142 for storing application programs and function programs or processes for executing the operation of the electronic device 600 via the central processing unit 100.
[0119] The memory 140 may also include a data storage unit 143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 144 of the memory 140 may include various drivers for the electronic device's communication functions and / or for performing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0120] The communication module 110 is a transmitter / receiver 110 that transmits and receives signals via antenna 111. The communication module (transmitter / receiver) 110 is coupled to the central processing unit 100 to provide input signals and receive output signals, which can be the same as in a conventional mobile communication terminal.
[0121] Based on different communication technologies, multiple communication modules 110 can be configured in the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide audio output via the speaker 131 and receive audio input from the microphone 132, thereby enabling typical telecommunications functions. The audio processor 130 can include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor 130 is coupled to a central processing unit 100, enabling on-device recording via the microphone 132 and on-device playback of stored audio via the speaker 131.
[0122] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0123] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0124] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0125] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0126] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. A method for ensuring high availability of mobile application pages, characterized in that, The method includes: Receive user requests to access mobile application pages; Load the mobile client's bundle resources according to the access request; Upon successful loading of the bundle resources on the mobile device, the mobile application page is displayed to the user. In response to the failure to load bundle resources on the mobile device, obtain the network address of the mobile application page; The client requests static resources of the mobile application page from the web server based on the network address and caches them locally on the client. The client then displays the mobile application page to the user. The mobile application page is rendered by parsing the static resources through the WebView built into the client. The step of obtaining the network address of the mobile application page includes: obtaining the network address of the mobile application page according to a mapping list, wherein the mapping list records the mapping relationship between the mobile bundle and the web page network address; The method further includes building the cross-platform application development project into a mobile bundle and a web bundle respectively, and generating a mapping list for recording the mapping relationship between the mobile bundle and the web network address; In response to a failure to load bundle resources on a mobile device, the method further includes: The static resources of the mobile application page are first retrieved from the cache of the local web page view on the client, and then the mobile application page is displayed to the user. If the static resource is not cached locally on the client or the cache has expired, the client is routed to the content delivery network to download the static resource and cache it locally on the client, and then the mobile application page is displayed to the user. If the content delivery network does not cache the static resources or the cache has expired, it obtains the network address of the mobile application page, requests the static resources of the mobile application page from the web server based on the network address, and then displays the mobile application page to the user.
2. The method for ensuring high availability of mobile application pages as described in claim 1, characterized in that, In response to a failure to load bundle resources on a mobile device, the method further includes: The static resources of the mobile application page are first retrieved from the cache of the local web page view on the client, and then the mobile application page is displayed to the user. If the static resources are not cached locally on the client or the cache has expired, the network address of the mobile application page is obtained, and the static resources of the mobile application page are requested from the web server based on the network address and cached locally on the client. Then, the mobile application page is displayed to the user.
3. The method for ensuring high availability of mobile application pages as described in any one of claims 1-2, characterized in that, The step of displaying the mobile application page to the user includes: The static resources are parsed using the client's built-in webpage view, rendered, and then displayed to the user as the mobile application page.
4. A device for ensuring high availability of mobile application pages, characterized in that, The device includes: The request receiving unit is used to receive mobile application page access requests sent by users. A resource loading unit is used to load the bundle resources of the mobile terminal according to the access request; A network address acquisition unit is used to acquire the network address of the mobile application page in response to the failure to load the bundle resources on the mobile device. A static resource request unit is used to request static resources of the mobile application page from the web server according to the network address and transfer them to the local client. The page display unit is used to display the mobile application page to the user in response to the successful loading of the bundle resources on the mobile device, and to display the mobile application page to the user after the static resource request unit obtains the static resources. The mobile application page is obtained by parsing the static resources and rendering them through the WebView built into the client. The device is also used to obtain the network address of the mobile application page according to the mapping list, wherein the mapping list records the mapping relationship between the mobile bundle and the web page network address; The device is also used to build the cross-platform application development project into a mobile bundle and a web bundle respectively, and generate a mapping list for recording the mapping relationship between the mobile bundle and the web network address; The device is also configured to respond to a failure to load bundle resources on the mobile device. The static resources of the mobile application page are first retrieved from the cache of the local web page view on the client, and then the mobile application page is displayed to the user. If the static resource is not cached locally on the client or the cache has expired, the client is routed to the content delivery network to download the static resource and cache it locally on the client, and then the mobile application page is displayed to the user. If the content delivery network does not cache the static resources or the cache has expired, it obtains the network address of the mobile application page, requests the static resources of the mobile application page from the web server based on the network address, and then displays the mobile application page to the user.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.
7. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Weex page rendering method, device, terminal and storage medium
CN108846131A
Webpage loading method and device
CN112559927A