Page loading method and device and storage medium

By splitting the target files in the application into basic files, general files and business files, and loading on demand, the problems of slow page loading speed and high traffic costs are solved, and faster page loading and lower traffic consumption are achieved.

CN119806674APending Publication Date: 2025-04-11ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411861016.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

When a user opens a page in the application, the file that needs to be loaded is large, resulting in slow page loading speed, short-term white screen phenomenon, and increasing the user's traffic cost.

Method used

By splitting the target files corresponding to the business page into basic files, general files and business files, and loading the basic files and general files when the application is opened, and loading the business files when the business page is opened.

Benefits of technology

It improves the loading speed of business pages, avoids the occurrence of white screens, and saves users' traffic costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806674A_ABST
    Figure CN119806674A_ABST
Patent Text Reader

Abstract

The invention relates to a page loading method and device and a storage medium, and the method comprises the steps: responding to an application starting instruction for an application program, and loading a basic file and a universal file; loading a business file in response to a page opening instruction for a business page in the application program; wherein the basic file, the general file and the business file are obtained by splitting a target file corresponding to the business page. The target file corresponding to the service page is split into the basic file, the universal file and the service file, so that the basic file and the universal file are loaded when the application program is started, the service file is loaded when the service page in the application program is started, and only the service file is loaded when the service page in the application program is started. Therefore, the loading speed of the service page is increased, the white screen phenomenon is avoided, and the traffic cost of the user is saved to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a page loading method, device and storage medium. Background Art

[0002] With the continuous development of Internet APPs (Applications), people use applications more and more frequently, which brings new challenges to the interactive experience of applications.

[0003] Currently, when a user opens a page of an application, the target file (i.e. the final executable file when the application is running) needs to be loaded. Since the file to be loaded is large, the page loading speed is slow, the page will have a short white screen phenomenon, and the user's traffic cost is increased to a certain extent. Summary of the invention

[0004] In order to solve the technical problem that when a user opens a page of an application, the file that needs to be loaded is large, resulting in a slow page loading speed, a short white screen phenomenon on the page, and to some extent an increase in the user's traffic cost, the embodiment of the present application provides a page loading method, device, electronic device and storage medium. The specific technical solution is as follows:

[0005] In a first aspect of an embodiment of the present application, a page loading method is first provided, the method comprising:

[0006] In response to an application start instruction for the application program, loading the basic file and the common file;

[0007] In response to a page opening instruction for a business page in the application, loading a business file;

[0008] The basic file, the common file and the business file are split from the target file corresponding to the business page, and the target file is the final executable file when the application is running.

[0009] In an optional implementation manner, the target file is specifically split into the basic file, the common file and the business file in the following manner:

[0010] Obtain a target file, wherein the target file includes multiple files;

[0011] Traversing the files in the target file, and determining whether a mark of the file is a first mark, wherein the first mark indicates that the corresponding file belongs to a basic file;

[0012] When the mark of the file is the first mark, storing the file in a basic file;

[0013] After the basic file is constructed, traverse the remaining files in the target file to determine whether the mark of the remaining file is a second mark, where the second mark indicates that the corresponding file belongs to a general file;

[0014] When the mark of the remaining files is the second mark, storing the remaining files in a common file;

[0015] After the construction of the general file is completed, the remaining files in the target file are stored in the business file to complete the construction of the business file.

[0016] In an optional implementation, when the mark of the remaining files is the second mark, after storing the remaining files in the common file, the method further includes:

[0017] Obtaining a file storage path of the target file, and performing a hash operation on the file storage path using a hash algorithm to obtain a hash value;

[0018] The hash value is converted into a character string in a preset base, and the character string in the preset base is used as a file identifier of the remaining files marked as the second mark.

[0019] In an optional implementation, the loading of basic files and common files includes:

[0020] Obtain the latest base version number of the latest base file from the first content distribution network, and obtain the base version number of the local base file;

[0021] When the latest basic version number is consistent with the basic version number, loading the local basic file;

[0022] If the latest base version number is not consistent with the base version number, loading the latest base file from the first content distribution network;

[0023] Obtain the latest universal version number of the latest universal file from the second content distribution network, and obtain the universal version number of the local universal file;

[0024] When the latest universal version number is consistent with the universal version number, loading the local universal file;

[0025] In a case where the latest universal version number is not consistent with the universal version number, the latest universal file is loaded from a second content distribution network.

[0026] In an optional implementation, the obtaining of the latest universal version number of the latest universal file from the second content distribution network and the obtaining of the universal version number of the local universal file include:

[0027] Check whether there is a local common file;

[0028] If there is a local universal file, obtaining the latest universal version number of the latest universal file from the second content distribution network, and obtaining the universal version number of the local universal file;

