Application page loading method and device, storage medium and electronic device
By obtaining and storing the application installation package on the terminal, detecting and requesting to update resource files, the problem of long loading time of application display pages is solved, and faster page loading speed is achieved.
Patent Information
- Application Number
- CN202110622384.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-03
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2041-06-03
AI Technical Summary
In the prior art, it takes too long to load the display page of an application, especially in a poor network environment, and there is a lack of effective solutions.
Obtain and store the application installation package on the terminal. The installation package contains page resource files that need to be downloaded through the network when running for the first time. When it is detected that the terminal requests to connect to the wireless network, it is allowed to send a resource file update request to the network side device. After successfully connecting to the wireless network, the updated resource file is obtained, realizing the pre-storage and synchronous loading of the resource file.
By pre-storing page resource files, the display loading time of the application is reduced and the page loading speed is improved.
Smart Images

Figure CN115437651B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a method and device for loading an application page, a storage medium, and an electronic device. Background Art
[0002] With the increasing popularity of smart terminals, people need to use the functions of applications on smart terminals to meet business needs every day.
[0003] For applications that frequently require iterative development, the usual practice is to display the page by opening a web link. However, in the process of users loading the application page, they need to download the page resource file again through the network, which will further increase the time it takes to load the page. The time it takes to load the web page will also depend on the network environment. Even in a very good network environment, it will take nearly 1 second to open. If the network environment is not good, it will take even longer. Furthermore, in the current related technologies, there is a technical problem that the application display page loading time is too long.
[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0005] Embodiments of the present invention provide a method and device for loading an application page, a storage medium, and an electronic device, so as to at least solve the technical problem in the related art that the display page loading time of an application program is too long.
[0006] According to one aspect of an embodiment of the present invention, a method for loading an application page is provided, comprising: obtaining an installation package of a target application on a target terminal, wherein a target resource file is constructed in the installation package, and the target resource file is a page resource file that needs to be downloaded through a network when the target application is run for the first time; installing the target application on the target terminal by running the installation package on the target terminal, wherein the target resource file is stored on the target terminal; in response to an application running instruction obtained on the target terminal, running the target application on the target terminal for the first time, and loading the target resource file stored on the target terminal in the target application to load the target resource file stored on the target terminal in the target application. The target application page is displayed in the user, wherein the target resource file includes page resources that need to be loaded when displaying the target application page; when it is detected that the target terminal requests to connect to the target wireless network and the target application is running in the background of the target terminal, the state of the target application is set to allow sending a resource file update request to the network side device, wherein the resource file update request is used to request to obtain an updated resource file; when the target terminal successfully connects to the target wireless network and the target application is running in the background of the target terminal, the resource file update request is sent to the network side device on the target application, and the updated resource file sent by the network side device is obtained.
[0007] According to another aspect of an embodiment of the present invention, a device for loading an application page is also provided, comprising: an acquisition module for acquiring an installation package of a target application on a target terminal, wherein a target resource file is constructed in the installation package, and the target resource file is a page resource file that needs to be downloaded through the network when the target application is run for the first time; an installation module for installing the target application on the target terminal by running the installation package on the target terminal, wherein the target resource file is stored on the target terminal; a loading module for running the target application on the target terminal for the first time in response to an application running instruction acquired on the target terminal, and loading the target resource file stored on the target terminal in the target application to load the target resource file stored on the target terminal in the target application, so as to The target application page is displayed in the target application, wherein the target resource file includes page resources that need to be loaded when displaying the target application page; a setting module is used to set the status of the target application to allow sending a resource file update request to the network side device when it is detected that the target terminal requests to connect to the target wireless network and the target application is running in the background of the target terminal, wherein the resource file update request is used to request to obtain an updated resource file; a sending module is used to send the resource file update request to the network side device on the target application when the target terminal successfully connects to the target wireless network and the target application is running in the background of the target terminal, and obtain the updated resource file sent by the network side device.
[0008] Optionally, the device is used to detect whether the target terminal requests to connect to the target wireless network in the following manner: detecting whether the target terminal switches from the currently connected mobile network to the target wireless local area network; or detecting whether the target terminal switches from the currently connected wireless local area network to the target wireless local area network; or when the target terminal is in a state of closing the mobile network connection and closing the wireless local area network connection, detecting whether the target terminal enables the wireless local area network connection.
[0009] Optionally, the device is also used to: obtain the hash value of the resource file to be pulled in the network side device; when the hash value of the resource file to be pulled is different from the hash value of the resource file last pulled by the target application, obtain the resource file to be pulled from the network side device; when the hash value of the resource file to be pulled is the same as the hash value of the resource file last pulled by the target application, stop obtaining the resource file to be pulled from the network side device.
[0010] Optionally, the device is also used to: obtain a target resource package of the target application from the network side device, wherein the target resource package is a resource package formed by packaging a group of resource files of the target application, and the group of resource files includes a compressed image obtained by compressing a target image; in the process of loading the target resource package in the target application, the compressed image is decompressed to obtain the target image, and the target image is loaded.
[0011] Optionally, the device is also used to: obtain the encrypted resource package of the target application from the network side device, wherein the encrypted resource package is a resource package obtained by encrypting the target resource package of the target application, and the target resource package is a resource package formed by packaging a group of resource files of the target application; decrypt the encrypted resource package in the target application to obtain the target resource package; and load the group of resource files in the target resource package in the target application.
[0012] Optionally, the device is also used to: determine the resource files that must be loaded and the resource files that do not have to be loaded when the target application is started; and construct an installation package for the target application based on the resource files that must be loaded, wherein the resource files that do not have to be loaded are located outside the installation package.
[0013] Optionally, the device is also used to: when the installation package constructs resource files that must be loaded when the target application is started and resource files that do not have to be loaded, when the target terminal starts the target application, load the resource files that must be loaded in the target application; when the target interaction instruction is obtained in the target application, load the resource files that do not have to be loaded in the target application, wherein the target interaction instruction is used to request the resource files that do not have to be loaded.
[0014] Optionally, the device is further configured to: determine an update frequency of the target resource file; and construct the target resource file into the installation package when the update frequency is less than a preset update frequency threshold.
[0015] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the above-mentioned method for loading an application page when running.
[0016] According to another aspect of an embodiment of the present invention, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned method for loading an application page through the computer program.
[0017] In an embodiment of the present invention, an installation package of an application is obtained on a terminal, and a page resource file that needs to be downloaded through the network when the application is run for the first time is constructed in the installation package. Then, by installing the application, the above-mentioned page resource file is stored on the terminal where the application is located. When it is detected that the target terminal requests to connect to the target wireless network and the target application is running in the background of the target terminal, the state of the target application is set to allow a resource file update request to be sent to the network-side device. When the target terminal successfully connects to the target wireless network and the target application is running in the background of the target terminal, a resource file update request is sent to the network-side device on the target application, and the updated resource file sent by the network-side device is obtained. Then, when the application is run for the first time on the terminal, the above-mentioned page resource file can be loaded at the same time. That is, by pre-configuring the page resource file to be loaded in the installation package and synchronously storing the page resource file to be loaded when the application is installed, the loading speed of the page resource is accelerated, thereby achieving the technical effect of reducing the display loading time of the application, thereby solving the technical problem of excessively long display page loading time of the application existing in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0019] Figure 1 is a schematic diagram of an application environment of an optional method for loading an application page according to an embodiment of the present invention;
[0020] Figure 2 is a flow chart of an optional method for loading an application page according to an embodiment of the present invention;
[0021] Figure 3 is a schematic diagram of an optional method for loading an application page according to an embodiment of the present invention;
[0022] Figure 4 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention;
[0023] Figure 5 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention;
[0024] Figure 6 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention;
[0025] Figure 7 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention;
[0026] Figure 8 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention;
[0027] Figure 9 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention;
[0028] Figure 10 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention;
[0029] Figure 11 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention;
[0030] Figure 12 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention;
[0031] Figure 13 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention;
[0032] Figure 14 is a schematic structural diagram of an optional device for loading an application page according to an embodiment of the present invention;
[0033] Figure 15 FIG. 4 is a schematic structural diagram of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0035] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0036] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretations:
[0037] Dynamic layout: This allows you to dynamically modify the UI layout based on page details without having to release new versions. This allows for seamless transitions from JavaScript to native. All page displays are automatically handled by the program, eliminating the need for frequent releases.
[0038] Native pages: These pages implement the UI based on the system-provided interfaces and frameworks. Compared to HTML5-based pages, they offer better performance, speed, and a more optimized user experience.
[0039] Bundle file: refers to a file generated by packaging some resource files (such as scripts, .CSS, and .js files) through script files. It is mainly used to facilitate integration or downloading to the terminal.
[0040] Loading time: This refers to the time it takes from clicking a news item to successfully displaying the news details page. This typically includes the decompression, decryption, and loading of the news bundle file.
[0041] In some application scenarios, page resources have the same meaning as page files and page resource files.
[0042] The present invention will be described below in conjunction with embodiments:
[0043] According to one aspect of an embodiment of the present invention, a method for loading an application page is provided. Optionally, in this embodiment, the method for loading an application page can be applied to Figure 1 In the hardware environment composed of the server 101 and the user terminal 103 shown in FIG. Figure 1As shown, the server 101 is connected to the terminal 103 via a network and can be used to provide services to the user terminal or the client installed on the user terminal. The client can be a video client, an instant messaging client, a browser client, an education client, a game client, etc. A database 105 can be set on the server or independently of the server to provide data storage services for the server 101, for example, a picture data storage server. The above-mentioned network can include but is not limited to: a wired network and a wireless network, wherein the wired network includes: a local area network, a metropolitan area network, and a wide area network, and the wireless network includes: Bluetooth, WIFI, and other networks that implement wireless communication. The user terminal 103 can be a terminal configured with a target application 107, which can include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop computer, a tablet computer, a PDA, a MID (Mobile Internet Device), a PAD, a desktop computer, a smart TV, a wearable device, and other computer devices. The above-mentioned server can be a single server, a server cluster consisting of multiple servers, or a cloud server. The target application 107 using the above-mentioned application page loading method is displayed on the user terminal 103.
[0044] Combine Figure 1 As shown, the above-mentioned method for loading the application page can be implemented in the user terminal 103 through the following steps:
[0045] S1, obtaining an installation package of a target application in the user terminal 103, wherein the installation package constructs a target resource file, which is a page resource file that needs to be downloaded through the network when the target application is run for the first time;
[0046] S2, installing the target application on the user terminal 103 by running the installation package on the user terminal 103, wherein the target resource file is stored on the user terminal 103;
[0047] S3, in response to the application execution instruction obtained on the user terminal 103, executing the target application for the first time on the user terminal 103, and loading the target resource file stored on the user terminal 103 into the target application, so as to display the target application page in the target application, wherein the target resource file includes page resources required to be loaded when displaying the target application page;
[0048] S4, upon detecting that the user terminal 103 requests to connect to the target wireless network and the target application is running in the background of the user terminal 103, setting the state of the target application to allow sending a resource file update request to the network-side device, wherein the resource file update request is used to request to obtain an updated resource file;
[0049] S5, when the user terminal 103 successfully connects to the target wireless network and the target application runs in the background of the user terminal 103, the target application sends a resource file update request to the network side device and obtains the updated resource file sent by the network side device.
[0050] Optionally, in this embodiment, the above-mentioned method for loading the application page may also be used by, including but not limited to, a client configured on the server.
[0051] Optionally, in this embodiment, the above-mentioned application page loading method may include but is not limited to asynchronous use by the user terminal 103 and the server 101. For example, the above-mentioned construction of the target resource file in the installation package may include but is not limited to being implemented by the client deployed on the server 101.
[0052] The above is only an example and is not specifically limited in this embodiment.
[0053] Alternatively, as an optional implementation, Figure 2 As shown, the method for loading the above application page includes:
[0054] S202, obtaining an installation package of a target application on a target terminal, wherein the installation package contains a target resource file, which is a page resource file that needs to be downloaded via the network when the target application is first run;
[0055] S204, installing the target application on the target terminal by running the installation package on the target terminal, wherein the target resource file is stored on the target terminal;
[0056] S206, in response to the application execution instruction obtained on the target terminal, executing the target application for the first time on the target terminal, and loading the target resource file stored on the target terminal into the target application, so as to display the target application page in the target application, wherein the target resource file includes page resources required to be loaded when displaying the target application page;
[0057] S208, when it is detected that the target terminal requests to connect to the target wireless network and the target application is running in the background of the target terminal, setting the state of the target application to allow sending a resource file update request to the network side device, wherein the resource file update request is used to request to obtain an updated resource file;
[0058] S210: When the target terminal successfully connects to the target wireless network and the target application runs in the background of the target terminal, the target application sends a resource file update request to the network side device and obtains the updated resource file sent by the network side device.
[0059] Optionally, in this embodiment, the above-mentioned target terminal may include but is not limited to mobile phones (such as Android phones, iOS phones, etc.), laptops, tablets, PDAs, MIDs (Mobile Internet Devices), PADs, desktop computers, smart TVs, wearable devices and other computer devices.
[0060] in, Figure 3 is a schematic diagram of an optional method for loading an application page according to an embodiment of the present invention, such as Figure 3 As shown:
[0061] First, the server performs pre-processing operations, including but not limited to steps S1 to S3, wherein:
[0062] S1. The server sends a compressed and encrypted resource file to a network-side device. For example, the resource file includes but is not limited to a page resource file that needs to be downloaded from the network when the target application is first run. The resource file may be stored in a network-side device such as a preset CDN (Content Delivery Network) network, and the generated encrypted resource file is uploaded to the CDN and subjected to an MD5 check.
[0063] S2: The server sends a configuration file to the configuration server, for example, a .plist file (containing version information, supported system versions, effective date of resource files, supported bundle list information, etc.);
[0064] Then, the terminal starts to execute the following steps:
[0065] S3. The terminal downloads an installation package (including compressed and encrypted resource files) from the server. For example, the installation package includes but is not limited to SIS or SISX installation packages for Symbian systems, JAD or JAR installation packages for Java programs, mtf installation packages, mpkg installation packages, or pkg installation packages for Linux systems, APK installation packages for Android systems, and installers or integrated software package installers (Installers) for Apple systems. During the packaging of the installation package, optimization may be performed using, but is not limited to, the following strategies or principles:
[0066] (1) Some larger dependencies can be loaded on demand to avoid loading unnecessary resources. At the same time, the size of resource files can be reduced and the loading time can be reduced. For example, resource packages that do not need to be updated frequently can be displayed according to the time period, including some language packages that are not required at the moment.
[0067] (2) For larger static images, the resource package size can be reduced, including but not limited to, by compressing the original image file. Since the existing technology generally uses the original image method to load static images, it is not necessary for the loading of resource files. At the same time, excessively large file resources will lead to increased download time and error rate (for example, necessary and infrequently updated images, including but not limited to buttons, can be separately included in the resource package and pre-issued. Unnecessary images, such as images that require user interaction, can be released in the corresponding resource package upon user request, etc.);
[0068] (3) For some non-icon type and large-sized images, they are automatically uploaded to the CDN through the custom loader in webpack provided by Hippy.
[0069] It should be noted that by integrating some infrequently updated resources into the App when it is built, the process of updating resource files during initialization is reduced. At the same time, for each page in the project, necessary dependencies are used and stored in the terminal in advance through pre-embedded methods, reducing unnecessary downloads. Pre-embedded public basic packages can reduce unnecessary data downloads, such as Figure 7 As shown, JS-MD5 is a tool function such as MD5; Vuex is the Vue data storage center; Core-JS is used to provide platform compatibility with JS code;
[0070] S4. Open the installation package on the terminal, install and run the application, and display the content. The installation package contains other files that need to be updated in addition to the basic package. For example, the installation package may include but is not limited to files in the Bundle format, which is an executable file in Unix / Linux systems. Users can run it using the . / ***(file name).bundle command in the terminal. Users can run it using the . / ***(file name).bundle command in the terminal. If necessary, sudo must be used to provide superuser privileges, and the administrator password must be provided. A class used to transfer data between Android activities. Bundle files can be viewed using four known software applications, which are usually macOS developed by Apple. It is associated with two main file types, but often appears in the Mac OS X Application Bundle format. In most cases, these files are considered PluginFiles, but they can also be Compressed Files. The Bundle file extension can be viewed on Mac, Windows, and Android. The page resource files that need to be downloaded from the network when the target application is first run may include but are not limited to text, icons, images, page layout information, font files, etc.
[0071] S5. When the application is running in the background on the terminal, upon detecting that the terminal requests to connect to a wireless network or that the terminal has successfully connected to a new wireless network, a resource file update request is sent to the network-side device. For example, stack information during the operation of the target application can be monitored. When it is determined that the target application is running in the background of the target terminal, the state of the target application is set to allow the sending of resource file update requests to the network-side device. The network-side device can include but is not limited to a CDN network or other network-side device capable of content distribution or storage. When the target terminal successfully connects to the target wireless network, the target application sends the resource file update request to the network-side device, which can include but is not limited to requesting the network-side device to send updated resource files when detecting that the target terminal is connected to the target wireless network, so as to update the resource files.
[0072] S6. The network-side device sends the compressed and encrypted resource file to the terminal according to the update request. The network-side device determines whether the version numbers are consistent. If they are inconsistent, the updated compressed and encrypted resource file will be sent. For example, the terminal reads the version number of the resource file from the network-side device, and the terminal determines whether the version number of the resource file is consistent with the read version number of the resource file. If they are inconsistent, the terminal matches the hash value of the resource file. If the version number and hash value of the resource file stored in the terminal and the resource file stored in the network-side device are inconsistent, the terminal obtains the updated resource file from the network-side device.
[0073] S7, obtain configuration information from the configuration server on the terminal, for example, the vueconfig configuration file obtained after encryption and compression (completed by the local packaging tool). By uploading the generated configuration file to the configuration file platform, similar to the normal configuration file release, you can set the region and quantity of the configuration file release;
[0074] S8, decompressing and decrypting the resource file on the terminal according to the configuration information. For example, when the terminal starts up, it will receive the configuration file information of the current version. By parsing the configuration file, it can obtain the download address of the bundle file, decompression and decryption keys, and other information. Then, the bundle file to be updated can be directly downloaded through the download address and preloaded;
[0075] S9. Load the decrypted resource file on the terminal. For example, configure the target application to include, but not limited to, an application using a dynamic layout framework for displaying page resources. Dynamic layout refers to dynamically modifying the UI display layout based on the page details without having to release a new terminal version. This allows for a seamless experience transition from JS to Native, where all page display is automatically handled by the program without the need for frequent version releases.
[0076] The above is only an example, and this embodiment does not impose any specific limitation.
[0077] Optionally, in this embodiment, the above-mentioned method for loading the application page may also include but is not limited to combining cloud technology, cloud computing, cloud storage, etc., wherein:
[0078] Cloud computing is a computing model that refers to the delivery and use of IT infrastructure, enabling on-demand, scalable access to resources over the internet. Broadly speaking, cloud computing refers to the delivery and use of services, enabling on-demand, scalable access to services over the internet. These services can be IT-related, software-related, internet-related, or other services. Cloud computing is the product of the convergence of traditional computer and network technologies, including grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing.
[0079] Cloud computing has rapidly grown, driven by the internet, real-time data streams, the diversification of connected devices, and the growing demand for search services, social networks, mobile commerce, and open collaboration. Unlike previous parallel and distributed computing approaches, the emergence of cloud computing will fundamentally revolutionize the entire internet and enterprise management model.
[0080] Cloud storage is a new concept that has been extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.
[0081] Currently, storage systems utilize a method for creating logical volumes. When creating a logical volume, physical storage space is allocated for each logical volume. This physical storage space may consist of disks on a specific storage device or several storage devices. When a client stores data on a logical volume, it stores the data on a file system. The file system divides the data into multiple parts, each of which is an object. An object contains not only the data but also additional information such as the data identifier (ID) of the data entity. The file system writes each object to the physical storage space of the logical volume and records the storage location information of each object. Therefore, when a client requests access to data, the file system can provide access to the data based on the storage location information of each object.
[0082] The storage system allocates physical storage space to logical volumes by pre-dividing the physical storage space into stripes based on the estimated capacity of the objects to be stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the Redundant Array of Independent Disks (RAID) groupings. A logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.
[0083] A private cloud is a cloud infrastructure with hardware and software resources created within a firewall, allowing departments within an organization or enterprise to share data center resources. In addition to hardware resources, creating a private cloud typically also requires cloud infrastructure (IaaS, Infrastructure as a Service) software.
[0084] Private cloud computing also encompasses three layers: cloud hardware, cloud platform, and cloud services. The difference is that the cloud hardware is the user's own personal computer or server, rather than the cloud computing vendor's data center. Cloud computing vendors build data centers to provide public cloud services to millions of users, requiring tens or even millions of servers. Private cloud computing, for individuals, only serves friends and family, while for businesses, only serves their employees, customers, and suppliers. Therefore, an individual or business's own personal computer or server is sufficient for providing cloud services.
[0085] A public cloud typically refers to a cloud provided by a third-party provider for users to use. Public clouds are typically available over the internet and may be free or low-cost. The core attribute of a public cloud is shared resource services. There are many instances of this type of cloud, providing services across today's open public networks.
[0086] Hybrid cloud, a fusion of public and private clouds, has been the primary model and development direction of cloud computing in recent years. Private clouds are primarily targeted at enterprise users. For security reasons, enterprises prefer to store data in private clouds, but at the same time, they desire access to public cloud computing resources. In this context, hybrid cloud is increasingly being adopted. It mixes and matches public and private clouds to achieve optimal results. This personalized solution achieves both cost-saving and security goals.
[0087] Optionally, in this embodiment, the above-mentioned installation package includes but is not limited to SIS or SISX installation package applied to Symbian system, JAD or JAR installation package used by Java program, mtf installation package, mpkg installation package or pkg installation package used by Linux system, APK installation package used by Android system, installer or software package integrated installer (Installer) used by Apple system, etc. The above is only an example and this embodiment does not make any specific limitation.
[0088] Optionally, in this embodiment, the target resource files include but are not limited to page resource files that need to be downloaded via the network when the target application is run for the first time. The target resource files may be stored in a database on the server, but may also be stored in a network-side device such as a preset CDN (Content Delivery Network) network. For example, a file in the Bundle format is an executable file in a Unix / Linux system. Users can run it using the . / ***(file name).bundle command in the terminal. Users can run it using the . / ***(file name).bundle command in the terminal. If necessary, sudo needs to be used to execute to provide superuser privileges, and an administrator password needs to be provided. A class used to transfer data between Android activities. Bundle files can be viewed using four known software applications, which are usually macOS developed by Apple. It is associated with two main file types, but often appears in the Mac OS X Application Bundle format. In most cases, these files are considered Plugin Files, but they can also be Compressed Files. The Bundle file extension can be viewed on Mac, Windows, and Android.
[0089] For example, Figure 4 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention, such as Figure 4 As shown, the above-mentioned acquisition of the target application installation package on the target terminal may be achieved by, but not limited to, the following steps:
[0090] S1, obtaining page resources through input source 402 (e.g., a client used by an operator), and generating page resource files on the client side of the server. For example, the resource files include but are not limited to page resource files that need to be downloaded via the network when the target application is first run.
[0091] S2, the client encrypts and compresses the page resource files in the background of server 404. For example, the above-mentioned page resource files may include but are not limited to files in the Bundle format, which is an executable file in the Unix / linux system. The user can use the . / ***(file name).bundle command in the terminal to run it. The user can use the . / ***(file name).bundle command in the terminal to run it. If necessary, sudo needs to be used to execute to provide super user permissions, and the administrator password needs to be provided. A class used to pass data between Android Activities. Bundle files can be viewed using four known software applications, which are usually macOS developed by Apple. It is associated with two main file types, but often appears in the Mac OS X Application Bundle format. In most cases, these files are considered Plugin Files, but they can also be Compressed Files. The Bundle file extension can be viewed on Mac, Windows, and Android. The page resource files that need to be downloaded through the network when the target application is run for the first time may include but are not limited to text, icons, pictures, page layout information, font files, etc.;
[0092] S3, the server 404 sends the page resource file to the network-side device 406. For example, the resource file includes but is not limited to the page resource file that needs to be downloaded through the network when the target application is first run. The resource file may be but is not limited to being stored in a preset CDN (Content Delivery Network) network or other network-side device. The generated encrypted resource file is uploaded to the CDN and an MD5 check is performed.
[0093] S4. Terminal 408 receives the page resource file sent by network device 406 and decrypts and decompresses it. For example, when the terminal starts up, it receives the configuration file information of the current version. By parsing the configuration file, it can obtain the download address of the bundle file, decompression and decryption keys, and other information. Then, it can directly download the bundle file to be updated through the download address and preload it.
[0094] S5. The display interface of terminal 408 displays the aforementioned page resource file. For example, the target application is configured to include, but is not limited to, an application using a dynamic layout framework for displaying page resources. Dynamic layout refers to dynamically modifying the UI display layout based on the content of the page details without the need to release a new terminal version. This allows for a seamless experience transition from JS to Native, where all page display is automatically performed by the program without the need for frequent version releases.
[0095] It should be noted that the above is only an optional solution. Figure 5 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention, such as Figure 5 As shown, the above-mentioned obtaining the installation package of the target application on the target terminal may also be achieved by, but not limited to, the following steps:
[0096] S1, obtaining page resources through input source 502 (e.g., a client used by an operator), and generating page resource files on the client side of the server. For example, the resource files include but are not limited to page resource files that need to be downloaded via the network when the target application is first run.
[0097] S2, the client encrypts and compresses page resource files and configuration files in the background of server 504. For example, the above-mentioned page resource files may include but are not limited to files in the Bundle format, which is an executable file in the Unix / linux system. The user can use the . / ***(file name).bundle command in the terminal to run it. The user can use the . / ***(file name).bundle command in the terminal to run it. If necessary, sudo needs to be used to execute to provide super user permissions, and the administrator password needs to be provided. Class for passing data between Android Activities. Bundle files can be viewed using four known software applications, which are usually macOS developed by Apple. It is associated with two main file types, but often appears in the Mac OS X Application Bundle format. In most cases, these files are considered Plugin Files, but they can also be Compressed Files. The Bundle file extension can be viewed on Mac, Windows, and Android, where the page resource files that need to be downloaded through the network when the target application is run for the first time may include but are not limited to text, icons, pictures, page layout information, font files, etc.;
[0098] S3-1, the server 504 sends a configuration file, such as a .plist file (including version information, supported system versions, effective date of resource files, supported bundle list information, etc.) to the configuration file server 506;
[0099] S3-2, the server 504 sends the page resource file to the network device 508. The resource file may include but is not limited to a resource file stored in a network device such as a preset CDN (Content Delivery Network). The generated encrypted resource file is uploaded to the CDN and an MD5 check is performed.
[0100] S4-1, the terminal 510 receives the page resource file sent by the network side device 508, and decrypts and decompresses it. It should be noted that by integrating some resources that are not frequently updated into the App when it is built, the process of updating resource files during initialization is reduced. At the same time, for each page in the project, necessary dependencies are used and stored in the terminal in advance through pre-embedded methods, reducing unnecessary downloads, pre-embedded public basic packages, and reducing unnecessary data downloads, such as Figure 7 As shown, JS-MD5 is a tool function such as MD5; Vuex is the Vue data storage center; Core-JS is used to provide platform compatibility with JS code;
[0101] S4-2, the terminal 510 receives the configuration file sent by the configuration file server 506, for example, the vueconfig configuration file obtained after encryption and compression (completed by the local packaging tool), and uploads the generated configuration file to the configuration file platform. Similar to ordinary configuration file publishing, the region and quantity of the configuration file can be set;
[0102] S5. Terminal 510 displays the page resource files on the corresponding display interface according to the configuration file. For example, the target application is configured to include, but is not limited to, an application using a dynamic layout framework for displaying page resources. Dynamic layout refers to dynamically modifying the UI display layout based on the content of the page details without the need to release a new terminal version. This allows for a seamless experience switch from JS to Native, where all page display is automatically completed by the program without the need for frequent version releases.
[0103] It should be noted that the above steps S1 to S2 may include but are not limited to generating page resource files and configuration files in the following manner: the files to be published by the Web front-end, such as JS+CSS files, are locally packaged by the Vue.js script to generate a JS Bundle file, and the corresponding .plist file is configured (including version information, supported system versions, effective date of resource files, supported bundle list information, etc.). After encryption and compression (completed by the local packaging tool), the encrypted resource files and vueconfig configuration files will be generated.
[0104] Steps S3-1 and S3-2 above may include, but are not limited to, configuring the publishing platform and uploading resource files in the following manner: uploading the generated encrypted resource files to the CDN and performing an MD5 checksum. Uploading the generated configuration files to the configuration file platform, similar to regular configuration file publishing, can configure the region and quantity of configuration file releases.
[0105] The above steps S4-1 and S4-2 may include but are not limited to pulling configuration files and downloading resource files in the following manner: when the terminal starts, it will receive the configuration file information of the current version. By parsing the configuration file, the download address, decompression and decryption keys and other information of the bundle file can be obtained. Then, the bundle file to be updated can be directly downloaded through the download address and preloaded.
[0106] Optionally, in this embodiment, the target resource file is a page resource file that needs to be downloaded through the network when the target application is run for the first time, and may include but is not limited to text, icons, pictures, page layout information, font files, etc.
[0107] For example, Figure 6 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention, such as Figure 6 As shown, the display interface of the terminal 602 includes but is not limited to the text page resources to be displayed included in the text 604, the icon page resources to be displayed included in the icon 606, the picture page resources to be displayed included in the picture 608, the page resources of different fonts included in the text 606 to be displayed, and the page layout configuration information of the terminal 602 included in the page layout 612, for example, the text "picture" is configured to be displayed on the left side of the display interface, and the picture 608 is configured to be displayed in the middle area of the display interface, etc.
[0108] Optionally, in this embodiment, the target application installed on the target terminal by running the installation package may include, but is not limited to, configuring the target application as an application that uses, but is not limited to, a dynamic layout framework for use in the display of page resources. Dynamic layout refers to dynamically modifying the UI display layout based on the content of the page details without the need to release a new terminal version. A seamless experience switching from JS to Native can be achieved, wherein the display of all pages is automatically completed by the program without the need for frequent version releases.
[0109] Optionally, in this embodiment, the above-mentioned construction of the target resource file in the installation package may be implemented including but not limited to the following methods:
[0110] Figure 7 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention, by Figure 7 The following shows how to build the Hippy dynamic layout mobile cross-end development framework to build the target resource file in the installation package.
[0111] Among them: Vendor.js: including but not limited to public dependencies (including hippy / vue, vue-router, vue-native-components, etc.);
[0112] Index.js: including but not limited to business logic;
[0113] Assets: including but not limited to static resources (e.g. text, images), just set the path when loading;
[0114] Optionally, in this embodiment, the loading method of the above-mentioned application page may include but is not limited to application in multiple application scenarios, and the above-mentioned target applications may include but are not limited to medical applications, financial applications, credit applications, banking applications, government applications, government applications, game applications, energy applications, education applications, security applications, building applications, transportation applications, Internet of Things applications, etc.
[0115] For example, Figure 8 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention, such as Figure 8 As shown, take the application in image processing scenario as an example:
[0116] S1, Figure 8 Page 1 shown in the figure is the display interface of the target terminal. After obtaining the interactive operation for "application D" (corresponding to the aforementioned application running instruction), application D is opened for the first time and page 2 is entered.
[0117] S2, on page 2, since the target application is installed on the target terminal, the target resource file is stored on the target terminal. The page layout information of application D and the corresponding display images and text are displayed on page 2. By performing an interactive operation on the "Photo" interactive object, page 3 for selecting "Photo" is entered;
[0118] S3, "All pictures" are displayed on page 3, wherein the pictures displayed on page 2 and page 3 are the above-mentioned target resource files stored on the target terminal loaded in the target application.
[0119] For example, Figure 9 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention, such as Figure 9 As shown, taking the application in game application scenario as an example:
[0120] S1, Figure 9 Page 1 shown in the figure is the display interface of the target terminal. After obtaining the interactive operation for "game application D" (corresponding to the aforementioned application running instruction), the game application D is opened for the first time and enters page 2.
[0121] S2, on page 2, since the target application is installed on the target terminal, the target resource file is stored on the target terminal. The page layout information of game D and the corresponding display images and text are all displayed on page 2. By performing an interactive operation on the "Enter Game" interactive object, page 3 of the game loading interface is entered;
[0122] S3, "Loading" is displayed on page 3, wherein the resources displayed on page 2 and page 3 are the above-mentioned target resource files stored on the target terminal loaded in the target application.
[0123] The above is only an example, and this embodiment does not impose any specific limitation.
[0124] Optionally, in this embodiment, the above-mentioned detection of whether the target terminal requests to connect to the target wireless network may include but is not limited to detecting the type of network to which the target terminal is connected, for example, detecting whether the target terminal is connected to the mobile operator's network via cellular data, and for example, detecting whether the target terminal is in a wireless local area network identified as a wireless network.
[0125] Optionally, in this embodiment, when it is detected that the target terminal requests to connect to the target wireless network and the target application is running in the background of the target terminal, the status of the target application is set to allow sending resource file update requests to the network side device, which may include but is not limited to monitoring the stack information during the operation of the target application. When it is determined that the above-mentioned target application is running in the background of the target terminal, the status of the target application is set to allow sending resource file update requests to the network side device.
[0126] The network-side devices mentioned above may include but are not limited to CDN networks and other network-side devices capable of content distribution or storage.
[0127] Optionally, in this embodiment, when the target terminal successfully connects to the target wireless network, sending a resource file update request to the network side device on the target application may include but is not limited to requesting the network side device to send the updated resource file when it is detected that the target terminal is connected to the above-mentioned target wireless network to achieve the update of the resource file.
[0128] For example, Figure 10 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention, such as Figure 10 As shown, taking image processing and gaming applications as examples:
[0129] S1, Figure 10 Page 1 shown in the figure is the display interface of the target terminal. After obtaining the interactive operation for "Game D" (corresponding to the aforementioned application running instruction), "Game D" is opened. Since "Application D" has been opened before, "Application D" is turned to run in the background of the target terminal and enters Page 2 corresponding to Game D.
[0130] S2. On page 2, an interactive operation for "jump to application list" is obtained to display an application list on page 3, including application A, application B, application C, application D, and application E. At this time, since application D is already running in the background of the target terminal and the target terminal is already connected to the target wireless network, the status of the target application is set to allow sending a resource file update request to the network-side device, and the resource file update has been completed during the display of page 2.
[0131] S3, in response to the interactive operation on "Application D", switching "Application D" from the background of the target terminal to the foreground and displaying it as page 4;
[0132] S4, page 4 is a display page generated according to the updated resource file, and an interactive operation for "photo" is obtained to achieve a jump to page 5, and further display page 5 generated according to the updated resource file.
[0133] The above is only an example, and this embodiment does not impose any specific limitation.
[0134] Through this embodiment, an installation package of an application is obtained on a terminal, and a page resource file that needs to be downloaded through the network when the application is run for the first time is constructed in the installation package. Then, by installing the application, the above-mentioned page resource file is stored on the terminal where the application is located. Furthermore, when the application is run for the first time on the terminal, the above-mentioned page resource file can be loaded at the same time. That is, by pre-configuring the page resource file to be loaded in the installation package and synchronously storing the page resource file to be loaded when installing the application, the loading speed of the page resource is accelerated, thereby achieving the technical effect of reducing the display loading time of the application, and thus solving the technical problem of too long display page loading time of the application existing in the related art.
[0135] As an optional solution, the above method also includes: when it is detected that the target terminal requests to connect to the target wireless network and the target application is running in the foreground of the target terminal, detecting whether the target terminal is successfully connected to the target wireless network; when the target terminal is successfully connected to the target wireless network, sending a resource file update request to the network side device on the target application, and obtaining the updated resource file sent by the network side device.
[0136] Optionally, in this embodiment, it may include but is not limited to the following: Figure 8 or Figure 9 As shown, in page 2, it may include but is not limited to detecting that the target terminal requests to connect to the target wireless network and the target application is running in the foreground of the target terminal, detecting whether the target terminal is successfully connected to the target wireless network. When the target terminal is successfully connected to the target wireless network, the target terminal sends a resource file update request to the network side device to update the resource file, and displays the updated resource file on page 3.
[0137] It should be noted that when the above-mentioned target application runs in the foreground of the target terminal, it may include but is not limited to obtaining the resource file corresponding to the interactive object of the currently displayed page, and in the process of displaying page 2, detecting whether the target terminal is successfully connected to the target wireless network. When the target terminal is successfully connected to the target wireless network, the target terminal sends a resource file update request to the network side device.
[0138] Through this embodiment, when it is detected that the target terminal requests to connect to the target wireless network and the target application is running in the foreground of the target terminal, it is detected whether the target terminal is successfully connected to the target wireless network; when the target terminal is successfully connected to the target wireless network, a resource file update request is sent to the network side device on the target application. When the terminal is connected to the target wireless network and the application is running in the background of the terminal, the above-mentioned resource file can still be updated to improve the loading speed of the page resources, thereby achieving the technical effect of reducing the display loading time of the application, and further solving the technical problem of the long display page loading time of the application existing in the related art.
[0139] As an optional solution, detecting whether the target terminal requests to connect to the target wireless network includes:
[0140] Detect whether the target terminal switches from the currently connected mobile network to the target wireless local area network; or
[0141] Detecting whether the target terminal switches from the currently connected wireless local area network to the target wireless local area network; or
[0142] When the target terminal is in a state where the mobile network connection and the wireless local area network connection are closed, it is detected whether the target terminal has enabled the wireless local area network connection.
[0143] Optionally, in this embodiment, the above-mentioned currently connected mobile network may include but is not limited to a mobile network that uses cellular data for data transmission, the above-mentioned currently connected wireless local area network may include but is not limited to a wireless local area network to which the target terminal has maintained a connection, and the above-mentioned target terminal is in a state of closing the mobile network connection and closing the wireless local area network connection, which may include but is not limited to detecting that the above-mentioned target terminal has failed to achieve network connection, and the status of both the mobile network connection and the wireless local area network connection are unavailable.
[0144] For example, Figure 11 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention, such as Figure 11As shown, when it is detected whether the target terminal switches from the currently connected mobile network to the target wireless local area network; or, when it is detected whether the target terminal switches from the currently connected wireless local area network to the target wireless local area network; or, when it is detected that the target terminal is in a state of closing the mobile network connection and closing the wireless local area network connection, it is detected whether the target terminal has enabled the wireless local area network connection, and after it is detected that the target terminal has enabled the wireless local area network connection, a prompt message 1102 is displayed to indicate that the target terminal allows the connection to the wireless local area network connection; "wifi-1" is displayed in the display interface as the above-mentioned target wireless local area network, and then, by performing an interactive operation on the interactive object 1104 "Connect Now", the target terminal is connected to the target wireless network "wifi-1".
[0145] Through this embodiment, the method of detecting whether the target terminal switches from the currently connected mobile network to the target wireless local area network; or detecting whether the target terminal switches from the currently connected wireless local area network to the target wireless local area network; or detecting whether the target terminal enables the wireless local area network connection when the target terminal is in a state of closing the mobile network connection and closing the wireless local area network connection is adopted. By detecting whether the target terminal is connected to the target wireless network, it is determined whether the resource files of the target application need to be updated in the target terminal. Then, when the terminal is connected to the target wireless network, the above-mentioned resource files can be updated to improve the loading speed of the page resources, thereby achieving the technical effect of reducing the display loading time of the application, and thus solving the technical problem of the long display page loading time of the application existing in the related art.
[0146] As an optional solution, the above method also includes: obtaining the hash value of the resource file to be pulled in the network side device; when the hash value of the resource file to be pulled is different from the hash value of the resource file pulled by the target application last time, obtaining the resource file to be pulled from the network side device; when the hash value of the resource file to be pulled is the same as the hash value of the resource file pulled by the target application last time, stopping obtaining the resource file to be pulled from the network side device.
[0147] Optionally, in this embodiment, the above-mentioned hash value generally refers to a hash function. In a general linear list or tree, the relative position of a record in the structure is random, that is, there is no definite relationship between the record and the keyword. Therefore, a series of comparisons with the keyword are required when searching for a record in the structure. This type of search method is based on "comparison", and the efficiency of the search depends on the number of comparisons performed during the search process. Ideally, the required record can be found directly, so a definite correspondence f must be established between the storage location of the record and its keyword, so that each keyword corresponds to a unique storage location in the structure. The elements in the hash table are determined by a hash function. The keyword K of the data element is used as an independent variable, and the value calculated through a certain functional relationship (called a hash function) is the storage address of the element. In this embodiment, the resource files to be pulled stored in the above-mentioned network side device are matched with corresponding hash values to distinguish whether the resource files to be pulled are the same as the resource files that have been pulled.
[0148] For example, Figure 12 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention, such as Figure 12 As shown, first, the server 1206 sends the compressed and encrypted resource file to the network side device 1208 and sends the configuration file to the configuration server 1204;
[0149] Secondly, the method for loading the application page may include but is not limited to the following:
[0150] S1, the terminal 1202 obtains configuration data from the configuration server 1204, for example, the vueconfig configuration file obtained after encryption and compression (completed by the local packaging tool), and uploads the generated configuration file to the configuration file platform. Similar to ordinary configuration file publishing, the region and quantity of the configuration file can be set;
[0151] S2, the terminal 1204 reads the version number of the resource file from the network side device 1208;
[0152] S3, the terminal 1202 or the network side device 1208 determines whether the version number of the resource file is consistent. If it is consistent, the current operation ends; if it is inconsistent, the step S4 is executed;
[0153] S4, the terminal 1202 or the network side device 1208 matches the hash value of the resource file to see if it is consistent. If it is consistent, the current operation ends. If it is inconsistent, the process proceeds to step S5;
[0154] S5, when the version numbers and hash values of the resource files stored in the terminal 1202 and the network-side device 1208 are inconsistent, the terminal 1202 obtains the updated resource files from the network-side device 1208;
[0155] S6, decompressing and decrypting the updated resource file at the terminal 1202;
[0156] S7, loading the resource file at the terminal 1202 to display the corresponding page.
[0157] It should be noted that for some application scenarios, it may also include but not be limited to matching only hash values without determining the version number to reduce the amount of data transmission.
[0158] The above is only an example, and this embodiment does not impose any specific limitation.
[0159] Through this embodiment, the hash value of the resource file to be pulled from the network side device is obtained; when the hash value of the resource file to be pulled is different from the hash value of the resource file pulled by the target application last time, the resource file to be pulled is obtained from the network side device; when the hash value of the resource file to be pulled is the same as the hash value of the resource file pulled by the target application last time, the method of stopping obtaining the resource file to be pulled from the network side device is adopted. By detecting whether the version number and hash value of the resource file stored in the target terminal are the same as the resource file stored in the network side device, if they are different, the target terminal updates the resource file from the network side device to increase the loading speed of the page resource, thereby achieving the technical effect of reducing the display loading time of the application, and further solving the technical problem of too long display page loading time of the application existing in the related art.
[0160] As an optional solution, the above method further includes:
[0161] Obtaining a target resource package of a target application from a network-side device, wherein the target resource package is a resource package formed by packaging a set of resource files of the target application, and the set of resource files includes a compressed image obtained by compressing the target image;
[0162] During the process of loading the target resource package in the target application, the compressed image is decompressed to obtain the target image, and the target image is loaded.
[0163] Optionally, in this embodiment, the above-mentioned target images may include but are not limited to static images, dynamic images, etc. Taking static images as an example, the existing technology generally loads static images of the original size, which will increase the data volume of the resource file and prolong the data transmission time. Through this application, static images (for example, buttons) and other images with lower update frequency can be compressed to reduce the size of the above-mentioned target resource package.
[0164] Optionally, in this embodiment, some dependencies may exist in the target resource package, such as page layout, language pack and other data, which may include but are not limited to on-demand loading to avoid loading unnecessary resources, thereby reducing the size of the target resource package and reducing loading time.
[0165] Optionally, in this embodiment, for some non-icon type and larger images, they are automatically uploaded to the network side device through the custom loader in the webpack provided in the target application, so as to facilitate subsequent rapid updates from the network side device.
[0166] Through this embodiment, a target resource package of a target application is obtained from a network-side device. During the process of loading the target resource package in the target application, a compressed image is decompressed to obtain a target image, and the target image is loaded. By compressing the image to reduce the data volume of the resource package, the loading speed of the page resource is increased, thereby achieving the technical effect of reducing the display loading time of the application, and solving the technical problem of long display page loading time of the application existing in the related art.
[0167] As an optional solution, the above method also includes: obtaining an encrypted resource package of the target application from a network side device, wherein the encrypted resource package is a resource package obtained by encrypting the target resource package of the target application, and the target resource package is a resource package formed by packaging a group of resource files of the target application; decrypting the encrypted resource package in the target application to obtain the target resource package; and loading a group of resource files in the target resource package in the target application.
[0168] Optionally, in this embodiment, encryption and decryption of the resource package can be implemented, including but not limited to using a configuration file that matches the resource file, where the configuration file includes but is not limited to parameter configurations such as supported system, date, download URL address, Zip compression and Bundle encryption / decryption symmetric key settings, loading / unloading resource files, MD5 verification, etc.
[0169] It should be noted that in the existing technology, encryption of transmitted resource files is generally achieved through channel set encryption, that is, the encryption of resource files is achieved by using a pre-configured protocol transmission. In this embodiment, it can also include but is not limited to encrypting the resource file itself on the basis of channel-level encryption, and then transmitting it through a pre-configured protocol. By using ciphertext transmission instead of plaintext transmission, the security performance of data transmission is further improved. In business scenarios such as finance, it can further protect user data security and improve user experience.
[0170] As an optional solution, the above method further includes: determining resource files that must be loaded and resource files that do not have to be loaded when the target application is started;
[0171] An installation package of the target application is constructed based on the resource files that must be loaded, wherein resource files that do not have to be loaded are located outside the installation package.
[0172] Optionally, in this embodiment, the installation package of the target application may be constructed including but not limited to resource files that must be loaded (eg, common dependency parts, specifically including but not limited to page layout of the target application, etc.).
[0173] by Figure 7 For example, Figure 7 The Vendor.js shown is the resource file that must be loaded, which may include but is not limited to hippy / vue, vue-router, vue-native-components, etc.
[0174] As for resource files that are not required to be loaded, this may include but is not limited to placing these resource files in the installation package in advance, for example, Figure 7 The JS-MD5 shown is a tool function such as MD5; Vuex is the Vue data storage center; Core-JS is used to provide platform compatibility with JS code and other resource files, which are built into the installation package of the target application so that after the application is installed using the installation package, these resource files can be directly called for data processing or application page loading.
[0175] As an optional solution, the above method further includes:
[0176] When resource files that must be loaded when the target application is started and resource files that are not required to be loaded are built in the installation package, when the target application is started on the target terminal, the resource files that must be loaded are loaded in the target application;
[0177] When the target interaction instruction is obtained in the target application, the resource files that are not required to be loaded are loaded in the target application, wherein the target interaction instruction is used to request the resource files that are not required to be loaded.
[0178] Optionally, in this embodiment, the above-mentioned target interaction instructions may include but are not limited to manually or automatically triggered interaction instructions. Taking manual triggering as an example, when an interactive operation is detected in the target application for some interactive objects (for example, buttons), it is determined that the target interaction instruction is obtained in the target application, and then, the resource files that are not required to be loaded are loaded in the target application. Taking automatic triggering as an example, it may include but is not limited to pre-configured associated response time. After the target application is started and the time corresponding to the above-mentioned response time has passed, the above-mentioned resource files that are not required to be loaded are obtained from the network side device.
[0179] It should be noted that when loading the above-mentioned resource files that must be loaded and the resource files that do not have to be loaded, you can also open the page to be displayed through Webview in some specific situations, for example, when the cloud instruction is not opened, there is no resource file, or the resource loading fails, and pull the resource file from the server or network side device.
[0180] For example, Figure 13 is a schematic diagram of another optional method for loading an application page according to an embodiment of the present invention, such as Figure 13 As shown, the resource file can be loaded in the following ways, including but not limited to:
[0181] S1, the terminal obtains touch operation;
[0182] S2, detects whether the target switch is turned on (the switch used to turn on cloud commands in the target application);
[0183] S3, detect whether the target terminal has resource files stored locally;
[0184] S4, when the target terminal does not store the resource file locally, calling the web view to access the server;
[0185] S5, load the resource file obtained from the server and check whether the loading is successful;
[0186] S6-1, if the loading is successful, call Hippy-Vue to load the resource file (corresponding to the aforementioned updating of the resource file from the network side device);
[0187] S6-2, in the event of a loading failure, calling the web view to access the server to re-acquire the updated resource file.
[0188] The above is only an example, and this embodiment does not impose any specific limitation.
[0189] Through this embodiment, when the resource files that must be loaded when the target application is started and the resource files that do not have to be loaded are constructed in the installation package, when the target terminal starts the target application, the resource files that must be loaded are loaded in the target application, and when the target interaction instruction is obtained in the target application, the resource files that do not have to be loaded are loaded in the target application. By judging the status of the loaded resources, the resource file acquisition method is flexibly adjusted to avoid affecting the user experience, thereby achieving the technical effect of reducing the display loading time of the application, and further solving the technical problem of the long display page loading time of the application in the related art.
[0190] As an optional solution, the above method further includes: determining an update frequency of the target resource file; and building the target resource file into the installation package when the update frequency is less than a preset update frequency threshold.
[0191] Optionally, in this embodiment, the above-mentioned update frequency may include but is not limited to being pre-configured by staff, specifically, may include but is not limited to a preset update frequency threshold, and when the update frequency is less than the preset update frequency threshold, the target resource file is built into the installation package.
[0192] Optionally, in this embodiment, it may also include but not be limited to associating the above-mentioned update frequency with the timing when the target terminal connects to the target wireless network. For example, when the target terminal switches from the currently connected mobile network to the target wireless local area network, the target resource file is built into the installation package; when the target terminal switches from the currently connected wireless local area network to the target wireless local area network, the target resource file is built into the installation package.
[0193] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present invention is not limited by the order of the actions described, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0194] According to another aspect of an embodiment of the present invention, there is also provided an application page loading device for implementing the above-mentioned application page loading method. Figure 14 As shown, the device includes:
[0195] The acquisition module 1402 is used to obtain the installation package of the target application on the target terminal, wherein the installation package constructs the target resource file, which is the page resource file that needs to be downloaded through the network when the target application is run for the first time;
[0196] An installation module 1404 is configured to install a target application on a target terminal by running an installation package on the target terminal, wherein the target resource file is stored on the target terminal;
[0197] The loading module 1406 is used to respond to the application running instruction obtained on the target terminal, run the target application on the target terminal for the first time, and load the target resource file stored on the target terminal in the target application to display the target application page in the target application, wherein the target resource file includes the page resources required to be loaded when displaying the target application page.
[0198] As an optional solution, the above-mentioned device is also used to: detect whether the target terminal requests to connect to the target wireless network; when it is detected that the target terminal requests to connect to the target wireless network and the target application is running in the background of the target terminal, set the status of the target application to allow sending a resource file update request to the network side device; when the target terminal successfully connects to the target wireless network, send a resource file update request to the network side device on the target application, wherein the resource file update request is used to request to obtain an updated resource file.
[0199] As an optional solution, the above-mentioned device is also used to: when it is detected that the target terminal requests to connect to the target wireless network and the target application is running in the foreground of the target terminal, detect whether the target terminal is successfully connected to the target wireless network; when the target terminal is successfully connected to the target wireless network, send a resource file update request to the network side device on the target application.
[0200] As an optional solution, the above-mentioned device is used to detect whether the target terminal requests to connect to the target wireless network in the following manner: detecting whether the target terminal switches from the currently connected mobile network to the target wireless local area network; or detecting whether the target terminal switches from the currently connected wireless local area network to the target wireless local area network; or when the target terminal is in a state of closing the mobile network connection and closing the wireless local area network connection, detecting whether the target terminal enables the wireless local area network connection.
[0201] As an optional solution, the above-mentioned device is also used to: obtain the hash value of the resource file to be pulled in the network side device; when the hash value of the resource file to be pulled is different from the hash value of the resource file pulled by the target application last time, obtain the resource file to be pulled from the network side device; when the hash value of the resource file to be pulled is the same as the hash value of the resource file pulled by the target application last time, stop obtaining the resource file to be pulled from the network side device.
[0202] As an optional solution, the above-mentioned device is also used to: obtain a target resource package of the target application from a network side device, wherein the target resource package is a resource package formed by packaging a group of resource files of the target application, and the group of resource files includes a compressed image obtained by compressing the target image; in the process of loading the target resource package in the target application, the compressed image is decompressed to obtain the target image, and the target image is loaded.
[0203] As an optional solution, the above-mentioned device is also used to: obtain an encrypted resource package of the target application from a network side device, wherein the encrypted resource package is a resource package obtained by encrypting the target resource package of the target application, and the target resource package is a resource package formed by packaging a group of resource files of the target application; decrypt the encrypted resource package in the target application to obtain the target resource package; and load a group of resource files in the target resource package in the target application.
[0204] As an optional solution, the above-mentioned device is also used to: determine the resource files that must be loaded and the resource files that do not have to be loaded when the target application is started; build an installation package of the target application based on the resource files that must be loaded, wherein the resource files that do not have to be loaded are located outside the installation package.
[0205] As an optional solution, the above-mentioned device is also used to: when the installation package constructs resource files that must be loaded when the target application is started and resource files that do not have to be loaded, when the target terminal starts the target application, load the resource files that must be loaded in the target application; when the target interaction instruction is obtained in the target application, load the resource files that do not have to be loaded in the target application, wherein the target interaction instruction is used to request the resource files that do not have to be loaded.
[0206] As an optional solution, the above-mentioned device is further used to: determine the update frequency of the target resource file; when the update frequency is less than a preset update frequency threshold, build the target resource file into the installation package.
[0207] According to another aspect of the embodiment of the present invention, an electronic device for implementing the above-mentioned method for loading an application page is also provided. The electronic device may be Figure 1 The terminal device or server shown in FIG. This embodiment is described by taking the electronic device as a terminal as an example. Figure 15 As shown, the electronic device includes a memory 1502 and a processor 1504. The memory 1502 stores a computer program, and the processor 1504 is configured to execute the steps in any of the above method embodiments through the computer program.
[0208] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0209] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0210] S1, obtaining an installation package of a target application on a target terminal, wherein the installation package contains a target resource file, which is a page resource file that needs to be downloaded through the network when the target application is run for the first time;
[0211] S2, installing the target application on the target terminal by running the installation package on the target terminal, wherein the target resource file is stored on the target terminal;
[0212] S3, in response to the application execution instruction obtained on the target terminal, executing the target application for the first time on the target terminal, and loading the target resource file stored on the target terminal into the target application, so as to display the target application page in the target application, wherein the target resource file includes page resources required to be loaded when displaying the target application page;
[0213] S4, when detecting that the target terminal requests to connect to the target wireless network and the target application is running in the background of the target terminal, setting the state of the target application to allow sending a resource file update request to the network side device, wherein the resource file update request is used to request to obtain an updated resource file;
[0214] S5, when the target terminal successfully connects to the target wireless network and the target application runs in the background of the target terminal, the target application sends a resource file update request to the network side device and obtains the updated resource file sent by the network side device.
[0215] Alternatively, those skilled in the art will appreciate that Figure 15 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, or other terminal devices. Figure 15 It does not limit the structure of the electronic device. For example, the electronic device may also include Figure 15 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 15 Different configurations shown.
[0216] Among them, the memory 1502 can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for loading the application page in the embodiment of the present invention. The processor 1504 executes various functional applications and data processing by running the software programs and modules stored in the memory 1502, that is, realizes the above-mentioned method for loading the application page. The memory 1502 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1502 may further include a memory remotely located relative to the processor 1504, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include but are not limited to the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 1502 can be used specifically but not limited to store information such as resource files. As an example, Figure 15 As shown, the memory 1502 may include, but is not limited to, the acquisition module 1402, the installation module 1404, and the loading module 1406 in the application page loading device. In addition, it may also include, but is not limited to, other module units in the application page loading device, which will not be repeated in this example.
[0217] Optionally, the transmission device 1506 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one embodiment, the transmission device 1506 includes a network interface controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In one embodiment, the transmission device 1506 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0218] In addition, the electronic device further includes: a display 1508 for displaying the page; and a connection bus 1510 for connecting various module components in the electronic device.
[0219] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting multiple nodes through network communication. The nodes may form a peer-to-peer (P2P) network, and any computing device, such as a server, terminal, or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.
[0220] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations of the aforementioned application page loading. The computer program is configured to perform the steps of any of the aforementioned method embodiments when run.
[0221] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0222] S1, obtaining an installation package of a target application on a target terminal, wherein the installation package contains a target resource file, which is a page resource file that needs to be downloaded through the network when the target application is run for the first time;
[0223] S2, installing the target application on the target terminal by running the installation package on the target terminal, wherein the target resource file is stored on the target terminal;
[0224] S3, in response to the application execution instruction obtained on the target terminal, executing the target application for the first time on the target terminal, and loading the target resource file stored on the target terminal into the target application, so as to display the target application page in the target application, wherein the target resource file includes page resources required to be loaded when displaying the target application page;
[0225] S4, when detecting that the target terminal requests to connect to the target wireless network and the target application is running in the background of the target terminal, setting the state of the target application to allow sending a resource file update request to the network side device, wherein the resource file update request is used to request to obtain an updated resource file;
[0226] S5, when the target terminal successfully connects to the target wireless network and the target application runs in the background of the target terminal, the target application sends a resource file update request to the network side device and obtains the updated resource file sent by the network side device.
[0227] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing the hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0228] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0229] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above-mentioned computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes a number of instructions for causing one or more computer devices (such as personal computers, servers, or network devices) to execute all or part of the steps of the methods described in various embodiments of the present invention.
[0230] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0231] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, and can be electrical or other forms.
[0232] The units described as separate components may or may not be physically separate, and the components shown as units 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0233] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0234] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A method for loading an application page, characterized in that: include: Obtaining an installation package of a target application on a target terminal, wherein the installation package contains a target resource file, which is a page resource file that needs to be downloaded via a network when the target application is run for the first time; Installing the target application on the target terminal by running the installation package on the target terminal, wherein the target resource file is stored on the target terminal; In response to an application execution instruction obtained on the target terminal, executing the target application for the first time on the target terminal, and loading the target resource file stored on the target terminal in the target application to display a target application page in the target application, wherein the target resource file includes page resources required to be loaded when displaying the target application page; When detecting that the target terminal requests to connect to the target wireless network and the target application is running in the background of the target terminal, setting the state of the target application to allow sending a resource file update request to the network side device, wherein the resource file update request is used to request to obtain an updated resource file; When the target terminal successfully connects to the target wireless network and the target application runs in the background of the target terminal, the target application sends the resource file update request to the network side device and obtains the updated resource file sent by the network side device.
2. The method according to claim 1, characterized in that The method further comprises: When it is detected that the target terminal requests to connect to the target wireless network and the target application is running in the foreground of the target terminal, detecting whether the target terminal is successfully connected to the target wireless network; When the target terminal successfully connects to the target wireless network, the target application sends the resource file update request to the network side device, and obtains the updated resource file sent by the network side device.
3. The method according to claim 1, wherein The step of setting the state of the target application to allow sending a resource file update request to the network side device when detecting that the target terminal requests to connect to the target wireless network and the target application is running in the background of the target terminal includes: Detecting whether the target terminal switches from a currently connected mobile network to a target wireless local area network; or Detecting whether the target terminal switches from a currently connected wireless local area network to a target wireless local area network; or When the target terminal is in a state where the mobile network connection and the wireless local area network connection are closed, it is detected whether the target terminal has enabled the wireless local area network connection.
4. The method according to claim 1, wherein The method further comprises: Get the hash value of the resource file to be pulled from the network side device; When the hash value of the resource file to be pulled is different from the hash value of the resource file last pulled by the target application, obtaining the resource file to be pulled from the network side device; When the hash value of the resource file to be pulled is the same as the hash value of the resource file last pulled by the target application, the acquisition of the resource file to be pulled from the network side device is stopped.
5. The method according to claim 1, wherein The method further comprises: Obtaining a target resource package of the target application from the network-side device, wherein the target resource package is a resource package formed by packaging a group of resource files of the target application, and the group of resource files includes a compressed image obtained by compressing a target image; During the process of loading the target resource package in the target application, the compressed image is decompressed to obtain the target image, and the target image is loaded.
6. The method according to claim 1, wherein The method further comprises: Obtaining an encrypted resource package of the target application from the network-side device, wherein the encrypted resource package is a resource package obtained by encrypting a target resource package of the target application, and the target resource package is a resource package formed by packaging a group of resource files of the target application; Decrypting the encrypted resource package in the target application to obtain the target resource package; The set of resource files in the target resource package is loaded into the target application.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: Determine resource files that must be loaded and resource files that do not have to be loaded when the target application is started; An installation package of the target application is constructed according to the resource files that must be loaded, wherein the resource files that do not have to be loaded are located outside the installation package.
8. The method according to any one of claims 1 to 6, characterized in that The method further comprises: When resource files that must be loaded when the target application is started and resource files that do not have to be loaded are constructed in the installation package, when the target terminal starts the target application, the resource files that must be loaded are loaded in the target application; When the target interaction instruction is obtained in the target application, the resource file that is not required to be loaded is loaded in the target application, wherein the target interaction instruction is used to request the resource file that is not required to be loaded.
9. The method according to any one of claims 1 to 6, characterized in that The method further comprises: Determining the update frequency of the target resource file; When the update frequency is less than a preset update frequency threshold, the target resource file is built into the installation package.
10. A device for loading an application page, characterized in that: include: An acquisition module, configured to acquire an installation package of a target application on a target terminal, wherein the installation package includes a target resource file, which is a page resource file that needs to be downloaded via the network when the target application is first run; An installation module, configured to install the target application on the target terminal by running the installation package on the target terminal, wherein the target resource file is stored on the target terminal; a loading module, configured to, in response to an application execution instruction acquired on the target terminal, execute the target application on the target terminal for the first time, and load the target resource file stored on the target terminal into the target application, so as to display a target application page in the target application, wherein the target resource file includes page resources required to be loaded when displaying the target application page; A setting module is configured to, when detecting that the target terminal requests to connect to the target wireless network and the target application is running in the background of the target terminal, set the state of the target application to allow sending a resource file update request to the network side device, wherein the resource file update request is used to request to obtain an updated resource file; The sending module is used to send the resource file update request to the network side device on the target application when the target terminal successfully connects to the target wireless network and the target application runs in the background of the target terminal, and obtain the updated resource file sent by the network side device.
11. The device according to claim 10, characterized in that The device is also used for: When it is detected that the target terminal requests to connect to the target wireless network and the target application is running in the foreground of the target terminal, detecting whether the target terminal is successfully connected to the target wireless network; When the target terminal successfully connects to the target wireless network, the target application sends the resource file update request to the network side device, and obtains the updated resource file sent by the network side device.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program can be executed by a terminal device or a computer to execute the method described in any one of claims 1 to 9.
13. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 9 through the computer program.
Citation Information
Patent Citations
Page loading processing method and device
CN107203555A
Network information processing method and device and electronic equipment
CN110287432A