CN111221613B - Program calling method and device and storage medium - Google Patents

Program calling method and device and storage medium Download PDF

Info

Publication number
CN111221613B
CN111221613B CN202010006341.5A CN202010006341A CN111221613B CN 111221613 B CN111221613 B CN 111221613B CN 202010006341 A CN202010006341 A CN 202010006341A CN 111221613 B CN111221613 B CN 111221613B
Authority
CN
China
Prior art keywords
component
page
level file
declaration information
application
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.)
Active
Application number
CN202010006341.5A
Other languages
Chinese (zh)
Other versions
CN111221613A (en
Inventor
董永清
孙良木
潘温
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202010006341.5A priority Critical patent/CN111221613B/en
Publication of CN111221613A publication Critical patent/CN111221613A/en
Application granted granted Critical
Publication of CN111221613B publication Critical patent/CN111221613B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)
  • Telephone Function (AREA)

Abstract

The disclosure relates to a program calling method and device and a storage medium. The method comprises the following steps: determining component tags contained in a page level file when compiling the mixed-mode mobile application; searching component declaration information corresponding to the component tag in an application-level file of the mixed-mode mobile application, wherein the application-level file comprises: component declaration information of a first type of functional component commonly called by at least two pages; and loading the page object of the first type of functional component on the page corresponding to the page-level file according to the component declaration information. According to the technical scheme in the embodiment of the disclosure, the component declaration information of the same functional component called by different pages is added into the application level file, and the component declaration information does not need to be added into each page level file, so that the size of an application program package is reduced, and the execution speed of the file is improved.

Description

Program calling method and device and storage medium
Technical Field
The present disclosure relates to the field of program development, and in particular, to a method and an apparatus for calling a program, and a storage medium.
Background
Currently, mobile electronic devices, such as mobile phones, tablet computers, smart wearable devices, and the like, have been widely used in various fields such as communication, entertainment, education, and the like. The user can realize corresponding functions based on application programs on the mobile terminal, including a mixed mode mobile application (HibridApp) without installing a client, such as a fast application, an applet and the like.
Taking the fast application as an example, the fast application is a novel application form based on a mobile phone hardware platform, and a user can enjoy the performance experience of the native application without downloading and installing the fast application, namely, using the fast application on the spot. In the process of developing the quick application, a developer can write JS codes to realize the running of the quick application at multiple ends of an Android system, an IOS system, webView and the like.
The fast application is constructed by taking pages as objects during running, and when the number of the pages is large, the program package occupies a large memory, and the running speed is slow, so that the page construction speed is easily influenced.
Disclosure of Invention
The disclosure provides a program calling method and device and a storage medium.
According to a first aspect of the embodiments of the present disclosure, there is provided a program calling method, including:
determining component tags contained in a page level file when compiling the mixed-mode mobile application;
searching component declaration information corresponding to the component tag in an application level file of the mixed-mode mobile application, wherein the application level file comprises: component declaration information of a first type of functional component commonly called by at least two pages;
and loading the page object of the first type of functional component on the page corresponding to the page-level file according to the component declaration information.
In some embodiments, the method further comprises:
searching component declaration information corresponding to the component tag in the page-level file;
the searching the component declaration information corresponding to the component tag in the application level file of the mixed-mode mobile application includes:
and when the component declaration information corresponding to the component tag is not found in the page-level file, finding the component declaration information corresponding to the component tag in the application-level file.
In some embodiments, the page-level file contains the component declaration information as: component declaration information of a second type of functional component that is called by a page alone;
the method further comprises the following steps:
and when the component declaration information corresponding to the component tag is found in the page level file, loading the page object of the second type of functional component on the page corresponding to the page level file.
In some embodiments, the package of mixed mode mobile applications comprises: the application-level file and at least two of the page-level files;
the application level file comprises: page declaration information of the at least two page-level documents, and component declaration information of the first type of functional component;
the page-level file includes: the component label of the first type of functional component and the component declaration information of the second type of functional component.
In some embodiments, the package of mixed mode mobile applications comprises:
a first set of components comprising: at least one functional component of the first type;
a second set of components comprising: and the at least one second type functional component, wherein the second type component sets of the second type functional components called by different pages are different.
In some embodiments, the page object of the first type of functional component includes: the cs style object.
In some embodiments, the method further comprises:
when updating the mixed-mode mobile application, if the same component tag exists in the added page-level file and other page-level files and the component declaration information of the component tag does not exist in the application-level file, adding the component declaration information of the component tag in the application-level file;
and storing the functional component corresponding to the component label in the first type component set in which the first type functional component is located.
According to a second aspect of the embodiments of the present disclosure, there is provided a program calling apparatus including:
the mobile application compiling module is used for compiling the mixed-mode mobile application and comprises a first determining module, a second determining module and a third determining module, wherein the first determining module is used for determining component tags contained in a page-level file when the mixed-mode mobile application is compiled;
a first searching module, configured to search, in an application-level file of the mixed-mode mobile application, component declaration information corresponding to the component tag, where the application-level file includes: component declaration information of a first type of functional component commonly called by at least two pages;
and the first loading module is used for loading the page object of the first type of functional component on the page corresponding to the page-level file according to the component declaration information.
In some embodiments, the apparatus further comprises:
the second searching module is used for searching the component declaration information corresponding to the component tag in the page-level file;
the first search module is specifically configured to:
and when the component declaration information corresponding to the component tag is not found in the page-level file, finding the component declaration information corresponding to the component tag in the application-level file.
In some embodiments, the page-level file contains the component declaration information as: component declaration information of a second type of functional component that is called by a page alone;
the device further comprises:
and the second loading module is used for loading the page object of the second type of functional component on the page corresponding to the page level file when the component declaration information corresponding to the component tag is found in the page level file.
In some embodiments, the package of mixed mode mobile applications comprises: the application-level file and at least two of the page-level files;
the application level file comprises: page declaration information of the at least two page-level documents, and component declaration information of the first type of functional component;
the page-level file includes: the component label of the first type of functional component and the component declaration information of the second type of functional component.
In some embodiments, the package of mixed mode mobile applications comprises:
a first set of components comprising: at least one functional component of the first type;
a second set of components comprising: and at least one second-class functional component, wherein the second-class component sets of the second-class functional components called by different pages are different.
In some embodiments, the page object of the first type of functional component includes: the cs style object.
In some embodiments, the apparatus further comprises:
an adding module, configured to, when the mixed-mode mobile application is updated, add component declaration information of the component tag in an application-level file if the same component tag exists in an added page-level file as that in another page-level file and the component declaration information of the component tag does not exist in the application-level file;
and the storage module is used for storing the functional component corresponding to the component label in the first type component set in which the first type functional component is located.
According to a third aspect of the embodiments of the present disclosure, there is provided a program calling apparatus, the apparatus including at least: a processor and a memory for storing executable instructions operable on the processor, wherein:
and when the processor is used for executing the executable instruction, the executable instruction executes the steps in any program calling method.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, implement the steps in any one of the above-mentioned program calling methods.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: according to the method in the embodiment of the disclosure, the component declaration information of the first type of functional component, which is required to be shared by a plurality of pages, is set in the application-level file, so that on one hand, the component declaration information of the first type of functional component is not required to be set in the page-level file, and the editing, updating and the like of the program are facilitated. On the other hand, the same first-class functional components do not need to be repeatedly stored in component sets corresponding to different page-level files, so that the memory occupied by the mixed-mode mobile application is saved, and the overall running speed of the mixed-mode mobile application is increased.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a flowchart illustrating a procedure call method according to an exemplary embodiment.
FIG. 2 is a flowchart illustrating a procedure call method in accordance with an exemplary embodiment.
FIG. 3 is a flowchart three illustrating a procedure call method in accordance with an exemplary embodiment.
Fig. 4 is a block diagram illustrating a structure of a procedure call apparatus according to an exemplary embodiment.
Fig. 5 is a block diagram illustrating an entity structure of a procedure call apparatus according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. 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 invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
FIG. 1 is a flowchart illustrating a program call method according to an exemplary embodiment, as shown in FIG. 1, including the steps of:
step S101, determining a component tag contained in a page-level file when compiling the mixed-mode mobile application;
step S102, searching component declaration information corresponding to the component label in an application level file of the mixed mode mobile application, wherein the application level file comprises: component declaration information for a first type of functional component commonly called by at least two pages;
step S103, loading the page object of the first type of functional component on the page corresponding to the page level file according to the component declaration information.
Here, the Hybrid-mode mobile application, i.e., the Hybrid app, is interposed between the web-app (web application) and the native-app (native application), is executed by the cloud, displays an execution result on the terminal, and receives a control instruction from the terminal. Fast applications, as well as applets, etc. are among this type of mixed mode mobile application.
Users of mixed mode mobile applications do not need to download installation application packages, i.e. point-and-play. The mixed-mode mobile application framework is deeply integrated in an operating system of the terminal equipment, seamless connection between user requirements and application services can be formed on the level of the operating system of the terminal equipment, a plurality of functions which can be used only in native applications but not in web applications can be realized conveniently in mixed-mode mobile applications, and performance experience of the native applications can be enjoyed. The operation of the mixed mode mobile application is executed by the mixed mode mobile application platform, and the operation result is displayed at the front end of the mixed mode mobile application, and the front end of the mixed mode mobile application can also be used for receiving the operation instruction of the mixed mode mobile application. For example, if a click operation for the mixed-mode mobile application is received by the mixed-mode mobile application-based front end, the specific execution of the click operation is performed by the mixed-mode mobile application platform. Therefore, the process of actually running the mixed-mode mobile application is mainly implemented based on a network architecture constructed by a mixed-mode mobile application platform and a mixed-mode mobile application front end.
Mixed-mode mobile applications can be divided from a data perspective into component trees (DOM, document Object Model), styles (CSS), logic (JS code, java Script code); the hybrid mode mobile application program package can be divided into a configuration file (manifest. Json), a global file (app. Ux, namely an application level file) and a page level file (page. Ux) from the composition, and the program is packaged to form an rpk packaging file, which is the program package of the hybrid mode mobile application.
When the mixed-mode mobile application is used on the mobile terminal, a program package of the mixed-mode application is downloaded firstly, and then each page of the mixed-mode application is generated by compiling and running an application-level file and each page-level file in the program package.
The above-mentioned program package of the mixed-mode mobile application may further include various functional components, and the functional components exist in the form of independent files. When the page-level file is compiled and run, various functional components independently stored outside the page-level file can be found through component tags in the page-level file, and the functional components are called to realize various functions. For example, loading modules of different functions in a page includes: a key module or a video display module, etc. The method can also be used for loading objects with different styles in the page, and comprises the following steps: color, font, and size of the object, etc.
When a functional component is called by a component tag, information for declaring the functional component in a program file, that is, the above-mentioned component declaration information, needs to be found. The component declaration information is used for declaring the functional component corresponding to the component label, and the functional component corresponding to the component label can be called through the component declaration information during compiling. The page-level document may contain component declaration information for the functional components, but this component declaration information is then only available for the current page-level document. If different page-level files need to call the same functional component, component declaration information needs to be added to the different page-level files. Meanwhile, the functional components need to be stored in component sets corresponding to different page-level files respectively, so that the final program package occupies a large space and the running speed is reduced.
Therefore, in the embodiment of the disclosure, the component declaration information of the first type functional component that at least two pages need to call is added to the application level file as the component declaration information that can be used globally. In the page-level file, the component tag is set at the position where the first type of functional component needs to be called. During compiling, according to the component tags in the page-level file, corresponding component declaration information is searched in the application-level file, and then the first-type functional components are called according to the component declaration information. Therefore, when the page corresponding to the page-level file is constructed, the page object corresponding to the first type of functional component can be loaded on the page.
By the method, the component declaration information of the called first-class functional component does not need to be set in the page-level file, and the same first-class functional component does not need to be repeatedly stored in component sets corresponding to different page-level files. The size of the space occupied by mixed mode mobile applications can be greatly reduced.
In some embodiments, as shown in fig. 2, the method further comprises:
step S201, searching component declaration information corresponding to the component tag in the page-level file;
in the above S102, the searching for the component declaration information corresponding to the component tag in the application-level file of the mixed-mode mobile application includes:
step S202, when the component declaration information corresponding to the component tag is not found in the page-level file, finding the component declaration information corresponding to the component tag in the application-level file.
In the compiling process, if the component tag is determined to exist, the component declaration information corresponding to the component tag can be searched in the page-level file. Functional components may also be stored in the component set corresponding to the page-level file, and the component declaration information in the page-level file is used to invoke the functional components stored in the component set corresponding to the page-level file. Therefore, in the compiling process, when determining that a component tag exists, it is necessary to determine whether a functional component corresponding to the component tag is stored in the component set of the current page. Therefore, whether the component declaration information corresponding to the component tag exists or not is searched in the page-level file, and if the component declaration information does not exist, the application-level file is accessed to search the component declaration information. And after finding the component declaration information, calling the corresponding first-class functional components.
In some embodiments, the component declaration information corresponding to the component tag may also be found in the application-level file and the page-level file at the same time, so that whether the component declaration information is found in the application-level file or the page-level file, the calling of the corresponding functional component may be implemented.
However, since the functional component corresponding to each component tag is not shared by other pages, it is possible to search for whether component declaration information corresponding to the component tag exists in the page-level file, and if so, it is not necessary to search for the application-level file, thereby saving the time required for compiling.
In some embodiments, the page-level file contains the component declaration information as: component declaration information of a second type of functional component that is called by a page alone;
as shown in fig. 3, the method further comprises:
step S301, when the component declaration information corresponding to the component tag is found in the page level file, loading the page object of the second type functional component on the page corresponding to the page level file.
If the component declaration information corresponding to the component tag is found in the current page-level file, the component declaration information does not need to be found in the application-level file. At this time, the second type functional component corresponding to the component tag is stored in the component set corresponding to the page-level file.
The second type of functional component is a component which is called by the current page independently and does not need to be called by other pages, so that the second type of functional component does not need to be stored in the global component set, and only needs to be stored in the component set corresponding to the current page. And, only the component declaration information needs to be set in the current page-level file.
By the method, the first type of functional components which can be called by a plurality of pages and the second type of functional components which are exclusive to one page can be respectively stored, and calling is realized through the component declaration information of the page level file and the application level file. Therefore, the waste caused by repeated storage of the shared first-class functional components is reduced, and the step of returning the application-level file to search the component declaration information when the second-class functional components are called is also reduced, so that the overall running speed of the program package and the construction speed when different pages are constructed are improved.
In some embodiments, the package of mixed mode mobile applications comprises: the application-level file and at least two of the page-level files;
the application level file comprises: page declaration information of the at least two page-level documents, and component declaration information of the first type of functional component;
the page-level file includes: the component label of the first type of functional component and the component declaration information of the second type of functional component.
When the mixed-mode mobile application runs at the terminal, the program package can be downloaded from the cloud server firstly. And constructing various pages in the application by operating the files in the program package, and displaying the pages to a user for use. The application-level file and the page-level file are stored in the program package in a file form, and various functional components can also be stored in the file package in a file form. During operation, the application-level file may be run first, the application may be started, and the main page may be displayed. The application-level file may include page declaration information of each page-level file, and the page declaration information is used to call the page-level file. That is, when the application-level file is run, the running of the page-level file may be entered according to the page declaration information, and a corresponding page may be constructed.
The page-level file contains various component tags, and when compiling, corresponding component declaration information needs to be searched according to the component tags, and then the corresponding components are called. If the component declaration information of the component tag cannot be found in the page-level file, the component tag may be a component tag of a first-class functional component, and the component declaration information corresponding to the component tag is located in the application-level file. If the component declaration information for the component label is found in the page-level file, the component label may correspond to the second type of functional component.
In some embodiments, the package of mixed mode mobile applications comprises:
a first set of components comprising: at least one functional component of the first type;
a second set of components comprising: and at least one second-class functional component, wherein the second-class component sets of the second-class functional components called by different pages are different.
In a package of a mixed-mode mobile application, an application-level file and a page-level file can be independently stored files, and different functional components to be called by the application-level file and the page-level file also need to be stored in the form of files in the package of files. In order to facilitate global calling, a first-class component set may be set, the first-class functional components are all stored in the first-class component set, and the functional components stored in the first-class component set may be called by any other file, including different page-level files. The component declaration information for the first type functional components in the first type component set can be set in an application level file, so that the global use is facilitated.
And for a second type of functional component to be called independently for a certain page, the functional component can be saved in a second type of component set corresponding to the page-level file for quick search and call. And storing the second type of functional components to be called for different pages in different sets of second type components.
Therefore, the optimization of the occupied storage space of the program package is realized, and the storage resources occupied by different files are reasonably distributed, so that the space occupied by the whole program package is smaller, and the running efficiency of the program is ensured.
In some embodiments, the page object of the first type of functional component includes: the cs style object.
The first type of functional component may be a css style object, but may also be other types of objects. The style object includes definitions of size, color, and shape of the display elements.
For different pages of the same application, there may be a greater probability that display elements of the same style appear, and therefore, by making different pages share style objects corresponding to the same first-class functional component in the above-described embodiment, display elements of the same style may be conveniently applied to different pages.
In some embodiments, the method further comprises:
when updating the mixed-mode mobile application, if the same component tag exists in the added page-level file and other page-level files and the component declaration information of the component tag does not exist in the application-level file, adding the component declaration information of the component tag in the application-level file;
and storing the functional component corresponding to the component label in the first type component set in which the first type functional component is positioned.
When the mixed-mode mobile application is updated, the page-level file can be added, deleted or modified, and when a new page-level file is added or the page-level file is modified, if the same functional components as other pages need to be called on the page, the corresponding component tags can be directly added into the page-level file. If the functional component is stored in the component set corresponding to the application-level file, that is, the functional component is a first type of functional component available for global use, the component declaration information corresponding to the functional component already exists in the application-level file. Therefore, the existing first-class functional components can be conveniently used when the page is added.
For functional components which are not stored in the first-type component set, the functional components may be called by only a single page before the application is updated, and therefore the functional components are stored in the component set corresponding to the page for calling the functional components and cannot be shared by other pages. And the functional component is found to have the requirement shared by other pages during updating, so the functional component can be saved in the first-class component set corresponding to the first-class functional component again, and meanwhile, the component declaration information of the functional component is added into the application-level file, so that the functional component becomes the functional component which can be called by different pages.
Therefore, the mixed-mode mobile application can be updated and expanded flexibly, and the excessive increase of the occupied memory of the program package caused by the updating of the mixed-mode mobile application is reduced.
The disclosed embodiments also provide the following examples:
in the development of mixed-mode mobile applications such as fast applications, a functional unit may be abstracted into components in order to be able to use the functional unit in multiple locations of a page or in multiple pages. Thereby enabling multiple pages to be imported into the component to enable reuse of the component.
The functional components can be imported in a page dimension, that is, if a plurality of pages all need to import the same functional component, declarations need to be defined in the plurality of pages. When a user-defined function component generates a ViewModel (view model) instance to build a page, the user-defined function component needs to execute and store the returned function component information in a page memory, and when the page is built, the user-defined function component generates an instance and builds a DOM according to the structure, the style and the function of the function component.
By the mode, the plurality of pages need to respectively perform the import declaration of the functional components, and the plurality of pages need to respectively store the information of the functional components, which wastes memory.
Examples are as follows:
assume that the fast application has multiple pages, including the following page components, i.e., page-level files: index1.Ux and index2.Ux. Both page level files need to reference the custom functional components part1.Ux and part2.Ux.
The custom component part1-
Figure BDA0002355419560000091
Figure BDA0002355419560000101
The custom component part2
Figure BDA0002355419560000102
-page component index1.Ux- -
Figure BDA0002355419560000103
-page component index2.Ux- -
Figure BDA0002355419560000104
Figure BDA0002355419560000111
Thus, it can be seen that the part1 component and the part2 component are introduced into both pages 1 and 2. Both of these components need to be stored in the set of components corresponding to page 1 and page 2. And when the page is compiled, acquiring the page from the corresponding component set, and dynamically generating a DOM structure. It can be seen that such repeated storage wastes a significant amount of memory space.
In the embodiment of the disclosure, the shared functional components part1 and part2 are imported into an application-level file, and during compiling, whether the components are stored in the current page or not can be searched first, and if so, component information is directly returned; if not, the application level file can be continuously searched, the component information in the application level file is searched, and the component is returned. That is, at this time, the part1 component and the part2 component may be stored in the component set corresponding to the application level file, so as to be called by different pages. The above example can therefore be reorganized as follows:
the custom component part1-
Figure BDA0002355419560000112
The custom component part2
Figure BDA0002355419560000113
APP document APP. Ux-
Figure BDA0002355419560000114
-page component index1.Ux- -
Figure BDA0002355419560000121
-page component index2.Ux- -
Figure BDA0002355419560000122
Therefore, the optimization of the codes is realized, and the storage space is saved. In the page containing the self-defined functional component, the pattern object is extracted by the method, so that the memory occupied by the program package can be greatly reduced, the execution of the program package is accelerated, and the construction speed of the page is increased. In addition, the coupling of the cs style and the js is eliminated through the method, the extracted cs style can be independently modified, updated and the like, the updating and the expansion of a program at the later stage are facilitated, and the analysis and the registration process of the cs style object are accelerated.
Fig. 4 is a block diagram illustrating a program invocation device according to an exemplary embodiment. Referring to fig. 4, the apparatus 400 includes a first determining module 410, a first lookup module 420, and a first loading module 430.
A first determining module 410, configured to determine a component tag included in a page-level file when compiling the mixed-mode mobile application;
a first searching module 420, configured to search for component declaration information corresponding to the component tag in an application-level file of the mixed-mode mobile application, where the application-level file includes: component declaration information for a first type of functional component commonly called by at least two pages;
the first loading module 430 is configured to load the page object of the first type functional component on the page corresponding to the page-level file according to the component declaration information.
In some embodiments, the apparatus further comprises:
the second searching module is used for searching the component declaration information corresponding to the component tag in the page-level file;
the first search module is specifically configured to:
and when the component declaration information corresponding to the component tag is not found in the page-level file, finding the component declaration information corresponding to the component tag in the application-level file.
In some embodiments, the page-level file contains the component declaration information as: component declaration information of a second type of functional component that is called by a page alone;
the device further comprises:
and the second loading module is used for loading the page object of the second type of functional component on the page corresponding to the page level file when the component declaration information corresponding to the component tag is found in the page level file.
In some embodiments, the package of mixed mode mobile applications comprises: the application-level file, the first class of functional components, and at least two of the page-level files;
the application level file comprises: page declaration information of the at least two page-level documents, and component declaration information of the first type of functional component;
the page-level file includes: the component label of the first type of functional component and the component declaration information of the second type of functional component.
In some embodiments, the package of mixed mode mobile applications comprises:
a first set of components comprising: at least one functional component of the first type;
a second set of components comprising: and at least one second-class functional component, wherein the second-class component sets of the second-class functional components called by different pages are different.
In some embodiments, the page object of the first type of functional component includes: the cs style object.
In some embodiments, the apparatus further comprises:
an adding module, configured to, when the mixed-mode mobile application is updated, add component declaration information of the component tag in an application-level file if the same component tag exists in an added page-level file as that in another page-level file and the component declaration information of the component tag does not exist in the application-level file;
and the storage module is used for storing the functional component corresponding to the component label in the first type component set in which the first type functional component is located.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 5 is a block diagram illustrating an entity structure of a detection apparatus 500 for communication of devices in the internet of things according to an exemplary embodiment. For example, the apparatus 500 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and so forth.
Referring to fig. 5, the apparatus 500 may include one or more of the following components: processing component 501, memory 502, power component 503, multimedia component 504, audio component 505, input/output (I/O) interface 506, sensor component 507, and communication component 508.
The processing component 501 generally controls the overall operation of the device 500, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 501 may include one or more processors 510 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 501 may also include one or more modules that facilitate interaction between the processing component 501 and other components. For example, the processing component 501 may include a multimedia module to facilitate interaction between the multimedia component 504 and the processing component 501.
The memory 510 is configured to store various types of data to support operations at the apparatus 500. Examples of such data include instructions for any application or method operating on the apparatus 500, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 502 may be implemented by any type or combination of volatile or non-volatile storage devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 503 provides power to the various components of the device 500. The power supply component 503 may include: a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the apparatus 500.
The multimedia component 504 includes a screen that provides an output interface between the device 500 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 504 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 500 is in an operating mode, such as a shooting mode or a video mode. Each front camera and/or rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
Audio component 505 is configured to output and/or input audio signals. For example, audio component 505 includes a Microphone (MIC) configured to receive external audio signals when apparatus 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 510 or transmitted via the communication component 508. In some embodiments, audio component 505 further comprises a speaker for outputting audio signals.
The I/O interface 506 provides an interface between the processing component 501 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 507 includes one or more sensors for providing various aspects of condition assessment for the device 500. For example, the sensor component 507 may detect the open/closed status of the device 500, the relative positioning of components, such as a display and keypad of the device 500, the sensor component 507 may also detect a change in position of the device 500 or a component of the device 500, the presence or absence of user contact with the device 500, orientation or acceleration/deceleration of the device 500, and a change in temperature of the device 500. The sensor assembly 507 may include a proximity sensor configured to detect the presence of a nearby object in the absence of any physical contact. The sensor assembly 507 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 507 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 508 is configured to facilitate wired or wireless communication between the apparatus 500 and other devices. The apparatus 500 may access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 508 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 508 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, or other technologies.
In an exemplary embodiment, the apparatus 500 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 502 comprising instructions, executable by the processor 510 of the apparatus 500 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions therein, which when executed by a processor of a mobile terminal, enable the mobile terminal to perform any one of the methods provided in the above embodiments.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (16)