[0029] In the case that no local universal file exists, the latest universal file is loaded from the second content distribution network.

[0030] In an optional implementation, the loading of the service file includes:

[0031] According to the loaded common file, the business file is loaded.

[0032] In an optional implementation, the loading of the business file according to the loaded general file includes:

[0033] Obtaining a loading version number of the loaded common file, and obtaining a local business file with the largest business version number that is not marked;

[0034] Determine the loading version number interval corresponding to the local business file with the largest business version number that is not marked, and determine whether the loading version number is within the loading version number interval;

[0035] When the loading version number is within the loading version number interval, the local business file with the largest business version number that is not marked is loaded.

[0036] In an optional embodiment, the method further comprises:

[0037] If the loaded version number is not within the loaded version number interval, marking the local business file with the maximum business version number;

[0038] Get the local business file with the largest unmarked business version number.

[0039] In an optional implementation, before loading the business file, the process further includes:

[0040] Check whether there are local business files;

[0041] If no local business file exists, determining the business type corresponding to the business page;

[0042] Downloading a service file corresponding to the service page from a third content distribution network corresponding to the service type, and saving the service file locally;

[0043] If the local service file exists, obtaining the latest service version number of the latest service file from the third content distribution network, and obtaining the service version number of the local service file;

[0044] When the latest service version number is not consistent with the service version number, the latest service file is downloaded from the third content distribution network.

[0045] In a second aspect of the embodiment of the present application, a page loading device is further provided, the device comprising:

[0046] A basic and common file loading module, for loading basic files and common files in response to an application start instruction for an application program;

[0047] A business file loading module, configured to load a business file in response to a page opening instruction for a business page in the application program;

[0048] The basic file, the common file and the business file are split from the target file corresponding to the business page, and the target file is the final executable file when the application is running.

[0049] In an optional implementation, the device further includes a file splitting module, and the file splitting module is specifically used to:

[0050] Obtain a target file, wherein the target file includes multiple files;

[0051] Traversing the files in the target file, and determining whether a mark of the file is a first mark, wherein the first mark indicates that the corresponding file belongs to a basic file;

[0052] When the mark of the file is the first mark, storing the file in a basic file;

[0053] After the basic file is constructed, traverse the remaining files in the target file to determine whether the mark of the remaining file is a second mark, where the second mark indicates that the corresponding file belongs to a general file;

[0054] When the mark of the remaining files is the second mark, storing the remaining files in a common file;

[0055] After the construction of the general file is completed, the remaining files in the target file are stored in the business file to complete the construction of the business file.

[0056] In an optional implementation, the device further includes a file identification generation module, and the file identification generation module is specifically used to:

[0057] Obtaining a file storage path of the target file, and performing a hash operation on the file storage path using a hash algorithm to obtain a hash value;

[0058] The hash value is converted into a character string in a preset base, and the character string in the preset base is used as a file identifier of the remaining files marked as the second mark.

[0059] In an optional implementation, the basic, general file loading module is specifically used for:

[0060] Obtain the latest base version number of the latest base file from the first content distribution network, and obtain the base version number of the local base file;

[0061] When the latest basic version number is consistent with the basic version number, loading the local basic file;

[0062] If the latest base version number is not consistent with the base version number, loading the latest base file from the first content distribution network;

[0063] Obtain the latest universal version number of the latest universal file from the second content distribution network, and obtain the universal version number of the local universal file;

[0064] When the latest universal version number is consistent with the universal version number, loading the local universal file;

[0065] In a case where the latest universal version number is not consistent with the universal version number, the latest universal file is loaded from a second content distribution network.

[0066] In an optional implementation, the basic, general file loading module is specifically used for:

[0067] Check whether there is a local common file;

[0068] If there is a local universal file, obtaining the latest universal version number of the latest universal file from the second content distribution network, and obtaining the universal version number of the local universal file;

[0069] In the case that no local universal file exists, the latest universal file is loaded from the second content distribution network.

[0070] In an optional implementation, the business file loading module is specifically used to:

[0071] According to the loaded common file, the business file is loaded.

[0072] In an optional implementation, the business file loading module is specifically used to:

[0073] Obtaining a loading version number of the loaded common file, and obtaining a local business file with the largest business version number that is not marked;

[0074] Determine the loading version number interval corresponding to the local business file with the largest business version number that is not marked, and determine whether the loading version number is within the loading version number interval;

[0075] When the loading version number is within the loading version number interval, the local business file with the largest business version number that is not marked is loaded.

[0076] In an optional implementation, the business file loading module is further used to:

[0077] If the loaded version number is not within the loaded version number interval, marking the local business file with the maximum business version number;

[0078] Get the local business file with the largest unmarked business version number.

[0079] In an optional implementation, the device further includes a service file download module, and the service file download module is specifically used to:

