Applet cross-end application method, related device and computer storage medium
By acquiring and modifying the logical relationships of mini-program pages, a second mini-program suitable for different platforms can be generated, solving the problem of cross-platform applications and improving development efficiency.
Patent Information
- Application Number
- CN202211347501.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2042-10-31
AI Technical Summary
Mini-programs cannot be directly used across different platforms, resulting in low development efficiency.
By obtaining the pages of the first mini-program, determining its logical relationships, and modifying its name, a second mini-program suitable for the second application platform is generated.
It enables cross-platform mini-program applications, improving development efficiency and eliminating the need to rewrite code.
Smart Images

Figure CN115934093B_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification relate to the field of computer technology, and in particular to a method, related apparatus, and computer storage medium for cross-platform application of mini-programs. Background Technology
[0002] The "use and go" concept sparked a wave of mini-programs. The excellent user experience, convenient dissemination methods, and improved development efficiency brought by rich component application programming interfaces (APIs) have attracted a large number of users. However, due to the different development languages used in various applications (APPs), mini-programs cannot be directly used across platforms. Summary of the Invention
[0003] This specification provides a method, related apparatus, and computer storage medium for cross-platform application of mini-programs, which can solve the problem that mini-programs on different platforms cannot be directly applied across platforms.
[0004] Firstly, embodiments of this specification provide a method for cross-platform application of mini-programs, the method comprising:
[0005] Get the M pages contained in the first mini-program; where the first mini-program is mounted on the first application; M is a positive integer greater than 1;
[0006] Based on the logical relationships of N pages in the first mini-program, a first logical dependency analysis result is determined; where N is a positive integer less than or equal to M; the first logical dependency analysis result includes the names of the N pages and the logical path corresponding to each page; the logical path is the path that calls the logical relationship;
[0007] The names of the N pages are modified according to the preset modification rules to obtain the second logical dependency analysis results;
[0008] The page of the second mini-program is generated based on the result of the second logical dependency analysis; wherein the second mini-program is mounted on the second application; the first application is different from the second application.
[0009] Secondly, this specification provides a cross-platform application device for mini-programs, the device comprising:
[0010] The acquisition module is used to acquire M pages contained in the first mini-program; wherein, the first mini-program is mounted on the first application; M is a positive integer greater than 1;
[0011] The determining module is used to determine a first logical dependency analysis result based on the logical relationship of N pages in the first mini-program; where N is a positive integer less than or equal to M; the first logical dependency analysis result includes the names of the N pages and the logical path corresponding to each page; the logical path is the path that calls the logical relationship;
[0012] The module is used to modify the names of the N pages according to preset modification rules to obtain the second logical dependency analysis result;
[0013] The generation module is used to generate the page of the second mini-program based on the result of the second logical dependency analysis; wherein the second mini-program is mounted on the second application; the first application is different from the second application.
[0014] Thirdly, the embodiments of the specification provide a program product, the program product including instructions that, when the instructions are run on a computer, cause the computer to perform the above-described method steps.
[0015] Fourthly, the embodiments of the specification provide a computer storage medium storing a plurality of instructions adapted for loading by a processor and executing the above-described method steps.
[0016] Fifthly, embodiments of this specification provide an electronic device that may include: a processor and a memory;
[0017] The memory stores a computer program adapted to be loaded by the processor and executed in accordance with the above-described method steps.
[0018] The beneficial effects of the technical solutions provided in some embodiments of this specification include at least the following:
[0019] This embodiment of the specification can obtain M pages contained in a first mini-program; determine the first logical dependency analysis result based on the logical relationship of N pages in the first mini-program; modify the names of the N pages according to preset modification rules to obtain the second logical dependency analysis result; and generate the pages of the second mini-program based on the second logical dependency analysis result. Therefore, the second mini-program in the second application of this embodiment can obtain a recognizable logical path by calling the name modification method to directly generate the required pages. This eliminates the need for developers to rewrite code according to the development languages of other application platforms, not only solving the problem of mini-programs from different platforms being unable to be directly applied across platforms, but also effectively improving the development efficiency of mini-programs. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this specification, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 The page diagrams of the applets in the applications related to the embodiments of this specification are shown;
[0022] Figure 2a This specification illustrates an application scenario diagram of the cross-platform application method for mini-programs according to an embodiment of this specification.
[0023] Figure 2b This document shows a page diagram generated by the cross-platform application method for mini-programs according to an embodiment of this specification.
[0024] Figure 3 A flowchart illustrating a method for cross-platform application of a mini-program provided in an embodiment of this specification is shown.
[0025] Figure 4 A flowchart illustrating another method for cross-platform application of mini-programs provided in the embodiments of this specification is shown.
[0026] Figure 5 This illustrates a page generated by another method for cross-platform application of mini-programs provided in an embodiment of this specification;
[0027] Figure 6 This document illustrates a flowchart of yet another method for cross-platform application of mini-programs provided in an embodiment of this specification.
[0028] Figure 7 This diagram illustrates the page construction process of a cross-platform application method for mini-programs according to an embodiment of this specification.
[0029] Figure 8 This specification illustrates a system architecture diagram of a cross-platform application method for mini-programs according to an embodiment of this specification;
[0030] Figure 9 This is a schematic diagram of the structure of a cross-platform application device for mini-programs provided in the embodiments of this specification;
[0031] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification. Detailed Implementation
[0032] In the following description, when referring to the accompanying drawings, the same numbers in different drawings denote the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this specification as detailed in the appended claims.
[0033] In the description of this specification, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of these terms in this specification based on the specific circumstances. Furthermore, in the description of this specification, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.
[0034] Figure 1 An exemplary page diagram of a mini-program in an application related to an embodiment of this specification is shown. Specifically, this page belongs to a local mini-program called "Pet ID Card" in application 1, which can display pet information such as pet type, nickname, sexual characteristics, birthday, and neutering status.
[0035] It is understood that the local mini-program in this manual refers to the mini-program developed by the development terminal of application 1. The developer can upload it to the server, and other applications can retrieve relevant data of the local mini-program in application 1 through the server.
[0036] Figure 2a This diagram illustrates an application scenario of the cross-platform application method for mini-programs, as described in this specification. The cross-platform application method provided in this specification can be applied to a server. Specifically, the cross-platform application method can use a server to call the "Pet ID Card" mini-program from application 1 to application 2. For example, a user can use the local "Pet ID Card" mini-program in application 1 on their phone to purchase pet insurance for their cat, or they can use the called "Pet ID Card" mini-program in application 2 on their phone to purchase pet insurance. When a user uses the "Pet ID Card" mini-program in application 2 to purchase pet insurance, application 2 needs to send a request to the server storing relevant data from application 1 to obtain the relevant data of the "Pet ID Card" mini-program, in order to generate the various pages of the "Pet ID Card" mini-program in application 2.
[0037] The server can connect to the terminal via a network. The network provides a communication link between the terminal and the server. The network can include various connection types, such as wired, wireless communication links, or fiber optic cables. Terminals include, but are not limited to, wearable devices, handheld devices, personal computers, tablets, in-vehicle devices, smartphones, computing devices, or other processing devices connected to a wireless modem.
[0038] It should be understood that Figure 2a The number of terminals, networks, and servers shown is merely illustrative. Depending on actual needs, there can be any number of terminals, networks, and servers. For example, servers could be a server cluster. Users can interact with terminals via the network using the server to obtain optimized versions, etc.
[0039] Specifically, the server in the embodiments of this specification can be a third-party server, such as a public server that simultaneously stores data from the first application and data from the second application. The terminal can request relevant data of the first mini-program in the first application from the third-party server. The server in the embodiments of this specification can also be a server cluster composed of multiple servers. For example, the terminal can request relevant data of the first mini-program from the server of the first application through the server of the second application.
[0040] Figure 2b The diagram illustrates a page generated by the cross-platform application method for mini-programs according to an embodiment of this specification. It's possible that since the "Pet ID Card" mini-program in application 1 is a local mini-program, a login page is not required. However, when a user uses this mini-program in application 2, they must first access login page 21, and after successful login, proceed to waiting page 22. Only after waiting page 22 completes its redirection can the user proceed to the next step. Figure 1 The page shown is from the "Pet ID Card" mini-program.
[0041] Next, combine Figure 1 The page diagrams of the applets in the applications related to the embodiments described in this specification are as follows: Figure 2a The application scenario diagram of the cross-platform application method for mini-programs described in the embodiments of this specification, and Figure 2b The page diagram generated by the cross-platform application method of mini-programs in the embodiments of this specification is used to introduce the cross-platform application method of mini-programs provided in the embodiments of this specification.
[0042] In one embodiment, Figure 3 The diagram illustrates a flowchart of a method for cross-platform application of mini-programs. Figure 3 As shown, the method for cross-platform application of this mini-program may include the following steps:
[0043] S301, retrieve the M pages contained in the first mini-program.
[0044] In this embodiment of the specification, the first applet is mounted on the first application; M is a positive integer greater than 1.
[0045] It is understandable that the first mini-program is a local mini-program of the first application. Possibly, the first mini-program may contain multiple pages. For example, if the first mini-program is a "Pet ID Card" mini-program, it may include: a pet profile page, a pet photo page, a pet insurance page, a pet encyclopedia page, an online consultation page, etc.
[0046] S302, Based on the logical relationships of N pages in the first mini-program, determine the results of the first logical dependency analysis.
[0047] In the embodiments of this specification, N is a positive integer less than or equal to M. The first logical dependency analysis result includes the names of N pages and the logical path corresponding to each page. The logical path is the path that calls the logical relationship.
[0048] Specifically, logical relationships are used to represent the navigation between pages. For example, clicking the "back" button in the first mini-program will navigate to the previous page, and clicking the "next" button will navigate to the next page. Logical paths can be understood as the path that needs to be invoked to generate the previous page when the user clicks the "back" button on the current page.
[0049] It is understandable that when the mini-program in the second application calls all pages of the mini-program in the first application, N is a positive integer equal to M; when the mini-program in the second application calls some pages of the mini-program in the first application, N is a positive integer less than M.
[0050] Specifically, in the embodiments of this specification, the names of the N pages are uniform; for example, the names of the N pages are all "abc".
[0051] Possibly, the first logical dependency analysis result in the embodiments of this specification can be understood as a tree structure, which includes N nodes. The information corresponding to each node may include the name of a page, and each page corresponds to at least one logical path. For example, the mutual dependency relationship between the pet profile page and the pet photo page is: clicking on a photo on the pet profile page will lead to the pet photo page. Further, if the pet profile page corresponds to node A and the pet photo page corresponds to node B, then node A and node B have a parent-child relationship, with node A being the parent node and node B being the child node. The information corresponding to node A is: the page name "abc" and the logical path "animalfile\" that calls and stores the pet profile page. The information corresponding to node B is: the page name "abc" and the logical path "animalfile\photos\" that calls and stores the pet photo page.
[0052] S303, Modify the names of N pages according to the preset modification rules to obtain the second logical dependency analysis results.
[0053] The preset modification rules are pre-defined rules for modifying page names. It is understood that this embodiment of the specification allows the second application to obtain the logical path to call pages within the mini-program by modifying the names of N pages. For example, the preset modification rule could be to uniformly modify the page names of the mini-programs in the first application to "xyz".
[0054] It's possible that the developer of the first application could upload their developed software package to a Node Package Manager (NPM). This manager would then provide centralized services that allow other developers to reference the package, reducing development costs. However, the level of support for these software packages may vary across different platform mini-program development guidelines. The mini-program in the second application might not be able to directly use the NPM package. Therefore, the name of the mini-program page in the first application would need to be modified so that the second application can call the NPM package.
[0055] It's understandable that the second logical dependency analysis result is the first logical dependency analysis result with the page name modified; that is, the second logical dependency analysis result can be understood as a tree structure. For example, after the name is modified in the first logical dependency analysis result, the information corresponding to node A in the second logical dependency analysis result is: page name xyz and the logical path animalfile\ that calls the page storing the pet profile. The information corresponding to node B is: page name xyz and the logical path animalfile\photos\ that calls the page storing the pet photos.
[0056] Possibly, in this embodiment of the specification, the first logical dependency analysis result can be saved to a local folder on the developer's terminal, and then the names of N pages can be modified according to preset modification rules. The modified second logical dependency analysis result can then be uploaded to the server. Specifically, in this embodiment of the specification, the modification process of the names of the N pages can be automatically identified and uniformly modified by the developer's terminal, or it can be manually modified by the developer.
[0057] S304, Generate the page of the second mini-program based on the results of the second logical dependency analysis.
[0058] In this embodiment of the specification, the second applet is mounted on the second application; the first application is different from the second application.
[0059] It is understandable that the second mini-program was developed based on the first mini-program in the first application.
[0060] It is possible that the number of pages in the second mini-program may differ from that in the first mini-program, due to reasons such as the need for registration, login, verification of user information, and the fact that the functions that can be implemented in the second application cannot be matched one by one.
[0061] In a specific embodiment, three pages contained in mini-program A1 within application 1 are obtained: a pet profile page, a pet photo page, and a pet encyclopedia page. Based on the navigation relationship of these three pages in mini-program A1, a first logical dependency analysis result is determined, allowing navigation from the pet profile page to the pet photo page and the pet encyclopedia page, respectively. The first logical dependency analysis result includes three pages whose names are all "abc". The logical path corresponding to the pet profile page is `animalfile\`, the logical path corresponding to the pet photo page is `animalfile\photos\`, and the logical path corresponding to the pet encyclopedia page is `animalfile\info\`. Further, the first logical dependency analysis result can be obtained from NPM and saved to a local folder. Then, the names of the three pages in mini-program A1 are changed from "abc" to "xyz" according to a preset naming convention to obtain a second logical dependency analysis result, which is then uploaded to NPM. Further, application 2 can then use NPM to call the logical paths of the pages to generate the corresponding three pages in mini-program A2.
[0062] This embodiment of the specification can obtain M pages contained in a first mini-program; determine the first logical dependency analysis result based on the logical relationship of N pages in the first mini-program; modify the names of the N pages according to preset modification rules to obtain the second logical dependency analysis result; and generate the pages of the second mini-program based on the second logical dependency analysis result. Therefore, the second mini-program in the second application of this embodiment can obtain a recognizable logical path by calling the name modification method to directly generate the required pages. This eliminates the need for developers to rewrite code according to the development languages of other application platforms, not only solving the problem of mini-programs from different platforms being unable to be directly applied across platforms, but also effectively improving the development efficiency of mini-programs.
[0063] In some implementations, all N pages in the first mini-program depend on at least one component. A component refers to a collection constructed according to specific specifications; a component can implement one or more functions, such as a pet list or an image list. Furthermore, a page depending on at least one component can be understood as the page implementing at least one function; for example, the current page could implement a photo-taking function.
[0064] In one embodiment, Figure 4 As shown in the figure, this specification provides a flowchart of a method for cross-platform application of mini-programs. Figure 4 As shown, the method for cross-platform application of this mini-program may include the following steps:
[0065] S401, retrieve the M pages contained in the first mini-program.
[0066] If possible, determine the pages that the second mini-program needs to generate; based on the pages that the second mini-program needs to generate and the M pages contained in the first mini-program, determine the common pages between the first and second mini-programs; based on the common pages and the pages that the second mini-program needs to generate, determine the non-common pages in the second mini-program.
[0067] In this specification, "public pages" in the embodiments refer to pages in the second mini-program that are identical to those in the first mini-program, while "non-public pages" refer to pages in the second mini-program other than public pages. For example, because... Figure 2b The second application's "Pet ID Card" page 23 and Figure 1 The page is the same as the first application "Pet ID Card" in China, therefore, Figure 2b In the second application, page 23, "Pet ID Card," is a public page. Since this second mini-program is not a local mini-program of the second application, a login page and a waiting page are needed to verify the user's identity and wait for relevant data to be retrieved from the first application on the server. Figure 2bThe login page 21 and waiting page 22 are non-public pages in the second mini-program.
[0068] It is understood that the embodiments of this specification may pre-set the pages to be generated in the second application and the navigation order of these pages.
[0069] Specifically, the embodiments of this specification can determine the common pages between the first mini-program and the second mini-program by means of page comparison or page filtering, and then determine the non-common pages in the second mini-program based on the common pages and the pages that the second mini-program needs to generate.
[0070] S402, Based on the logical relationships of N pages in the first mini-program, determine the result of the first logical dependency analysis.
[0071] Possibly, embodiments of this specification can perform dependency analysis on the logical relationship between public and non-public pages to generate a first logical dependency analysis result. Specifically, the logical relationship between public and non-public pages can be determined by determining the jump order between them, and then the first logical dependency analysis result can be determined based on this logical relationship.
[0072] S403, modify the names of N pages according to the preset modification rules to obtain the second logical dependency analysis results.
[0073] Specifically, S403 is the same as S303, and will not be repeated here.
[0074] S404, Based on the components that N pages in the first mini-program depend on, determine the dependency analysis results of the first component.
[0075] Possibly, embodiments of this specification can perform dependency analysis on the relationships between components that public and non-public pages depend on, to obtain the dependency analysis results of the first component.
[0076] Specifically, the relationships between components that the public page depends on and components that the non-public page depends on can be determined by identifying the interrelationships between the components in the public page and the components in the non-public page, and then the results of the first component dependency analysis can be determined based on these relationships.
[0077] In this embodiment, the first component dependency analysis result may include the names of N pages and the component path corresponding to each component on each page; the component path is the path that calls the component. For example, if a page needs to display a list of pet pictures for the current user, the component path can be understood as the path that calls the pet picture list: charts\animalphotos\. That is, by executing this path, the pet picture list function can be implemented on the page. Specifically, in this embodiment, the names of the N pages are uniform; for example, the name of all N pages is "abc".
[0078] It is possible that the first component dependency analysis result in the embodiments of this specification can be understood as a tree structure, which includes multiple nodes. The information corresponding to each node may include the name of a page and the component path corresponding to a component on that page. For example, Figure 5 The pet profile page 53 shown may include components such as selecting a pet type, filling in pet information, and a "Next" button. After obtaining the pet information, clicking the "Next" button generates the "My Pet" page, which may include components such as a pet avatar, pet growth stages (pet care tips, puppyhood, adolescence, etc.), and pet knowledge (disease prevention, breeding and sterilization, healthy diet, etc.). It is understood that the "Next" button is dependent on the various components on the "My Pet" page. Therefore, this embodiment of the specification can construct a tree structure of components through the relationships between the page and its components.
[0079] S405, modify the names of N pages according to the preset modification rules to obtain the second component dependency analysis results.
[0080] Possibly, if the "Next" button component on the pet profile page corresponds to node C, and the pet growth stage component on the "My Pets" page corresponds to node D, then nodes C and D have a parent-child relationship, with node C being the parent node and node D being the child node. The information corresponding to node C is: the page name "abc" and the path of the component that stores the "Next" button on the pet profile page: `animalfile\next\`. The information corresponding to node D is: the page name "abc" and the path of the component that stores the pet growth stage on the "My Pets" page: `myanimal\generations\`.
[0081] It is understood that the embodiments of this specification can modify the names of N pages to enable the second application to obtain the component paths of the components in the calling pages. For example, the preset modification rule is to uniformly modify the page names of the mini-programs in the first application to xyz.
[0082] It's understandable that the second component dependency analysis result is the first component dependency analysis result with the page name modified; that is, the second component dependency analysis result can be understood as a tree structure. For example, after the first component dependency analysis result is renamed, the information corresponding to node C in the second component dependency analysis result is: the page name xyz and the component path animalfile\next\ that calls the "Next" button on the page storing the pet's profile. The information corresponding to node D is: the page name xyz and the component path myanimal\generations\ that calls the pet's growth stages on the "My Pet" page.
[0083] Possibly, in this embodiment of the specification, the first component dependency analysis result can be saved to the local folder of the developer's terminal, and then the names of N pages can be modified according to the preset modification rules. After the modification is completed, the second logical dependency analysis result is obtained, and the modified second component dependency analysis result is uploaded to the server so that each page in the second applet of the second application can realize the preset component function.
[0084] S406, Generate the page of the second mini-program based on the results of the second logical dependency analysis and the second component dependency analysis.
[0085] It is understood that the embodiments of this specification can determine the page navigation order in the second mini-program through the results of the second logical dependency analysis, and determine the dependency relationships between components within each page or between components in the second mini-program through the results of the second component dependency analysis. Furthermore, the pages of the second mini-program can be generated based on the page navigation order and the relationships between components within each page.
[0086] See Figure 5In one specific embodiment, three pages are obtained from mini-program A1 in application 1: pet profile page, "My Pet" page, pet photo page, and pet encyclopedia page. Based on the pre-defined pages required by mini-program A2 in application 2: login page 51, waiting page 52, pet profile page 53, and "My Pet" page 54, the common pages between application 1 and application 2 are determined to be: pet profile page 53 and "My Pet" page 54, while the non-common pages are: login page 51 and waiting page 52. Based on the navigation relationship of these four pages in mini-program A2, the first logical dependency analysis result is determined, showing a path from login page 51 to waiting page 52 to pet profile page 53 to "My Pet" page 54. Based on the dependency relationship between components in pet profile page 53 and "My Pet" page 54 in mini-program A2, the first component dependency analysis result is determined. Furthermore, by modifying the page names in the first logical dependency analysis result and the first component dependency analysis result, the second logical dependency analysis result and the second component dependency analysis result are obtained. The second logical dependency analysis result and the second component dependency analysis result are uploaded to NPM, and the second application can use NPM to call the logical path of the page and the component path in the page to generate the four pre-defined pages in the mini-program A2.
[0087] Therefore, the second mini-program in the second application of the embodiments of this specification can obtain identifiable logical paths and component paths by calling the name modification method, so as to directly generate the required pages and components in the pages. This not only realizes the calling of logical relationships between pages, but also realizes the calling of various component functions in the pages, effectively improving development efficiency.
[0088] In some implementations, the pages of the second applet may include text and / or images. At least two pages of the second applet may each include at least one image.
[0089] In one embodiment, Figure 6 As shown in the figure, this specification provides a flowchart of a method for cross-platform application of mini-programs. Figure 6 As shown, the method for cross-platform application of this mini-program may include the following steps:
[0090] S601, retrieve the M pages contained in the first mini-program.
[0091] Specifically, S601 is the same as S401, and will not be repeated here.
[0092] S602, Based on the logical relationships of N pages in the first mini-program, determine the result of the first logical dependency analysis.
[0093] Specifically, S602 is the same as S402, and will not be repeated here.
[0094] S603, modify the names of N pages according to the preset modification rules to obtain the second logical dependency analysis results.
[0095] Specifically, S603 is the same as S403, which will not be repeated here.
[0096] S604, Based on the components that N pages in the first mini-program depend on, determine the dependency analysis results of the first component.
[0097] Specifically, S604 is the same as S404, and will not be repeated here.
[0098] S605, modify the names of N pages according to the preset modification rules to obtain the second component dependency analysis results.
[0099] Specifically, S605 is the same as S405, which will not be repeated here.
[0100] S606, Determine the structural information corresponding to the text and / or images in the page of the second mini-program.
[0101] In this specification, the structural information in the embodiments is used to represent the position, length, size, number, and other information of text and / or images on the page. For example, Figure 5 The pet profile page 53 contains 3 images, and the coordinates of the pet's avatar on the page are (20, 80), etc.
[0102] S607, perform dependency analysis on the structural information to obtain the first structural dependency analysis result.
[0103] The first structural dependency analysis result in the embodiments of this specification may include: the names of N pages, and the structural paths corresponding to the text or images on each page; the structural path is the path for calling structural information. For example, when a page includes multiple pet pictures, the structural information is the position and display size of each pet picture on the page. Furthermore, the position and size of the pet picture on the page can be determined by calling the structural paths of each pet picture.
[0104] It is possible that the first structural dependency analysis result in the embodiments of this specification can also be understood as a tree structure, which includes multiple nodes. The information corresponding to each node may include the name of a page and the structural path corresponding to each text and / or image on each page. For example, Figure 5The pet profile page 53 shown may include text such as "Pet ID Card," "Nickname," and "Please select pet type," as well as images such as pet avatars. Furthermore, information such as the position, size, and number of text and images in the pet profile page 53 can be obtained through structural paths, and a tree structure of the page structure can be generated based on this information, i.e., the result of the first structural dependency analysis.
[0105] S608, modify the names of N pages according to the preset modification rules to obtain the second structural dependency analysis results.
[0106] Possibly, if the text "Pet ID Card" and "Please select pet type" on the pet profile page correspond to nodes E and F respectively, it's understandable that since nodes E and F are on the same page, they are child nodes. The information corresponding to node E is: page name "abc" and the structure path that stores "Pet ID Card" (animalfile\word1\). The information corresponding to node F is: page name "abc" and the structure path that stores "Please select pet type" (animalfile\word2\).
[0107] It is understood that the embodiments of this specification can modify the names of N pages to enable the second application to obtain the structural path of the text and / or images in the page being called. For example, the preset modification rule is to uniformly modify the page names of the mini-programs in the first application to xyz.
[0108] Possibly, in embodiments of this specification, the first structural dependency analysis result can be saved to a local folder on the developer's terminal. After renaming N pages in the local folder, the modified second structural dependency analysis result can be uploaded to the server, so that the second application can recognize the structural paths of text and / or images, thereby determining the structural attributes of text and / or images in each page of the second mini-program within the second application.
[0109] S609, determine the relationship between images on at least two pages.
[0110] In the embodiments of this specification, the relationships between images refer to whether the images are the same, whether they belong to each other, etc. For example, Figure 5 The pet avatar image on page 53 of the pet profile is the same as the pet avatar image on page 54 of the "My Pets" page.
[0111] S610, perform dependency analysis on the relationship between images in at least two pages to obtain the first image dependency analysis result.
[0112] In this embodiment of the specification, the first image dependency analysis result includes the names of N pages and the image path corresponding to each image on each page; the image path is the path to call the image, that is, the image stored on the server can be obtained through this path.
[0113] It is possible that the first image dependency analysis result in the embodiments of this specification can also be understood as a tree structure, which includes multiple nodes. The information corresponding to each node may include the name of a page and the image path corresponding to each image in each page. For example, Figure 5 The pet avatar and pet profile page 53 shown are shown. Figure 5 The pet avatars on the "My Pets" page 54 shown correspond to nodes G and H, respectively. The information corresponding to node G includes: page name abc and image path animalfile\hp\. The information corresponding to node H includes: page name abc and image path animalfile\hp\. Based on the above nodes G and H, a tree structure of the images on these two pages can be generated, which is the first image dependency analysis result.
[0114] Possibly, due to Figure 5 The pet avatar image on page 53 of the "Pet Profile" section is the same as the pet avatar image on page 54 of the "My Pets" section. Therefore, the image path (animalfile\hp\) for the same image is the same across different pages.
[0115] S611, modify the names of N pages according to the preset modification rules to obtain the second image dependency analysis results.
[0116] It is understood that the embodiments of this specification can modify the names of N pages to enable the second application to obtain the image paths of images on the pages. For example, the preset modification rule is to uniformly change the page names of the mini-programs in the first application from "abc" to "xyz".
[0117] S612, based on the results of the second logical dependency analysis, the second component dependency analysis, the second structural dependency analysis, and the second image dependency analysis, generate the page of the second mini-program.
[0118] Possibly, embodiments of this specification may obtain the page logic information of the second mini-program based on the second logical dependency analysis result; obtain the page configuration information of the second mini-program based on the second component dependency analysis result; obtain the page structure information of the second mini-program based on the second structural dependency analysis result; obtain the page image information of the second mini-program based on the second image dependency analysis result; and generate the page of the second mini-program based on the page logic information, page configuration information, page structure information, and page image information of the second mini-program.
[0119] Possibly, see Figure 7 The process of building the page of the second applet in the second application in the embodiments of this specification may include four stages: initialization stage, analysis stage, compilation stage, and building stage.
[0120] Specifically, the initialization phase can include two parts: development configuration and output configuration. Development configuration can include hot reloading and input / output. Hot reloading aims to automatically refresh and output the compiled code after changes to the source code in the first mini-program. Input / output aims to determine the compilation paths for code input and output. Output configuration can include page filtering, plugin replacement, and node package management replacement. Page filtering aims to identify common pages between the first and second mini-programs. Plugin replacement aims to replace plugin types to adapt to different applications. Node package management replacement aims to replace the NPM packages of the first application in the node package manager with the NPM packages of the second application. The entry file list between the initialization and analysis phases refers to the files ultimately output by the initialization phase; that is, the second mini-program will ultimately output common and non-common pages.
[0121] Specifically, the analysis phase can include two parts: dependency analysis and file generation. The dependency analysis part includes component dependencies, page logic dependencies, page structure dependencies, and image dependencies. The purpose of page logic dependencies is to obtain the first logical dependency analysis result, the purpose of component dependencies is to obtain the first component dependency analysis result, the purpose of page structure dependencies is to obtain the first structural dependency analysis result, and the purpose of image dependencies is to obtain the first image dependency analysis result. Possibly, the aforementioned component dependencies, page logic dependencies, page structure dependencies, and image dependencies can be implemented through component dependencies, JS dependencies, sjs dependencies, and assets dependencies, respectively. The file generation part includes component localization, page logic localization, and page structure file generation. The purpose of component localization is to obtain the first component dependency analysis result, modify the page names according to predetermined rules, and store the modified second component dependency analysis result. The purpose of page logic localization is to obtain the first logical dependency analysis result, modify the page names according to predetermined rules, and store the modified second logical dependency analysis result. The purpose of page structure file generation is to obtain the first structural dependency analysis result, modify the page names according to predetermined rules, and store the modified second structural dependency analysis result.
[0122] Specifically, the four transformations in the compilation phase may include: a first transformation based on the results of the second logical dependency analysis, a second transformation based on the results of the second structural dependency analysis, a third transformation based on the results of the second component dependency analysis, and a fourth transformation based on the results of the second image dependency analysis.
[0123] Specifically, the first transformation in the compilation phase can include: syntax transformation, interface transformation, and instance replacement. Syntax transformation aims to call the page logic localization subfile in the file generation module and remove unnecessary code. Interface transformation aims to transform interface functionalities that need to be added in the second application, such as adding a payment function interface usable in the second application. Instance replacement aims to perform data isolation; for example, different pages may need to share pet counts, but when a user adds new pet profile information, the existing pet count information may not be needed temporarily. The second transformation in the compilation phase can include: conditional compilation, page structure file referencing, and attribute transformation. Conditional compilation aims to distinguish the source of the code, i.e., whether it is code from the first application or the second application. Page structure file referencing aims to call the page structure subfile in the file generation module. Attribute replacement aims to replace the attributes of images and text, as some applications may support automatic stretching while others may not. The third transformation can include: dependency path handling and cross-platform configuration replacement. Dependency path handling aims to call the component localization subfile, that is, to replace the node information in the NPM package with the node information in the local file. The purpose of cross-platform configuration replacement is to check whether the corresponding functions in the mini-programs of different applications can be matched one-to-one. The fourth transformation may include: local image conversion and code optimization. The purpose of local image conversion is to call the second image dependency analysis results and convert the binary image files on the server into a base64 format that the second application can directly use. The purpose of code optimization is to ensure that the output image is readable and occupies as little storage space as possible. It is possible that the second image dependency analysis results can be directly uploaded to the server in the form of image binary code. After local image conversion, the second application can complete the call without needing name recognition or other processes. Therefore, the second image dependency analysis results do not require localization of the file portion.
[0124] Possibly, embodiments of this specification can determine the duplicate and non-duplicate fields in the page logic information, page configuration information, page structure information, and page image information of the second mini-program; package the duplicate fields in the page logic information into a common logic information package, the duplicate fields in the page configuration information into a common configuration information package, the duplicate fields in the page structure information into a common structure information package, and the duplicate fields in the page image information into a common image information package; based on the non-duplicate fields in the page logic information, page configuration information, page structure information, and page image information, and by calling the common logic information package, the common configuration information package, the common structure information package, and the common image information package, the page of the second mini-program can be generated.
[0125] Specifically, see Figure 7 The build phase can include two parts: common file generation and code merging. Common file generation can include packaging and project configuration output. Packaging aims to bundle code with duplicate dependencies into a common package; for example, this can be done using a JS Bundle tool. Project configuration output aims to determine the final output information of the second mini-program. Code merging can include multi-platform output and compression / obfuscation. Multi-platform output aims to allow the second mini-program to be output on different platforms. Compression / obfuscation aims to remove spaces, replace variable names, etc., to reduce code size and prevent attacks.
[0126] See Figure 8 In a specific example, Figure 8A system architecture diagram illustrating a cross-platform mini-program application method from an embodiment of this specification is shown. This system architecture diagram may include six parts: a cross-platform mini-program application product, a plugin, a community analysis and build module, a community package (utils), and a tool layer (dep). It is understood that developers can complete the development of the cross-platform mini-program application product on their development terminal. This cross-platform mini-program application product may include a command-line interface (Cli) and a configuration module (Config). The command-line interface may include: a build unit (build) for building the design process, a module hot-swap (HMR) for adding new code, a watch module for monitoring code execution, and a pre-defined integrated development environment (IDE) (Cli) and project template (boilerate). The configuration module may include input / output for determining the code compilation path, a Babel compiler for compiling the code, an ESLint syntax checker for checking the accuracy of the compiled syntax, and an output platform for determining the output direction. A plugin refers to a mini-program running in the target application; an application 2 plugin refers to a mini-program running in application 2; and an application 3 plugin refers to a mini-program running in application 3. Application 2 plugin specifically includes two parts: FileGenerator for file generation and FileTranspile for file conversion. File generation includes two localized files and two other files. The two localized files are page logic and components, and the two other files are static resource files (image files in the page) and page structure files. The file conversion part includes four conversions: a first conversion, a second conversion, a third conversion, and a fourth conversion. The first conversion includes syntax / interface conversion, path conversion, and instance replacement. The third conversion includes path conversion and cross-platform configuration replacement. The fourth conversion includes image conversion and code optimization.
[0127] Understandable Figure 8File generation and conversion within the plugin can be achieved through analysis and building, community packages, and a tool layer. Analysis and building can include two parts: dependency analysis and unified building. Dependency analysis can include: the entry file `PageEntry`, components, image dependency analysis results, structural dependency analysis results (XML), logical dependency analysis results (JS), and component dependency analysis results (JSON). Image dependency analysis results can be implemented using CSS, specifically including: external Cascading Style Sheets (CSS) for determining relationships between images, CSS rules, and image resources. Structural dependency analysis results can be implemented using XML, specifically including: tags for identifying text and / or images, attributes for determining text and / or image size, format, and position, and page structure generation for generating text and / or images on the page. Logical dependency analysis results can be implemented using JS, including the NPM module for node package management, local modules, and page structure (sjs). Component dependency analysis results can be implemented using JSON, including: local components and node package components. The entry file can determine the local components and node package components in the component dependency analysis results; combining these two types of components yields the components of the second mini-program. A unified build process can consist of two parts: packaging and peripheral modules. Packaging can include common packages, reference path replacement, and compression / obfuscation. Peripheral modules can include: a SourceMap to store location information of the corresponding positions before and after code transformation, project configuration, and files to be copied.
[0128] Specifically, Figure 8 The community packages in this framework are open-source, reusable tools that can include: code transformation, parsers, file tools, and open-source files related to the development process. Code transformation can include tools for conversion standards, object replacement, reference syntax, and class conversion. Parsers can include external cascading style parsing and page structure parsing. File tools can include compression and copying tools. The development process can utilize open-source files such as `transformLog` (transformation log), `generateDoc` (incompatibility report), `recordError` (error log), and `NPMinstallcheck` (node package installation check). The dependency analysis portion of the build process can use tools from the tool layer to complete the construction of each unit, specifically including: the mini-program converter `antmove`, multimedia file `mpx`, the front-end resource loading / bundling tool `webpack`, and the workflow management tool `tapable`.
[0129] Therefore, this embodiment of the specification can construct the text, images, and image relationships between pages in the second mini-program based on the results of the second logical dependency analysis, the second component dependency analysis, the second structural dependency analysis, and the second image dependency analysis. Furthermore, this embodiment of the specification packages duplicate fields into a common package, thus extracting the required node packages into a common output package. This ensures a sufficiently small file size and solves the cumbersome problem of indirect construction required when using node packages in related technologies.
[0130] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0131] Figure 9 This is a schematic diagram of the structure of the cross-platform application device for mini-programs provided in the embodiments of this specification. The device is used to execute the cross-platform application method for mini-programs according to any of the embodiments described above. Figure 9 As shown, the cross-platform application device for this mini-program may include:
[0132] The acquisition module 91 is used to acquire M pages contained in the first mini-program; wherein, the first mini-program is mounted on the first application; M is a positive integer greater than 1;
[0133] The determining module 92 is used to determine a first logical dependency analysis result based on the logical relationship of N pages in the first mini-program; where N is a positive integer less than or equal to M; the first logical dependency analysis result includes the names of the N pages and the logical path corresponding to each page; the logical path is the path that calls the logical relationship;
[0134] Module 93 is used to modify the names of the N pages according to preset modification rules to obtain the second logical dependency analysis result;
[0135] The generation module 94 is used to generate the page of the second mini-program based on the result of the second logical dependency analysis; wherein the second mini-program is mounted on the second application; the first application is different from the second application.
[0136] This embodiment of the specification can obtain M pages contained in a first mini-program; determine the first logical dependency analysis result based on the logical relationship of N pages in the first mini-program; modify the names of the N pages according to preset modification rules to obtain the second logical dependency analysis result; and generate the pages of the second mini-program based on the second logical dependency analysis result. Therefore, the second mini-program in the second application of this embodiment can obtain a recognizable logical path by calling the name modification method to directly generate the required pages. This eliminates the need for developers to rewrite code according to the development languages of other application platforms, not only solving the problem of mini-programs from different platforms being unable to be directly applied across platforms, but also effectively improving the development efficiency of mini-programs.
[0137] In some embodiments, all N pages in the first mini-program depend on at least one component;
[0138] Prior to the generation module 94, the device further includes:
[0139] The first component dependency analysis result determination module is used to determine the first component dependency analysis result based on the components that N pages in the first mini-program depend on; wherein, the first component dependency analysis result includes the names of the N pages and the component path corresponding to each component in each page; the component path is the path that calls the component;
[0140] The second component dependency analysis result determination module is used to modify the names of the N pages according to the preset modification rules to obtain the second component dependency analysis result;
[0141] The generation module 94 is specifically used for:
[0142] The page of the second mini-program is generated based on the results of the second logical dependency analysis and the second component dependency analysis.
[0143] In some embodiments, N is a positive integer less than M;
[0144] After the acquisition module 91 and before the determination module 92, the device further includes:
[0145] The page determination module is used to determine the page that the second mini-program needs to generate;
[0146] The common page determination module is used to determine the common pages between the first mini program and the second mini program based on the pages that the second mini program needs to generate and the M pages contained in the first mini program;
[0147] The non-public page determination module is used to determine the non-public pages in the second mini-program based on the public pages and the pages that the second mini-program needs to generate.
[0148] The determining module 92 includes:
[0149] The first logical dependency analysis result generation unit is used to perform dependency analysis processing on the logical relationship between the public page and the non-public page, and generate the first logical dependency analysis result.
[0150] The first component dependency analysis result determination module is specifically used for:
[0151] Dependency analysis is performed on the relationships between the components that the public page and the non-public page depend on to obtain the dependency analysis results of the first component.
[0152] In some embodiments, the pages of the second mini-program include text and / or images;
[0153] Prior to the generation module 94, the device further includes:
[0154] The structural information determination module is used to determine the structural information corresponding to the text and / or images in the page of the second mini-program.
[0155] The first structural dependency analysis result is obtained by performing dependency analysis on the structural information; wherein, the first structural dependency analysis result includes: the names of the N pages, and the structural paths corresponding to the text and / or images in each page; the structural path is the path for calling the structural information;
[0156] The second structural dependency analysis result obtaining module is used to modify the names of the N pages according to the preset modification rules to obtain the second structural dependency analysis result;
[0157] The generation module 94 is specifically used for:
[0158] Based on the results of the second logical dependency analysis, the second component dependency analysis, and the second structural dependency analysis, the page of the second mini-program is generated.
[0159] In some embodiments, at least two pages of the second mini-program each include at least one image;
[0160] Prior to the generation module 94, the device further includes:
[0161] A relationship determination module is used to determine the relationship between images in the at least two pages;
[0162] The first image dependency analysis result obtaining module is used to perform dependency analysis on the relationship between images in the at least two pages to obtain a first image dependency analysis result; wherein, the first image dependency analysis result includes the names of the N pages, and the image path corresponding to each image in each page; the image path is the path that calls the image;
[0163] The second image dependency analysis result acquisition module is used to modify the names of the N pages according to the preset modification rules to obtain the second image dependency analysis result;
[0164] The generation module 94 is specifically used for:
[0165] Based on the results of the second logical dependency analysis, the second component dependency analysis, the second structural dependency analysis, and the second image dependency analysis, the page of the second mini-program is generated.
[0166] In some embodiments, the generation module 94 includes:
[0167] The first obtaining unit is used to obtain the page logic information of the second mini-program based on the result of the second logical dependency analysis;
[0168] The second obtaining unit is used to obtain the page configuration information of the second mini-program based on the dependency analysis results of the second component;
[0169] The third obtaining unit is used to obtain the page structure information of the second mini-program based on the results of the second structural dependency analysis;
[0170] The fourth obtaining unit is used to obtain the page image information of the second mini-program based on the second image dependency analysis result;
[0171] The page generation unit is used to generate the page of the second mini-program based on the page logic information, page configuration information, page structure information, and page image information of the second mini-program.
[0172] In some embodiments, the page generation unit includes:
[0173] The field determination subunit is used to determine the duplicate and non-duplicate fields in the page logic information, page configuration information, page structure information, and page image information of the second mini-program.
[0174] The common package generation subunit is used to package the duplicate fields in the page logical information to generate a logical information common package, the duplicate fields in the page configuration information to generate a configuration information common package, the duplicate fields in the page structure information to generate a structure information common package, and the duplicate fields in the page image information to generate an image information common package.
[0175] The page generation subunit is used to generate the page of the second mini-program based on the non-repeating fields in the page logical information, the page configuration information, the page structure information, and the page image information, and by calling the logical information public package, the configuration information public package, the structure information public package, and the image information public package.
[0176] It should be noted that the cross-platform application device for mini-programs provided in the above embodiments is only illustrated by the division of the above functional modules when executing the cross-platform application method for mini-programs. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the cross-platform application device for mini-programs provided in the above embodiments and the cross-platform application method embodiments for mini-programs belong to the same concept, and the implementation process is detailed in the method embodiments, which will not be repeated here.
[0177] The example numbers in this specification are for descriptive purposes only and do not represent the superiority or inferiority of the examples.
[0178] Please see Figure 10 This is a schematic diagram of the structure of an electronic device 10 provided in an embodiment of this specification. Figure 10 As shown, the electronic device 10 may include: at least one processor 11, at least one network interface 14, user interface 13, memory 15, and at least one communication bus 12.
[0179] The communication bus 12 is used to enable communication between these components.
[0180] The user interface 13 may include a display screen and a camera. Optionally, the user interface 13 may also include a standard wired interface and a wireless interface.
[0181] The network interface 14 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).
[0182] The processor 11 may include one or more processing cores. The processor 11 connects to various parts within the electronic device 10 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 15, and by calling data stored in the memory 15. Optionally, the processor 11 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 11 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display on the screen; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 11 and may be implemented as a separate chip.
[0183] The memory 15 may include random access memory (RAM) or read-only memory. Optionally, the memory 15 may include a non-transitory computer-readable storage medium. The memory 15 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 15 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 15 may also be at least one storage device located remotely from the aforementioned processor 11. Figure 10 As shown, the memory 15, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a cross-platform application program.
[0184] exist Figure 10In the illustrated electronic device 10, the user interface 13 is mainly used to provide an input interface for the user and to obtain the user's input data; while the processor 11 can be used to call the cross-platform application of the applet stored in the memory 15 and specifically perform the following operations:
[0185] Get the M pages contained in the first mini-program; where the first mini-program is mounted on the first application; M is a positive integer greater than 1;
[0186] Based on the logical relationships of N pages in the first mini-program, a first logical dependency analysis result is determined; where N is a positive integer less than or equal to M; the first logical dependency analysis result includes the names of the N pages and the logical path corresponding to each page; the logical path is the path that calls the logical relationship;
[0187] The names of the N pages are modified according to the preset modification rules to obtain the second logical dependency analysis results;
[0188] The page of the second mini-program is generated based on the result of the second logical dependency analysis; wherein the second mini-program is mounted on the second application; the first application is different from the second application.
[0189] In one possible embodiment, all N pages in the first mini-program depend on at least one component;
[0190] Before executing the page for generating the second mini-program based on the second logical dependency analysis result, the processor 11 also executes:
[0191] Based on the components that the N pages in the first mini-program depend on, a first component dependency analysis result is determined; wherein, the first component dependency analysis result includes the names of the N pages, and the component path corresponding to each component in each page; the component path is the path for calling the component;
[0192] The names of the N pages are modified according to the preset modification rules to obtain the second component dependency analysis results;
[0193] In one possible embodiment, when the processor 11 executes the page that generates the second applet based on the second logical dependency analysis result, it specifically performs the following:
[0194] The page of the second mini-program is generated based on the results of the second logical dependency analysis and the second component dependency analysis.
[0195] In one possible embodiment, N is a positive integer less than M;
[0196] After the processor 11 executes the step of obtaining the M pages contained in the first mini-program, and before determining the first logical dependency analysis result based on the logical relationship of the N pages in the first mini-program, it further executes the following:
[0197] Determine the pages that the second mini-program needs to generate;
[0198] Based on the pages that the second mini-program needs to generate and the M pages contained in the first mini-program, determine the common pages between the first mini-program and the second mini-program;
[0199] Based on the public page and the page that the second mini-program needs to generate, determine the non-public pages in the second mini-program;
[0200] When the processor 11 executes the first logical dependency analysis result based on the logical relationship of N pages in the first mini-program, it specifically performs the following:
[0201] Dependency analysis is performed on the logical relationship between the public page and the non-public page to generate the first logical dependency analysis result;
[0202] The determination of the first component dependency analysis result based on the components that N pages in the first mini-program depend on includes:
[0203] Dependency analysis is performed on the relationships between the components that the public page and the non-public page depend on to obtain the dependency analysis results of the first component.
[0204] In one possible embodiment, the page of the second applet includes text and / or images;
[0205] Before executing the page for generating the second mini-program based on the second logical dependency analysis result, the processor 11 also executes:
[0206] Determine the structural information corresponding to each text and / or image in the page of the second mini-program;
[0207] Dependency analysis is performed on the structural information to obtain a first structural dependency analysis result; wherein, the first structural dependency analysis result includes: the names of the N pages, and the structural paths corresponding to the text and / or images in each page; the structural paths are the paths for calling the structural information;
[0208] The names of the N pages are modified according to the preset modification rules to obtain the second structural dependency analysis results;
[0209] When the processor 11 executes the page for generating the second mini-program based on the second logical dependency analysis result, it specifically performs the following:
[0210] Based on the results of the second logical dependency analysis, the second component dependency analysis, and the second structural dependency analysis, the page of the second mini-program is generated.
[0211] In one possible embodiment, at least two pages of the second mini-program each include at least one image;
[0212] Before executing the page for generating the second mini-program based on the second logical dependency analysis result, the processor 11 also executes:
[0213] Determine the relationship between the images in the at least two pages;
[0214] Dependency analysis is performed on the relationships between images in the at least two pages to obtain a first image dependency analysis result; wherein, the first image dependency analysis result includes the names of the N pages and the image path corresponding to each image in each page; the image path is the path that calls the image;
[0215] The names of the N pages are modified according to the preset modification rules to obtain the second image dependency analysis results;
[0216] When the processor 11 executes the page for generating the second mini-program based on the second logical dependency analysis result, it specifically performs the following:
[0217] Based on the results of the second logical dependency analysis, the second component dependency analysis, the second structural dependency analysis, and the second image dependency analysis, the page of the second mini-program is generated.
[0218] In one possible embodiment, when the processor 11 generates the page of the second mini-program based on the second logical dependency analysis result, the second component dependency analysis result, the second structural dependency analysis result, and the second image dependency analysis result, it specifically performs the following:
[0219] Based on the results of the second logical dependency analysis, the page logic information of the second mini-program is obtained;
[0220] Based on the dependency analysis results of the second component, the page configuration information of the second mini-program is obtained;
[0221] The page structure information of the second mini-program is obtained based on the results of the second structural dependency analysis;
[0222] Based on the results of the second image dependency analysis, the page image information of the second mini-program is obtained;
[0223] Based on the page logic information, page configuration information, page structure information, and page image information of the second mini-program, the page of the second mini-program is generated.
[0224] In one possible embodiment, when the processor 11 generates the page of the second mini-program based on the page logic information, page configuration information, page structure information, and page image information of the second mini-program, it specifically performs the following:
[0225] Determine the duplicate and non-duplicate fields in the page logic information, page configuration information, page structure information, and page image information of the second mini-program;
[0226] Duplicate fields in the page logic information are packaged into a common logic information package; duplicate fields in the page configuration information are packaged into a common configuration information package; duplicate fields in the page structure information are packaged into a common structure information package; and duplicate fields in the page image information are packaged into a common image information package.
[0227] Based on the non-repeating fields in the page logic information, the page configuration information, the page structure information, and the page image information, and by calling the logic information common package, the configuration information common package, the structure information common package, and the image information common package, the page of the second mini-program is generated.
[0228] This specification also provides a computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform the above-described instructions. Figure 3 , Figure 4 , Figure 6 One or more steps in the illustrated embodiment. If the constituent modules of the aforementioned cross-platform mini-program application device are implemented as software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium.
[0229] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented, in whole or in part, as 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, all or part of the processes or functions described in the embodiments of this specification are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)).
[0230] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The aforementioned storage medium includes various media capable of storing program code, such as Read Only Memory (ROM), Random Access Memory (RAM), magnetic disks, or optical disks. Unless otherwise specified, the technical features of this embodiment and its implementation schemes can be combined arbitrarily.
[0231] The embodiments described above are merely preferred embodiments of this specification and are not intended to limit the scope of this specification. Any modifications and improvements made by those skilled in the art to the technical solutions of this specification without departing from the spirit of this specification should fall within the protection scope defined by the claims of this specification.
Claims
1. A method for cross-platform application of mini-programs, the method comprising: Get the M pages contained in the first mini-program; where the first mini-program is mounted on the first application; M is a positive integer greater than 1; Determine the page that the second mini-program needs to generate; wherein the second mini-program is hosted on a second application; the first application is different from the second application; Based on the pages that the second mini-program needs to generate and the M pages contained in the first mini-program, the common pages between the first mini-program and the second mini-program are determined; wherein, the common pages are used to represent the pages in the second mini-program that are the same as the pages in the first mini-program; Based on the public pages and the pages that the second mini-program needs to generate, the non-public pages in the second mini-program are determined; wherein, the non-public pages are used to represent the other pages in the second mini-program besides the public pages; Dependency analysis is performed on the logical relationship between the public pages and the non-public pages to generate a first logical dependency analysis result; where N is a positive integer less than M; the first logical dependency analysis result includes the names of the N pages and the logical path corresponding to each page; the logical path is the path that calls the logical relationship; each of the N pages in the first mini-program depends on at least one component; The names of the N pages are modified according to the preset modification rules to obtain the second logical dependency analysis results; Dependency analysis is performed on the relationships between the components that the public pages and the non-public pages depend on, resulting in a first component dependency analysis result. This first component dependency analysis result includes the names of the N pages and the component path corresponding to each component within each page. The component path is the path used to call the component. The names of the N pages are modified according to the preset modification rules to obtain the second component dependency analysis results; The page of the second mini-program is generated based on the results of the second logical dependency analysis and the second component dependency analysis.
2. The method according to claim 1, wherein the page of the second mini-program includes text and / or images; Before generating the page of the second mini-program based on the second logical dependency analysis result, the method further includes: Determine the structural information corresponding to each text and / or image in the page of the second mini-program; Dependency analysis is performed on the structural information to obtain a first structural dependency analysis result; wherein, the first structural dependency analysis result includes: the names of the N pages, and the structural paths corresponding to the text and / or images in each page; the structural paths are the paths for calling the structural information; The names of the N pages are modified according to the preset modification rules to obtain the second structural dependency analysis results; The process of generating the page for the second mini-program based on the second logical dependency analysis result includes: Based on the results of the second logical dependency analysis, the second component dependency analysis, and the second structural dependency analysis, the page of the second mini-program is generated.
3. The method according to claim 2, wherein at least two pages of the second mini-program each include at least one image; Before generating the page of the second mini-program based on the second logical dependency analysis result, the method further includes: Determine the relationship between the images in the at least two pages; Dependency analysis is performed on the relationships between images in the at least two pages to obtain a first image dependency analysis result; wherein, the first image dependency analysis result includes the names of the N pages and the image path corresponding to each image in each page; the image path is the path that calls the image; The names of the N pages are modified according to the preset modification rules to obtain the second image dependency analysis results; The process of generating the page for the second mini-program based on the second logical dependency analysis result includes: Based on the results of the second logical dependency analysis, the second component dependency analysis, the second structural dependency analysis, and the second image dependency analysis, the page of the second mini-program is generated.
4. The method according to claim 3, wherein generating the page of the second mini-program based on the second logical dependency analysis result, the second component dependency analysis result, the second structural dependency analysis result, and the second image dependency analysis result includes: Based on the results of the second logical dependency analysis, the page logic information of the second mini-program is obtained; Based on the dependency analysis results of the second component, the page configuration information of the second mini-program is obtained; The page structure information of the second mini-program is obtained based on the results of the second structural dependency analysis; Based on the results of the second image dependency analysis, the page image information of the second mini-program is obtained; Based on the page logic information, page configuration information, page structure information, and page image information of the second mini-program, the page of the second mini-program is generated.
5. The method according to claim 4, wherein generating the page of the second mini-program based on the page logic information, page configuration information, page structure information, and page image information of the second mini-program includes: Determine the duplicate and non-duplicate fields in the page logic information, page configuration information, page structure information, and page image information of the second mini-program; Duplicate fields in the page logic information are packaged into a common logic information package; duplicate fields in the page configuration information are packaged into a common configuration information package; duplicate fields in the page structure information are packaged into a common structure information package; and duplicate fields in the page image information are packaged into a common image information package. Based on the non-repeating fields in the page logic information, the page configuration information, the page structure information, and the page image information, and by calling the logic information common package, the configuration information common package, the structure information common package, and the image information common package, the page of the second mini-program is generated.
6. A cross-platform application device for mini-programs, the device comprising: The acquisition module is used to acquire M pages contained in the first mini-program; wherein, the first mini-program is mounted on the first application; M is a positive integer greater than 1; The page determination module is used to determine the page that the second mini-program needs to generate; wherein the second mini-program is mounted on a second application; the first application is different from the second application; The common page determination module is used to determine the common pages between the first mini-program and the second mini-program based on the pages that the second mini-program needs to generate and the M pages contained in the first mini-program; wherein, the common page is used to refer to the page in the second mini-program that is the same as the page in the first mini-program; The non-public page determination module is used to determine the non-public pages in the second mini-program based on the public pages and the pages that the second mini-program needs to generate; wherein, the non-public pages are used to represent the pages of the second mini-program other than the public pages; The determination module is used to perform dependency analysis on the logical relationship between the public pages and the non-public pages, and generate a first logical dependency analysis result; wherein, N is a positive integer less than or equal to M; the first logical dependency analysis result includes the names of the N pages and the logical path corresponding to each page; the logical path is the path that calls the logical relationship; each of the N pages in the first mini-program depends on at least one component; The module is used to modify the names of the N pages according to preset modification rules to obtain the second logical dependency analysis result; The first component dependency analysis result determination module is used to perform dependency analysis on the relationships between components that the public page and the non-public page depend on, and obtain the first component dependency analysis result; wherein, the first component dependency analysis result includes the names of the N pages, and the component path corresponding to each component in each page; the component path is the path for calling the component; The second component dependency analysis result determination module is used to modify the names of the N pages according to the preset modification rules to obtain the second component dependency analysis result; The generation module is used to generate the pages of the second mini-program based on the results of the second logical dependency analysis and the results of the second component dependency analysis.
7. A program product, characterized in that, The program product includes instructions that, when executed on a computer, cause the computer to perform the steps of the method as described in any one of claims 1 to 5.
8. A computer storage medium storing a plurality of instructions adapted for loading by a processor and executing the method steps of any one of claims 1-5.
9. An electronic device, comprising: A processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and executed the method steps as claimed in any one of claims 1-5.
Citation Information
Patent Citations
Small program cross-end application method, related device and computer storage medium
CN114579182A
Method and apparatus for converting a website into a native mobile application
US9448776B1