1. A program call method, comprising:
determining a component tag contained in a page level file when compiling the mixed mode mobile application;
searching component declaration information corresponding to the component tag in an application-level file of the mixed-mode mobile application, wherein the application-level file comprises: component declaration information for a first type of functional component commonly called by at least two pages;
and loading the page object of the first type of functional component on the page corresponding to the page-level file according to the component declaration information.
2. The method of claim 1, further comprising:
searching component declaration information corresponding to the component tag in the page-level file;
the searching for the component declaration information corresponding to the component tag in the application-level file of the mixed-mode mobile application includes:
and when the component declaration information corresponding to the component tag is not found in the page-level file, finding the component declaration information corresponding to the component tag in the application-level file.
3. The method of claim 2, wherein the page-level file contains the component declaration information as: component declaration information of a second type of functional component that is called by a page alone;
the method further comprises the following steps:
and when the component declaration information corresponding to the component tag is found in the page level file, loading the page object of the second type of functional component on the page corresponding to the page level file.
4. The method of claim 3, wherein the package of mixed mode mobile applications comprises: the application-level file and at least two of the page-level files;
the application level file comprises: page declaration information of the at least two page-level documents, and component declaration information of the first type of functional component;
the page-level file includes: the component label of the first type of functional component and the component declaration information of the second type of functional component.
5. The method of claim 3 or 4, wherein the package of mixed mode mobile applications comprises:
a first set of components comprising: at least one functional component of the first type;
a second set of components comprising: and the at least one second type functional component, wherein the second type component sets of the second type functional components called by different pages are different.
6. The method of claim 1, wherein the page object of the first type of functional component comprises: cascading style sheets css style objects.
7. The method of claim 1, further comprising:
when the mixed mode mobile application is updated, if the same component label exists in the added page level file and other page level files and the component declaration information of the component label does not exist in the application level file, adding the component declaration information of the component label in the application level file;
and storing the functional component corresponding to the component label in the first type component set in which the first type functional component is located.
8. A program calling apparatus, comprising:
the mobile application compiling module is used for compiling the mixed-mode mobile application and comprises a first determining module, a second determining module and a third determining module, wherein the first determining module is used for determining component tags contained in a page-level file when the mixed-mode mobile application is compiled;
a first searching module, configured to search, in an application-level file of the mixed-mode mobile application, component declaration information corresponding to the component tag, where the application-level file includes: component declaration information for a first type of functional component commonly called by at least two pages;
and the first loading module is used for loading the page object of the first type of functional component on the page corresponding to the page-level file according to the component declaration information.
9. The apparatus of claim 8, further comprising:
the second searching module is used for searching the component declaration information corresponding to the component tag in the page-level file;
the first search module is specifically configured to:
and when the component declaration information corresponding to the component tag is not found in the page-level file, finding the component declaration information corresponding to the component tag in the application-level file.
10. The apparatus of claim 9, wherein the page-level file contains the component declaration information: component declaration information of a second type of functional component that is called by a page alone;
the device further comprises:
and the second loading module is used for loading the page object of the second type of functional component on the page corresponding to the page level file when the component declaration information corresponding to the component tag is found in the page level file.
11. The apparatus of claim 10, wherein the package of mixed mode mobile applications comprises: the application-level file and at least two of the page-level files;
the application level file comprises: page declaration information of the at least two page-level documents, and component declaration information of the first type of functional component;
the page-level file includes: the component label of the first type of functional component and the component declaration information of the second type of functional component.
12. The apparatus of claim 10 or 11, wherein the package of mixed mode mobile applications comprises:
a first set of components comprising: at least one functional component of the first type;
a second set of components comprising: and at least one second-class functional component, wherein the second-class component sets of the second-class functional components called by different pages are different.
13. The apparatus of claim 8, wherein the page object of the first type of functional component comprises: the cs style object.
14. The apparatus of claim 8, further comprising:
an adding module, configured to, when the mixed-mode mobile application is updated, add component declaration information of the component tag in an application-level file if the same component tag exists in an added page-level file as that in another page-level file and the component declaration information of the component tag does not exist in the application-level file;
and the storage module is used for storing the functional component corresponding to the component label in the first type component set in which the first type functional component is located.
15. A program calling apparatus, comprising at least: a processor and a memory for storing executable instructions operable on the processor, wherein:
the processor is configured to execute the executable instructions, and the executable instructions perform the steps of the procedure call method as claimed in any one of claims 1 to 7.
16. A non-transitory computer-readable storage medium having stored thereon computer-executable instructions that, when executed by a processor, perform steps in the procedure call method provided in any one of claims 1 to 7.
CN202010006341.5A 2020-01-03 2020-01-03 Program calling method and device and storage medium Active CN111221613B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010006341.5A CN111221613B (en) 2020-01-03 2020-01-03 Program calling method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010006341.5A CN111221613B (en) 2020-01-03 2020-01-03 Program calling method and device and storage medium

Publications (2)

Publication Number Publication Date
CN111221613A CN111221613A (en) 2020-06-02
CN111221613B true CN111221613B (en) 2023-04-18

Family

ID=70828104

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010006341.5A Active CN111221613B (en) 2020-01-03 2020-01-03 Program calling method and device and storage medium

Country Status (1)

Country Link
CN (1) CN111221613B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114756319A (en) * 2022-04-25 2022-07-15 中国建设银行股份有限公司 Applet page display method, device and equipment and storage medium
CN117616392A (en) * 2022-06-20 2024-02-27 北京小米移动软件有限公司 Application starting method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102163206A (en) * 2011-01-30 2011-08-24 青岛海信传媒网络技术有限公司 Method and system for loading pages
CN107368562A (en) * 2017-07-07 2017-11-21 北京小米移动软件有限公司 Display methods, device and the terminal of the page
CN109325205A (en) * 2018-09-25 2019-02-12 中国建设银行股份有限公司 A kind of page generation method and device
CN110569078A (en) * 2018-05-18 2019-12-13 广州腾讯科技有限公司 Method and device for preloading webpage-level program

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10725838B2 (en) * 2017-03-29 2020-07-28 Microsoft Technology Licensing, Llc Application startup control
US10824791B2 (en) * 2018-02-26 2020-11-03 Servicenow, Inc. System for building and modeling web pages

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102163206A (en) * 2011-01-30 2011-08-24 青岛海信传媒网络技术有限公司 Method and system for loading pages
CN107368562A (en) * 2017-07-07 2017-11-21 北京小米移动软件有限公司 Display methods, device and the terminal of the page
CN110569078A (en) * 2018-05-18 2019-12-13 广州腾讯科技有限公司 Method and device for preloading webpage-level program
CN109325205A (en) * 2018-09-25 2019-02-12 中国建设银行股份有限公司 A kind of page generation method and device

Also Published As

Publication number Publication date
CN111221613A (en) 2020-06-02

Similar Documents

Publication Publication Date Title
CN111026396B (en) Page rendering method and device, electronic equipment and storage medium
CN109032606B (en) Native application compiling method and device and terminal
CN110990105B (en) Interface display method and device, electronic equipment and storage medium
CN111026490B (en) Page rendering method and device, electronic equipment and storage medium
CN111026491B (en) Interface display method, device, electronic equipment, server and storage medium
CN109542417B (en) Method, device, terminal and storage medium for rendering webpage through DOM
CN109710259B (en) Data processing method, device and storage medium
CN111221613B (en) Program calling method and device and storage medium
CN110851108A (en) Electronic equipment operation method and device, electronic equipment and storage medium
CN111078325B (en) Application program running method and device, electronic equipment and storage medium
CN111008057A (en) Page display method and device and storage medium
CN107402756B (en) Method, device and terminal for drawing page
CN115373763B (en) Plug-in loading method and device, electronic equipment and storage medium
CN110908629A (en) Electronic equipment operation method and device, electronic equipment and storage medium
CN107368562B (en) Page display method and device and terminal
CN111580873B (en) Page updating method and device, terminal and storage medium
CN111104110B (en) Global style sharing method, global style sharing device and electronic device
CN110989987B (en) Portal webpage generation method and device, client, server and storage medium
CN111104183B (en) Application program running method and device, electronic equipment and storage medium
CN114546436A (en) Micro front-end service updating method and device, electronic equipment and storage medium
CN112256445A (en) Data processing method, device and equipment based on application program and storage medium
CN112083981A (en) Method and device for creating page view component
CN111596949B (en) Method and device for developing application program
CN112181406A (en) Rendering engine sharing method and device
CN111273910B (en) Method, device and storage medium for acquiring resource number identifier

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
GR01 Patent grant
GR01 Patent grant