[0080] Check whether there are local business files;

[0081] If no local business file exists, determining the business type corresponding to the business page;

[0082] Downloading a service file corresponding to the service page from a third content distribution network corresponding to the service type, and saving the service file locally;

[0083] If the local service file exists, obtaining the latest service version number of the latest service file from the third content distribution network, and obtaining the service version number of the local service file;

[0084] When the latest service version number is not consistent with the service version number, the latest service file is downloaded from the third content distribution network.

[0085] In a third aspect of the embodiments of the present application, there is further provided an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0086] Memory, used to store computer programs;

[0087] The processor is used to implement any page loading method described in the first aspect when executing a program stored in the memory.

[0088] In a fourth aspect of the embodiments of the present application, a storage medium is further provided, wherein instructions are stored in the storage medium, and when the storage medium is run on a computer, the computer executes any of the page loading methods described in the first aspect above.

[0089] In a fifth aspect of the embodiments of the present application, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute any of the page loading methods described above.

[0090] The technical solution provided by the embodiment of the present application loads basic files and common files in response to an application start instruction for an application program, and loads business files in response to a page start instruction for a business page in an application program, wherein the basic files, common files, and business files are split from target files corresponding to the business pages.

[0091] By splitting the target files corresponding to the business pages into basic files, general files and business files, the basic files and general files are loaded when the application is opened, and the business files are loaded when the business page in the application is opened. In this way, when the business page in the application is opened, only the business files are loaded, which improves the loading speed of the business page, avoids the occurrence of white screen phenomenon, and saves the user's traffic cost to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0092] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0093] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0094] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0095] Figure 1 A schematic diagram of an implementation flow of a page loading method shown in an embodiment of the present application;

[0096] Figure 2 A schematic diagram of an implementation process of a file splitting method shown in an embodiment of the present application;

[0097] Figure 3This is a schematic diagram of an implementation flow of another page loading method shown in an embodiment of the present application;

[0098] Figure 4 It is a structural schematic diagram of a page loading device shown in an embodiment of the present application;

[0099] Figure 5 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION

[0100] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0101] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0102] like Figure 1 FIG. 1 is a schematic diagram of an implementation flow of a page loading method provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0103] S101 , in response to an application start instruction for an application program, loading basic files and common files.

[0104] In an embodiment of the present application, when a user wants to open an application, an application start instruction can be executed for the application (for example, by clicking, executing an application start instruction for the application), thereby actively loading basic files and common files in response to the application start instruction for the application.

[0105] It should be noted that in the embodiments of the present application, for basic files, the meaning of the files can be understood as basic package files, and the contents mainly include libraries for building pages and libraries for building cross-platform applications. And for basic files, they do not need to be updated frequently, for example, about once a year, or can be built into the host package and updated together with the host package. In addition, for basic files, their specific responsibilities are to be responsible for the core logic of the framework, responsible for the underlying rendering, communication, etc.

[0106] For common files, their meaning can be understood as common package files, which mainly contain common basic libraries required by the business (such as common component libraries (such as swiper, image-picker, clipboard, etc.)) and common tool classes required by the business (such as HttpModule, RouterModule, BillingModule, etc.). And for common files, they do not need to be updated frequently, for example, about once a month, or they can be built into the host package and updated together with the host package, or they can also be updated dynamically. In addition, for common files, their specific responsibilities are to be responsible for common logic, which can be provided for all business reuse, and to be responsible for component assembly and packaging, etc.

[0107] For business files, the meaning of the files can be understood as business package files, which mainly include business codes for rendering specific pages and resource files required for page rendering, where resource files include image resource files or font resource files, etc. And for business files, they need to be updated frequently, for example, once a week on average, or they can be updated at any time, or they can be updated dynamically, and do not need to be updated with the host package. In addition, for business files, their specific responsibilities are to render specific business pages, perform user interaction operations, etc.

[0108] In the embodiment of the present application, the basic file, the general file, and the business file are all determined based on the intersection of the main content and the update frequency contained in the file. The file number range corresponding to different file types is determined based on the intersection of the main content and the update frequency contained in the file. In the embodiment of the present application, taking the file id range as an example, the number within the file number range corresponding to the basic file (the first tag range) is identified as the first tag, that is, the first tag indicates that the corresponding file belongs to the basic file; the file marked with the first tag is stored in the basic file. The number within the file number range corresponding to the general file (the second tag range) is identified as the second tag, that is, the second tag indicates that the corresponding file belongs to the general file; the file marked with the second tag is stored in the general file. The number within the file number range corresponding to the business file (the third tag range) is identified as the third tag, that is, the third tag indicates that the corresponding file belongs to the business file; the file marked with the third tag is stored in the business file. Alternatively, after the construction of the basic file and the general file is completed, the remaining files in the target file are stored in the business file to complete the construction of the business file.

