CN115934093A - Applet cross-terminal application method, related device and computer storage medium - Google Patents
Applet cross-terminal application method, related device and computer storage medium Download PDFInfo
- Publication number
- CN115934093A CN115934093A CN202211347501.8A CN202211347501A CN115934093A CN 115934093 A CN115934093 A CN 115934093A CN 202211347501 A CN202211347501 A CN 202211347501A CN 115934093 A CN115934093 A CN 115934093A
- Authority
- CN
- China
- Prior art keywords
- page
- applet
- analysis result
- logic
- pages
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 76
- 238000003860 storage Methods 0.000 title claims abstract description 16
- 238000004458 analytical method Methods 0.000 claims abstract description 276
- 238000012986 modification Methods 0.000 claims abstract description 42
- 230000004048 modification Effects 0.000 claims abstract description 42
- 230000001419 dependent effect Effects 0.000 claims description 22
- 238000004806 packaging method and process Methods 0.000 claims description 17
- 238000012545 processing Methods 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 6
- 238000006243 chemical reaction Methods 0.000 description 22
- 230000006870 function Effects 0.000 description 19
- 238000010586 diagram Methods 0.000 description 18
- 238000011161 development Methods 0.000 description 16
- 230000008569 process Effects 0.000 description 13
- 230000004807 localization Effects 0.000 description 8
- 230000009466 transformation Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 7
- 238000010276 construction Methods 0.000 description 7
- 230000006835 compression Effects 0.000 description 4
- 238000007906 compression Methods 0.000 description 4
- 238000007726 management method Methods 0.000 description 4
- 238000001914 filtration Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000001954 sterilising effect Effects 0.000 description 2
- 238000004659 sterilization and disinfection Methods 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 241000282326 Felis catus Species 0.000 description 1
- 230000000712 assembly Effects 0.000 description 1
- 238000000429 assembly Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000009395 breeding Methods 0.000 description 1
- 230000001488 breeding effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 201000010099 disease Diseases 0.000 description 1
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 1
- 235000004280 healthy diet Nutrition 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000000366 juvenile effect Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000010419 pet care Methods 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 230000010076 replication Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Stored Programmes (AREA)
Abstract
The embodiment of the specification discloses an applet cross-end application method, a related device and a computer storage medium, wherein the method comprises the following steps: and determining a first logic dependence analysis result according to the obtained logic relationship of the M pages in the first small program, modifying the names of the N pages in the first logic dependence analysis result according to a preset modification rule to obtain a second logic dependence analysis result, and further generating a page of the second small program based on the second logic dependence analysis result.
Description
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to an applet cross-end application method, a related apparatus, and a computer storage medium.
Background
The concept of 'walking after use' causes a wave of applets, the excellent use experience of applets, a convenient propagation mode, and the improvement of development efficiency brought by rich component Application Programming Interfaces (API) attracts a large number of users, but applets in various Application programs (APP) cannot be directly applied across platforms due to different development languages.
Disclosure of Invention
The embodiment of the specification provides an applet cross-end application method, a related device and a computer storage medium, which can solve the problem that applets between different platforms cannot be directly applied in a cross-platform mode.
In a first aspect, an embodiment of the present specification provides an applet cross-end application method, where the method includes:
acquiring M pages contained in a first applet; the first applet is loaded in a first application program; m is a positive integer greater than 1;
determining a first logic dependence analysis result based on the logic relation of N pages in the first applet; wherein N is a positive integer less than or equal to M; the first logic dependence analysis result comprises the names of the N pages and a logic path corresponding to each page; the logic path is a path for calling the logic relationship;
modifying the names of the N pages according to a preset modification rule to obtain a second logic dependence analysis result;
generating a page of a second applet based on the second logical dependency analysis result; wherein the second applet is loaded on a second application; the first application is different from the second application.
In a second aspect, the present specification provides an applet cross-end application apparatus, the apparatus comprising:
the acquisition module is used for acquiring M pages contained in the first applet; the first applet is loaded in a first application program; m is a positive integer greater than 1;
the determining module is used for determining a first logic dependence analysis result based on the logic relation of N pages in the first applet; wherein N is a positive integer less than or equal to M; the first logic dependence analysis result comprises the names of the N pages and a logic path corresponding to each page; the logic path is a path for calling the logic relationship;
the obtaining module is used for modifying the names of the N pages according to a preset modification rule to obtain a second logic dependence analysis result;
a generating module, configured to generate a page of a second applet based on the second logical dependency analysis result; wherein the second applet is loaded on a second application; the first application is different from the second application.
In a third aspect, the specification embodiments provide a program product comprising instructions which, when run on a computer, cause the computer to perform the method steps described above.
In a fourth aspect, the illustrative embodiments provide a computer storage medium having stored thereon a plurality of instructions adapted to be loaded by a processor and to carry out the method steps described above.
In a fifth aspect, embodiments of the present specification provide an electronic device, which may include: a processor and a memory;
wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
The technical scheme provided by some embodiments of the present description brings beneficial effects at least including:
the embodiment of the present specification may obtain M pages included in the first applet; determining a first logic dependence analysis result based on the logic relation of N pages in the first applet; modifying the names of the N pages according to a preset modification rule to obtain a second logic dependence analysis result; a page of the second applet is generated based on the second logical dependency analysis result. Therefore, the second applet in the second application in the embodiment of the description can obtain the recognizable logic path by calling the modification name to directly generate the required page, so that a developer does not need to rewrite codes according to the development languages of other application terminals, the problem that the applets between different platforms cannot be directly applied across the platforms is solved, and the development efficiency of the applets is effectively improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present specification, the drawings required to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present specification, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
FIG. 1 illustrates a page diagram of an applet in an application program in connection with an embodiment of the present description;
FIG. 2a is a diagram illustrating an application scenario of an applet cross-end application method according to an embodiment of the present specification;
FIG. 2b illustrates a page diagram generated by the applet cross-end application method of an embodiment of the present specification;
FIG. 3 is a flowchart illustrating an applet cross-end application method provided in an embodiment of the present specification;
FIG. 4 is a flow chart illustrating another applet cross-end application method provided by an embodiment of the present specification;
FIG. 5 is a diagram illustrating a page generated by another applet cross-application method provided by an embodiment of the present specification;
FIG. 6 is a flowchart illustrating another applet cross-end application method provided in an embodiment of the present specification;
FIG. 7 is a schematic diagram illustrating a page building process of an applet cross-end application method according to an embodiment of the present specification;
FIG. 8 is a diagram illustrating a system architecture of an applet cross-end application method in an embodiment of the present specification;
fig. 9 is a schematic structural diagram of an applet cross-end application device provided in an embodiment of the present specification;
fig. 10 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification.
Detailed Description
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the specification, as detailed in the claims that follow.
In the description herein, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The specific meanings of the above terms in the present specification can be understood in specific cases by those of ordinary skill in the art. Further, in the description of the present specification, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Fig. 1 is a page diagram illustrating an applet in an application program according to an embodiment of the present specification. Specifically, the page belongs to one of local applets "pet id cards" in the application 1, and can show pet information such as pet type, pet name, sex character, birth date, sterilization condition, and the like.
It should be understood that the local applet in this specification refers to an applet developed by a development terminal of the application 1, and a developer can upload the applet to a server, so that other applications can call up data related to the local applet in the application 1 through the server.
Fig. 2a shows an application scenario diagram of the applet cross-end application method in the embodiment of the present specification. The applet cross-end application method provided by the embodiment of the specification can be applied to a server. Specifically, the applet cross-end application method in the embodiment of the present specification may implement calling the "pet id" applet in the application program 1 to the application program 2 through the server. For example, the user may use the local applet "pet id" in the application 1 of the mobile phone to purchase pet insurance for his pet cat, or may use the applet "pet id" called in the application 2 of the mobile phone to purchase pet insurance. When a user purchases pet insurance using the "pet identification card" applet in the application 2, the application 2 needs to send a request for obtaining data related to the "pet identification card" applet to a server storing data related to the application 1 to generate respective pages of the "pet identification card" applet in the application 2.
Wherein the server may be connected to the terminal via a network. The network is used to provide a communication link between the terminal and the server. The network may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few. Terminals include, but are not limited to: wearable devices, handheld devices, personal computers, tablet computers, in-vehicle devices, smart phones, computing devices or other processing devices connected to a wireless modem, and the like.
It should be understood that the number of terminals, networks, and servers in fig. 2a is merely illustrative. There may be any number of terminals, networks, and servers, as desired for the particular application. For example, the server may be a server cluster composed of a plurality of servers. The user can use the server to interact with the terminal through the network so as to obtain the optimized version and the like.
Specifically, the server in this embodiment may be a third-party server, for example, a public server that stores data of the first application and data of the second application at the same time, and the terminal may request the third-party server for data related to the first applet in the first application. The server in this embodiment may also be a server cluster formed by a plurality of servers, for example, the terminal may request the server of the first application program for the data related to the first applet through the server of the second application program.
FIG. 2b shows a page diagram generated by the applet cross-end application method of the embodiment of the present specification. Possibly, since the "pet id" applet in the application 1 is its local applet, no login page is needed, but the user needs to enter the login page 21 first when using the applet in the application 2, enter the wait page 22 after the login is successful, and enter the page in the "pet id" applet shown in fig. 1 after the jump completed by the wait page 22.
Next, a page diagram of an applet in an application related to the embodiment of the present specification introduced in fig. 1, an application scenario diagram of an applet cross-end application method in the embodiment of the present specification introduced in fig. 2a, and a page diagram generated by the applet cross-end application method in the embodiment of the present specification introduced in fig. 2b are combined to introduce the applet cross-end application method provided in the embodiment of the present specification.
In one embodiment, as shown in fig. 3, a flowchart of an applet cross-end application method is provided. As shown in fig. 3, the applet cross-end application method may include the following steps:
s301, M pages contained in the first applet are obtained.
A first applet in the embodiment of the specification is loaded in a first application; m is a positive integer greater than 1.
It will be appreciated that the first applet is a native applet to the first application. Possibly, the first applet may contain a plurality of pages, for example, where the first applet is a "pet identification card" applet, it may include: pet profile pages, pet photo pages, pet insurance pages, pet care encyclopedia pages, online inquiry pages, and the like.
S302, determining a first logic dependence analysis result based on the logic relation of N pages in the first applet.
Wherein N in the embodiments of the present description is a positive integer less than or equal to M. The first logic dependence analysis result comprises the names of the N pages and the logic path corresponding to each page. A logical path is a path that invokes a logical relationship.
Specifically, the logical relationship is used to represent the jump relationship between pages, for example, clicking the "back" button on a page in the first applet jumps to the previous page, and clicking the "next" button jumps to the next page. The logical path may be understood as a path that needs to be invoked to generate the previous page when the user clicks a "back" button in the current page.
It will be appreciated that when an applet in the second application calls all pages of the applet in the first application, N is a positive integer equal to M; when the applet in the second application calls the partial page of the applet in the first application, N is a positive integer less than M.
Specifically, the names of N pages in the embodiments of the present specification are uniform, for example, the names of N pages are all abc.
Possibly, the first logical dependency analysis result in this embodiment may be understood as a tree structure, where the tree structure includes N nodes, and the information corresponding to each node may include a name of a page, and each page corresponds to at least one logical path. For example, the interdependence between the pet profile page and the pet photo page is: clicking on the picture of the pet profile page may enter the pet picture page. Further, if the pet file page corresponds to the node a and the pet photo page corresponds to the node B, the node a and the node B are in a parent-child relationship, the node a is a parent node, the node B is a child node, and the information corresponding to the node a is as follows: the page name abc and the logic path animalfile \ for storing the pet file page are called. The information corresponding to the node B is: the page name abc and the logic path animalfile \ photos \ for storing the pet photo page are called.
S303, modifying the names of the N pages according to a preset modification rule to obtain a second logic dependence analysis result.
The preset modification rule is a preset rule for modifying page names, and it can be understood that in the embodiments of the present specification, the names of N pages may be modified, so that the second application program may obtain a logic path of a page in the calling applet. For example, the preset modification rule is to modify the page name of the applet in the first application program into xyz uniformly.
Possibly, the developer of the first application program can upload the software Package developed by the developer to a Node Package Manager (NPM), and other developers can refer to the Package through the centralized service provided by the NPM, so as to reduce the development cost. However, in the development specifications of applets of different platforms, the support degree of these software packages may be different, and an applet in a second application may not be able to directly use the NPM package, so that the name of an applet page in a first application needs to be modified so that the second application can call the NPM package.
It is understood 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 of the first logical dependency analysis result is modified, the information corresponding to the node a in the second logical dependency analysis result is: the page name xyz and the logical path animation file for calling and storing the pet file page. The information corresponding to the node B is: the page name xyz and the logical path animation \ photos \ for storing the pet photo page are called.
Possibly, in the embodiment of the present specification, the first logic dependency analysis result may be stored in a local folder of the developer terminal, the names of the N pages are modified according to a preset modification rule, and the modified second logic dependency analysis result is uploaded to the server. Specifically, in this embodiment, the process of modifying the names of the N pages may be automatically identified and modified in a unified manner by the developer terminal, or may be manually modified by the developer terminal.
S304, generating a page of the second small program based on the second logic dependence analysis result.
Wherein, the second applet in the embodiment of the present specification is installed in the second application; the first application is different from the second application.
It is to be understood that the second applet is developed based on the first applet in the first application.
Possibly, the number of pages of the second applet may not be equal to the number of pages of the first applet due to the fact that registration, login, authentication of user information, and functions that can be implemented in the second application cannot be one-to-one.
In a specific embodiment, 3 pages included in the applet A1 in the application 1 are obtained: the pet file page, the pet photo page and the pet encyclopedia page are based on the jump relationship of the 3 pages in the small program A1, a first logic dependence analysis result is determined, and the pet file page can jump to the pet photo page and the pet encyclopedia page respectively. The names of the 3 pages included in the first logic dependence analysis result are abc, the logic path corresponding to the pet file page is animalfile \ the logic path corresponding to the pet photo page is animalfile \ photos \ and the logic path corresponding to the pet encyclopedia page is animalfile \ info \ the first logic dependence analysis result is abc. Further, the first logical dependency analysis result may be obtained from the NPM and stored in the local folder, the names of the 3 pages of the applet A1 are modified from abc to xyz according to the preset specified name, the second logical dependency analysis result is obtained, and the second logical dependency analysis result is uploaded to the NPM. Further, the application 2 can call the logical path of the page through the NPM to generate the corresponding 3 pages in the applet A2.
The embodiment of the present specification may obtain M pages included in the first applet; determining a first logic dependence analysis result based on the logic relation of N pages in the first applet; modifying the names of the N pages according to a preset modification rule to obtain a second logic dependence analysis result; generating a page of the second applet based on the second logical dependency analysis result. Therefore, the second applet in the second application in the embodiment of the description can obtain the recognizable logic path by calling the modification name to directly generate the required page, so that a developer does not need to rewrite codes according to the development languages of other application terminals, the problem that the applets between different platforms cannot be directly applied across the platforms is solved, and the development efficiency of the applets is effectively improved.
In some embodiments, each of the N pages in the first applet depends on at least one component. The component refers to a set formed by a specific specification, and one component can realize one or more functions, for example, functions of a pet list, a picture list and the like. Further, a page dependent on at least one component may be understood as a page that may implement at least one function, e.g., the current page may implement a camera function.
In one embodiment, as shown in fig. 4, an embodiment of the present specification provides a flowchart of an applet cross-end application method. As shown in fig. 4, the applet cross-end application method may include the following steps:
s401, M pages contained in the first applet are obtained.
Possibly, determining a page which needs to be generated by the second applet; determining a common page between the first small program and the second small program based on a page required to be generated by the second small program and M pages contained in the first small program; and determining the non-public pages in the second small program based on the public pages and the pages which need to be generated by the second small program.
The common page in the embodiment of the present specification is used to indicate a page in the second applet, which is the same as the page of the first applet, and the non-common page is used to indicate another page of the second applet except the common page. For example, since the "pet id" page 23 in the second application of fig. 2b is the same as the "pet id" page of the first application of fig. 1, the "pet id" page 23 in the second application of fig. 2b is a public page. Since the second applet is not local to the second application, it is necessary to add a login page and a wait page to verify the user identity and wait for obtaining the relevant data in the first application from the server, so the login page 21 and the wait page 22 in fig. 2b are non-public pages in the second applet.
It is understood that the present specification embodiment may preset the pages that need to be generated in the second application and the jump sequence of the pages.
Specifically, in the embodiments of the present description, a common page between the first applet and the second applet may be determined through page comparison or page filtering, and then a non-common page in the second applet may be determined based on the common page and a page that needs to be generated by the second applet.
S402, determining a first logic dependence analysis result based on the logic relation of N pages in the first applet.
Possibly, the embodiments of the present specification may perform dependency analysis processing on a logical relationship between a common page and a non-common page, and generate a first logical dependency analysis result. Specifically, the logical relationship between the common page and the non-common page may be determined by determining the jump sequence between the common page and the non-common page, and then determining the first logical dependency analysis result according to the logical relationship.
And S403, modifying the names of the N pages according to a preset modification rule to obtain a second logic dependence analysis result.
Specifically, S403 corresponds to S303, and is not described herein again.
S404, determining a first component dependence analysis result based on the N page dependence components in the first applet.
Possibly, the embodiments of the present specification may perform dependency analysis processing on a relationship between a common page and a component that is not dependent on the common page, to obtain a first component dependency analysis result.
Specifically, the relationship between the common page dependent component and the non-common page dependent component can be determined by determining the interrelationship between each component in the common page and each component in the non-common page, and then the first component dependency analysis result is determined according to the relationship.
The first component dependency analysis result in this embodiment may include names of N pages and a component path corresponding to each component in each page; the component path is the path that invokes the component. For example, a pet picture list of the current user needs to be displayed in the page, and the component path may be understood as a path charts \ animalphotons \ of calling the pet picture list, that is, a pet picture list function may be implemented in the page by executing the path. Specifically, the names of N pages in the embodiments of the present specification are uniform, for example, the names of N pages are all abc.
Possibly, the first component dependency analysis result in this embodiment may be understood as a tree structure, where the tree structure includes a plurality of nodes, and the information corresponding to each node may include a name of a page and a component path corresponding to a component in the page. For example, the pet profile page 53 shown in FIG. 5 may include components for selecting a pet type, filling out pet information, a "next" button, and so forth. After the pet information is obtained, a 'next' key can be clicked to generate a 'my pet' page, and the page can comprise components such as pet head portraits, pet growth periods (pet raising awareness, juvenile period, adolescence and the like), pet common sense (disease control, breeding sterilization, healthy diet and the like) and the like. It will be appreciated that the "next" button has a dependency relationship with the various components in the "my pets" page. Therefore, the embodiment of the specification can construct a tree structure of the components through the page and the mutual relationship among the components in the page.
S405, modifying the names of the N pages according to a preset modification rule to obtain a second component dependence analysis result.
Possibly, if the component of the "next" button in the pet file page corresponds to a node C, and the component of the pet growing period in the "my pet" page corresponds to a node D, the node C and the node D are in a parent-child relationship, the node C is a parent node, the node D is a child node, and the information corresponding to the node C is: the page name abc and a component path animalfile \ next \ for calling and storing a next button in the pet file page. The information corresponding to the node D is as follows: the page name abc and the component path creatures \ generations \ of the pet growth period in the call My Pet page.
It is understood that the embodiments of the present specification may modify the names of the N pages so that the second application program may obtain the component path of the component in the calling page. For example, the preset modification rule is to modify the page name of the applet in the first application program into xyz uniformly.
It is understood that the second component-dependent analysis result is the first component-dependent analysis result with the page name modified, that is, the second component-dependent analysis result can be understood as a tree structure. For example, after the name of the first component-dependent analysis result is modified, the information corresponding to the node C in the second component-dependent analysis result is: the page name xyz and the component path animation file \ next \ of the next button in the page for storing the pet file are called. The information corresponding to the node D is as follows: the page name xyz and the component path myanimal \ generations \ of the pet growth period in the call My Pet page.
Possibly, in the embodiment of the present specification, the first component dependency analysis result may be stored in a local folder of the developer terminal, the names of the N pages are modified according to a preset modification rule, a second logic dependency analysis result obtained after modification is completed, and the modified second component dependency analysis result is uploaded to the server, so that each page in the second applet in the second application program can implement a preset component function.
S406, generating a page of the second applet based on the second logic dependence analysis result and the second component dependence analysis result.
It is understood that the embodiments of the present specification may determine, through the second logic dependency analysis result, a jump order of pages in the second applet, and determine, through the second component dependency analysis result, a dependency relationship between components within each page or between pages in the second applet. Further, the page of the second applet may be generated by the order of the pages' jumps and the relationship between the components within the page.
Referring to fig. 5, in a specific embodiment, 3 pages included in the applet A1 in the application 1 are obtained: a pet file page, a my pet page, a pet photo page, a pet encyclopedia page, and a page required by the applet A2 in the application program 2, which is preset: landing page 51, waiting page 52, pet profile page 53, "my pets" page 54, may determine that the common page between application 1 and application 2 is: pet profile page 53, "My pets" page 54, non-public pages are: a login page 51, a wait page 52. Based on the jump relationship of these 4 pages in the applet A2, it is determined that the first logical dependency analysis result may be from the login page 51 to the wait page 52 to the pet profile page 53 to the "my pet" page 54. The first component dependency analysis result is determined based on the dependency relationship between the components in the pet profile page 53 and the my pet page 54 in the applet A2. Further, the page names in the first logic dependence analysis result and the first component dependence analysis result are modified to obtain a second logic dependence analysis result and a second component dependence analysis result, the second logic dependence analysis result and the second component dependence analysis result are uploaded to the NPM, and the second application program can call the logic path of the page and the component path in the page through the NPM to generate 4 pages preset in the applet A2.
Therefore, the second applet in the second application in the embodiment of the present specification may obtain the identifiable logic path and component path by calling the modification name to directly generate the required page and the component in the page, which not only realizes the calling of the logic relationship between the pages, but also realizes the calling of the functions of each component in the page, and effectively improves the development efficiency.
In some embodiments, the page of the second applet may include text and/or pictures. The at least two pages of the second applet may each include at least one picture.
In one embodiment, as shown in fig. 6, an embodiment of the present specification provides a flowchart of an applet cross-end application method. As shown in fig. 6, the applet cross-end application method may include the following steps:
s601, M pages contained in the first applet are obtained.
Specifically, S601 is identical to S401, and is not described herein again.
S602, determining a first logic dependence analysis result based on the logic relationship of the N pages in the first applet.
Specifically, S602 is identical to S402, and is not described herein again.
S603, modifying the names of the N pages according to a preset modification rule to obtain a second logic dependence analysis result.
Specifically, S603 is identical to S403, and is not described herein again.
S604, determining a first component dependence analysis result based on N page dependence components in the first applet.
Specifically, S604 is identical to S404, and is not described herein again.
S605, modifying the names of the N pages according to a preset modification rule to obtain a second component dependence analysis result.
Specifically, S605 is identical to S405, and is not described herein again.
S606, determining the structure information corresponding to the characters and/or pictures in the page of the second small program.
The structural information in the embodiments of the present specification is used to indicate information such as positions, lengths, sizes, and numbers of characters and/or pictures in a page. For example, the number of pictures on the pet profile page 53 in fig. 5 is 3, and the coordinate position of the pet avatar on the page is (20, 80).
S607, the dependency analysis is carried out on the structure information to obtain a first structure dependency analysis result.
The first structure dependency analysis result in this embodiment of the present specification may include: the name of N pages and the structure path corresponding to the characters or pictures in each page; the structure path is a path for calling the structure information. For example, when the page includes a plurality of pet pictures, the structural information is the position and the display size of each pet picture in the page, and further, the position and the size of each pet picture in the page can be determined by calling the structural path of each pet picture.
Possibly, the first structure dependency analysis result in this embodiment may also be understood as a tree structure, where the tree structure includes a plurality of nodes, and the information corresponding to each node may include a name of one page and a structure path corresponding to each text and/or picture in each page. For example, the pet profile page 53 shown in FIG. 5 may include words such as "pet ID", "nickname", "please select pet type", etc., and pictures such as a pet avatar. Further, information such as the position, size, number, etc. of the text and the picture in the pet profile page 53 can be obtained through the structure path, and a tree structure of the page structure, that is, a first structure dependency analysis result, is further generated based on the information.
S608, modifying the names of the N pages according to a preset modification rule to obtain a second structure dependence analysis result.
Possibly, if the words "pet id" and "please select pet type" in the pet file page correspond to the node E and the node F, respectively, it can be understood that the node E and the node F are in a child relationship because the node E and the node F are on the same page. The information corresponding to the node E is: the page name abc and a structural path animalfile \ word1\ for calling and storing the pet identity card are included. The information corresponding to the node F is: the page name abc and a structure path animalfile \ word2\ for calling and storing the 'please select the pet type'.
It is understood that, in the embodiments of the present specification, names of N pages may be modified, so that the second application may obtain a structural path for calling structural information of characters and/or pictures in the page. For example, the preset modification rule is to modify the page name of the applet in the first application program to xyz uniformly.
Possibly, in the embodiment of the present specification, the first structure dependency analysis result may be first stored in a local folder of the developer terminal, and after the names of the N pages are modified in the local folder, the modified second structure dependency analysis result is uploaded to the server, so that the second application program may identify the structure path of the text and/or the picture, thereby determining the structure attribute of the text and/or the picture in each page in the second applet in the second application program.
And S609, determining the relation between the pictures in at least two pages.
In the embodiments of the present specification, the relationship between pictures indicates whether the pictures are the same or not, and whether the pictures belong to the same or not. For example, the picture of the pet avatar in the pet profile page 53 in FIG. 5 is the same as the picture of the pet avatar in the "My Pet" page 54.
S610, performing dependency analysis on the relationship between the pictures in the at least two pages to obtain a first picture dependency analysis result.
The first picture dependency analysis result in the embodiment of the present specification includes names of N pages and a picture path corresponding to each picture in each page; the picture path is a path for calling a picture, that is, a picture stored in the server can be acquired through the path.
Possibly, the first picture dependency analysis result in this embodiment may also be understood as a tree structure, where the tree structure includes a plurality of nodes, and the information corresponding to each node may include a name of one page and a picture path corresponding to each picture in each page. For example, the pet avatar in the pet profile page 53 shown in fig. 5 and the pet avatar in the my pet page 54 shown in fig. 5 correspond to nodes G and H, respectively, and the information corresponding to the node G includes: the page name abc and the picture path animalfile \ hp \ and the information corresponding to the node H comprises: the page names abc and the picture paths animalfile \ hp \ further generate tree structures of pictures in the two pages based on the node G and the node H, namely a first picture dependence analysis result.
Possibly, since the picture of the pet avatar in the pet profile page 53 in fig. 5 is the same as the picture of the pet avatar in the "my pet" page 54, the picture paths (animation file \ hp \) of the same picture retrieval picture of different pages are the same.
S611, modifying the names of the N pages according to a preset modification rule to obtain a second picture dependence analysis result.
It is understood that, in the embodiments of the present specification, the names of the N pages may be modified, so that the second application may obtain a picture path for calling a picture in the page. For example, the preset modification rule is to uniformly modify the page name of the applet in the first application program from abc to xyz.
And S612, generating a page of the second applet based on the second logic dependence analysis result, the second component dependence analysis result, the second structure dependence analysis result and the second picture dependence analysis result.
Possibly, the embodiments of the present description may obtain page logic information of the second applet based on the second logic dependency analysis result; obtaining page configuration information of the second applet based on the second component dependence analysis result; obtaining page structure information of the second applet based on the second structure dependence analysis result; obtaining page picture information of the second applet based on the second picture dependence analysis result; and generating a page of the second small program based on the page logic information, the page configuration information, the page structure information and the page picture information of the second small program.
Possibly, referring to fig. 7, the building process of the page of the second applet in the second application in this embodiment of the specification may include: the method comprises four stages of an initialization stage, an analysis stage, a compiling stage and a construction stage.
Specifically, the initialization phase may include both developing the configuration and outputting the configuration. Wherein developing the configuration may include: hot updates and input-output. The purpose of the hot update is that the compiled code can be automatically refreshed and output after the source code in the first applet is changed. The purpose of the input and output is to determine the compilation path of the code input and output. The output configuration may include: page filtering, plug-in replacement, and node package management replacement. Wherein the purpose of the page filtering is to determine common pages in the first applet and the second applet. The purpose of plug-in replacement is to replace the type of plug-in to accommodate different applications. The purpose of the node packet management replacement is to replace the NPM packet of the first application with the NPM packet of the second application in the node packet manager. The entry file list between the initialization stage and the analysis stage refers to the file finally output by the initialization stage, that is, the second applet finally outputs the public page and the non-public page.
In particular, the analysis phase may comprise: dependence analysis and file generation. Wherein the dependency analysis section includes: component dependencies, page logic dependencies, page structure dependencies, and picture dependencies. The purpose of the page logic is to obtain a first logic dependence analysis result, the purpose of the component dependence is to obtain a first component dependence analysis result, the purpose of the page structure dependence is to obtain a first structure dependence analysis result, and the purpose of the picture dependence is to obtain a first picture dependence analysis result. Possibly, the component dependency, the page logic dependency, the page structure dependency, and the picture dependency described above may be implemented by component dependency, JS dependency, sjs dependency, and assets dependency, in turn. The file generation section includes: component localization, page logic localization, and page structure file generation. The purpose of component localization is to obtain a first component dependence analysis result, modify a page name in the first component dependence analysis result according to a preset rule, and store a second component dependence analysis result obtained after modification. The purpose of the page logic localization is to obtain a first logic dependence analysis result, modify the page name in the first logic dependence analysis result according to a preset rule, and store a second logic dependence analysis result obtained after modification. The purpose of generating the page structure file is to obtain a first structure dependence analysis result, modify the page name of the first structure dependence analysis result according to a preset rule, and store a second structure dependence analysis result obtained after modification.
Specifically, four transformations in the compilation stage may include: a first transformation based on the second logical dependency analysis result, a second transformation based on the second structural dependency analysis result, a third transformation based on the second component dependency analysis result, and a fourth transformation based on the second picture dependency analysis result.
In particular, the first transformation in the compilation stage may include: syntax conversion, interface conversion, and instance substitution. The purpose of the grammar conversion is to call page logic localization sub-files in the file generation module and remove unnecessary codes in the page logic localization sub-files. The purpose of the interface conversion is to convert the interface function that needs to be added in the second application, for example, adding a payment function interface that can be used for the second application. The purpose of instance replacement is to isolate data, for example, the number of pets may need to be shared between different pages, but the user may not need the information of the number of pets before adding the profile information of new pets. The second conversion in the compilation stage may include: conditional compilation, page structure file referencing, and attribute translation. The purpose of conditional compilation is to distinguish between the source of the code, i.e. the code of the first application or the code of the second application. The purpose of the page structure file reference is to invoke a page structure subfile in the file generation module. The purpose of attribute replacement is that some application programs may support automatic stretching and some may not support images and characters, and therefore, the attributes of the images and the characters need to be replaced. The third conversion may include: dependent path processing and cross-end configuration replacement. The purpose of the dependent path processing is to invoke the component localization sub-file, that is, the node information in the NPM packet is replaced by the node information in the local file. The purpose of cross-terminal configuration replacement is to check whether the corresponding functions in the applets in different applications can be in one-to-one correspondence. The fourth conversion may include: native picture conversion and optimization code. The purpose of the local picture conversion is to call the second picture dependency analysis result and convert the binary file picture on the server into a base64 format that can be directly applied by the second application program. The purpose of optimizing the code is to ensure that the output picture can be read and the occupied storage space reaches the minimum value as much as possible. Possibly, the second picture dependence analysis result can be directly uploaded to the server in the form of a binary code of the picture, and after the local picture is converted, the second application program can complete calling without processes such as name recognition and the like, so that the second picture dependence analysis result does not need a file part to perform localization processing on the second picture dependence analysis result.
Possibly, embodiments of the present description may determine the repeated fields and the non-repeated fields in the page logic information, the repeated fields and the non-repeated fields in the page configuration information, the repeated fields and the non-repeated fields in the page structure information, and the repeated fields and the non-repeated fields in the page picture information of the second applet; packaging repeated fields in the page logic information to generate a logic information public packet, packaging repeated fields in the page configuration information to generate a configuration information public packet, packaging repeated fields in the page structure information to generate a structure information public packet, and packaging repeated fields in the page picture information to generate a picture information public packet; and calling the logic information public packet, the configuration information public packet, the structure information public packet and the picture information public packet based on the non-repeated field in the page logic information, the non-repeated field in the page configuration information, the non-repeated field in the page structure information and the non-repeated field in the page picture information, and generating the page of the second applet.
In particular, referring to fig. 7, the construction phase may include: the method comprises the steps of generating a public file and combining codes. Wherein the public file generation may include: packaging and project configuration output. The purpose of packaging is to package the code with repeated dependency into a public package, and for example, the method can be completed by adopting a JS Bundle punch tool. The purpose of the project configuration output is to determine the information that the second applet will ultimately output. The code merging may include: multi-ended output and compression aliasing. Wherein the purpose of the multi-port output is to enable different platforms to output the second applet. The purpose of compression obfuscation is to remove spaces in the code, replace variable names, etc. to reduce the code volume, prevent the code from being attacked.
Referring to FIG. 8, in a specific example, FIG. 8 shows a system architecture diagram of an applet cross-end application method in an embodiment of the present specification. Wherein the system architecture diagram may include: 6 parts of cross-end application product, plug-in plugin, analysis and construction commom, community packages, tool layer dep and the like of the applet. It will be appreciated that developers may develop an applet cross-terminal application product after their development terminal has been completed, which may include a command line interface Cli and a configuration Config module. Wherein, the command line interface may include: the system comprises a building unit build for building a design flow, a module hot replacement HMR for adding new codes, a detection module watch for monitoring code running, and a preset integrated development environment IDE Cli and a project template build. The configuration module may include input/output for determining a code compiling path, a compiler Babel for compiling the code, a syntax check esline for checking whether a compiling syntax is accurate, and an output platform for determining an output direction. Plug-ins refer to applets running in the target application, application 2 plug-ins refer to applets running in application 2, and application 3 plug-ins refer to applets running in application 3. The application 2 plug-ins may specifically include: file generation and file transformation are two parts. The file generation may include two localized files and two other files, the two localized files being: page logic and components, two other files are: static resource files (picture files in pages) and page structure files. The file conversion part may include: a first conversion, a second conversion, a third conversion, and a fourth conversion. Wherein the first converting may include: syntax/interface conversion, path conversion, instance substitution. The third conversion may include: path switching and cross-end configuration replacement. And fourth conversion: picture conversion and optimization code.
It is to be appreciated that the file generation and file transformation in the plug-in of FIG. 8 can be implemented by the analytics build, community package, and tool layers. Wherein the analysis building may comprise: dependence analysis and unified construction. The dependency analysis may include: the portal file PageEntry, the Component, the picture dependency analysis result, the structure dependency analysis result XML, the logic dependency analysis result JSS and the Component dependency analysis result JSON. The picture dependency analysis result may be implemented by CSS, which may specifically include: and the external cascading style sheet, the cascading style sheet Rule CSS Rule and the picture resource are used for determining the relation between the pictures. The structure dependency analysis result may be implemented by XML, which may specifically include: the method comprises the steps of generating a page structure, generating labels for identifying characters and/or pictures, determining attributes of information such as sizes, formats and positions of the characters and/or pictures, and generating the page structure of the characters and/or pictures in the page. The logical dependency analysis result may be implemented by JS, which may include the node package management NPM module, the local module, and the page structure sjs. The component dependency analysis results may be implemented by JSON, which may include: a local component and a node bundle component. The local component and the node packet component in the component dependency analysis result can be determined through the entry file, and the two components are combined to obtain the component of the second applet. The unified build may include: and the packaging module and the peripheral module. The packaging may include: common wrapping, reference path replacement, and compression obfuscation. The peripheral module may include: the method is used for storing the position information SourceMap of the corresponding position before and after code conversion, project configuration and files to be copied.
Specifically, the community package in fig. 8 is an open-source reusable tool, which may specifically include: transcoding, parsers, file tools, and open source files such as development processes. Wherein transcoding may include: conversion criteria, object replacement, reference syntax, class conversion, etc. The resolver may include: external cascading style parsing and page structure parsing. The document tool may include: compression and replication tools. The development process can use open source files such as transform log, output incompatible report generadoc, error record recordor, node package installation detection NPMinstallcheck, and the like. The dependent analysis part in the analysis construction may use a tool in the tool layer to complete the construction of each unit, which may specifically include: the system comprises an applet converter anti-move, a multimedia file mpx, a front-end resource loading/packaging tool webpack and a process management tool table.
Therefore, the embodiment of the present specification can implement the construction of the text, the picture, and the picture relationship between the pages in the second applet based on the second logic dependency analysis result, the second component dependency analysis result, the second structure dependency analysis result, and the second picture dependency analysis result. In addition, the repeated fields are packaged into a public packet, so that the required node packets can be extracted into the public output packet, and the problem that the node packets need to be indirectly constructed when small programs are called in the related technology is solved on the basis of ensuring that the size is small enough.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Fig. 9 is a schematic structural diagram of an applet cross-end application device provided in an embodiment of the present specification. The device is used for executing the small program cross-end application method in any embodiment of the specification. As shown in fig. 9, the applet cross-end application device may include:
an obtaining module 91, configured to obtain M pages included in a first applet; the first applet is loaded on a first application program; m is a positive integer greater than 1;
a determining module 92, configured to determine a first logic dependency analysis result based on the logic relationship of the N pages in the first applet; wherein N is a positive integer less than or equal to M; the first logic dependence analysis result comprises the names of the N pages and a logic path corresponding to each page; the logic path is a path for calling the logic relationship;
an obtaining module 93, configured to modify the names of the N pages according to a preset modification rule, so as to obtain a second logic dependency analysis result;
a generating module 94, configured to generate a page of a second applet based on the second logic dependency analysis result; wherein the second applet is loaded on a second application; the first application is different from the second application.
The embodiment of the present specification may obtain M pages included in the first applet; determining a first logic dependence analysis result based on the logic relation of N pages in the first applet; modifying the names of the N pages according to a preset modification rule to obtain a second logic dependence analysis result; generating a page of the second applet based on the second logical dependency analysis result. Therefore, the second applet in the second application in the embodiment of the description can obtain the recognizable logic path by calling the modification name to directly generate the required page, so that a developer does not need to rewrite codes according to the development languages of other application terminals, the problem that the applets between different platforms cannot be directly applied across the platforms is solved, and the development efficiency of the applets is effectively improved.
In some embodiments, each of the N pages in the first applet depends on at least one component;
before the generating module 94, the apparatus further includes:
a first component dependency analysis result determination module, configured to determine a first component dependency analysis result based on N page-dependent components in the first applet; the first component dependence analysis result comprises the names of the N pages and a component path corresponding to each component in each page; the component path is a path for calling the component;
the second component dependence analysis result determining module is used for modifying the names of the N pages according to the preset modification rule to obtain a second component dependence analysis result;
the generating module 94 is specifically configured to:
generating a page of the second applet based on the second logical dependency analysis result and the second component dependency analysis result.
In some embodiments, N is a positive integer less than M;
after the obtaining module 91 and before the determining module 92, the apparatus further includes:
the page determining module is used for determining a page which needs to be generated by the second applet;
a common page determining module, configured to determine a common page between the first applet and the second applet, based on a page that needs to be generated by the second applet and M pages included in the first applet;
the non-public page determining module is used for determining a non-public page in the second small program based on the public page and a page needing to be generated by the second small program;
the determining module 92 includes:
a first logic dependency analysis result generation unit, configured to perform dependency analysis processing on a logic relationship between the public page and the non-public page, and generate a first logic dependency analysis result;
the first component dependence analysis result determination module is specifically configured to:
and performing dependency analysis processing on the relationship between the public page and the non-public page dependent component to obtain the first component dependency analysis result.
In some embodiments, the page of the second applet comprises text and/or pictures;
before the generating module 94, the apparatus further includes:
the structure information determining module is used for determining the structure information corresponding to the characters and/or the pictures in the page of the second small program;
obtaining a first structure dependence analysis result, and performing dependence analysis on the structure information to obtain a first structure dependence analysis result; wherein the first structure-dependent analysis result comprises: the names of the N pages and the structure paths corresponding to the characters and/or pictures in each page; the structure path is a path for calling the structure information;
a second structure dependency analysis result obtaining module, configured to modify the names of the N pages according to the preset modification rule, so as to obtain a second structure dependency analysis result;
the generating module 94 is specifically configured to:
generating a page of the second applet based on the second logical dependency analysis result, the second component dependency analysis result, and the second structural dependency analysis result.
In some embodiments, at least two pages of the second applet respectively comprise at least one picture;
before the generating module 94, the apparatus further includes:
the relation determining module is used for determining the relation between the pictures in the at least two pages;
a first picture dependence analysis result obtaining module, configured to perform dependence analysis on a relationship between pictures in the at least two pages to obtain a first picture dependence analysis result; the first picture dependence analysis result comprises names of the N pages and picture paths corresponding to each picture in each page; the picture path is a path for calling the picture;
a second picture dependence analysis result obtaining module, configured to modify the names of the N pages according to the preset modification rule to obtain a second picture dependence analysis result;
the generating module 94 is specifically configured to:
generating a page of the second applet based on the second logical dependency analysis result, the second component dependency analysis result, the second structure dependency analysis result, and the second picture dependency analysis result.
In some embodiments, the generating module 94 includes:
a first obtaining unit, configured to obtain page logic information of the second applet based on the second logic dependency analysis result;
a second obtaining unit, configured to obtain page configuration information of the second applet based on the second component dependency analysis result;
a third obtaining unit, configured to obtain page structure information of the second applet based on the second structure dependency analysis result;
a fourth obtaining unit, configured to obtain page picture information of the second applet based on the second picture dependency analysis result;
and the page generating unit is used for generating the page of the second small program based on the page logic information, the page configuration information, the page structure information and the page picture information of the second small program.
In some embodiments, the page generating unit includes:
a field determination subunit, configured to determine a repeated field and a non-repeated field in the page logic information of the second applet, a repeated field and a non-repeated field in the page configuration information, a repeated field and a non-repeated field in the page structure information, and a repeated field and a non-repeated field in the page picture information;
a common packet generating subunit, configured to package repeated fields in the page logic information to generate a logic information common packet, package repeated fields in the page configuration information to generate a configuration information common packet, package repeated fields in the page structure information to generate a structure information common packet, and package repeated fields in the page picture information to generate a picture information common packet;
and the page generating subunit is configured to generate a page of the second applet, based on the non-duplicate field in the page logic information, the non-duplicate field in the page configuration information, the non-duplicate field in the page structure information, and the non-duplicate field in the page picture information, and call the logic information common packet, the configuration information common packet, the structure information common packet, and the picture information common packet.
It should be noted that, when the applet cross-end application apparatus provided in the foregoing embodiment executes the applet cross-end application method, only the division of the functional modules is taken as an example, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the functions described above. In addition, the applet cross-end application device and the applet cross-end application method embodiment provided in the above embodiments belong to the same concept, and details of implementation processes are referred to as method embodiments, and are not described herein again.
The above example numbers are for description only and do not represent the merits of the examples.
Referring to fig. 10, a schematic structural diagram of an electronic device 10 is provided for an embodiment of the present disclosure. As shown in fig. 10, the electronic device 10 may include: at least one processor 11, at least one network interface 14, a user interface 13, a memory 15, at least one communication bus 12.
Wherein the communication bus 12 is used to enable connection communication between these components.
The user interface 13 may include a Display screen (Display) and a Camera (Camera), and the optional user interface 13 may also include a standard wired interface and a wireless interface.
The network interface 14 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others.
Processor 11 may include one or more processing cores, among other things. The processor 11 interfaces with various components throughout the electronic device 10 using various interfaces and lines to perform various functions of the electronic device 10 and to process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 15 and invoking data stored in the memory 15. Alternatively, the processor 11 may be implemented in at least one hardware form of Digital Signal Processing (DSP), field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 11 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 11, but may be implemented by a single chip.
The Memory 15 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 15 includes a non-transitory computer-readable medium. The memory 15 may be used to store instructions, programs, code, sets of codes or sets of instructions. The memory 15 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like; the storage data area may store data and the like referred to in the above respective method embodiments. The memory 15 may alternatively be at least one memory device located remotely from the aforementioned processor 11. As shown in fig. 10, the memory 15, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and an applet cross-terminal application program.
In the electronic device 10 shown in fig. 10, the user interface 13 is mainly used as an interface for providing input for a user, and acquiring data input by the user; and the processor 11 may be configured to invoke the applet stored in the memory 15 to perform the following operations:
acquiring M pages contained in a first applet; the first applet is loaded in a first application program; m is a positive integer greater than 1;
determining a first logic dependence analysis result based on the logic relation of N pages in the first applet; wherein N is a positive integer less than or equal to M; the first logic dependence analysis result comprises the names of the N pages and a logic path corresponding to each page; the logic path is a path for calling the logic relationship;
modifying the names of the N pages according to a preset modification rule to obtain a second logic dependence analysis result;
generating a page of a second applet based on the second logical dependency analysis result; wherein the second applet is loaded on a second application; the first application is different from the second application.
In one possible embodiment, each of the N pages in the first applet depends on at least one component;
the processor 11 further performs, before executing the generating of the page of the second applet based on the second logical dependency analysis result:
determining a first component dependency analysis result based on the N page-dependent components in the first applet; the first component dependence analysis result comprises the names of the N pages and a component path corresponding to each component in each page; the component path is a path for calling the component;
modifying the names of the N pages according to the preset modification rule to obtain a second component dependence analysis result;
in a possible embodiment, the processor 11, during executing the page generating the second applet based on the second logic dependency analysis result, specifically performs:
generating a page of the second applet based on the second logical dependency analysis result and the second component dependency analysis result.
In one possible embodiment, N is a positive integer less than M;
after the obtaining of the M pages included in the first applet, and before the determining of the first logical dependency analysis result based on the logical relationship of the N pages in the first applet, the processor 11 further performs:
determining a page which needs to be generated by the second applet;
determining a common page between the first applet and the second applet based on the page required to be generated by the second applet and the M pages contained in the first applet;
determining a non-public page in the second applet based on the public page and a page which needs to be generated by the second applet;
when the processor 11 executes the logic relationship based on the N pages in the first applet and determines a first logic dependency analysis result, it specifically executes:
performing dependence analysis processing on the logic relationship between the public page and the non-public page to generate a first logic dependence analysis result;
the determining a first component dependency analysis result based on the N page-dependent components in the first applet comprises:
and performing dependency analysis processing on the relationship between the public page and the assemblies which are not depended by the public page to obtain a first assembly dependency analysis result.
In a possible embodiment, the page of the second applet comprises text and/or pictures;
the processor 11, before executing the generating of the page of the second applet based on the second logic dependency analysis result, further executes:
determining the respective corresponding structural information of the characters and/or pictures in the page of the second small program;
performing dependency analysis on the structural information to obtain a first structural dependency analysis result; wherein the first structure-dependent analysis result comprises: the names of the N pages and the structure paths corresponding to the characters and/or pictures in each page respectively; the structure path is a path for calling the structure information;
modifying the names of the N pages according to the preset modification rule to obtain a second structure dependence analysis result;
when the processor 11 executes the page of the second applet generated based on the second logic dependency analysis result, specifically execute:
generating a page of the second applet based on the second logical dependency analysis result, the second component dependency analysis result, and the second structural dependency analysis result.
In a possible embodiment, at least two pages of the second applet respectively comprise at least one picture;
the processor 11, before executing the generating of the page of the second applet based on the second logic dependency analysis result, further executes:
determining a relationship between pictures in the at least two pages;
performing dependency analysis on the relationship between the pictures in the at least two pages to obtain a first picture dependency analysis result; the first picture dependency analysis result comprises names of the N pages and picture paths corresponding to pictures in each page; the picture path is a path for calling the picture;
modifying the names of the N pages according to the preset modification rule to obtain a second picture dependence analysis result;
when the processor 11 executes the page of the second applet generated based on the second logic dependency analysis result, specifically execute:
generating a page of the second applet based on the second logical dependency analysis result, the second component dependency analysis result, the second structure dependency analysis result, and the second picture dependency analysis result.
In a possible embodiment, the processor 11 specifically performs, when executing the generating of the page of the second applet based on the second logic dependency analysis result, the second component dependency analysis result, the second structure dependency analysis result, and the second picture dependency analysis result:
obtaining page logic information of the second small program based on the second logic dependence analysis result;
obtaining page configuration information of the second applet based on the second component dependence analysis result;
obtaining page structure information of the second applet based on the second structure dependence analysis result;
obtaining page picture information of the second applet based on the second picture dependence analysis result;
and generating a page of the second small program based on the page logic information, the page configuration information, the page structure information and the page picture information of the second small program.
In a possible embodiment, when executing the generating of the page of the second applet based on the page logic information, the page configuration information, the page structure information, and the page picture information of the second applet, the processor 11 specifically executes:
determining repeated fields and non-repeated fields in page logic information, repeated fields and non-repeated fields in page configuration information, repeated fields and non-repeated fields in page structure information and repeated fields and non-repeated fields in page picture information of the second applet;
packaging repeated fields in the page logic information to generate a logic information public packet, packaging repeated fields in the page configuration information to generate a configuration information public packet, packaging repeated fields in the page structure information to generate a structure information public packet, and packaging repeated fields in the page picture information to generate a picture information public packet;
and generating a page of the second applet based on the non-repeated field in the page logic information, the non-repeated field in the page configuration information, the non-repeated field in the page structure information and the non-repeated field in the page picture information, and calling the logic information common packet, the configuration information common packet, the structure information common packet and the picture information common packet.
Embodiments of the present specification also provide a computer-readable storage medium having stored therein instructions, which when executed on a computer or processor, cause the computer or processor to perform one or more of the steps of the embodiments shown in fig. 3, 4, and 6. The components of the above-mentioned applet cross-end application device may be stored in the computer-readable storage medium if they are implemented in the form of software functional units and sold or used as independent products.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the procedures or functions described in accordance with the embodiments of the present specification are generated in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in or transmitted over a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)), or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., digital Versatile Disk (DVD)), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. And the aforementioned storage medium includes: various media capable of storing program codes, such as a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, and an optical disk. The technical features in the present examples and embodiments may be arbitrarily combined without conflict.
The above-mentioned embodiments are only described as preferred embodiments of the present disclosure, and do not limit the scope of the present disclosure, and various modifications and improvements of the technical solution of the present disclosure made by those skilled in the art without departing from the design spirit of the present disclosure should fall within the protection scope defined by the claims of the present disclosure.
Claims (11)
1. An applet cross-end application method, the method comprising:
acquiring M pages contained in a first applet; the first applet is loaded in a first application program; m is a positive integer greater than 1;
determining a first logic dependence analysis result based on the logic relation of N pages in the first applet; wherein N is a positive integer less than or equal to M; the first logic dependence analysis result comprises the names of the N pages and a logic path corresponding to each page; the logic path is a path for calling the logic relationship;
modifying the names of the N pages according to a preset modification rule to obtain a second logic dependence analysis result;
generating a page of a second applet based on the second logical dependency analysis result; wherein the second applet is loaded on a second application; the first application is different from the second application.
2. The method of claim 1, wherein each of the N pages in the first applet depends on at least one component;
before generating a page of a second applet based on the second logical dependency analysis result, the method further comprises:
determining a first component dependency analysis result based on the N page-dependent components in the first applet; the first component dependence analysis result comprises the names of the N pages and a component path corresponding to each component in each page; the component path is a path for calling the component;
modifying the names of the N pages according to the preset modification rule to obtain a second component dependence analysis result;
the generating a page of a second applet based on the second logical dependency analysis result includes:
generating a page of the second applet based on the second logical dependency analysis result and the second component dependency analysis result.
3. The method of claim 2, N is a positive integer less than M;
after obtaining M pages included in the first applet, and before determining a first logical dependency analysis result based on a logical relationship of the N pages in the first applet, the method further includes:
determining a page which needs to be generated by the second applet;
determining a common page between the first applet and the second applet based on a page required to be generated by the second applet and M pages contained in the first applet;
determining a non-public page in the second applet based on the public page and the page which needs to be generated by the second applet;
the determining a first logic dependency analysis result based on the logic relationship of the N pages in the first applet comprises:
performing dependence analysis processing on the logic relationship between the public page and the non-public page to generate a first logic dependence analysis result;
the determining a first component dependency analysis result based on the N page-dependent components in the first applet comprises:
and performing dependency analysis processing on the relationship between the public page and the non-public page dependent component to obtain the first component dependency analysis result.
4. A method according to claim 2 or 3, the page of the second applet comprising text and/or pictures;
before generating a page of a second applet based on the second logical dependency analysis result, the method further comprises:
determining the respective corresponding structural information of the characters and/or the pictures in the page of the second small program;
performing dependency analysis on the structural information to obtain a first structural dependency analysis result; wherein the first structure-dependent analysis result comprises: the names of the N pages and the structure paths corresponding to the characters and/or pictures in each page respectively; the structure path is a path for calling the structure information;
modifying the names of the N pages according to the preset modification rule to obtain a second structure dependence analysis result;
the generating a page of a second applet based on the second logical dependency analysis result includes:
generating a page of the second applet based on the second logical dependency analysis result, the second component dependency analysis result, and the second structural dependency analysis result.
5. The method of claim 4, at least two pages of the second applet respectively comprising at least one picture;
before generating a page of a second applet based on the second logical dependency analysis result, the method further comprises:
determining a relationship between pictures in the at least two pages;
performing dependency analysis on the relationship between the pictures in the at least two pages to obtain a first picture dependency analysis result; the first picture dependence analysis result comprises names of the N pages and picture paths corresponding to each picture in each page; the picture path is a path for calling the picture;
modifying the names of the N pages according to the preset modification rule to obtain a second picture dependence analysis result;
the generating a page of a second applet based on the second logical dependency analysis result includes:
generating a page of the second applet based on the second logical dependency analysis result, the second component dependency analysis result, the second structure dependency analysis result, and the second picture dependency analysis result.
6. The method of claim 5, the generating a page of the second applet based on the second logical dependency analysis result, the second component dependency analysis result, the second structure dependency analysis result, the second picture dependency analysis result, comprising:
obtaining page logic information of the second small program based on the second logic dependence analysis result;
obtaining page configuration information of the second applet based on the second component dependence analysis result;
obtaining page structure information of the second applet based on the second structure dependence analysis result;
obtaining page picture information of the second applet based on the second picture dependence analysis result;
and generating a page of the second applet based on the page logic information, the page configuration information, the page structure information and the page picture information of the second applet.
7. The method of claim 6, the generating a page of the second applet based on page logic information, page configuration information, page structure information, and page picture information of the second applet, comprising:
determining repeated fields and non-repeated fields in page logic information, repeated fields and non-repeated fields in page configuration information, repeated fields and non-repeated fields in page structure information and repeated fields and non-repeated fields in page picture information of the second applet;
packaging repeated fields in the page logic information to generate a logic information public packet, packaging repeated fields in the page configuration information to generate a configuration information public packet, packaging repeated fields in the page structure information to generate a structure information public packet, and packaging repeated fields in the page picture information to generate a picture information public packet;
and generating a page of the second applet based on the non-repeated field in the page logic information, the non-repeated field in the page configuration information, the non-repeated field in the page structure information and the non-repeated field in the page picture information, and calling the logic information common packet, the configuration information common packet, the structure information common packet and the picture information common packet.
8. An applet cross-end application apparatus, the apparatus comprising:
the acquisition module is used for acquiring M pages contained in the first applet; the first applet is loaded in a first application program; m is a positive integer greater than 1;
the determining module is used for determining a first logic dependence analysis result based on the logic relation of N pages in the first applet; wherein N is a positive integer less than or equal to M; the first logic dependence analysis result comprises the names of the N pages and a logic path corresponding to each page; the logic path is a path for calling the logic relationship;
the obtaining module is used for modifying the names of the N pages according to a preset modification rule to obtain a second logic dependence analysis result;
a generating module, configured to generate a page of a second applet based on the second logic dependency analysis result; wherein the second applet is loaded on a second application; the first application is different from the second application.
9. A program product, characterized in that it comprises instructions which, when run on a computer, cause the computer to carry out the method steps according to any one of claims 1 to 7.
10. A computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the method steps according to any of claims 1-7.
11. An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps according to any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211347501.8A CN115934093A (en) | 2022-10-31 | 2022-10-31 | Applet cross-terminal application method, related device and computer storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211347501.8A CN115934093A (en) | 2022-10-31 | 2022-10-31 | Applet cross-terminal application method, related device and computer storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115934093A true CN115934093A (en) | 2023-04-07 |
Family
ID=86554661
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211347501.8A Pending CN115934093A (en) | 2022-10-31 | 2022-10-31 | Applet cross-terminal application method, related device and computer storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115934093A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117539451A (en) * | 2024-01-10 | 2024-02-09 | 杭州新中大科技股份有限公司 | Process execution method, device, electronic equipment and storage medium |
CN118394333A (en) * | 2024-06-28 | 2024-07-26 | 华能信息技术有限公司 | A method and system for quickly building an application based on industry templates |
-
2022
- 2022-10-31 CN CN202211347501.8A patent/CN115934093A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117539451A (en) * | 2024-01-10 | 2024-02-09 | 杭州新中大科技股份有限公司 | Process execution method, device, electronic equipment and storage medium |
CN117539451B (en) * | 2024-01-10 | 2024-04-12 | 杭州新中大科技股份有限公司 | Flow execution method, device, electronic equipment and storage medium |
CN118394333A (en) * | 2024-06-28 | 2024-07-26 | 华能信息技术有限公司 | A method and system for quickly building an application based on industry templates |
CN118394333B (en) * | 2024-06-28 | 2024-11-19 | 华能信息技术有限公司 | A method and system for quickly building an application based on industry templates |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110825362B (en) | Low-code application software development system and method | |
US11667033B2 (en) | Systems and methods for robotic process automation | |
WO2018228211A1 (en) | Application conversion method, apparatus and device | |
WO2018072626A1 (en) | Method and apparatus for invoking component, and method and apparatus for processing component data | |
CN108830720A (en) | Intelligent contract operation method, device, system and computer readable storage medium | |
US8756407B2 (en) | Configuration rule prototyping tool | |
CN109542459A (en) | Application program packaging method and device, computer installation and computer storage medium | |
CN115934093A (en) | Applet cross-terminal application method, related device and computer storage medium | |
US11537367B1 (en) | Source code conversion from application program interface to policy document | |
CN111399840A (en) | Module development method and device | |
CN117112060A (en) | Component library construction method, device, electronic equipment and storage medium | |
CN117093286B (en) | Plug-in generation method, device, equipment and computer readable storage medium | |
CN114879976A (en) | Version environment deployment method and device and electronic equipment | |
CN112035112A (en) | Application program development method, system, medium and electronic device | |
CN111158777A (en) | Component calling method, apparatus, and computer-readable storage medium | |
CN117149162A (en) | SDK automatic generation method and device, electronic equipment and storage medium | |
CN110737431A (en) | Software development method, development platform, terminal device and storage medium | |
CN118259922B (en) | Compiling method, compiling device, compiling product, compiling device, compiling equipment and compiling medium for application program | |
CN118502992A (en) | Service orchestration method and related equipment | |
US20240296047A1 (en) | Cross-platform plug-in development methods, apparatuses, and electronic devices | |
CN113961279A (en) | Page rendering method, device, server and storage medium | |
CN117389567A (en) | Multi-terminal application development method, device, medium and equipment | |
CN113961194B (en) | Flutter cross-application-based engineering construction method, system, terminal and medium | |
CN116594676A (en) | Application packaging method, device, equipment and storage medium | |
CN117971350A (en) | Applet operating method, device and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |