Program subpackaging method and computer program product
By obtaining the configuration files and subcontracting rules of the applet, automatically determining the page categories and performing subcontracting processing, the existing applets' subcontracting problems are solved, and the performance of the applet is improved.
Patent Information
- Application Number
- CN202510293062.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-06-20
AI Technical Summary
The existing mini-program subcontracting loading mechanism has problems with low subcontracting efficiency and low accuracy, resulting in poor performance optimization results.
Provide a program subcontracting method, which determines the categories of each page by obtaining the configuration files and subcontracting rules of the program to be subcontracted, and automatically subcontracts according to the categories and subcontracting rules.
It improves the accuracy and efficiency of program subcontracting, avoids inefficiency and inaccuracy caused by manual subcontracting, and optimizes the performance of mini programs.
Smart Images

Figure CN120179279A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a program sub-packaging method and a computer program product. Background Art
[0002] With the rapid development of the mobile Internet, as a lightweight application form, mini-programs have been widely used in various fields. However, with the continuous increase and complexity of mini-program functions, their resource consumption has gradually increased, thus affecting the performance of mini-programs.
[0003] To optimize the performance of mini-programs, a sub-packaging loading mechanism can be adopted. By dividing the resources of a mini-program into multiple sub-packages and dynamically loading the sub-packages required by users, the loading time can be reduced and the program performance can be improved.
[0004] However, the current sub-packaging loading mechanism is mainly implemented based on manual sub-packaging configuration by developers, which has problems of low sub-packaging efficiency and low accuracy. Summary of the Invention
[0005] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a program sub-packaging method and a computer program product that can avoid the problems of low accuracy and low sub-packaging efficiency caused by manual sub-packaging, and improve the accuracy and efficiency of program sub-packaging.
[0006] In a first aspect, this application provides a program sub-packaging method. The method includes: Obtain the configuration file of the program to be sub-packaged. The configuration file includes the configuration information of each page of the program to be sub-packaged and the sub-packaging rules; the sub-packaging rules include sub-packaging categories and the corresponding sub-packaging methods for each type of page; the sub-packaging category is used to represent the category of the sub-packaged page, and the category is related to the page reference relationship; determine the category of each page based on the configuration information of each page of the program to be sub-packaged, and determine the pages to be sub-packaged according to the category of each page of the program to be sub-packaged and the category of the sub-packaged page; perform sub-packaging processing on the pages to be sub-packaged according to the sub-packaging method corresponding to the category of the pages to be sub-packaged.
[0007] In combination with the first aspect, in a possible implementation manner, the category is related to the page reference relationship, including: if the category of the page is a referenced page and the number of reference objects is greater than a preset threshold, then the page is a sub-packaged page; or, if the category of the page is an independent page, then the page is a sub-packaged page.
[0008] In combination with the first aspect, in a possible implementation, the categories of each page of the program to be subcontracted are determined based on the configuration information of each page of the program to be subcontracted, and the pages to be subcontracted are determined according to the categories of each page of the program to be subcontracted and the category of the subcontracted page, including: determining the reference relationship between each page of the program to be subcontracted based on the configuration information of each page of the program to be subcontracted, and determining the category of each page according to the reference relationship between each page; the category of each page includes a referenced page or an independent page; if the category of the page of the program to be subcontracted matches the subcontracting category, the page is determined to be a page to be subcontracted.
[0009] In combination with the first aspect, in a possible implementation, the configuration information of a page includes a template file and a script file, and determining the reference relationship between each page of the program to be subcontracted based on the configuration information of each page of the program to be subcontracted includes: performing a logical structure analysis on the page according to the template file and the script file of the page to obtain the jump page of the page; determining the reference relationship between each page of the program to be subcontracted according to the jump pages of each page of the program to be subcontracted.
[0010] In combination with the first aspect, in a possible implementation, subcontracting the pages to be subcontracted according to the subcontracting method corresponding to the category of the pages to be subcontracted includes: creating a subcontracting directory for the program to be subcontracted according to the subcontracting method corresponding to the category of the pages to be subcontracted; moving the configuration information of the pages to be subcontracted to the subcontracting directory.
[0011] In combination with the first aspect, in a possible implementation, the configuration information of a page further includes a style file, and moving the configuration information of the pages to be subcontracted to the subcontracting directory includes: performing a logical structure analysis on the pages to be subcontracted according to the script file and the style file of the pages to be subcontracted to obtain the static resources corresponding to the pages to be subcontracted; moving the configuration information and the static resources of the pages to be subcontracted to the subcontracting directory.
[0012] In combination with the first aspect, in a possible implementation, the program subcontracting method further includes: determining the path after subcontracting of the pages to be subcontracted according to the subcontracting directory corresponding to the pages to be subcontracted; updating the configuration file of the program to be subcontracted according to the path after subcontracting of the pages to be subcontracted.
[0013] In combination with the first aspect, in a possible implementation, the program subcontracting method further includes: presenting a subcontracting configuration entry, where the subcontracting configuration entry includes a subcontracting rule configuration item; receiving a configuration operation on the subcontracting rule configuration item, and determining the subcontracting rule configured by the user based on the configuration operation; adding the subcontracting rule to the configuration file of the program to be subcontracted.
[0014] In combination with the first aspect, in a possible implementation, the program subcontracting method further includes: obtaining the original configuration file of the program to be subcontracted, where the original configuration file includes the configuration information of each page of the program to be subcontracted; determining the reference relationship between each page based on the configuration information of each page of the program to be subcontracted, and determining the category of each page according to the reference relationship between each page; determining the subcontracting category from the categories of each page of the program to be subcontracted, and generating subcontracting rules according to the subcontracting category and the subcontracting methods corresponding to each type of page, and updating the original configuration file according to the subcontracting rules to obtain the configuration file.
[0015] In combination with the first aspect, in a possible implementation, the program to be subcontracted is a parasitic application of the target application, and the method further includes: running the target application, receiving an operation on the parasitic application by the user through the user interface of the target application, and determining the page to be jumped to in response to the operation; if the page to be jumped to is a subcontracted page, determining the path corresponding to the page to be jumped to according to the configuration file of the program to be subcontracted, and loading the subcontract of the page to be jumped to according to the path.
[0016] In a second aspect, the present application also provides a program subcontracting device. The device includes: An acquisition module, configured to acquire the configuration file of the program to be subcontracted, where the configuration file includes the configuration information of each page of the program to be subcontracted and subcontracting rules; the subcontracting rules include a subcontracting category and the subcontracting methods corresponding to each type of page; the subcontracting category is used to characterize the category of the subcontracted page, and the category is related to the page reference relationship; A determination module, configured to determine the category of each page based on the configuration information of each page of the program to be subcontracted, and determine the page to be subcontracted according to the category of each page of the program to be subcontracted and the category of the subcontracted page; A subcontracting module, configured to perform subcontracting processing on the page to be subcontracted based on the subcontracting method corresponding to the category of the page to be subcontracted.
[0017] In a third aspect, the present application also provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0018] In a fourth aspect, the present application also provides a computer-readable storage medium. On the computer-readable storage medium, a computer program is stored, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0019] In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0020] An embodiment of the present application provides a program subcontracting method and a computer program product. First, a configuration file of the program to be subcontracted is obtained, where the configuration file includes the configuration information of each page of the program to be subcontracted and subcontracting rules, and the subcontracting rules include subcontracting categories and subcontracting methods corresponding to each type of page. Then, based on the configuration information of each page of the program to be subcontracted and the category information related to the page reference relationship, the category of each page is analyzed, and then the pages to be subcontracted are determined according to the category of each page and the category of the pages to be subcontracted specified in the subcontracting rules. Finally, subcontracting processing is performed on the pages to be subcontracted based on the subcontracting method corresponding to the category of the pages to be subcontracted. By pre-configuring the subcontracting rules, the embodiment of the present application can achieve automatic subcontracting of the program, avoiding the problems of low accuracy and subcontracting efficiency caused by manual subcontracting. Description of the Drawings
[0021] Other features, objects, and advantages of the present application will become more apparent by reading the detailed description of the non-limiting embodiments with reference to the following drawings: Figure 1 It is a schematic flowchart of a program subcontracting method in an embodiment; Figure 2 It is a schematic diagram of page jumps of a program subcontracting method in an embodiment; Figure 3 It is another schematic diagram of page jumps of a program subcontracting method in an embodiment; Figure 4 It is another schematic flowchart of a program subcontracting method in an embodiment; Figure 5 It is another schematic flowchart of a program subcontracting method in an embodiment; Figure 6 It is another schematic flowchart of a program subcontracting method in an embodiment; Figure 7 It is a schematic diagram of a subcontracting directory of a program subcontracting method in an embodiment; Figure 8 It is another schematic flowchart of a program subcontracting method in an embodiment; Figure 9 It is another schematic flowchart of a program subcontracting method in an embodiment; Figure 10 It is another schematic flowchart of a program subcontracting method in an embodiment; Figure 11 It is a schematic diagram of an entry for configuring subcontracting rules of a program subcontracting method in an embodiment; Figure 12 It is another schematic flowchart of a program subcontracting method in an embodiment; Figure 13 It is another schematic flowchart of a program subcontracting method in an embodiment; Figure 14 It is a structural block diagram of a program subcontracting device in an embodiment; Figure 15 It is an internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0022] The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention, rather than limiting the invention. Additionally, it should be noted that for the sake of description, only parts related to the invention are shown in the drawings.
[0023] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and embodiments. Additionally, the term "and / or" in this document is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of the objects.
[0024] In an embodiment, as Figure 1 shown, a program subcontracting method is provided. In this embodiment, the method is illustrated by taking its application to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps: Step 101: Obtain the configuration file of the program to be subcontracted.
[0025] The configuration file defines the running behavior and appearance of the program, including the parameters required for the program to run, the running environment of the program, security policies, compatibility, etc. As shown in Table 1 below, in the embodiments of the present application, the configuration file of the program to be subcontracted includes the configuration information of each page of the program to be subcontracted and the subcontracting rules. Among them, the configuration information of the page defines the structure, event handling logic, visual style, etc. of each page of the program to be subcontracted. The subcontracting rules include subcontracting categories and the corresponding subcontracting methods for each type of page. The subcontracting category is used to represent the category of the subcontracted page, that is, the category of the page that needs to be subcontracted as stipulated by the subcontracting rules.
[0026] Table 1
[0027] The category of a page is related to the page reference relationship. For example, pages can be classified according to whether they are referenced by other pages; in the case where a page is referenced, the page can be classified according to the number of reference objects (i.e., the pages that reference this page).
[0028] Among them, the page reference relationship characterizes the jump situation between pages, such as whether a page jumps from other pages of the program to be subcontracted and the number of other pages that can jump to this page. A page being referenced means that this page can be jumped from other pages of the program to be subcontracted; for example, as Figure 2 shown, after clicking the button a on page A, the content of page B is presented, then page B is referenced by page A, page A is the reference page of page B, and can also be called the reference object of page B. Correspondingly, page B is the jump page of page A. A page not being referenced means that this page cannot be jumped from other pages of the program to be subcontracted. For example, it can only be jumped through methods such as scanning a code, clicking on a link, or clicking on the icon of the program to be subcontracted.
[0029] In a possible implementation, pages can also be classified based on other parameters. For example, pages can be classified according to the usage frequency of the pages, and the page categories include frequently displayed pages, infrequently displayed pages, etc. Pages can be classified according to the resource occupancy space of the pages, and the page categories can include large-volume pages, small-volume pages, etc.
[0030] In the embodiments of this application, before subcontracting the program to be subcontracted, the subcontracting rules can be pre-configured in the configuration file of the program to be subcontracted. When subcontracting the program to be subcontracted, obtain the configuration file of the program to be subcontracted, and extract the configuration information of each page of the program to be subcontracted and the pre-configured subcontracting rules from it, so as to analyze the configuration information of the pages to obtain the categories of the pages, and then implement the subcontracting process of the program to be subcontracted according to the subcontracting categories and corresponding subcontracting methods specified in the subcontracting rules.
[0031] In a possible implementation, when the program to be subcontracted is a WeChat mini-program, the subcontracting rules can be stored in the configuration file app.json in advance. When subcontracting the WeChat mini-program, extract the configuration information of each page of the mini-program and the pre-configured subcontracting rules from this configuration file for subsequent analysis of the subcontracting plan.
[0032] Step 102: Determine the categories of each page based on the configuration information of each page of the program to be subcontracted, and determine the pages to be subcontracted according to the categories of each page of the program to be subcontracted and the categories of the subcontracted pages.
[0033] In the embodiments of the present application, since the page category is related to the reference relationship of the page, all pages of the program to be sub-packaged can be traversed based on the configuration information of each page of the program to be sub-packaged, and the pages that each page of the program to be sub-packaged can jump to can be determined, that is, the jump pages corresponding to each page are determined. The reference relationship between the pages of the program to be sub-packaged is obtained by integrating the jump pages of all pages of the program to be sub-packaged. As Figure 3 shown, taking the program to be sub-packaged including page A, page B, page C, page D, and page E as an example for illustration: Traverse the five pages according to the configuration information of the above-mentioned pages, and determine that page A can jump to page B, page C, and page D, page B can jump to page D, page C can jump to page A and page B, page D can jump to page B, and page E can jump to page A. Then the page reference relationship of each page can be expressed as: Page A is referenced by page C and has 1 reference object; page B is referenced by page A, page C, and page D and has 3 reference objects; page C is referenced by page A and has 1 reference object; page D is referenced by page A and page B and has 2 reference objects; page E is not referenced by any page and has no reference object.
[0034] Then, based on the reference relationship corresponding to each page, all pages of the program to be sub-packaged are classified according to the correlation between the page category and the page reference relationship, and the category of each page is determined. For example, if the pages are classified according to whether the page is referenced by other pages and the number of page reference objects, the pages of the program to be sub-packaged can be divided into three categories: independent pages, single-reference pages, and multi-reference pages. Among them, an independent page is a page that cannot be jumped from other pages of the program to be sub-packaged, that is, a page without a reference object, such as page E; a single-reference page is a page that can be jumped from another page of the program to be sub-packaged, that is, a page with one reference object, such as page A and page C; a multi-reference page is a page that can be jumped from multiple other pages of the program to be sub-packaged, that is, a page with two or more reference objects, such as page B and page D.
[0035] Next, for each page, it is determined whether the category of the page meets the sub-packaging category specified in the sub-packaging rules. If it meets, it is a page to be sub-packaged. The sub-packaging category is the category of the page that needs to be sub-packaged, that is, the category of the sub-packaged page. The sub-packaging category can be configured by developers according to the actual application scenarios such as the product type of the program to be sub-packaged (such as entertainment, learning, etc.) and user positioning (such as young users), or can be set after analyzing the resource occupancy, importance, usage frequency, etc. of each page of the program to be sub-packaged.
[0036] For example, considering that a page has a large number of reference objects, its usage frequency during actual use will be relatively high. To avoid problems such as delays and lags during the loading of such pages, such pages can be set as sub-packaged pages, that is, if the category of the page is a referenced page and the number of reference objects is greater than a preset threshold, then the page is a sub-packaged page. Or, considering that a page has no reference objects and the importance of the page is relatively high, to ensure the loading speed of such pages, such pages can be set as sub-packaged pages, that is, if the category of the page is an independent page, then the page is a sub-packaged page.
[0037] Step 103: Perform sub-packaging processing on the page to be sub-packaged based on the sub-packaging method corresponding to the category of the page to be sub-packaged.
[0038] In the embodiments of the present application, after determining the page to be sub-packaged of the program to be sub-packaged, the sub-packaging method of the page to be sub-packaged is determined according to the corresponding relationship between the page category and the sub-packaging method in the sub-packaging rules. Then, sub-packages corresponding to the page to be sub-packaged are created according to the sub-packaging method corresponding to the page to be sub-packaged, and the resources required for loading the page to be sub-packaged (such as the configuration information of the page) are stored in the corresponding sub-packages. At the same time, the resources required for loading the page to be sub-packaged in the main package are deleted to complete the sub-packaging of the page to be sub-packaged.
[0039] Among them, the sub-packaging method can be specifically set according to aspects such as whether to sub-package separately and the migration degree of the page loading resources during sub-packaging. For example, the sub-packaging method can include being separately divided into a single sub-package and migrating all page loading resources, being separately divided into a single sub-package and migrating some page loading resources, being divided into a single sub-package together with pages of category X and migrating all page loading resources, and being divided into a single sub-package together with pages of category X and migrating some page loading resources. Among them, category X is one or more other categories of pages, which can be specifically set according to the actual situation of the program to be sub-packaged.
[0040] When actually setting the corresponding relationship between the sub-packaging category and the sub-packaging method in the sub-packaging rules, the resource occupancy situation and loading speed requirements of the pages corresponding to the sub-packaging category can be considered for specific settings. For example, if the pages of category 1 have a large number of reference objects, the page loading resources occupy a large space, and the requirements for the page loading speed are relatively high, then the sub-packaging method of the pages of category 1 can be set as being separately sub-packaged and migrating all page loading resources.
[0041] An embodiment of the present application provides a program subcontracting method. First, a configuration file of the program to be subcontracted is obtained. The configuration file includes configuration information of each page of the program to be subcontracted and subcontracting rules. The subcontracting rules include subcontracting categories and subcontracting methods corresponding to each type of page. Then, based on the configuration information of each page of the program to be subcontracted and category information related to the page reference relationship, the category of each page is analyzed, and then the pages to be subcontracted are determined according to the category of each page and the category of the subcontracted pages specified in the subcontracting rules. Finally, the pages to be subcontracted are subcontracted based on the subcontracting method corresponding to the category of the pages to be subcontracted. By pre-configuring the subcontracting rules, the embodiment of the present application can achieve automatic subcontracting of the program, avoiding the problems of low accuracy and subcontracting efficiency caused by manual subcontracting.
[0042] The foregoing embodiments provide a solution for analyzing page categories based on page configuration information and screening pages to be subcontracted. In another embodiment of the present application, the page category can be analyzed and the pages to be subcontracted can be determined from the relevance between the category and the page reference relationship. For example, the foregoing "determining the category of each page based on the configuration information of each page of the program to be subcontracted and determining the pages to be subcontracted according to the category of each page of the program to be subcontracted and the category of the subcontracted pages" includes the following Figure 4 steps: Step 201: Determine the reference relationship between each page of the program to be subcontracted based on the configuration information of each page of the program to be subcontracted, and determine the category of each page according to the reference relationship between each page.
[0043] In the embodiment of the present application, first, one or more starting pages are determined from all the pages of the program to be subcontracted. According to the configuration information of the starting pages, all the pages of the program to be subcontracted are traversed starting from the starting pages to determine the reference relationship between each page.
[0044] Among them, the starting page can be the home page of the program to be subcontracted, the page corresponding to the label in the navigation bar (usually at the bottom or top of the home page) of the home page, etc. For example, when the program to be subcontracted is a WeChat mini-program, the pages configured in the tabBar of the configuration item of the program to be subcontracted can be determined as the starting pages. The embodiment of the present application does not limit the starting page, and can be set according to the actual situation of the program to be subcontracted.
[0045] During the specific traversal, for each starting page, first analyze the configuration information of the starting page, extract page jump-related information such as the click jump events and jump instructions of the page, determine the jump page corresponding to the starting page according to the extracted information, and record it. Then, for each jump page of the starting page, analyze the configuration information of the jump page again, determine the jump page corresponding to the jump page, and record it. Then continue the page traversal until the analysis of the configuration information of all pages is completed and the jump pages of all pages are determined, then the page traversal of the program to be subcontracted is completed. By synthesizing the jump pages of each page recorded during the traversal process, the reference relationship between the pages of the program to be subcontracted can be obtained.
[0046] For example, as above Figure 3 shown, pages A and E can be used as the starting pages, then there are two traversal branches based on page A and based on page E in this page traversal. For the traversal branch based on page E, first analyze the configuration information of page E, determine that page E can jump to page A, that is, the jump page of page E is another starting page. Since there is a traversal branch based on page A, after recording the jump relationship between page E and page A, the page traversal based on page E can be ended. For the traversal branch based on page A, first analyze the configuration information of page A, determine that page A can jump to pages B, C, and D, and record; then, analyze the configuration information of page B in turn, determine that page B can jump to page D; analyze the configuration information of page C, determine that page C can jump to pages A and B; analyze the configuration information of page D, determine that page D can jump to page B, and record the above jump relationships. By synthesizing the jump relationships of all pages of the program to be subcontracted recorded, Figure 3 the page jump relationship diagram of the program to be subcontracted as shown can be obtained. By performing a reverse analysis of the page jump relationship, the reference relationship of the page can be obtained. For example, as Figure 2 shown, the jump page of page A is page B, then the reference page of page B is page A.
[0047] After determining the reference relationship of each page, the pages of the program to be subcontracted can be analyzed by category according to the correlation between the page category and the page reference relationship to determine the category to which each page belongs. Among them, the correlation between the page category and the page reference relationship can indicate the corresponding relationship between the page category and the page reference situation. For each page of the program to be subcontracted, the reference situation of the page (whether it is a referenced page, the number of reference objects, etc.) can be first analyzed based on the reference relationship of the page. For example, based on the reference relationship of the page, it is determined that the page is a referenced page and the number of reference objects is greater than a preset threshold. Then, find the page category corresponding to the reference situation of the page from the corresponding relationship between the page category and the page reference situation, which is the category corresponding to the page of the program to be subcontracted.
[0048] Step 202: If the category of the page of the program to be subcontracted matches the subcontracting category, determine the page as the page to be subcontracted.
[0049] In the embodiment of the present application, after determining the categories of the pages of the program to be subcontracted, for each page, the category of the page is matched with the subcontracting categories specified in the subcontracting rules. If the category of the page does not match the subcontracting category, the page is not subcontracted, and the relevant resources loaded by the page are retained in the main package of the program to be subcontracted; if the category of the page matches the subcontracting category, determine that the page is the page to be subcontracted and the page needs to be subcontracted.
[0050] The method provided in the embodiment of the present application can determine the reference relationship between the pages of the program to be subcontracted based on the configuration information of the pages of the program to be subcontracted, determine the categories of the pages according to the reference relationship between the pages, and then determine the pages to be subcontracted through the matching result of the page category and the subcontracting category. The embodiment of the present application utilizes the pre-configured subcontracting rules to realize the automatic confirmation of the pages to be subcontracted through the analysis of the reference relationship and category analysis of the pages, avoiding the problems of low accuracy and screening efficiency caused by manual screening of the pages to be subcontracted.
[0051] The foregoing embodiments introduce the solution for analyzing the page reference relationship according to the page configuration information. In another embodiment of the present application, the page configuration information includes a template file and a script file, and the page reference relationship can be specifically analyzed according to the template file and the script file in the page configuration information. For example, the "determining the reference relationship between the pages of the program to be subcontracted based on the configuration information of the pages of the program to be subcontracted" involved above includes the steps as Figure 5 shown below: Step 301: Perform a logical structure analysis on the page according to the template file and the script file of the page to obtain the jump page of the page.
[0052] Among them, the template file of the page defines the structure of the page, including information such as the layout and content display of the page; the script file of the page defines the event processing logic of the page, including instruction information such as jump instructions and event processing function information such as click jump functions. The logical structure represents the mechanism for switching and jumping between pages, and can also be called navigation logic.
[0053] In the embodiments of the present application, the template files and script files of the page can be traversed, and the relevant information of page switching and page jumping can be extracted from the template files and script files first. For example, the tag $wait representing the jump waiting time, the tag $url representing the jump page address, etc. are extracted from the template file, and the page jump instruction, click jump function, etc. are extracted from the script file of the page. In a specific implementation, tools (such as the compiler babel, the functional module html-parser, PostCSS, etc.) can be used to convert the template file and script file of the page into an Abstract Syntax Tree (AST) respectively, and the template file and script file are traversed according to the tree structure of the AST to extract the relevant information of page switching and page jumping.
[0054] Then, the jump page of this page can be determined from the relevant information of page jumping. For example, if the jump page address indicated by the tag $url is the address of page C, it can be determined that the jump page of this page is page C; if a certain click jump function defines that clicking the button a on the page jumps to page B, the jump page of this page can be determined as page B from this information.
[0055] Step 302: Determine the reference relationship between the pages of the program to be subcontracted according to the jump pages of the pages of the program to be subcontracted.
[0056] In the embodiments of the present application, for each page of the program to be subcontracted, the reference page of the jump page can be determined by performing reverse analysis according to the jump page of the page. After completing the reverse analysis of all the pages of the program to be subcontracted, the reference pages of the pages of the program to be subcontracted can be obtained, that is, the reference relationship between each page and other pages.
[0057] The method provided by the embodiments of the present application can analyze the template files and script files containing page structure logic in the page configuration information to obtain the jump pages of each page, and then perform reverse analysis according to the jump pages of each page to obtain the reference relationship between the pages of the program to be subcontracted. The embodiments of the present application perform targeted analysis on the navigation logic in the page configuration information, and can comprehensively and accurately determine the reference relationship between pages.
[0058] The foregoing embodiments introduce the solution for subcontracting the pages to be subcontracted. In another embodiment of the present application, the subcontracting scheme of the program to be subcontracted can be determined according to the subcontracting method of the pages to be subcontracted, and then the subcontracting can be completed. For example, the "subcontracting the pages to be subcontracted according to the subcontracting method corresponding to the category of the pages to be subcontracted" involved above includes the following Figure 6 shown steps: Step 401: Create a subcontracting directory for the program to be subcontracted according to the subcontracting method corresponding to the category of the pages to be subcontracted.
[0059] In the embodiments of the present application, for various to-be-subcontracted pages of the to-be-subcontracted program, it is determined whether the to-be-subcontracted pages are subcontracted separately according to the subcontracting method corresponding to the subcontracting type of the to-be-subcontracted pages. If it is determined that the to-be-subcontracted pages of this type are subcontracted separately, parameters such as the name, root directory, and occupied space of the subpackage corresponding to the to-be-subcontracted pages of this type are generated. If it is determined that the to-be-subcontracted pages of this type are subcontracted in combination with other types of to-be-subcontracted pages, it is first determined whether the subpackage parameters corresponding to the page types of the combined subcontracting have been generated. If they have been generated, the relationship between the to-be-subcontracted pages of this type and the subpackage is established; if they have not been generated, parameters such as the name, root directory, and occupied space of the subpackage corresponding to the to-be-subcontracted pages of this type are generated. Finally, as Figure 7 shown, a subcontracting directory of the to-be-subcontracted program is constructed according to the subpackage information corresponding to all types of to-be-subcontracted pages of the to-be-subcontracted program.
[0060] It can be understood that the number of subpackages is less than or equal to the number of categories of to-be-subcontracted pages. For example, if the subcontracting method corresponding to the to-be-subcontracted pages is to be grouped into one subpackage with other types of subcontracted pages, the number of subpackages of the to-be-subcontracted program is less than the number of categories of to-be-subcontracted pages.
[0061] Step 402: Move the configuration information of the to-be-subcontracted pages to the subcontracting directory.
[0062] In the embodiments of the present application, according to the subcontracting directory, the relevant resources (i.e., configuration information) required for loading each to-be-subcontracted page are migrated to the corresponding subpackage of the subcontracting directory. Specifically, the configuration information of the to-be-subcontracted pages is moved to the storage space of the corresponding subpackage in the subcontracting directory, and at the same time, the configuration information of the to-be-subcontracted pages in the main package is deleted to complete the subcontracting of the to-be-subcontracted program.
[0063] The method provided by the embodiments of the present application subcontracts relevant parameters of the subcontracting directory according to the subcontracting method corresponding to the to-be-subcontracted pages, such as the number of subpackages, names, etc., creates a subcontracting directory according to the parameters, and finally moves the resources of the to-be-subcontracted pages to the subcontracting directory. The embodiments of the present application can automatically perform subcontracting operations according to the subcontracting method of the to-be-subcontracted pages after the to-be-subcontracted pages are determined, complete the subcontracting of the to-be-subcontracted program, and ensure the integrity and orderliness of the program subcontracting process.
[0064] In a possible implementation manner, the configuration information of the page further includes a style file. When migrating the relevant resources of the to-be-subcontracted pages, the static resources extracted from the style file of the to-be-subcontracted pages can also be migrated to the subcontracting directory to improve the page loading speed. That is, the "moving the configuration information of the to-be-subcontracted pages to the subcontracting directory" mentioned above includes as Figure 8 shown steps: Step 501: Perform a logical structure analysis on the to-be-subcontracted pages according to the script file and style file of the to-be-subcontracted pages to obtain the static resources corresponding to the to-be-subcontracted pages.
[0065] Among them, the style file of the page defines the visual style of the page, including parameters such as color, font, and spacing. The static resources of the page refer to pre-defined resources that will not change due to user requests, such as HyperText Markup Language (HTML), Cascading Style Sheets (CSS), JavaScript files, pictures, audio, video, etc.
[0066] In the embodiments of the present application, the style file and script file of the page can be traversed, and the static resources required for the rendering of the page can be extracted from the style file and script file. In a specific implementation, tools (such as the compiler babel, the functional module html-parser, PostCSS, etc.) can be used to convert the style file and script file of the page into an Abstract Syntax Tree (AST) respectively, and the style file and script file can be traversed according to the tree structure of the AST to extract the static resources required for the rendering of the page.
[0067] Step 502: Move the configuration information and static resources of the page to be subcontracted to the subcontracted directory.
[0068] In the embodiments of the present application, according to the subcontracted directory, the configuration information and static resources of each page to be subcontracted are jointly migrated to the corresponding subpackage under the subcontracted directory. Specifically, the configuration information and static resources of the page to be subcontracted are moved to the storage space of the corresponding subpackage in the subcontracted directory, and at the same time, the configuration information and static resources of the page to be subcontracted in the main package are deleted to complete the subcontracting of the program to be subcontracted.
[0069] The method provided by the embodiments of the present application can jointly migrate the configuration information and static resources of the page to be subcontracted to the subcontracted directory when migrating the resources of the page to be subcontracted, so that when loading the subpackage of the page to be subcontracted, the static resources of the page to be subcontracted can be directly read, avoiding searching for the static resources of the program to be subcontracted from the main package, effectively saving the reading time of the static resources, and improving the loading speed of the page to be subcontracted.
[0070] The foregoing embodiments provide a solution for migrating the resources of the page to be subcontracted. In another embodiment of the present application, after the resources are migrated, the configuration file of the program to be subcontracted needs to be updated according to the migrated parameters to ensure the stability of the program operation. This embodiment includes the following Figure 9 shown steps: Step 601: Determine the path of the page to be subcontracted after subcontracting according to the subcontracted directory corresponding to the page to be subcontracted.
[0071] In the embodiments of the present application, when creating a subpackage directory for a program to be subpackaged, subpackage configuration information including the names of each subpackage, the root directory, etc. is generated. Among them, the root directory can represent the path of the subpackage. Therefore, the subpackage of the page to be subpackaged can be determined from the subpackage directory corresponding to the page to be subpackaged, and the path of the subpackage can be filtered out from the subpackage configuration information.
[0072] Step 602: Update the configuration file of the program to be subpackaged according to the path after subpackaging of the page to be subpackaged.
[0073] In the embodiments of the present application, since the path information before subpackaging of the page to be subpackaged (original path information) is retained in the configuration file of the program to be subpackaged, in order to avoid errors during page loading, it is necessary to replace the original path information of the page to be subpackaged with the path of the subpackage after subpackaging of the page to be subpackaged, so as to complete the update of the configuration file of the program to be subpackaged.
[0074] In a possible implementation manner, the configuration file of the program to be subpackaged can be updated based on all the subpackage configuration information of the program to be subpackaged, that is, the subpackage configuration information of the program to be subpackaged is stored in the configuration file of the program to be subpackaged. In a specific implementation, taking the program to be subpackaged as a WeChat mini-program as an example for illustration, the subPackages field in the configuration file app.json should be updated based on the subpackage configuration information.
[0075] The method provided by the embodiments of the present application determines the path information after subpackaging of each page to be subpackaged after creating the subpackage directory, and replaces the original path information of the program to be subpackaged in the configuration file of the program to be subpackaged based on the path information after subpackaging, so as to ensure that the resources of the page to be subpackaged are accurately loaded during program operation and ensure the stability of program operation.
[0076] The foregoing embodiments introduce a solution for pre-configuring subpackage rules. In another embodiment of the present application, the subpackage rules can be manually configured or automatically generated based on the configuration information of the program to be subpackaged. In the case of manually configuring subpackage rules, this embodiment includes the following Figure 10 shown steps: Step 701: Present a subpackage configuration entry, and the subpackage configuration entry includes subpackage rule configuration items.
[0077] Among them, the subpackage configuration entry is an interface provided for developers or users to set the subpackage rules of the program to be subpackaged.
[0078] As Figure 11 shown, the subpackage configuration entry includes subpackage rule configuration items, and the subpackage rule configuration items can include subpackage category configuration items and subpackage method configuration items. Developers or users can configure the subpackage category and the subpackage method corresponding to the subpackage category of each subpackage rule in sequence by means of selection or input.
[0079] Step 702: Receive the configuration operation for the subcontracting rule configuration item, and determine the subcontracting rule configured by the user based on the configuration operation.
[0080] In the embodiment of the present application, after the server receives the configuration operations for the subcontracting category and subcontracting method, it determines the subcontracting category and subcontracting method configured by the developer or user based on the configuration operations, establishes the corresponding relationship between the subcontracting category and the subcontracting method, and generates a subcontracting rule. For example, if based on the configuration operation for the subcontracting rule configuration item, it is determined that the configured subcontracting category is "2 - referenced page" and the subcontracting method is "separate subcontracting", and the "confirmation" instruction is received, then the subcontracting rule "the referenced page is subcontracted separately" is generated. Until the "end configuration" instruction is received, indicating that the developer or user has completed the configuration of the subcontracting rules for the program to be subcontracted, all the previously generated subcontracting rules are the subcontracting rules for the program to be subcontracted configured by the user.
[0081] Step 703: Add the subcontracting rule to the configuration file of the program to be subcontracted.
[0082] In the embodiment of the present application, after all the subcontracting rules for the program to be subcontracted are generated based on the user configuration operation, the subcontracting rules are stored in the corresponding address range of the configuration file of the program to be subcontracted, and the addition of the subcontracting rules to the configuration file is completed.
[0083] The method provided by the embodiment of the present application can present a subcontracting configuration entry including the subcontracting rule configuration item for the developer or user to configure the subcontracting rules. Manual configuration can be performed according to different application scenarios and different user requirements of the program to be subcontracted, making the subcontracting rules more flexible.
[0084] In one embodiment, in the case of automatically configuring the subcontracting rules, this embodiment includes the steps as Figure 12 shown: Step 801: Obtain the original configuration file of the program to be subcontracted.
[0085] Among them, the original configuration file is the configuration file of the program to be subcontracted without subcontracting rules added, and includes the configuration information of each page of the program to be subcontracted.
[0086] In the embodiment of the present application, first obtain the configuration file of the program to be subcontracted in order to obtain the configuration information of each page of the program to be subcontracted therein.
[0087] Step 802: Determine the reference relationship between each page based on the configuration information of each page of the program to be subcontracted, and determine the category of each page according to the reference relationship between each page.
[0088] In the embodiment of the present application, first, one or more starting pages are determined from all the pages of the program to be subpackaged. According to the configuration information of the starting pages, all the pages of the program to be subpackaged are traversed starting from the starting pages, and the reference relationships between the pages are determined.
[0089] During the specific traversal, for each starting page, first analyze the configuration information of the starting page, extract page jump-related information such as the click jump event and jump instruction of the page, determine the jump page corresponding to the starting page according to the extracted information, and record it. Then, for each jump page of the starting page, analyze the configuration information of the jump page again to determine the jump page corresponding to the jump page and record it. Then continue the page traversal until the analysis of the configuration information of all pages is completed and the jump pages of all pages are determined, then the page traversal of the program to be subpackaged is completed. By synthesizing the jump pages of each page recorded during the traversal process, the reference relationships between the pages of the program to be subpackaged can be obtained. After determining the reference relationships between the pages, the pages can be classified based on the differences in the reference relationships, so that different categories of pages correspond to different page reference situations.
[0090] Step 803: Determine the subpackage category from the categories of the pages of the program to be subpackaged, generate a subpackage rule according to the subpackage category and the subpackage methods corresponding to each category of pages, and update the original configuration file according to the subpackage rule to obtain a configuration file.
[0091] In the embodiment of the present application, for different categories of pages, determine the pages that need to be subpackaged among them, and generate a subpackage category based on the category of the pages that need to be subpackaged. For example, considering that when a page has a relatively large number of reference objects, the usage frequency in actual use will be relatively high. To avoid problems such as delays and lags during the loading of such pages, such pages can be set as subpackage pages. At this time, the subpackage category is the page with reference objects and the number of reference objects is greater than a preset threshold. Or, considering that when a page has no reference objects, the importance of the page is relatively high. To ensure the loading speed of such pages, such pages can be set as subpackage pages. At this time, the subpackage category is an independent page.
[0092] After determining the subpackage category, a corresponding subpackage method can be configured for each subpackage category. Among them, the subpackage method can be specifically set according to aspects such as whether to subpackage alone and the degree of migration of page loading resources during subpackaging. For example, the subpackage method can include being separately divided into a subpackage and migrating all page loading resources, being separately divided into a subpackage and migrating some page loading resources, being divided into a subpackage together with the pages of category X and migrating all page loading resources, being divided into a subpackage together with the pages of category X and migrating some page loading resources. Among them, category X is one or more other categories of pages, which can be specifically set according to the actual situation of the program to be subpackaged.
[0093] When configuring the subcontracting method corresponding to the subcontracting category, specific settings such as the resource occupancy of the subcontracting category corresponding page and the loading speed requirements can be considered. For example, if the page of category 1 has many reference objects, the loading resources of the page occupy a large space, and the loading speed requirement for the page is high, then the subcontracting method for the page of category 1 can be set to separate subcontracting and migrate all page loading resources. Finally, subcontracting rules are generated based on the subcontracting category, subcontracting method, and the corresponding relationship between the subcontracting category and the subcontracting method. The subcontracting rules are added to the original configuration file of the program to be subcontracted to obtain the configuration file of the program to be subcontracted.
[0094] The method provided by the embodiments of the present application can determine the reference relationship between pages according to the configuration information of each page in the original configuration file of the program to be subcontracted, determine the category of each page according to the reference relationship between pages, and then screen out the subcontracting category from them, and generate subcontracting rules according to the subcontracting category and the corresponding subcontracting method, and update the original configuration file according to the subcontracting rules to obtain the configuration file. The method provided by the embodiments of the present application can analyze the reference relationship, category, etc. of each page according to the configuration information of the program to be subcontracted, and automatically generate subcontracting rules according to the analysis results, so that the subcontracting rules are more in line with the actual configuration of the program to be subcontracted itself, and thus the subcontracting scheme executed based on the subcontracting rules is more reasonable.
[0095] In one embodiment, taking the parasitic application of the target application as the program to be subcontracted as an example, the loading process of the program to be subcontracted after subcontracting processing is described. This embodiment includes as Figure 13 the following steps: Step 901, run the target application, receive the operation of the user on the parasitic application through the user interface of the target application, and determine the page to be jumped to in response to the operation.
[0096] Among them, the target application can be an application such as WeChat or Alipay. Correspondingly, the parasitic application can be a WeChat mini program, an Alipay mini program, etc.
[0097] In the embodiments of the present application, the target application is run first, and then the parasitic application is opened on the user interface of the target application. During the running of the parasitic application, the operation of the user on the parasitic application is received, and the page to be jumped to in response to the user operation, that is, the page to be presented, is determined.
[0098] Step 902, if the page to be jumped to is a subcontracted page, determine the path corresponding to the page to be jumped to according to the configuration file of the program to be subcontracted, and load the subcontract of the page to be jumped to according to the path.
[0099] In the embodiments of the present application, first, obtain the subpackage configuration information of the parasitic application, extract the page identifiers of each subpackage page from the subpackage configuration information, and then, compare the page identifier of the page to be jumped to with each page identifier in turn. If there is a subpackage page whose page identifier is the same as that of the page to be jumped to, determine that the page to be jumped to is a subpackage page, determine the path of the subpackage corresponding to the page to be jumped to from the configuration file of the parasitic application, and load the subpackage of the page to be jumped to according to this path, and present the page to be jumped to.
[0100] In the method provided by the embodiments of the present application, when the program to be subpackaged is a parasitic application, first run the target application program parasitized by the parasitic application, and then run the parasitic application through the user interface of the target application program. When the page to be jumped to during the running of the parasitic application is a subpackage page, load the subpackage of the page to be jumped to based on the path of the subpackage corresponding to the page to be jumped to, and present the page to be jumped to. The method provided by the embodiments of the present application takes into account the subpackage situation of the program during the program running process, dynamically loads the main package or different subpackages according to the user's usage requirements, avoids situations such as freezing and delay, and improves the page loading speed.
[0101] It should be noted that although the operations of the method of the present invention are described in a specific order in the drawings, this does not require or imply that these operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the steps depicted in the flowchart can be changed in the order of execution. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step for execution, and / or one step can be decomposed into multiple steps for execution.
[0102] In one embodiment, as Figure 14 shown, a program subpackage device is provided, including: an acquisition module 1001, a determination module 1002, and a subpackage module 1003, where: The acquisition module 1001 is configured to acquire the configuration file of the program to be subpackaged. The configuration file includes the configuration information of each page of the program to be subpackaged and the subpackage rules; the subpackage rules include the subpackage categories and the subpackage methods corresponding to each type of page; the subpackage categories are used to represent the categories of the subpackage pages, and the categories are related to the page reference relationship; The determination module 1002 is configured to determine the category of each page based on the configuration information of each page of the program to be subpackaged, and determine the page to be subpackaged according to the category of each page of the program to be subpackaged and the category of the subpackage page; The subpackage module 1003 is configured to perform subpackage processing on the page to be subpackaged based on the subpackage method corresponding to the category of the page to be subpackaged.
[0103] In one embodiment, the category is related to the page reference relationship, including: if the category of a page is a referenced page and the number of reference objects is greater than a preset threshold, then the page is a subcontracted page; or, if the category of a page is an independent page, then the page is a subcontracted page.
[0104] In one embodiment, the determining module 1002 is specifically configured to determine the reference relationship between the pages of the program to be subcontracted based on the configuration information of each page of the program to be subcontracted, and determine the category of each page according to the reference relationship between the pages; the category of each page includes a referenced page or an independent page; if the category of the page of the program to be subcontracted matches the subcontracting category, then the page is determined to be a page to be subcontracted.
[0105] In one embodiment, the configuration information of a page includes a template file and a script file. The determining module 1002 is further configured to perform a logical structure analysis on the page according to the template file and the script file of the page to obtain the jump page of the page; determine the reference relationship between the pages of the program to be subcontracted according to the jump pages of the pages of the program to be subcontracted.
[0106] In one embodiment, the subcontracting module 1003 is specifically configured to create a subcontracting directory for the program to be subcontracted according to the subcontracting method corresponding to the category of the page to be subcontracted; move the configuration information of the page to be subcontracted to the subcontracting directory.
[0107] In one embodiment, the configuration information of a page further includes a style file. The subcontracting module 1003 is further configured to perform a logical structure analysis on the page to be subcontracted according to the script file and the style file of the page to be subcontracted to obtain the static resources corresponding to the page to be subcontracted; move the configuration information and the static resources of the page to be subcontracted to the subcontracting directory.
[0108] In one embodiment, the program subcontracting apparatus further includes an updating module, configured to determine the path after subcontracting of the page to be subcontracted according to the subcontracting directory corresponding to the page to be subcontracted; update the configuration file of the program to be subcontracted according to the path after subcontracting of the page to be subcontracted.
[0109] In one embodiment, the program subcontracting apparatus further includes a manual configuration module, configured to present a subcontracting configuration entry, and the subcontracting configuration entry includes a subcontracting rule configuration item; receive a configuration operation on the subcontracting rule configuration item, determine the subcontracting rule configured by the user based on the configuration operation; add the subcontracting rule to the configuration file of the program to be subcontracted.
[0110] In one embodiment, the program subcontracting device further includes an automatic configuration module, which is used to obtain the original configuration file of the program to be subcontracted. The original configuration file includes the configuration information of each page of the program to be subcontracted; determine the reference relationship between each page based on the configuration information of each page of the program to be subcontracted, and determine the category of each page according to the reference relationship between each page; determine the subcontracting category from the categories of each page of the program to be subcontracted, generate subcontracting rules according to the subcontracting category and the subcontracting methods corresponding to each type of page, and update the original configuration file according to the subcontracting rules to obtain the configuration file.
[0111] In one embodiment, the program to be subcontracted is a parasitic application of the target application. The program subcontracting device further includes a loading module, which is used to run the target application, receive the operation of the user on the parasitic application through the user interface of the target application, and determine the page to be jumped to in response to the operation; if the page to be jumped to is a subcontracted page, determine the path corresponding to the page to be jumped to according to the configuration file of the program to be subcontracted, and load the subcontract of the page to be jumped to according to the path.
[0112] It should be understood that the various units or modules described in the program subcontracting correspond to the respective steps in the method described in the reference Figure 1 description. Therefore, the operations and features described above for the method also apply to the program subcontracting and the units included therein, and will not be elaborated herein. The program subcontracting can be pre-implemented in the browser or other security applications of the electronic device, or can be loaded into the browser or its security applications of the electronic device by means of downloading, etc. The corresponding units in the program subcontracting can cooperate with the units in the electronic device to implement the solutions of the embodiments of the present application.
[0113] Next, refer to Figure 15 , which shows a schematic structural diagram of a computer system 1100 of a terminal device or a server suitable for implementing the embodiments of the present application.
[0114] As Figure 15 shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1102 or the program loaded from the storage section 508 into the random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the system 1100 are also stored. The CPU 1101, ROM 1102, and RAM 1103 are connected to each other through a bus 1104. The input / output (I / O) interface 1105 is also connected to the bus 1104.
[0115] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as required. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 1110 as required so that a computer program read therefrom is installed into the storage section 1108 as required.
[0116] Specifically, according to an embodiment of the present disclosure, the process described above with reference to Figure 1 can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program tangibly embodied on a machine-readable medium, the computer program including program code for performing Figure 1 the method. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1109, and / or installed from the removable medium 1111.
[0117] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this application, a computer-readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device. And in this application, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination of the above.
[0118] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram can represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks can occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0119] The units or modules involved in the embodiments described in this application can be implemented in software or in hardware. The described units or modules can also be provided in a processor. Among them, the names of these units or modules do not, in some cases, limit the units or modules themselves.
[0120] As another aspect, this application also provides a computer-readable storage medium. The computer-readable storage medium can be included in the computer device described in the above embodiments, or can exist alone without being assembled into the computer device. The above computer-readable storage medium stores one or more programs, and when the above programs are executed by one or more processors, the methods described in this application are performed. For example, the steps of the method shown in Figure 1 can be executed.
[0121] The embodiments of this application provide a computer program product. The computer program product includes instructions, and when the instructions are run, the methods described in the embodiments of this application are executed. For example, the steps of the method shown in Figure 1 can be executed.
[0122] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0123] The above description is only a preferred embodiment of the present application and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the technical solutions formed by mutually replacing the above features with (but not limited to) technical features with similar functions disclosed in the present application.
Claims
1. A program subpackaging method, characterized in that: The method comprises: Obtaining a configuration file of the program to be subpackaged, wherein the configuration file includes configuration information of each page of the program to be subpackaged and a subpackage rule; the subpackage rule includes a subpackage category and a subpackage method corresponding to each type of page; the subpackage category is used to represent the category of the subpackage page, and the category is related to the page reference relationship; Determine the category of each page of the program to be subpackaged based on the configuration information of each page, and determine the page to be subpackaged according to the category of each page of the program to be subpackaged and the category of the subpackaged page; The pages to be sub-packaged are sub-packaged based on the sub-package method corresponding to the category of the pages to be sub-packaged.
2. The method according to claim 1, characterized in that: The categories are related to page reference relationships and include: If the category of the page is a referenced page and the number of referenced objects is greater than a preset threshold, the page is a sub-package page; or, If the category of the page is an independent page, then the page is a subpackage page.
3. The method according to claim 1 or 2, characterized in that: Determining the category of each page of the program to be sub-packaged based on the configuration information of each page of the program to be sub-packaged, and determining the page to be sub-packaged according to the category of each page of the program to be sub-packaged and the category of the sub-packaged page, including: Determine the reference relationship between the pages of the program to be subpackaged based on the configuration information of the pages of the program to be subpackaged, and determine the category of each page according to the reference relationship between the pages; the category of each page includes a referenced page or an independent page; If the category of the page of the program to be sub-packaged matches the sub-package category, the page is determined to be a page to be sub-packaged.
4. The method according to claim 3, characterized in that The configuration information of the page includes a template file and a script file, and the determining the reference relationship between the pages of the program to be sub-packaged based on the configuration information of the pages of the program to be sub-packaged includes: Performing a logical structure analysis on the page according to the template file and the script file of the page to obtain a jump page of the page; The reference relationship between the pages of the program to be sub-packaged is determined according to the jump pages of the pages of the program to be sub-packaged.
5. The method according to claim 1, characterized in that The sub-packaging process of the pages to be sub-packaged based on the sub-packaging method corresponding to the category of the pages to be sub-packaged includes: Create a sub-packaging directory of the program to be sub-packaged according to the sub-packaging method corresponding to the category of the page to be sub-packaged; Move the configuration information of the page to be subpackaged to the subpackage directory.
6. The method according to claim 5, characterized in that The configuration information of the page also includes a style file, and the step of moving the configuration information of the to-be-subpackaged page to the subpackage directory includes: Performing a logical structure analysis on the page to be subpackaged according to the script file and style file of the page to be subpackaged, and obtaining static resources corresponding to the page to be subpackaged; Move the configuration information of the page to be subpackaged and the static resources to the subpackage directory.
7. The method according to claim 5, characterized in that The method further comprises: Determine the path of the page to be subpackaged after subpackaging according to the subpackage directory corresponding to the page to be subpackaged; The configuration file of the program to be packaged is updated according to the path after the page to be packaged is packaged.
8. The method according to claim 1, characterized in that: The method further comprises: Presenting a sub-packaging configuration entry, wherein the sub-packaging configuration entry includes a sub-packaging rule configuration item; receiving a configuration operation on the subpackaging rule configuration item, and determining the subpackaging rule configured by the user based on the configuration operation; Add the subpackaging rules to the configuration file of the program to be subpackaged.
9. The method according to claim 1, characterized in that: The method further comprises: Obtaining an original configuration file of the program to be sub-packaged, wherein the original configuration file includes configuration information of each page of the program to be sub-packaged; Determine the reference relationship between the pages based on the configuration information of the pages of the program to be packaged, and determine the category of each page according to the reference relationship between the pages; The subpackaging category is determined from the categories of each page of the program to be subpackaged, and the subpackaging rule is generated according to the subpackaging category and the subpackaging method corresponding to each type of page, and the original configuration file is updated according to the subpackaging rule to obtain the configuration file.
10. A computer program product, characterized in that The computer program product comprises instructions, which, when executed, cause the method according to any one of claims 1 to 9 to be performed.