[0109] S102, in response to a page opening instruction for a business page in an application, loading a business file.

[0110] In an embodiment of the present application, for a specific business page in an application, when a user wants to open the business page, a page opening instruction can be executed for the business page (for example, by clicking, executing a page opening instruction for the business page), so that the business file can be loaded in response to the page opening instruction for the business page in the application.

[0111] In this way, when the user opens the application, the basic files and common files are loaded actively, and when the user opens a specific business page in the application, the business files are loaded. Among them, the basic files, common files and business files are split from the target files corresponding to the business pages. The target file is the final executable file when the application is running. In this way, when the business page in the application is opened, only the business files are loaded, which improves the loading speed of the business page, avoids the occurrence of white screen phenomenon, and saves the user's traffic cost to a certain extent.

[0112] It should be noted that the business file can also be called a business package file, and the target file can be divided into three types of files: basic package files, general package files, and business package files. And the above-mentioned business page can be any business page in the application, which is not limited in the embodiment of the present application.

[0113] Through the above description of the technical solution provided by the embodiment of the present application, in response to the application start instruction for the application, the basic files and the common files are loaded, and in response to the page start instruction for the business page in the application, the business files are loaded, wherein the basic files, the common files and the business files are split from the target files corresponding to the business pages, and the target files are the final executable files when the application is running. In one embodiment of the present application, the business page can be an integral page composed of multiple pages with an associated relationship, such as a home page containing multiple components displayed when the application is opened, or it can be a single page, such as a page displayed after opening Word.

[0114] By splitting the target files corresponding to the business pages into basic files, general files and business files, the basic files and general files are loaded when the application is opened, and the business files are loaded when the business page in the application is opened. In this way, when the business page in the application is opened, only the business files are loaded, which improves the loading speed of the business page, avoids the occurrence of white screen phenomenon, and saves the user's traffic cost to a certain extent.

[0115] In addition, for the target file corresponding to a specific business page in the application, which contains multiple files, it means that the target file is composed of multiple files. Then, for any file in the target file, it can be marked with a corresponding tag according to the content of the file and the update frequency of the file, and the tags of each file are different. For example, if a file belongs to a general basic library required by the business and is updated about once a month, it means that the file is a general file and can be marked with 201. If the file belongs to a library used to build a page and is updated about once a year, it means that the file is a basic file and can be marked with 101.

[0116] For basic files, they mainly include libraries for building pages and libraries for building cross-platform applications, and the update frequency is, for example, about once a year. Common files mainly include common basic libraries required by the business and common tool classes required by the business, and the update frequency is, for example, about once a month. Therefore, the basic files and common files have different contents and update frequencies. Therefore, different tag ranges are set for basic files and common files. The first tag range (for example, 101-109) of the basic files corresponds to the first tag, and the second tag range (for example, 201-209) of the common files corresponds to the second tag.

[0117] Subsequently, the files in the target file are traversed to determine whether the file's mark belongs to the first mark range. If so, the file's mark is considered to be the first mark, and the file is stored in the basic file. After the basic file is constructed, the remaining files in the target file are traversed to determine whether the remaining files' marks belong to the second mark range. If so, the file's mark is considered to be the second mark, and the file is stored in the general file. After the general file is constructed, the remaining files in the target file are stored in the business file, and the business file construction is completed. In this way, the target file is split.

[0118] Based on this, Figure 2 FIG. 1 is a schematic diagram of an implementation flow of a file splitting method provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0119] S201, obtaining a target file, wherein the target file includes multiple files.

[0120] In an embodiment of the present application, a target file is obtained, wherein the target file contains multiple files and corresponds to a specific business page in the application. The target file is subsequently split into three files, namely a basic file, a general file, and a business file.

[0121] It should be noted that the target file is split into the above three files according to whether it needs to be updated frequently, which means that if the target file is updated frequently, it can be split into the above three files, otherwise it does not need to be split into the above three files.

[0122] In addition, for the target file, it corresponds to a specific business page in the application. If there are multiple business pages in the application, then theoretically there are also multiple target files. The above-mentioned splitting operation can be performed on each target file to facilitate splitting the target file corresponding to the specific business page in the application into three files, namely, the basic file, the general file and the business file.

[0123] S202, traverse the files in the target file, and determine whether the mark of the file is the first mark.

[0124] S203: When the mark of the file is the first mark, store the file into the basic file.

[0125] In the embodiment of the present application, a basic file is first constructed. To this end, for a target file, the files in the target file are traversed to determine whether the tag of the file is the first tag, which means that the file belongs to the basic file. Therefore, if the tag of the file is the first tag, the file is stored in the basic file.

