Application loading method, application loading framework, device, equipment, storage medium and program product
By storing the main application file and the sub-application file separately and loading only the target sub-application file, the problem of low application loading efficiency in the existing technology is solved, and a more efficient loading process and more flexible system management is achieved.
Patent Information
- Application Number
- CN202411585911.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, when loading the main application, all sub-application functional modules associated with it need to be loaded, resulting in low application loading efficiency.
By storing the main application file and multiple sub-application files separately, and only loading the corresponding files of the target sub-application when the application is loaded, without loading all sub-application files of the main application, this method can significantly reduce the need during the loading process. The amount of data processed.
This method significantly improves the efficiency of application loading, saves time and resources, and improves system flexibility through the sub-application management layer, allowing sub-applications to be loaded, updated or removed independently without affecting the overall functionality of the main application.
Smart Images

Figure CN119440668A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an application loading method, an application loading framework, a device, a equipment, a storage medium and a program product. Background Art
[0002] In the development process of the World Wide Web (Web), with the continuous expansion of the scale of Internet applications, the functions of Web applications are becoming more and more complex, which also makes the design and development of graphical user interfaces (GUI) face new challenges.
[0003] When developing a graphical user interface (GUI) based on a web application, all the functional modules required by the application are usually placed in the same directory, which includes the functional modules of the main application and the functional modules of each sub-application required by the main application. When the GUI interface loads the main application, the system needs to load all the sub-application functional modules associated with it.
[0004] However, the above application loading method has the problem of low efficiency. Summary of the invention
[0005] Based on this, it is necessary to provide an application loading method, application loading framework, device, equipment, storage medium and program product that can improve application loading efficiency in response to the above technical problems.
[0006] In a first aspect, the present application provides an application loading method, which is applied to an application loading framework, and the method includes:
[0007] When receiving an application loading request, obtaining a target sub-application file corresponding to the target sub-application in the storage space; the main application file and the plurality of sub-application files stored in the storage space are stored separately;
[0008] Configure the target sub-application according to the target sub-application file, and load the configured target sub-application.
[0009] The application loading method provided in the embodiment of the present application obtains the target sub-application file corresponding to the target sub-application in the storage space when receiving the application loading request, then configures the target sub-application according to the target sub-application file, and loads the configured target sub-application. Among them, the main application file and multiple sub-application files stored in the storage space are stored separately. In the above method, by storing the main application file and the multiple sub-application files separately, when the application is subsequently loaded, only the target sub-application file corresponding to the target sub-application needs to be loaded, without loading all the sub-application files of the main application, which can greatly reduce the amount of data that needs to be processed during the loading process, thereby significantly improving the loading efficiency and saving time and resources. Moreover, through the sub-application management layer, the application loading system can manage different sub-applications more flexibly, and the sub-applications can be independently loaded, updated or removed as needed without affecting the overall function of the main application, thereby improving the flexibility of the system.
[0010] In one embodiment, configuring the target sub-application according to the target sub-application file and loading the configured target sub-application includes:
[0011] Initialize the target sub-application according to the target sub-application file to obtain the initialized target sub-application;
[0012] The configuration information corresponding to the initialized target sub-application is obtained, and the initialized target sub-application is loaded according to the configuration information.
[0013] In one embodiment, obtaining configuration information corresponding to the initialized target sub-application includes:
[0014] If the type of the application loading request is the main application calling the sub-application loading type, the application rendering layer in the application loading framework is called to establish an interaction channel between the target sub-application and the main application, and the sub-application management layer in the application loading framework is called to obtain the configuration information corresponding to the target sub-application from the main application based on the interaction channel;
[0015] If the type of the application loading request is a sub-application separate loading type, the sub-application management layer is called to establish an interaction channel between the target sub-application and the main application, and according to the result of establishing the interaction channel, the configuration information corresponding to the target sub-application is obtained.
[0016] The method described in the embodiment of the present application can realize the diversification of application loading methods through different types of application loading requests, which greatly improves the flexibility and efficiency of application loading. Moreover, the above method can not only realize the nested structure of the main application loading sub-applications, but also support the independent loading of sub-applications. In this mode, the coupling between the main application and the sub-applications is significantly reduced, making the structure of the entire system more modular, which can improve the maintainability of the system.
[0017] In one embodiment, according to the result of establishing the interactive channel, obtaining configuration information corresponding to the target sub-application includes:
[0018] If the result of establishing the interactive channel indicates that the interactive channel is successfully established, then the configuration information corresponding to the target sub-application is obtained from the main application based on the interactive channel;
[0019] If the result of establishing the interactive channel indicates that the interactive channel establishment fails, the configuration information corresponding to the target sub-application is obtained from the default parameters set in the sub-application management layer.
[0020] The method described in the embodiment of the present application can further determine whether it is necessary to load according to the main application configuration information by establishing an interaction channel between the target sub-application and the main application, and can flexibly load according to different requirements, thereby improving the flexibility of application loading.
[0021] In one of the embodiments, when an application loading request is received, obtaining a target sub-application file corresponding to the target sub-application in the storage space includes:
[0022] If the type of the application loading request is a main application calling a sub-application loading type, the application loading layer in the application loading framework is called to mount the target sub-application, and after the mounting process is completed, the sub-application management layer in the application loading framework is called to obtain the target sub-application file corresponding to the target sub-application in the storage space;
[0023] If the type of the application loading request is a sub-application separate loading type, the sub-application management layer in the application loading framework is called to obtain a target sub-application file corresponding to the target sub-application in the storage space.
[0024] The method described in the embodiments of the present application first performs a mount process for the main application calling the sub-application loading type to ensure that the sub-application runs correctly in the context of the main application, thereby avoiding resource conflicts and repeated loading and optimizing the use of system resources. For the sub-application separate loading type, the target sub-application file is directly obtained from the storage space without the need for a mount process, thereby reducing unnecessary operations, thereby shortening the loading time and improving the overall application loading efficiency.
[0025] In one embodiment, the method further comprises:
[0026] When an update request for a sub-application file stored in a storage space is received, the sub-application file stored in the storage space is updated according to the update requirements of the update request; the update requirements include adding a new sub-application file in the storage space, deleting a sub-application file, or modifying a sub-application file.
[0027] The method described in the embodiment of the present application improves the efficiency of sub-application update by storing the main application file and multiple sub-application files separately. When the sub-application is subsequently updated, only the content to be updated of the sub-application file needs to be updated. There is no need to update the sub-application file by changing the main application file, thereby improving the efficiency of sub-application update.
[0028] In a second aspect, the present application also provides an application loading framework, which includes a main application management layer, an application loading layer, an application rendering layer and a sub-application management layer; the sub-application management layer is used to execute any method in the above-mentioned first aspect.
[0029] In a third aspect, the present application further provides an application loading device, the device comprising:
[0030] An acquisition module, configured to acquire a target sub-application file corresponding to the target sub-application in the storage space when receiving an application loading request; the main application file and the plurality of sub-application files stored in the storage space are stored separately;
[0031] The loading module is used to configure the target sub-application according to the target sub-application file and load the configured target sub-application.
[0032] In a fourth aspect, the present application further provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:
[0033] When receiving an application loading request, obtaining a target sub-application file corresponding to the target sub-application in the storage space; the main application file and the plurality of sub-application files stored in the storage space are stored separately;
[0034] Configure the target sub-application according to the target sub-application file, and load the configured target sub-application.
[0035] In a fifth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0036] When receiving an application loading request, obtaining a target sub-application file corresponding to the target sub-application in the storage space; the main application file and the plurality of sub-application files stored in the storage space are stored separately;
[0037] Configure the target sub-application according to the target sub-application file, and load the configured target sub-application.
[0038] In a sixth aspect, the present application further provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0039] When receiving an application loading request, obtaining a target sub-application file corresponding to the target sub-application in the storage space; the main application file and the plurality of sub-application files stored in the storage space are stored separately;
[0040] Configure the target sub-application according to the target sub-application file, and load the configured target sub-application.
[0041] The above-mentioned application loading method, application loading framework, device, equipment, storage medium and program product, the method obtains the target sub-application file corresponding to the target sub-application in the storage space when receiving the application loading request, and then configures the target sub-application according to the target sub-application file, and loads the configured target sub-application. Among them, the main application file and multiple sub-application files stored in the storage space are stored separately. In the above-mentioned method, by storing the main application file and the multiple sub-application files separately, when the application is subsequently loaded, only the target sub-application file corresponding to the target sub-application needs to be loaded, without loading all the sub-application files of the main application, which can greatly reduce the amount of data that needs to be processed during the loading process, thereby significantly improving the loading efficiency and saving time and resources. Moreover, through the sub-application management layer, the application loading system can manage different sub-applications more flexibly, and the sub-applications can be independently loaded, updated or removed as needed without affecting the overall function of the main application, thereby improving the flexibility of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic diagram of a loading framework for application in the prior art;
[0043] Figure 2 A schematic diagram of an application loading framework in one embodiment;
[0044] Figure 3 A schematic diagram of a flow chart of an application loading method in an embodiment;
[0045] Figure 4 A schematic diagram of a flow chart of an application loading method in another embodiment;
[0046] Figure 5 A schematic diagram of a flow chart of an application loading method in another embodiment;
[0047] Figure 6 A schematic diagram of a flow chart of an application loading method in another embodiment;
[0048] Figure 7 A schematic diagram of a flow chart of an application loading method in another embodiment;
[0049] Figure 8 A schematic diagram of an application loading framework in another embodiment;
[0050] Fig. 9A schematic diagram of a flow chart of an application loading method in another embodiment;
[0051] Fig.10 It is a structural block diagram of an application loading device in one embodiment;
[0052] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] In the development of the World Wide Web (Web), as the scale of Internet applications continues to expand, the functions of Web applications are becoming more and more complex, which also makes the design and development of graphical user interfaces (GUIs) face new challenges. When developing a graphical user interface (GUI) based on a Web application, all the required functional modules of the application are usually placed in the same directory, including the functional modules of the main application and the functional modules of each sub-application required by the main application. When the GUI interface loads the main application, the system needs to load all the sub-application functional modules associated with it. Figure 1 As shown, the existing application loading architecture includes a main application business layer, a tool loading layer and a sub-application rendering layer. When loading the main application, the target main application is first obtained in the main application business layer, and then the target main application and all sub-applications associated with the target main application are loaded through the tool loading layer. The target sub-application is then determined from all sub-applications through the tool loading layer, and the configuration information of the main application is obtained. Then, the target sub-application is loaded and rendered using the configuration information of the main application through the sub-application rendering layer. When loading the main application, the above method needs to load all sub-application resources related to the main application, so the above application loading method has the problem of low efficiency. The present application provides an application loading method, which aims to solve the above technical problems. The following embodiments will specifically illustrate the application loading method described in the present application.
[0055] The application loading method provided in the embodiment of the present application can be applied to Figure 2In the application loading system shown, the application loading system includes an application loading framework 101 and a storage space 102. The application loading framework includes a main application management layer, an application loading layer, an application rendering layer, a sub-application management layer and multiple sub-applications. Among them, the main application management layer is used to receive the target main application and send configuration information to the target sub-application; the application loading layer is used to mount the target sub-application and manage the mount point; the application rendering layer application establishes a main-sub-application channel to instruct the sub-application management layer to obtain the configuration information sent by the main application management layer from the channel; the sub-application management layer is used to load and render the target sub-application according to the configuration information; the sub-application management layer is also used to independently load the target sub-application according to its own default file.
[0056] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a partial structure related to the present application scheme, and does not constitute a limitation on the application loading system to which the present application scheme is applied. The specific application loading system may include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0057] In one embodiment, Figure 3 As shown, an application loading method is provided, which is applied to Figure 1 The sub-application management layer in is used as an example to illustrate the following steps:
[0058] S201, when an application loading request is received, a target sub-application file corresponding to the target sub-application in the storage space is obtained; the main application file and multiple sub-application files stored in the storage space are stored separately.
[0059] The application loading request is a loading request of a target sub-application, and the types of application loading request include a main application calling a sub-application loading type and a sub-application separate loading type. The storage space includes multiple main application files and multiple sub-application files stored separately therefrom. The target sub-application file is a packaged file of the target sub-application.
[0060] In an embodiment of the present application, multiple main application files and multiple sub-application files can be pre-stored separately in a storage space. Optionally, in order to avoid resource competition problems, for files shared by the main application and the sub-application, the shared files can be stored in the main application file and mirrored in the sub-application file. Optionally, the main application file and the corresponding sub-application file can be stored in one thread. Specifically, a corresponding number of packaging threads can be opened according to the number of sub-applications to perform parallel packaging, so that the effect of packaging a main application and multiple sub-applications at the same time can be achieved. By using the parallel packaging method, the longest time consumed is the packaging time of the main application, which is much faster than the original single-thread packaging speed. At the same time, because there are multiple packaging entries, it is possible to compile only the main application or only the sub-application, so as to achieve the purpose of flexible compilation and packaging.
[0061] When it is necessary to load an application, the application loading system can receive a loading request triggered by the user through the application loading interface, and determine the type of the application loading request according to the application loading method. Specifically, if the loading request includes the main application identifier, for example, the user accesses the main application link, the type of the application loading request is determined as the main application calling the sub-application loading type. In this case, the application loading system can call the main application management layer to pop up the sub-application list on the application loading interface, and then receive the target sub-application clicked or triggered by the user. If the loading request includes the sub-application identifier, for example, the user directly enters the instruction "url#child" on the application loading interface, the type of the application loading request is determined as the main application calling the sub-application separate loading type. In this case, the application loading system can call the sub-application management layer to determine the target sub-application according to the sub-application identifier. It should be noted that different types of application loading requests correspond to different ways of obtaining the target sub-application file corresponding to the target sub-application in the storage space. After receiving the application loading request, the sub-application management layer can determine the type of the application loading request and the target sub-application according to the application loading request, and then obtain the target sub-application file corresponding to the identifier of the target sub-application from the storage space according to the loading method corresponding to the type of the application loading request.
[0062] S202: configure the target sub-application according to the target sub-application file, and load the configured target sub-application.
[0063] In the embodiment of the present application, after the sub-application management layer obtains the target sub-application file corresponding to the target sub-application based on the above steps, it can further obtain the configuration information, and then configure the target sub-application based on the target sub-application file and the configuration information to obtain the configured target sub-application, and then call the application rendering layer to load and render the configured target sub-application. Among them, the target sub-application file is a file used to load the target sub-application normally, that is, a static file; the configuration information is a file used to personalize the target sub-application, that is, a dynamic file, specifically including other customized information configuration files such as user information configuration files and time information configuration files. The sub-application management layer configures the target sub-application in a manner that: first use the target sub-application file to preliminarily load the target sub-application to obtain the preliminarily loaded target sub-application, and then use the configuration information to load the preliminarily loaded target sub-application again to obtain the loaded and configured target sub-application. Optionally, the sub-application management layer can also configure the target sub-application in a manner that: merge the target sub-application file and the configuration file to obtain the merged file, and then use the merged file to configure and load the target sub-application to obtain the loaded and configured target sub-application.
[0064] The application loading method provided in the embodiment of the present application obtains the target sub-application file corresponding to the target sub-application in the storage space when receiving the application loading request, then configures the target sub-application according to the target sub-application file, and loads the configured target sub-application. Among them, the main application file and multiple sub-application files stored in the storage space are stored separately. In the above method, by storing the main application file and the multiple sub-application files separately, when the application is subsequently loaded, only the target sub-application file corresponding to the target sub-application needs to be loaded, without loading all the sub-application files of the main application, which can greatly reduce the amount of data that needs to be processed during the loading process, thereby significantly improving the loading efficiency and saving time and resources. Moreover, through the sub-application management layer, the application loading system can manage different sub-applications more flexibly, and the sub-applications can be independently loaded, updated or removed as needed without affecting the overall function of the main application, thereby improving the flexibility of the system.
[0065] In one embodiment, a specific implementation method for configuring the target sub-application according to the target sub-application file is also provided, such as Figure 4 As shown, the step S202 of "configuring the target sub-application according to the target sub-application file and loading the configured target sub-application" includes:
[0066] S301, initializing a target sub-application according to a target sub-application file to obtain an initialized target sub-application.
[0067] The sub-application management layer includes a sub-application initialization module, and the sub-application initialization module is used to perform initialization operations on a target sub-application according to a target sub-application file.
[0068] In the embodiment of the present application, after obtaining the target sub-application file, the sub-application management layer can use the target sub-application file to preliminarily load the target sub-application to implement an initialization operation and obtain an initialized target sub-application.
[0069] S302, obtaining configuration information corresponding to the initialized target sub-application, and loading the initialized target sub-application according to the configuration information.
[0070] In the embodiment of the present application, after the sub-application management layer completes the initialization operation of the target sub-application, it can further obtain the configuration information corresponding to the target sub-application from the main application management layer, and then use the configuration information to load and render the initialized target sub-application. Optionally, the sub-application management layer can obtain the configuration information itself.
[0071] Specifically, Figure 5 As shown, the "obtaining configuration information corresponding to the initialized target sub-application" in the above step S201 includes:
[0072] S401, if the type of the application loading request is the main application calling the sub-application loading type, then the application rendering layer in the application loading framework is called to establish an interaction channel between the target sub-application and the main application, and the sub-application management layer in the application loading framework is called to obtain the configuration information corresponding to the target sub-application from the main application based on the interaction channel.
[0073] Among them, the application rendering layer includes an application interface function management module and a sub-application rendering module. The interface function management module is used to establish an interactive channel between the main application and the sub-application, and the sub-application rendering module is used to perform sub-application rendering.
[0074] The configuration information is a file used to personalize the target sub-application, that is, a dynamic file, including user information configuration files, time information configuration files, and other customized information configuration files.
[0075] In an embodiment of the present application, after the sub-application management layer completes the initialization of the target sub-application, if it is determined that the type of the application loading request is a sub-application loading type called by the main application, then the application loading system or the sub-application management layer can call the interface function management module in the application rendering layer to establish an interaction channel between the target sub-application and the main application. After the interaction channel between the target sub-application and the main application is established, the sub-application management layer can obtain the configuration information corresponding to the target sub-application from the main application on the main application management layer through the interaction channel.
[0076] S402: If the type of the application loading request is a sub-application separate loading type, the sub-application management layer is called to establish an interaction channel between the target sub-application and the main application, and configuration information corresponding to the target sub-application is obtained according to the result of establishing the interaction channel.
[0077] The result of establishing the interactive channel includes a result of successful establishment or a result of failed establishment.
[0078] In an embodiment of the present application, if the sub-application management layer determines that the type of application loading request is a sub-application separate loading type, then the application loading system or the sub-application management layer can call the sub-application management layer to establish an interaction channel between the target sub-application and the main application, and based on the result of establishing the interaction channel, determine whether it is necessary to load according to the main application configuration information, and obtain the configuration information corresponding to the target sub-application.
[0079] The method described in the embodiment of the present application can realize the diversification of application loading methods through different types of application loading requests, which greatly improves the flexibility and efficiency of application loading. Moreover, the above method can not only realize the nested structure of the main application loading sub-applications, but also support the independent loading of sub-applications. In this mode, the coupling between the main application and the sub-applications is significantly reduced, making the structure of the entire system more modular, which can improve the maintainability of the system.
[0080] In one embodiment, a specific implementation method for obtaining configuration information is also provided, such as Figure 6 As shown, the "acquiring configuration information corresponding to the target sub-application according to the result of establishing the interactive channel" in the above step S402 includes:
[0081] S501, according to the result of establishing the interactive channel, determine whether the interactive channel is successfully established, if successful, execute S502, if unsuccessful, execute S503.
[0082] In the embodiment of the present application, there are two situations in the process of loading a sub-application separately: the first is that there is a main application in the upper layer of the sub-application. In this case, it is necessary to load the target sub-application according to the configuration information of the main application; the second is that there is no main application in the upper layer of the sub-application. In this case, it is not necessary to load the target sub-application according to the configuration information of the main application.
[0083] S502: Obtain configuration information corresponding to the target sub-application from the main application based on the interactive channel.
[0084] In an embodiment of the present application, if the result of establishing an interactive channel indicates that the interactive channel is successfully established, this situation indicates that there is a main application on the upper layer of the sub-application, and the sub-application needs to be loaded according to the main application configuration information, then the sub-application management layer can obtain the configuration information corresponding to the target sub-application from the main application on the main application management layer based on the interactive channel.
[0085] S503: Obtain configuration information corresponding to the target sub-application from the default parameters set in the sub-application management layer.
[0086] The default parameters are the default configuration information of the sub-application. The default parameters can be stored in the same location as the sub-application file, or can be stored separately, or can be stored in the sub-application management layer.
[0087] In an embodiment of the present application, if the result of establishing an interactive channel indicates that the interactive channel establishment failed, this situation indicates that there is no main application in the upper layer of the sub-application, then the sub-application management layer can call the default parameters corresponding to the target sub-application and determine the default parameters as the configuration information corresponding to the target sub-application.
[0088] The method described in the embodiment of the present application can further determine whether it is necessary to load according to the main application configuration information by establishing an interaction channel between the target sub-application and the main application, and can flexibly load according to different requirements, thereby improving the flexibility of application loading.
[0089] In one embodiment, a specific implementation method for obtaining the target sub-application file is also provided, such as Figure 7 As shown, the above step S201 of "acquiring a target sub-application file corresponding to the target sub-application in the storage space upon receiving an application loading request" includes:
[0090] S601, if the type of application loading request is the main application calling the sub-application loading type, then the application loading layer in the application loading framework is called to mount the target sub-application, and after the mounting process is completed, the sub-application management layer in the application loading framework is called to obtain the target sub-application file corresponding to the target sub-application in the storage space.
[0091] Among them, the application loading layer includes a mount point management module.
[0092] In the embodiment of the present application, after the sub-application management layer receives the application loading request, the method described in S201 can be used to determine the type of the application loading request. If it is determined that the type of the application loading request is a main application calling a sub-application loading type, then the mount point management module in the application loading layer can be called to mount the target sub-application. When the mount processing is completed, it indicates that the subsequent loading process is implemented based on the mounted target sub-application. In this case, the sub-application management layer can obtain the target sub-application file corresponding to the target sub-application in the storage space.
[0093] S602: If the type of the application loading request is a sub-application separate loading type, the sub-application management layer in the application loading framework is called to obtain a target sub-application file corresponding to the target sub-application in the storage space.
[0094] In the embodiment of the present application, if it is determined that the type of the application loading request is a sub-application separate loading type, the sub-application management layer can directly obtain the target sub-application file corresponding to the target sub-application in the storage space.
[0095] The method described in the embodiments of the present application first performs a mount process for the main application calling the sub-application loading type to ensure that the sub-application runs correctly in the context of the main application, thereby avoiding resource conflicts and repeated loading and optimizing the use of system resources. For the sub-application separate loading type, the target sub-application file is directly obtained from the storage space without the need for a mount process, thereby reducing unnecessary operations, thereby shortening the loading time and improving the overall application loading efficiency.
[0096] In one embodiment, when the sub-application needs to be updated, the method further includes:
[0097] When an update request for a sub-application file stored in the storage space is received, the sub-application file stored in the storage space is updated according to the update requirement of the update request.
[0098] The update request is used to update the sub-application, and the update request includes adding a new sub-application file in the storage space, deleting a sub-application file, or modifying a sub-application file.
[0099] In the embodiment of the present application, when the application loading system or the sub-application management layer receives an update request for a sub-application file stored in the storage space, the sub-application file stored in the storage space can be directly updated. For example, in subsequent development, multiple sub-applications are added. It is only necessary to copy the sub-application file to the deployment directory where the sub-application file is located, and the main application will automatically read the name of the sub-application under the deployment directory, so that the main application knows which sub-applications are in the current deployment directory. The main application can list these sub-applications and access them, which can solve the problem of requiring a full update to update the application.
[0100] The method described in the embodiment of the present application improves the efficiency of sub-application update by storing the main application file and multiple sub-application files separately. When the sub-application is subsequently updated, only the content to be updated of the sub-application file needs to be updated. There is no need to update the sub-application file by changing the main application file, thereby improving the efficiency of sub-application update.
[0101] In one embodiment, Figure 8 As shown, the present application also provides an application loading framework, which includes a main application management layer, an application loading layer, an application rendering layer and a sub-application management layer.
[0102] In an embodiment of the present application, the main application management layer includes a log management module and a sub-application list display module; wherein the log management module is used to record the logs during the application loading process, and the sub-application list display module is used to display the sub-application list. The application loading layer includes a mount point management module, a sub-application loading module, an interactive channel management module, a sub-application unloading / cleaning module, and a sub-application exception management module; wherein the mount point management module is used to mount the target sub-application, the sub-application loading module is used to load the initialized target sub-application, the interactive channel management module is used to delete or add interactive channels, the sub-application unloading / cleaning module is used to unload or clean up the sub-application, and the sub-application exception management module is used to obtain and display sub-application exception information. The application rendering layer includes an application interface function management module and a sub-application rendering module. wherein the interface function management module is used to establish an interactive channel between the main application and the sub-application, and the sub-application rendering module is used to render the loaded target sub-application. The above-mentioned application rendering layer realizes the function of rendering and mounting the sub-application to the specified location, and realizes a method for the main application to notify the sub-application of data changes, and provides it to the main application for calling. If the main application exists, the main application will call the data change method provided by the sub-application rendering module to provide the relevant information of the main application, and finally the sub-application rendering module will be mounted to the location specified by the main application for rendering and display. If the main application does not call the data change method provided by the sub-application rendering module, it means that it is a sub-application accessed separately, then it will be directly rendered to the root node of the Web page to complete the independent rendering of the sub-application. The above-mentioned sub-application management layer includes a sub-application initialization module, an application synchronization module, and an exception information capture module. Among them, the sub-application initialization module is used to initialize the target sub-application according to the target sub-application file, the application synchronization module is used to synchronize the latest information of the sub-application to the main application management layer, and the exception information capture module is used to capture the exception information of the sub-application, and pass the exception information to the sub-application exception management module in the application loading layer for exception handling.
[0103] Based on all the above embodiments, an application loading method is also provided, such as Fig. 9As shown, the method includes:
[0104] S701: Receive an application loading request and determine the type of the application loading request.
[0105] S702: If the type of the application loading request is a main application calling a sub-application loading type, the application loading layer is called to mount the target sub-application.
[0106] S703, calling the sub-application management layer to obtain a target sub-application file corresponding to the target sub-application in the storage space.
[0107] S704, initialize the target sub-application according to the target sub-application file to obtain an initialized target sub-application.
[0108] S705 , calling the application rendering layer to establish an interaction channel between the target sub-application and the main application, and calling the sub-application management layer to obtain configuration information corresponding to the target sub-application from the main application based on the interaction channel.
[0109] S706: Load the initialized target sub-application according to the configuration information.
[0110] S707: If the type of the application loading request is a sub-application separate loading type, call the sub-application management layer to obtain a target sub-application file corresponding to the target sub-application in the storage space.
[0111] S708, initializing the target sub-application according to the target sub-application file to obtain an initialized target sub-application.
[0112] S709, calling the sub-application management layer to establish an interaction channel between the target sub-application and the main application.
[0113] S710: If the result of establishing the interactive channel indicates that the interactive channel is successfully established, then obtaining configuration information corresponding to the target sub-application from the main application based on the interactive channel.
[0114] S711: If the result of establishing the interactive channel indicates that the interactive channel establishment fails, then the configuration information corresponding to the target sub-application is obtained from the default parameters set in the sub-application management layer.
[0115] S712: Load the initialized target sub-application according to the configuration information.
[0116] S713, when receiving an update request for a sub-application file stored in the storage space, updating the sub-application file stored in the storage space according to the update requirements of the update request, wherein the update requirements include adding a new sub-application file in the storage space, deleting a sub-application file, or modifying a sub-application file.
[0117] The methods described in the above steps are all described in the above embodiments. Please refer to the above description for details and will not be repeated here.
[0118] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0119] Based on the same inventive concept, the embodiment of the present application also provides an application loading device for implementing the above-mentioned application loading method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more application loading device embodiments provided below can refer to the limitations on the application loading method above, and will not be repeated here.
[0120] In one embodiment, Fig.10 As shown, an application loading device is provided, comprising:
[0121] The acquisition module 11 is used to acquire the target sub-application file corresponding to the target sub-application in the storage space when receiving an application loading request; the main application file and multiple sub-application files stored in the storage space are stored separately.
[0122] The loading module 12 is used to configure the target sub-application according to the target sub-application file and load the configured target sub-application.
[0123] In one embodiment, the loading module 12 includes:
[0124] The initialization unit is used to initialize the target sub-application according to the target sub-application file to obtain the initialized target sub-application.
[0125] The loading unit is used to obtain configuration information corresponding to the initialized target sub-application and load the initialized target sub-application according to the configuration information.
[0126] In one embodiment, the loading unit comprises:
[0127] The first acquisition sub-unit is used to call the application rendering layer in the application loading framework to establish an interaction channel between the target sub-application and the main application if the type of the application loading request is a main application calling a sub-application loading type, and call the sub-application management layer in the application loading framework to obtain configuration information corresponding to the target sub-application from the main application based on the interaction channel.
[0128] The second acquisition subunit is used to call the sub-application management layer to establish an interaction channel between the target sub-application and the main application if the type of the application loading request is a sub-application separate loading type, and obtain configuration information corresponding to the target sub-application based on the result of establishing the interaction channel.
[0129] In one embodiment, the second acquisition sub-unit is specifically used to obtain configuration information corresponding to the target sub-application from the main application based on the interactive channel if the result of establishing the interactive channel indicates that the interactive channel is successfully established; if the result of establishing the interactive channel indicates that the interactive channel fails to be established, obtain the configuration information corresponding to the target sub-application from the default parameters set in the sub-application management layer.
[0130] In one embodiment, the acquisition module 11 includes:
[0131] The mounting unit is used to call the application loading layer in the application loading framework to mount the target sub-application if the type of application loading request is the main application calling the sub-application loading type, and after the mounting process is completed, call the sub-application management layer in the application loading framework to obtain the target sub-application file corresponding to the target sub-application in the storage space.
[0132] The acquisition unit is used to call the sub-application management layer in the application loading framework to acquire the target sub-application file corresponding to the target sub-application in the storage space if the type of the application loading request is a sub-application separate loading type.
[0133] In one embodiment, the application loading device further includes:
[0134] The update module is used to update the sub-application files stored in the storage space according to the update requirements of the update request when an update request for the sub-application files stored in the storage space is received; the update requirements include adding new sub-application files in the storage space, deleting sub-application files, or modifying sub-application files.
[0135] Each module in the above-mentioned application loading device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0136] In one embodiment, a computer device is provided. The computer device may be a terminal or a server. The internal structure diagram thereof may be as follows: Fig.11 As shown, the computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an application loading method is realized. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0137] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0138] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0139] When receiving an application loading request, obtaining a target sub-application file corresponding to the target sub-application in the storage space; the main application file and the plurality of sub-application files stored in the storage space are stored separately;
[0140] Configure the target sub-application according to the target sub-application file, and load the configured target sub-application.
[0141] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0142] Initialize the target sub-application according to the target sub-application file to obtain the initialized target sub-application;
[0143] The configuration information corresponding to the initialized target sub-application is obtained, and the initialized target sub-application is loaded according to the configuration information.
[0144] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0145] If the type of the application loading request is the main application calling the sub-application loading type, the application rendering layer in the application loading framework is called to establish an interaction channel between the target sub-application and the main application, and the sub-application management layer in the application loading framework is called to obtain the configuration information corresponding to the target sub-application from the main application based on the interaction channel;
[0146] If the type of the application loading request is a sub-application separate loading type, the sub-application management layer is called to establish an interaction channel between the target sub-application and the main application, and according to the result of establishing the interaction channel, the configuration information corresponding to the target sub-application is obtained.
[0147] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0148] If the result of establishing the interactive channel indicates that the interactive channel is successfully established, then the configuration information corresponding to the target sub-application is obtained from the main application based on the interactive channel;
[0149] If the result of establishing the interactive channel indicates that the interactive channel establishment fails, the configuration information corresponding to the target sub-application is obtained from the default parameters set in the sub-application management layer.
[0150] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0151] If the type of the application loading request is a main application calling a sub-application loading type, the application loading layer in the application loading framework is called to mount the target sub-application, and after the mounting process is completed, the sub-application management layer in the application loading framework is called to obtain the target sub-application file corresponding to the target sub-application in the storage space;
[0152] If the type of the application loading request is a sub-application separate loading type, the sub-application management layer in the application loading framework is called to obtain a target sub-application file corresponding to the target sub-application in the storage space.
[0153] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0154] When an update request for a sub-application file stored in a storage space is received, the sub-application file stored in the storage space is updated according to the update requirements of the update request; the update requirements include adding a new sub-application file in the storage space, deleting a sub-application file, or modifying a sub-application file.
[0155] The above embodiment provides a computer device, whose implementation principle and technical effect are similar to those of the above method embodiment, and will not be repeated here.
[0156] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0157] When receiving an application loading request, obtaining a target sub-application file corresponding to the target sub-application in the storage space; the main application file and the plurality of sub-application files stored in the storage space are stored separately;
[0158] Configure the target sub-application according to the target sub-application file, and load the configured target sub-application.
[0159] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0160] Initialize the target sub-application according to the target sub-application file to obtain the initialized target sub-application;
[0161] The configuration information corresponding to the initialized target sub-application is obtained, and the initialized target sub-application is loaded according to the configuration information.
[0162] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0163] If the type of the application loading request is the main application calling the sub-application loading type, the application rendering layer in the application loading framework is called to establish an interaction channel between the target sub-application and the main application, and the sub-application management layer in the application loading framework is called to obtain the configuration information corresponding to the target sub-application from the main application based on the interaction channel;
[0164] If the type of the application loading request is a sub-application separate loading type, the sub-application management layer is called to establish an interaction channel between the target sub-application and the main application, and according to the result of establishing the interaction channel, the configuration information corresponding to the target sub-application is obtained.
[0165] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0166] If the result of establishing the interactive channel indicates that the interactive channel is successfully established, then the configuration information corresponding to the target sub-application is obtained from the main application based on the interactive channel;
[0167] If the result of establishing the interactive channel indicates that the interactive channel establishment fails, the configuration information corresponding to the target sub-application is obtained from the default parameters set in the sub-application management layer.
[0168] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0169] If the type of the application loading request is a main application calling a sub-application loading type, the application loading layer in the application loading framework is called to mount the target sub-application, and after the mounting process is completed, the sub-application management layer in the application loading framework is called to obtain the target sub-application file corresponding to the target sub-application in the storage space;
[0170] If the type of the application loading request is a sub-application separate loading type, the sub-application management layer in the application loading framework is called to obtain a target sub-application file corresponding to the target sub-application in the storage space.
[0171] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0172] When an update request for a sub-application file stored in a storage space is received, the sub-application file stored in the storage space is updated according to the update requirements of the update request; the update requirements include adding a new sub-application file in the storage space, deleting a sub-application file, or modifying a sub-application file.
[0173] The above embodiment provides a computer-readable storage medium, whose implementation principle and technical effect are similar to those of the above method embodiment, and will not be repeated here.
[0174] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0175] When receiving an application loading request, obtaining a target sub-application file corresponding to the target sub-application in the storage space; the main application file and the plurality of sub-application files stored in the storage space are stored separately;
[0176] Configure the target sub-application according to the target sub-application file, and load the configured target sub-application.
[0177] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0178] Initialize the target sub-application according to the target sub-application file to obtain the initialized target sub-application;
[0179] The configuration information corresponding to the initialized target sub-application is obtained, and the initialized target sub-application is loaded according to the configuration information.
[0180] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0181] If the type of the application loading request is the main application calling the sub-application loading type, the application rendering layer in the application loading framework is called to establish an interaction channel between the target sub-application and the main application, and the sub-application management layer in the application loading framework is called to obtain the configuration information corresponding to the target sub-application from the main application based on the interaction channel;
[0182] If the type of the application loading request is a sub-application separate loading type, the sub-application management layer is called to establish an interaction channel between the target sub-application and the main application, and according to the result of establishing the interaction channel, the configuration information corresponding to the target sub-application is obtained.
[0183] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0184] If the result of establishing the interactive channel indicates that the interactive channel is successfully established, then the configuration information corresponding to the target sub-application is obtained from the main application based on the interactive channel;
[0185] If the result of establishing the interactive channel indicates that the interactive channel establishment fails, the configuration information corresponding to the target sub-application is obtained from the default parameters set in the sub-application management layer.
[0186] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0187] If the type of the application loading request is a main application calling a sub-application loading type, the application loading layer in the application loading framework is called to mount the target sub-application, and after the mounting process is completed, the sub-application management layer in the application loading framework is called to obtain the target sub-application file corresponding to the target sub-application in the storage space;
[0188] If the type of the application loading request is a sub-application separate loading type, the sub-application management layer in the application loading framework is called to obtain a target sub-application file corresponding to the target sub-application in the storage space.
[0189] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0190] When an update request for a sub-application file stored in a storage space is received, the sub-application file stored in the storage space is updated according to the update requirements of the update request; the update requirements include adding a new sub-application file in the storage space, deleting a sub-application file, or modifying a sub-application file.
[0191] The above embodiment provides a computer program product, whose implementation principle and technical effect are similar to those of the above method embodiment, and will not be repeated here.
[0192] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0193] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0194] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An application loading method, characterized in that: The method is applied to an application loading framework, and the method comprises: When receiving an application loading request, obtaining a target sub-application file corresponding to the target sub-application in the storage space; the main application file and the plurality of sub-application files stored in the storage space are stored separately; The target sub-application is configured according to the target sub-application file, and the configured target sub-application is loaded.
2. The method according to claim 1, characterized in that The configuring the target sub-application according to the target sub-application file and loading the configured target sub-application includes: Initializing the target sub-application according to the target sub-application file to obtain an initialized target sub-application; The configuration information corresponding to the initialized target sub-application is obtained, and the initialized target sub-application is loaded according to the configuration information.
3. The method according to claim 2, characterized in that The obtaining configuration information corresponding to the initialized target sub-application includes: If the type of the application loading request is a main application calling a sub-application loading type, the application rendering layer in the application loading framework is called to establish an interaction channel between the target sub-application and the main application, and the sub-application management layer in the application loading framework is called to obtain configuration information corresponding to the target sub-application from the main application based on the interaction channel; If the type of the application loading request is a sub-application separate loading type, the sub-application management layer is called to establish an interaction channel between the target sub-application and the main application, and configuration information corresponding to the target sub-application is obtained according to the result of establishing the interaction channel.
4. The method according to claim 3, characterized in that The acquiring, according to the result of establishing the interactive channel, configuration information corresponding to the target sub-application includes: If the result of establishing the interactive channel indicates that the interactive channel is successfully established, acquiring configuration information corresponding to the target sub-application from the main application based on the interactive channel; If the result of establishing the interactive channel indicates that the interactive channel establishment fails, the configuration information corresponding to the target sub-application is obtained from the default parameters set in the sub-application management layer.
5. The method according to any one of claims 1 to 4, characterized in that: When receiving the application loading request, obtaining the target sub-application file corresponding to the target sub-application in the storage space includes: If the type of the application loading request is a main application calling a sub-application loading type, the application loading layer in the application loading framework is called to mount the target sub-application, and after the mounting process is completed, the sub-application management layer in the application loading framework is called to obtain the target sub-application file corresponding to the target sub-application in the storage space; If the type of the application loading request is a sub-application separate loading type, the sub-application management layer in the application loading framework is called to obtain a target sub-application file corresponding to the target sub-application in the storage space.
6. The method according to claim 1, characterized in that The method further comprises: When an update request for a sub-application file stored in the storage space is received, the sub-application file stored in the storage space is updated according to the update requirements of the update request; the update requirements include adding a new sub-application file in the storage space, deleting a sub-application file, or modifying a sub-application file.
7. An application loading framework, characterized in that: The application loading framework includes a main application management layer, an application loading layer, an application rendering layer and a sub-application management layer; the sub-application management layer is used to execute the method according to any one of claims 1-6.
8. An application loading device, characterized in that: The device comprises: an acquisition module, configured to acquire a target sub-application file corresponding to the target sub-application in the storage space upon receiving an application loading request; the main application file and the plurality of sub-application files stored in the storage space are stored separately; A loading module is used to configure the target sub-application according to the target sub-application file and load the configured target sub-application.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.