[0126] In this way, after traversing the files in the target file, the files marked as the first mark in the target file are stored in the basic file, and the construction of the basic file can be completed to obtain the basic file. It should be noted that for the files in the target file, corresponding marks are set in advance according to their ownership, and this embodiment of the application does not limit this.

[0127] S204, after the basic file is constructed, traverse the remaining files in the target file to determine whether the mark of the remaining file is the second mark.

[0128] S205: When the mark of the remaining files is the second mark, store the remaining files into the general file.

[0129] In the embodiment of the present application, after the basic file is constructed, a common file is constructed. To this end, for the target file, the remaining files in the target file are traversed to determine whether the mark of the remaining file is the second mark, which means that the file belongs to a common file. Therefore, if the mark of the remaining file is the second mark, the remaining file is stored in the common file.

[0130] In this way, after traversing the remaining files in the target file, the remaining files marked as the second mark in the target file are stored in the common file, so that the construction of the common file can be completed and the common file can be obtained.

[0131] In addition, in an embodiment of the present application, the target file is divided into basic files, general files and business files. There is a logical dependency relationship between the business files and the general files, that is, the files in the business files need to depend on the files in the general files. To this end, it is necessary to ensure that the file identifiers (such as file IDs) of the files in the general files are unique and fixed, while the traditional file identifiers that use digital types will change when adding files to the general files.

[0132] Based on this, the embodiment of the present application adopts a brand-new method to generate corresponding file identifiers for files in the general file, which can ensure that they are unique and fixed, and the file identifiers of files in the basic file and the file identifiers of files in the business file can be set to corresponding fixed identifiers. Specifically, in the case where the remaining files are marked as the second mark, after the remaining files are stored in the general file, the file storage path of the target file can be obtained, and the file storage path can be hashed using a hash algorithm to obtain a hash value, which can be, for example, a 256-bit fixed-length hash value, and then the hash value is converted into a preset base string, and the preset base string is used as the file identifier of the remaining files marked as the second mark. For example, the hash value is converted into a hexadecimal string as the file ID of the remaining files.

[0133] S206, after the construction of the general file is completed, the remaining files in the target file are stored in the business file to complete the construction of the business file.

[0134] In the embodiment of the present application, after the basic files and the general files are constructed, the business files are constructed. To this end, after the basic files and the general files are constructed, the remaining files in the target file belong to the business files, and the remaining files in the target file are stored in the business files to complete the construction of the business files.

[0135] In this way, the files marked with the first mark in the target file are stored in the basic file, and the remaining files marked with the second mark in the target file are stored in the common file. The remaining files in the target file naturally belong to the business files. At this time, the remaining files in the target file are stored in the business file to complete the construction of the basic file, the common file, and the business file.

[0136] In this way, for the target file corresponding to a specific business page in the application, which contains multiple files, you can mark the files that belong to the basic file and the general file, and then traverse the files in the target file. If the file belongs to the basic file, put it into the basic file; if the file belongs to the general file, put it into the general file, and finally put the remaining files into the business files, so as to complete the splitting of the target file.

[0137] In addition, the above-mentioned split business files can be uploaded to the corresponding content distribution network according to the business type of the business page, and the split basic files and common files can be built into the file storage directory of the application, for example, the split basic files and common files can be built into the assets directory of the application. In this way, when the user opens the application, if the basic files and common files are not updated, the local basic files and local common files will be actively loaded. When the user opens a specific business page in the application, the business files are downloaded from the content distribution network and then loaded.

[0138] Based on this, Figure 3 FIG. 1 is a schematic diagram of an implementation flow of another page loading method provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0139] S301 , in response to an application start instruction for an application program, obtaining a latest basic version number of a latest basic file from a first content distribution network, and obtaining a basic version number of a local basic file.

[0140] S302: When the latest basic version number is consistent with the basic version number, load the local basic file.

[0141] S303: When the latest basic version number is not consistent with the basic version number, load the latest basic file from the first content distribution network.

[0142] S304, obtaining the latest universal version number of the latest universal file from the second content distribution network, and obtaining the universal version number of the local universal file.

[0143] S305, when the latest universal version number is consistent with the universal version number, load the local universal file.

[0144] S306: When the latest universal version number is not consistent with the universal version number, load the latest universal file from the second content distribution network.

[0145] In an embodiment of the present application, when a user wants to open an application, an application start instruction can be executed for the application (for example, by clicking, executing an application start instruction for the application), so that basic files and common files are actively loaded in response to the application start instruction for the application.

[0146] Among them, the basic files and common files split from the target files are generally chosen to be built into the file storage directory of the application. For example, the split basic files and common files are built into the assets directory of the application. In this way, the basic files and common files exist locally. Therefore, the above loading of basic files and common files actually loads local basic files and local common files.

[0147] In addition, it is inevitable that the basic files and common files may be updated. To this end, the latest basic version number of the latest basic file is obtained from the first content distribution network, and the basic version number of the local basic file is obtained. If the latest basic version number is consistent with the basic version number, it means that the basic file has not been updated. At this time, the local basic file is loaded. If the latest basic version number is inconsistent with the basic version number, it means that the basic file has been updated. At this time, the latest basic file is loaded from the first content distribution network. Here, the first content distribution network is specifically used to store basic files.

[0148] Similarly, the latest universal version number of the latest universal file is obtained from the second content distribution network, and the universal version number of the local universal file is obtained. If the latest universal version number is consistent with the universal version number, it means that the universal file has not been updated. At this time, the local universal file is loaded. If the latest universal version number is inconsistent with the universal version number, it means that the universal file is updated. At this time, the latest universal file is loaded from the second content distribution network. Here, the second content distribution network is specifically used to store universal files.

[0149] Among them, for loading the latest basic file from the first content distribution network, specifically, the latest basic file is downloaded from the first content distribution network, and then the latest basic file is decompressed to obtain the decompressed latest basic file, and then the decompressed latest basic file is verified, for example, by MD5. After the verification passes, the decompressed latest basic file is saved and loaded.

[0150] Similarly, for loading the latest universal file from the second content distribution network, specifically, the latest universal file is downloaded from the second content distribution network, and then the latest universal file is decompressed to obtain the decompressed latest universal file, and then the decompressed latest universal file is subjected to, for example, MD5 verification. After the verification passes, the decompressed latest universal file is saved and loaded.

[0151] In addition, for the common files split from the target files, you can choose to build them into the file storage directory of the application, or you can choose to upload them to the corresponding content distribution network. If there is no common file locally, you can directly load the latest common file from the second content distribution network. To this end, you can first detect whether there is a local common file. If there is a local common file, obtain the latest common version number of the latest common file from the second content distribution network, and obtain the common version number of the local common file. Otherwise, load the latest common file from the second content distribution network. The process of loading the latest common file from the second content distribution network can refer to the above.

[0152] S307 , in response to a page opening instruction for a business page in the application, loading a business file.

[0153] In an embodiment of the present application, for a specific business page in an application, when a user wants to open the business page, a page opening instruction can be executed for the business page (for example, by clicking to execute a page opening instruction for the business page), so that a business file can be loaded in response to the page opening instruction for the business page in the application. Based on the loaded business file, the business page can be rendered, thereby presenting a specific business page to the user.

[0154] Among them, the business files split from the target files are uploaded to the corresponding content distribution network according to the business type of the business page. For this purpose, it is necessary to first download and save them locally, and then load the business files.

[0155] Based on this, it is detected whether there are local business files. If there are no local business files, the business type corresponding to the business page is determined, the business file corresponding to the business page is downloaded from the third content distribution network corresponding to the business type, and the business file is saved locally. Among them, it is possible to detect whether there are local business files from the local cache and the local disk. For example, it is detected whether there are local business files in the local cache. If there are no local business files in the local cache, it is detected whether there are local business files on the local disk. If there are no local business files on the local disk, the business type corresponding to the business page is determined, the business file corresponding to the business page is downloaded from the third content distribution network corresponding to the business type, and the business file is saved locally.

[0156] If there is a local business file (for example, there is a local business file in the local cache or there is a local business file on the local disk), the latest business version number of the latest business file is obtained from the third content distribution network, and the business version number of the local business file is obtained. If the latest business version number is consistent with the business version number, there is no need to download the latest business file. If the latest business version number is inconsistent with the business version number, the latest business file is downloaded from the third content distribution network. Here, the third content distribution network is specifically used to store business files.

[0157] At this point, through the above processing, business files exist locally, so business files can be loaded. Among them, before loading business files, it is also necessary to rely on the loaded common files, that is, load business files according to the loaded common files. For example, there are three versions of common files, C1.0, C1.1, and C2.0, and there are also three versions of business files, B1.0, B1.1, and B2.0. The common files of version C2.0 have made major updates compared to the common files of version C1.1, so the business files of version B2.0 can only run on the basis of the common files of version C2.0. Therefore, in order to ensure that the business files are correctly loaded and run, a reliable version number range is set for the business files. When the user opens the business page, first determine the version number of the common files that have been loaded by the current application, and then match the business files that need to be loaded accordingly.

[0158] Based on this, the loading version number of the loaded common file is obtained, and the local business file with the unmarked maximum business version number is obtained, the loading version number interval (for example, 1.1 to 1.9) corresponding to the local business file with the unmarked maximum business version number is determined, and it is determined whether the loading version number is within the loading version number interval. If the loading version number is within the loading version number interval, the local business file with the unmarked maximum business version number is loaded.

[0159] When the loading version number is not within the loading version number interval, mark the local business file of the maximum business version number, and then jump to the step of obtaining the local business file of the unmarked maximum business version number, that is, re-obtain the local business file of the unmarked maximum business version number, determine the loading version number interval corresponding to the local business file of the unmarked maximum business version number, and determine whether the loading version number is within the loading version number interval. When the loading version number is within the loading version number interval, load the local business file of the unmarked maximum business version number until a business file matching the loading version number of the loaded common file is found and then loaded.

[0160] By splitting the target files corresponding to the business pages into basic files, general files and business files, the basic files and general files are loaded when the application is opened, and the business files are loaded when the business page in the application is opened. In this way, when the business page in the application is opened, only the business files are loaded, which improves the loading speed of the business page, avoids the occurrence of white screen phenomenon, and saves the user's traffic cost to a certain extent.

[0161] Corresponding to the above method embodiment, the present application embodiment also provides a page loading device, such as Figure 4 As shown, the device may include: a basic, general file loading module 410 and a business file loading module 420.

[0162] A basic and common file loading module 410, for loading basic files and common files in response to an application start instruction for an application program;

[0163] A business file loading module 420, configured to load a business file in response to a page opening instruction for a business page in the application;

[0164] The basic file, the common file and the business file are split from the target file corresponding to the business page, and the target file is the final executable file when the application is running.

[0165] In an optional implementation, the device further includes a file splitting module, and the file splitting module is specifically used to:

[0166] Obtain a target file, wherein the target file includes multiple files;

[0167] Traversing the files in the target file, and determining whether a mark of the file is a first mark, wherein the first mark indicates that the corresponding file belongs to a basic file;

[0168] When the mark of the file is the first mark, storing the file in a basic file;

[0169] After the basic file is constructed, traverse the remaining files in the target file to determine whether the mark of the remaining file is a second mark, where the second mark indicates that the corresponding file belongs to a general file;

[0170] When the mark of the remaining files is the second mark, storing the remaining files in a common file;

[0171] After the construction of the general file is completed, the remaining files in the target file are stored in the business file to complete the construction of the business file.

[0172] In an optional implementation, the device further includes a file identification generation module, and the file identification generation module is specifically used to:

[0173] Obtaining a file storage path of the target file, and performing a hash operation on the file storage path using a hash algorithm to obtain a hash value;

[0174] The hash value is converted into a character string in a preset base, and the character string in the preset base is used as a file identifier of the remaining files marked as the second mark.

[0175] In an optional implementation, the basic, general file loading module is specifically used for:

[0176] Obtain the latest base version number of the latest base file from the first content distribution network, and obtain the base version number of the local base file;

[0177] When the latest basic version number is consistent with the basic version number, loading the local basic file;

[0178] If the latest base version number is not consistent with the base version number, loading the latest base file from the first content distribution network;

[0179] Obtain the latest universal version number of the latest universal file from the second content distribution network, and obtain the universal version number of the local universal file;

[0180] When the latest universal version number is consistent with the universal version number, loading the local universal file;

[0181] In a case where the latest universal version number is not consistent with the universal version number, the latest universal file is loaded from a second content distribution network.

[0182] In an optional implementation, the basic, general file loading module is specifically used for:

[0183] Check whether there is a local common file;

[0184] If there is a local universal file, obtaining the latest universal version number of the latest universal file from the second content distribution network, and obtaining the universal version number of the local universal file;

[0185] In the case that no local universal file exists, the latest universal file is loaded from the second content distribution network.

[0186] In an optional implementation, the business file loading module is specifically used to:

[0187] According to the loaded common file, the business file is loaded.

[0188] In an optional implementation, the business file loading module is specifically used to:

[0189] Obtaining a loading version number of the loaded common file, and obtaining a local business file with the largest business version number that is not marked;

[0190] Determine the loading version number interval corresponding to the local business file with the largest business version number that is not marked, and determine whether the loading version number is within the loading version number interval;

[0191] When the loading version number is within the loading version number interval, the local business file with the largest business version number that is not marked is loaded.

[0192] In an optional implementation, the business file loading module is further used to:

[0193] If the loaded version number is not within the loaded version number interval, marking the local business file with the maximum business version number;

[0194] Get the local business file with the largest unmarked business version number.

[0195] In an optional implementation, the device further includes a service file downloading module, and the service file downloading module is specifically used to:

[0196] Check whether there are local business files;

[0197] If no local business file exists, determining the business type corresponding to the business page;

[0198] Downloading a service file corresponding to the service page from a third content distribution network corresponding to the service type, and saving the service file locally;

[0199] If the local service file exists, obtaining the latest service version number of the latest service file from the third content distribution network, and obtaining the service version number of the local service file;

[0200] When the latest service version number is not consistent with the service version number, the latest service file is downloaded from the third content distribution network.

[0201] The present application also provides an electronic device, such as Figure 5 As shown, it includes a processor 51, a communication interface 52, a memory 53 and a communication bus 54, wherein the processor 51, the communication interface 52, and the memory 53 communicate with each other through the communication bus 54.

[0202] A memory 53, for storing computer programs;

[0203] The processor 51 is used to execute the program stored in the memory 53 to implement the following steps:

[0204] In response to an application start instruction for an application, basic files and common files are loaded; in response to a page start instruction for a business page in the application, business files are loaded; wherein the basic files, the common files and the business files are split from the target files corresponding to the business pages.

[0205] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0206] The communication interface is used for communication between the above electronic device and other devices.

[0207] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0208] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0209] In another embodiment provided in the present application, a storage medium is also provided, in which instructions are stored. When the storage medium is run on a computer, the computer executes any of the page loading methods in the above embodiments.

[0210] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any of the page loading methods in the above embodiments.

[0211] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a storage medium, or transmitted from one storage medium to another storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0212] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0213] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0214] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A page loading method, characterized in that: The method comprises: In response to an application start instruction for the application program, loading the basic file and the common file; In response to a page opening instruction for a business page in the application, loading a business file; The basic file, the common file and the business file are split from the target file corresponding to the business page.

2. The method according to claim 1, characterized in that The target file is specifically split into the basic file, the general file and the business file in the following manner: Obtain a target file, wherein the target file includes multiple files; Traversing the files in the target file, and determining whether the mark of the file is the first mark; When the mark of the file is the first mark, storing the file in a basic file; After the basic file is constructed, traverse the remaining files in the target file to determine whether the mark of the remaining file is the second mark; When the mark of the remaining files is the second mark, storing the remaining files in a common file; After the construction of the general file is completed, the remaining files in the target file are stored in the business file to complete the construction of the business file.

3. The method according to claim 2, characterized in that In the case where the mark of the remaining files is the second mark, after storing the remaining files in the common file, the method further includes: Obtaining a file storage path of the target file, and performing a hash operation on the file storage path using a hash algorithm to obtain a hash value; The hash value is converted into a character string in a preset base, and the character string in the preset base is used as a file identifier of the remaining files marked as the second mark.

4. The method according to claim 1, characterized in that: The loading of basic files and common files includes: Obtain the latest base version number of the latest base file from the first content distribution network, and obtain the base version number of the local base file; When the latest basic version number is consistent with the basic version number, loading the local basic file; If the latest base version number is not consistent with the base version number, loading the latest base file from the first content distribution network; Obtain the latest universal version number of the latest universal file from the second content distribution network, and obtain the universal version number of the local universal file; When the latest universal version number is consistent with the universal version number, loading the local universal file; In a case where the latest universal version number is not consistent with the universal version number, the latest universal file is loaded from a second content distribution network.

5. The method according to claim 4, characterized in that The step of obtaining the latest universal version number of the latest universal file from the second content distribution network and obtaining the universal version number of the local universal file includes: Check whether there is a local common file; If there is a local universal file, obtaining the latest universal version number of the latest universal file from the second content distribution network, and obtaining the universal version number of the local universal file; In the case that no local universal file exists, the latest universal file is loaded from the second content distribution network.

6. The method according to claim 1, characterized in that The loading of the business file includes: According to the loaded common file, the business file is loaded.

7. The method according to claim 6, characterized in that The step of loading a business file according to the loaded general file includes: Obtaining a loading version number of the loaded common file, and obtaining a local business file with the largest business version number that is not marked; Determine the loading version number interval corresponding to the local business file with the largest business version number that is not marked, and determine whether the loading version number is within the loading version number interval; When the loading version number is within the loading version number interval, the local business file with the largest business version number that is not marked is loaded.

8. The method according to claim 7, characterized in that The method further comprises: If the loaded version number is not within the loaded version number interval, marking the local business file with the maximum business version number; Get the local business file with the largest unmarked business version number.

9. The method according to claim 1, characterized in that: Before loading the business file, also include: Check whether there are local business files; If no local business file exists, determining the business type corresponding to the business page; Downloading a service file corresponding to the service page from a third content distribution network corresponding to the service type, and saving the service file locally; If the local service file exists, obtaining the latest service version number of the latest service file from the third content distribution network, and obtaining the service version number of the local service file; When the latest service version number is not consistent with the service version number, the latest service file is downloaded from the third content distribution network.

10. A page loading device, characterized in that: The device comprises: A basic and common file loading module, for loading basic files and common files in response to an application start instruction for an application program; A business file loading module, configured to load a business file in response to a page opening instruction for a business page in the application program; The basic file, the common file and the business file are split from the target file corresponding to the business page.

11. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.