CN114764354A - Dependency management method and device based on PAAS, electronic equipment and medium - Google Patents

Dependency management method and device based on PAAS, electronic equipment and medium Download PDF

Info

Publication number
CN114764354A
CN114764354A CN202210410330.2A CN202210410330A CN114764354A CN 114764354 A CN114764354 A CN 114764354A CN 202210410330 A CN202210410330 A CN 202210410330A CN 114764354 A CN114764354 A CN 114764354A
Authority
CN
China
Prior art keywords
target
application
resource
sub
dependent
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.)
Granted
Application number
CN202210410330.2A
Other languages
Chinese (zh)
Other versions
CN114764354B (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.)
Kaos Digital Technology Qingdao Co ltd
Karos Iot Technology Co ltd
Haier Digital Technology Qingdao Co Ltd
Cosmoplat Industrial Intelligent Research Institute Qingdao Co Ltd
Haier Cosmo IoT Technology Co Ltd
Original Assignee
Haier Digital Technology Qingdao Co Ltd
Haier Caos IoT Ecological Technology Co Ltd
Cosmoplat Industrial Intelligent Research Institute Qingdao 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 Haier Digital Technology Qingdao Co Ltd, Haier Caos IoT Ecological Technology Co Ltd, Cosmoplat Industrial Intelligent Research Institute Qingdao Co Ltd filed Critical Haier Digital Technology Qingdao Co Ltd
Priority to CN202210410330.2A priority Critical patent/CN114764354B/en
Publication of CN114764354A publication Critical patent/CN114764354A/en
Application granted granted Critical
Publication of CN114764354B publication Critical patent/CN114764354B/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/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/954Navigation, e.g. using categorised browsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • 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/44505Configuring for program initiating, e.g. using registry, configuration files
    • 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/44594Unloading
    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes

Abstract

The application provides a PAAS-based dependency management method, device, electronic equipment and medium. The method comprises the following steps: loading parent application information when a target child application is called; the parent application information comprises resource-dependent paths of a plurality of child applications; determining whether the target child application can share the path of the dependent resource in the parent application information based on the dependent configuration table of the target child application; the dependency configuration table stores the paths of the dependent resources which can be used by the target sub-application; if yes, determining a path of sharable target dependent resources, and loading the target dependent resources based on the path of the target dependent resources; and after the target dependent resource is loaded, carrying out mounting processing based on the target dependent resource, and generating a sub application example to be displayed on a page. The method saves the resource loading burden of the sub-application when the sub-application is switched, and improves the resource display efficiency, thereby being beneficial to improving the user experience.

Description

Dependency management method and device based on PAAS, electronic equipment and medium
Technical Field
The present application relates to computer network technologies, and in particular, to a dependency management method and apparatus based on PAAS, an electronic device, and a medium.
Background
With the continuous increase of business requirements, codes of front-end engineering gradually expand, so that front-end applications gradually develop into 'megastone applications', and great challenges exist in the directions of application maintenance, application upgrading and the like.
To meet the above challenges, the concept of a micro front-end is proposed. The micro front end is a structure similar to micro service, the idea of micro service is applied to a browser end, namely web application is converted from single application into application integrating a plurality of small front end applications, and each front end application can run independently, be developed independently and be deployed independently.
For the above manner, when the plurality of sub-applications load the resources, the resources are loaded in full, and meanwhile, due to the technical evolution of the modern front end, the resources to be loaded are often huge, so that the resource display efficiency of the user is low when the sub-applications are switched, and further, the improvement of the user experience is not facilitated.
Disclosure of Invention
The application provides a PAAS-based dependency management method, device, electronic equipment and medium, which are used for reducing the front-end page burden, so that the efficiency of front-end resource display is improved, and the user experience is further improved.
In one aspect, the present application provides a dependency management method based on PAAS, including:
loading parent application information when a target child application is called; wherein the parent application information includes resource dependent paths of a plurality of child applications;
determining whether the target child application can share a path of a dependent resource in the parent application information based on a dependent configuration table of the target child application; wherein the dependency configuration table stores resource-dependent paths usable by the target sub-application;
if yes, determining a path of sharable target dependent resources, and loading the target dependent resources from a cache space based on the path of the target dependent resources, wherein the target dependent resources are resources pre-stored to the cache space based on the path of the target dependent resources, and the cache space is used for caching historically loaded dependent resources.
And after the target dependent resource is loaded, carrying out mounting processing based on the target dependent resource, generating a sub application instance and displaying the sub application instance on a page.
In another possible implementation manner, if there are multiple target dependent resources, the loading the target dependent resource from a cache space based on a path of the target dependent resource includes:
adding a plurality of target dependent resources to an asynchronous queue, and pulling the target dependent resources in the asynchronous queue according to a preset rule;
and after the target dependent resource is pulled, loading the target dependent resource based on a minimum system loading tool.
In another possible implementation manner, before the calling the target sub-application, the method further includes:
acquiring sub-application information triggered by a user on a navigation page, wherein the sub-application information is a webpage address input by the user or a sub-application identifier selected by the user;
and determining the target sub-application to be called based on the sub-application information.
In another possible implementation manner, the method further includes:
and if the target dependent resource does not exist in the cache space, loading the target dependent resource according to the path of the target dependent resource.
In another possible implementation manner, the mount processing is performed based on the target dependent resource, and the sub-application instance is generated and displayed before the page, and the method further includes:
acquiring path configuration information of the target sub-application, wherein the path configuration information comprises a path of a resource to be loaded of the target sub-application;
determining paths of independent resources except the target dependent resource according to the path of the resource to be loaded;
loading the independent resource of the target sub-application based on the path of the independent resource;
in another possible implementation manner, the performing mount processing based on the target dependent resource and generating a sub-application instance to be displayed on a page includes:
and carrying out mounting processing based on the target dependent resource and the independent resource, and generating a sub application example to be displayed on a page.
In another possible implementation manner, if the target child application cannot share the resource-dependent path in the parent application information, the method further includes:
carrying out full loading on the resources to be loaded based on the path configuration information;
updating the parent application information based on the resource-dependent path in the path configuration information.
In another possible implementation manner, when it is determined that the target child application does not share the dependent resource of the parent application, the method further includes:
acquiring a configuration file of the target sub-application, wherein the configuration file comprises a plurality of compiling hook functions;
determining a target hook function corresponding to each target dependent resource in a plurality of compiling hook functions based on the target dependent resource of the sharable parent application;
separating the target dependent resource based on the target hook function;
and acquiring a script code corresponding to the target dependent resource, and injecting the script code into a source code of the target sub-application to realize the independent operation of the target sub-application.
In another possible implementation manner, after the target dependent resource is loaded, mount processing is performed based on the target dependent resource, and a sub application instance is generated and displayed on a page, the method further includes:
judging whether the current target sub-application is switched or closed;
and if so, unloading the current target sub-application based on an unloading event, wherein the unloading event is a umount command and is used for forcibly unloading the sub-application information.
In another possible implementation manner, the determining whether the current target sub-application is switched or closed includes:
acquiring current sub-application information triggered by a user on a navigation page;
and if the current sub-application information is inconsistent with the acquired sub-application information, determining that the target sub-application is switched or closed.
In another aspect, the present application provides an industrial PAAS-based dependency management apparatus, including:
the first loading module is used for loading the parent application information when the target child application is called; wherein the parent application information includes resource dependent paths of a plurality of child applications;
a first determining module, configured to determine, based on a dependency configuration table of the target child application, whether the target child application can share a path of a dependent resource in the parent application information; wherein the dependency configuration table stores resource-dependent paths usable by the target sub-application;
a second loading module, configured to determine a path of a sharable target dependent resource when the target child application can share the path of the dependent resource in the parent application information, and load the target dependent resource from a cache space based on the path of the target dependent resource, where the target dependent resource is a resource that is pre-stored in the cache space based on the path of the target dependent resource, and the cache space is used for caching a historically loaded dependent resource;
and the display module is used for carrying out mounting processing based on the target dependent resource after the target dependent resource is loaded, and generating a sub application example to be displayed on a page.
In another possible implementation manner, when there are multiple target dependent resources, the second loading module is specifically configured to:
adding a plurality of target dependent resources to an asynchronous queue, and pulling the target dependent resources in the asynchronous queue according to a preset rule;
and after the target dependent resource is pulled, loading the target dependent resource based on a minimum system loading tool.
In another possible implementation manner, the apparatus further includes:
the first acquisition module is used for acquiring sub-application information triggered by a user on a navigation page, wherein the sub-application information is a webpage address input by the user or a sub-application identifier selected by the user;
and the second determining module is used for determining the target sub-application to be called based on the sub-application information.
In another possible implementation manner, the apparatus further includes:
and the third loading module is used for loading the target dependent resource according to the path of the target dependent resource when the target dependent resource does not exist in the cache space.
In another possible implementation manner, the apparatus further includes:
a second obtaining module, configured to obtain path configuration information of the target sub-application, where the path configuration information includes a path of a resource to be loaded of the target sub-application;
a third determining module, configured to determine, according to the path of the resource to be loaded, a path of an independent resource other than the target dependent resource;
a fourth loading module, configured to load the independent resource of the target sub-application based on the path of the independent resource;
in another possible implementation manner, the display module is specifically configured to:
and carrying out mounting processing based on the target dependent resource and the independent resource, and generating a sub application example to be displayed on a page.
In another possible implementation manner, the apparatus further includes:
the fifth loading module is used for carrying out full loading on the resources to be loaded based on the path configuration information;
and the updating module is used for updating the parent application information based on the path depending on the resource in the path configuration information.
In another possible implementation manner, the apparatus further includes:
a third obtaining module, configured to obtain a configuration file of the target sub-application, where the configuration file includes a plurality of compiling hook functions;
a fourth determining module, configured to determine, based on a target dependent resource of a sharable parent application, a target hook function corresponding to each target dependent resource among the plurality of compiling hook functions;
a separating module for separating the target dependent resource based on the target hook function;
and the injection module is used for acquiring the script code corresponding to the target dependent resource and injecting the script code into the source code of the target sub-application so as to realize the independent operation of the target sub-application.
In another possible implementation manner, the apparatus further includes:
the judging module is used for judging whether the current target sub-application is switched or closed;
and the unloading module is used for unloading the current target sub-application based on an unloading event when the current target sub-application is switched or closed, wherein the unloading event is specifically an umount command and is used for forcibly unloading the sub-application information.
In another possible implementation manner, the unloading module is specifically configured to:
acquiring current sub-application information triggered by a user on a navigation page;
and if the current sub-application information is inconsistent with the acquired sub-application information, determining that the target sub-application is switched or closed.
In a third aspect, the present invention provides an electronic device comprising:
at least one processor and a memory;
the memory stores computer-executable instructions;
the at least one processor executing the memory-stored computer-executable instructions cause the at least one processor to perform the PAAS-based dependency management method of any one of the first aspects above.
In a fourth aspect, the present invention provides a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, implement the PAAS-based dependency management method according to any one of the first aspect.
The application provides a PAAS-based dependency management method, device, electronic device and medium, after a user determines a target child application on a page, the electronic device can enable a resource to be loaded of the target child application to be loaded through a parent application, and the specific loading process is as follows: first, based on the dependency configuration table of the target child application, it is determined whether shareable dependencies exist between the target child application and the parent application. If sharable dependencies exist between the target child application and the parent application, the electronic device judges whether the target dependent resources are cached in the cache space based on the dependency configuration table, and if the target dependent resources cached in the cache space exist, the target dependent resources are directly pulled from the cache space, so that the time for loading the part of the target dependent resources is saved, the loading time of resources to be loaded of the target child application is reduced, and the use experience of a user is facilitated to be improved.
For the target dependent resources and independent resources except the target dependent resources which do not exist in the cache space, the electronic equipment loads the resources based on the path configuration information of the target sub-application so as to ensure the resource integrity of the target sub-application. And after the resource to be loaded is loaded, generating an example based on the resource to be loaded and displaying the example on a page for a user to look up.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
FIG. 1 is a schematic diagram of a system for dependency management based on industrial PAAS according to an embodiment of the present application;
FIG. 2 is a user page interaction diagram provided by an embodiment of the present application;
fig. 3a is a schematic diagram of a dependency management method based on PAAS according to an embodiment of the present application;
fig. 3b is a flowchart of a dependency management method based on PAAS according to an embodiment of the present application;
FIG. 4 is a flowchart of a sub-application construction provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of an industrial PAAS-based dependency management apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same 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 application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims.
Fig. 1 is a schematic diagram of a system for dependency management based on industrial PAAS according to an embodiment of the present application. As shown in fig. 1, the system provided in the embodiment of the present application includes a terminal and a server, where the terminal may be a computer, a mobile phone, a tablet, and other devices that can interact with a user. For example, the terminal may be a computer as shown in fig. 1. The computer communicates with the server via a network.
Fig. 2 is a user page interaction diagram provided in an embodiment of the present application. As shown in fig. 2, the sub-application is registered in the parent application in advance, when the user opens a navigation page on the computer and inputs any address or selects any identifier on the navigation page, the electronic device determines a target sub-application that the user needs to start based on the address or the identifier, controls the computer page to jump to the page of the target sub-application, and controls the server to load the resource to be loaded of the target sub-application. The electronic device can generate an instance based on the resource to be loaded and display the instance on a computer page for a user to refer to. Because a plurality of sub-applications which can be started by the user exist in the navigation page, the user can freely switch the target sub-application based on the requirement. When the user switches the target sub-application or closes the current target sub-application, after the server unloads the resource loaded by the previous target sub-application, the resource of the switched target sub-application is loaded and finally displayed on a computer page, or the page is directly closed.
For the above process, when the next target sub-application is switched, the resources of the next target sub-application are all loaded in full, and the loaded resources are often huge due to the technical evolution of the modern front end, thereby causing low loading efficiency. Because the resources among the sub-applications have considerable commonality, namely sharing dependence exists among the sub-applications, the application provides a PAAS-based dependence management method to manage the dependence resources when the sub-applications load the resources, so as to achieve the effects of greatly accelerating the loading speed of the page, reducing the occupation of network resources and reducing the execution burden of the js engine, and simultaneously, the PAAS-based dependence management method is beneficial to improving the use experience of users.
Fig. 3a is a schematic diagram of a dependency management method based on PAAS according to an embodiment of the present application, and fig. 3b is a flowchart of the dependency management method based on PAAS according to the embodiment of the present application. Some embodiments of the present application will be described in detail below with reference to fig. 3a and 3 b. The features of the embodiments and examples described below may be combined with each other without conflict between the embodiments.
As shown in FIG. 3a, the parent application is used to load the underlying common dependencies upon initialization for load-time invocation by the various child applications. And the plurality of child applications register the service in advance and write the information of the child applications into the parent application. In particular, the sub-applications include a routing manager and an application manager. When the child application is loaded through the parent application, the resource path of the child application is firstly obtained, and whether the child application and the parent application are dependent and shared is judged based on the resource path of the child application. And if the child application and the parent application have the dependency sharing, loading the child application resource according to the dependency loader. And if the child application and the parent application do not depend on sharing, directly loading the resources to be loaded in a full amount according to the resource path of the child application. And mounting the loaded sub-application resources, and generating and displaying a sub-application example based on the sub-application resources. The process of loading the sub-application resource based on the dependent loader is described in detail in the following embodiments.
As shown in fig. 3b, the method in this embodiment may include step S301, step S302, step S303 and step S304, wherein,
in step S301, when the target child application is called, parent application information is loaded.
The parent application information comprises resource-dependent paths of a plurality of child applications, and the child application information comprises information such as child application webpage addresses, child application identifiers, path configuration of resources to be loaded and the like. The electronic device needs to determine the target sub-application by the user before calling the target sub-application.
Optionally, the manner of determining the target sub-application by the user may include: and acquiring sub-application information triggered by a user on the navigation page, and determining a target sub-application to be called based on the sub-application information.
Specifically, the sub-application information is a web page address input by a user or a sub-application identifier selected by the user, where the sub-application identifier may be a text identifier or a graphic identifier. Assuming that the web page address of a sub-application is "xxx.com/abc" and the identifier is "weather", when the user inputs the address "xxx.com/abc" on the navigation page or selects the identifier of "weather", the sub-application is determined to be the target sub-application.
Step S302, based on the dependency configuration table of the target child application, determining whether the target child application can share the path of the dependent resource in the parent application information.
The dependent configuration table is provided by the target sub-application, the dependent configuration table stores the paths of the dependent resources which can be used by the target sub-application, and the dependent configuration table is artificially configured and written into the sub-application in advance. The method for determining whether the target child application can share the path of the dependent resource in the parent application information may be: searching for the usable path of the dependent resource of the target child application in the parent application information, wherein the path indicating that the target child application can share the dependent resource in the parent application information can be found, and the path indicating that the target child application cannot share the dependent resource in the parent application information cannot be found.
Step S303, if yes, determining a path of the sharable target dependent resource, and loading the target dependent resource from the cache space based on the path of the target dependent resource.
And determining the path of the sharable target dependent resource, namely determining the path of the target dependent resource of the target child application from the parent application information. When the child application resource is loaded based on the parent application, the electronic device stores the historically loaded dependent resource in the cache space. When the target dependent resource which can share the dependency with the parent application and is contained in the target child application selected or switched by the user is overlapped with the historically loaded dependent resource, the corresponding dependent resource can be directly pulled from the cache space.
Specifically, the method for the electronic device to determine whether the target dependent resource is a resource pre-stored in the cache space based on the target resource dependent path may be: and searching the path of the target dependent resource in the paths of the resources contained in the cache space.
Optionally, when there are multiple target dependent resources, loading the target dependent resources from the cache space based on the path of the target dependent resources, which may include: adding a plurality of target dependent resources to an asynchronous queue, and pulling the target dependent resources in sequence based on an import sequence (import-maps); and after the target dependent resource is pulled, loading the target dependent resource based on a minimum system loading tool (systemJs).
Optionally, when the target dependent resource cannot be found in the cache space, the target dependent resource is loaded according to the path of the target dependent resource. And for the target dependent resources which cannot be found in the cache space, the electronic equipment loads the target dependent resources according to the paths corresponding to the target dependent resources.
And step S304, after the target dependent resource is loaded, carrying out mounting processing based on the target dependent resource, and generating a sub application example to be displayed on a page.
Optionally, before performing mount processing based on the target dependent resource and generating and displaying the sub-application instance on the page, a path of the resource to be loaded of the target sub-application is obtained, a path of the independent resource except the target dependent resource is determined according to the path of the resource to be loaded, and the independent resource of the target sub-application is loaded based on the path of the independent resource.
And after the independent resources exist in the target sub-application and the independent resources are loaded, carrying out mounting processing based on the loaded independent resources and the dependent resources, and generating and displaying sub-application examples on a page.
Optionally, when the user switches or closes the target sub-application, the electronic device destroys both the route and the instance through an uninstall event (umount event), and completes uninstalling of the sub-application, so as to switch or close the target sub-application.
Specifically, the manner for the electronic device to determine whether the target sub-application is switched or closed may be: and acquiring current sub-application information, judging whether the current sub-application information is consistent with the sub-application information of the target sub-application, and if not, indicating that the target sub-application is switched or closed by a user.
On the basis of the technical solution provided in the foregoing embodiment, optionally, when the target child application cannot share the resource-dependent path in the parent application information, the method further includes: carrying out full loading on the resources to be loaded based on the path configuration information; and updating the parent application information based on the path of the dependent resource in the path configuration information.
Specifically, when the target child application and the parent application do not have a dependency relationship, the resource to be loaded is directly loaded through the path configuration information of the target child application. And meanwhile, completing the registration of the target child application, writing the target child application information into the parent application, and completing the updating of the parent application.
Based on the technical solutions provided in the foregoing embodiments, optionally, when it is determined that the target child application does not share the dependent resource of the parent application, the method further includes: acquiring a configuration file of a target sub-application, wherein the configuration file comprises a plurality of compiling hook functions; determining a target hook function corresponding to each target dependent resource in a plurality of compiling hook functions based on the target dependent resource of the sharable parent application; separating target dependent resources based on a target hook function; and acquiring script codes corresponding to the target dependent resources, and injecting the script codes into source codes of the target sub-application to realize independent operation of the target sub-application.
Specifically, as shown in the construction process of the sub-application shown in fig. 4, before compiling the sub-application, it is first determined whether the sub-application has a configuration file, and if not, the sub-application is directly compiled, and at this time, the sub-application needs to be loaded by the parent application. If so, searching a hook function, entering the hook function, analyzing the source code according to the configuration file, generating a dependence injection code to rewrite the source code, compiling at the moment, and outputting a compiling result according to the configuration file, so that the child application can load independent resources without depending on the parent application.
In addition, before the construction of the parent application enters the compiling link, the configuration file is read at first, and the configuration file configures plug-ins and various configuration parameters required by each construction link. Meanwhile, if the parent application plug-in is included, the child configuration table is read. When a parent application needs to load a basic module, the parent application enters a compiling hook function to search a target hook function, enters the target hook function, analyzes a source code, separates dependence according to a configuration file, and finally rewrites the source code and injects the source code into a self-executed script code.
According to the method provided by the embodiment, when a user opens any target child application, the electronic device can load the parent application first, so that the parent application is in a usable state. At this time, if sharable dependencies exist between the target child application and the parent application and the corresponding target dependent resource can be found in the cache space, the target dependent resource is directly loaded from the cache space, so that time for reloading the target dependent resource based on the target dependent resource path of the target child application is saved, the efficiency of opening or switching the target child application is improved, and user experience is favorably improved. Meanwhile, when the resource to be loaded of the target child application has an independent resource which is not shared with the parent application, after the independent resource and the target dependent resource which needs to be reloaded are loaded based on the path configuration information, the resource to be loaded is mounted, and an instance is generated and displayed on a page for a user to look up.
The embodiments described above introduce a dependency management method based on PAAS from the perspective of method flow, and the following embodiments describe a dependency management apparatus based on industrial PAAS from the perspective of virtual modules or virtual units, which are described in detail in the following embodiments.
The embodiment of the present application provides a dependency management apparatus based on industrial PAAS, as shown in fig. 5, the apparatus includes a first loading module 51, a first determining module 52, a second loading module 53 and a display module 54, wherein,
a first loading module 51, configured to load parent application information when the target child application is called; wherein the parent application information comprises resource-dependent paths of the plurality of child applications;
a first determining module 52, configured to determine whether the target child application can share the path of the dependent resource in the parent application information based on the dependent configuration table of the target child application; the dependency configuration table stores the paths of the dependent resources which can be used by the target sub-application;
a second loading module 53, configured to, when a target child application may share a path of a dependent resource in parent application information, determine a path of a sharable target dependent resource, and load the target dependent resource from a cache space based on the path of the target dependent resource, where the target dependent resource is a resource that is pre-stored in the cache space based on the path of the target dependent resource, and the cache space is used for caching the historically loaded dependent resource;
and the display module 54 is configured to perform mounting processing based on the target dependent resource after the target dependent resource is loaded, generate a sub application instance, and display the sub application instance on a page.
In another possible implementation manner of the embodiment of the present application, when there are multiple target dependent resources, the second loading module 53 is specifically configured to:
adding a plurality of target dependent resources to an asynchronous queue, and pulling the target dependent resources in the asynchronous queue according to a preset rule;
after the target dependent resource pull is completed, the target dependent resource is loaded based on a minimal system loading tool (systemJs).
In another possible implementation manner of the embodiment of the present application, the apparatus further includes:
the first acquisition module is used for acquiring sub-application information triggered by a user on a navigation page, wherein the sub-application information is a webpage address input by the user or a sub-application identifier selected by the user;
and the second determining module is used for determining the target sub-application to be called based on the sub-application information.
In another possible implementation manner of the embodiment of the present application, the apparatus further includes:
and the third loading module is used for loading the target dependent resource according to the path of the target dependent resource when the target dependent resource does not exist in the cache space.
In another possible implementation manner of the embodiment of the present application, the apparatus further includes:
the second acquisition module is used for acquiring the path configuration information of the target sub-application, wherein the path configuration information comprises a path of the resource to be loaded of the target sub-application;
the third determining module is used for determining the path of the independent resource except the target dependent resource according to the path of the resource to be loaded;
and the fourth loading module is used for loading the independent resources of the target sub-application based on the paths of the independent resources.
In another possible implementation manner of the embodiment of the present application, the display module 54 is specifically configured to:
and carrying out mounting processing based on the target dependent resource and the independent resource, and generating a sub application instance to be displayed on a page.
In another possible implementation manner of the embodiment of the present application, the apparatus further includes:
the fifth loading module is used for carrying out full loading on the resources to be loaded based on the path configuration information;
and the updating module is used for updating the parent application information based on the path depending on the resource in the path configuration information.
In another possible implementation manner of the embodiment of the present application, the apparatus further includes:
the third acquisition module is used for acquiring a configuration file of the target sub-application, wherein the configuration file comprises a plurality of compiling hook functions;
a fourth determining module, configured to determine, based on the target dependent resource of the sharable parent application, a target hook function corresponding to each target dependent resource among the plurality of compiling hook functions;
a separation module for separating the target dependent resource based on the target hook function;
and the injection module is used for acquiring the script codes corresponding to the target dependent resources and injecting the script codes into the source codes of the target sub-application so as to realize the independent operation of the target sub-application.
In another possible implementation manner of the embodiment of the present application, the apparatus further includes:
and the judging module is used for judging whether the current target sub-application is switched or closed.
And the unloading module is used for unloading the current target sub-application based on an unloading event when the current target sub-application is switched or closed, wherein the unloading event is specifically an umount command and is used for forcibly unloading the sub-application information.
In another possible implementation manner of the embodiment of the present application, the unloading module is specifically configured to:
acquiring current sub-application information triggered by a user on a navigation page;
and if the current sub-application information is inconsistent with the acquired sub-application information, determining that the target sub-application is switched or closed.
In the embodiment of the present application, the first loading module 51, the second loading module 53, the third loading module, the fourth loading module, and the fifth loading module may be the same loading module, may be different loading modules, or may be partially the same loading module. The first determining module 52, the second determining module, the third determining module, and the fourth determining module may be the same determining module, may be different determining modules, or may be partially the same determining module. The first obtaining module, the second obtaining module and the third obtaining module may be the same obtaining module, may be different obtaining modules, or may be partially the same obtaining module. The embodiments of the present application are not limited to these examples.
The dependence management apparatus based on industrial PAAS provided in the embodiments of the present application is applicable to the above method embodiments, and is not described herein again.
In an embodiment of the present application, there is provided an electronic device, as shown in fig. 6, the electronic device shown in fig. 6 includes: a processor 61 and a memory 62. Wherein the processor 61 is coupled to the memory 62, such as via a bus 63. Optionally, the electronic device may also include a transceiver 64. It should be noted that the transceiver 64 is not limited to one in practical application, and the structure of the electronic device is not limited to the embodiment of the present application.
The Processor 61 may be a Central Processing Unit (CPU) 61, a general purpose Processor 61, a data Signal Processor 61 (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 61 may also be a combination that performs a computational function, such as comprising one or more of a combination of microprocessors 61, a combination of a DSP and microprocessors 61, and the like.
Bus 63 may include a path that transfers information between the aforementioned components. The bus 63 may be a Peripheral Component Interconnect (PCI) bus 63, an Extended Industry Standard Architecture (EISA) bus 63, or the like. The bus 63 may be divided into an address bus 63, a data bus 63, a control bus 63, etc. For ease of illustration, only one thick line is shown in fig. 6, but this does not indicate only one bus 63 or one type of bus 63.
The Memory 62 may be a Read Only Memory 62 (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory 62 (RAM) or other type of dynamic storage device that can store information and instructions, an Electrically Erasable Programmable Read Only Memory 62 (EEPROM), a Compact Disc Read Only Memory (CD-ROM) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), magnetic Disc storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
The memory 62 is used for storing application program codes for executing the scheme of the application, and is controlled to be executed by the processor 61. The processor 61 is configured to execute application program code stored in the memory 62 to implement the aspects shown in the foregoing method embodiments.
Wherein, the electronic device includes but is not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, Personal Digital Assistants (PDAs), tablet computers (PADs), Portable Multimedia Players (PMPs), in-vehicle terminals (e.g., car navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. But also a server, etc. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
The embodiment of the present application provides a computer readable storage medium, on which a computer program is stored, and when the computer program runs on a computer, the computer is enabled to execute the corresponding content in the foregoing method embodiment.
Other embodiments of the present application 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 application 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 application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements that have been 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 application is limited only by the appended claims.

Claims (15)

1. A dependency management method based on PAAS is characterized by comprising the following steps:
loading parent application information when a target child application is called; wherein the parent application information includes resource dependent paths of a plurality of child applications;
determining whether the target child application can share a path of a dependent resource in the parent application information based on a dependent configuration table of the target child application; wherein the dependency configuration table stores resource-dependent paths usable by the target sub-application;
if yes, determining a path of sharable target dependent resources, and loading the target dependent resources from a cache space based on the path of the target dependent resources, wherein the target dependent resources are resources pre-stored to the cache space based on the path of the target dependent resources, and the cache space is used for caching historically loaded dependent resources;
and after the target dependent resource is loaded, carrying out mounting processing based on the target dependent resource, generating a sub application instance and displaying the sub application instance on a page.
2. The method of claim 1, wherein if there are multiple target dependent resources, the loading the target dependent resource from a cache space based on the path of the target dependent resource comprises:
adding a plurality of target dependent resources to an asynchronous queue, and pulling the target dependent resources in the asynchronous queue according to a preset rule;
and after the target dependent resource is pulled, loading the target dependent resource based on a minimum system loading tool.
3. The method of claim 1, wherein prior to the invoking the target sub-application, the method further comprises:
acquiring sub-application information triggered by a user on a navigation page, wherein the sub-application information is a webpage address input by the user or a sub-application identifier selected by the user;
and determining the target sub-application to be called based on the sub-application information.
4. The method of claim 1, further comprising:
and if the target dependent resource does not exist in the cache space, loading the target dependent resource according to the path of the target dependent resource.
5. The method of claim 1, wherein the mount processing based on the target dependent resource and generating the sub-application instance to be displayed before the page, the method further comprises:
acquiring path configuration information of the target sub-application, wherein the path configuration information comprises a path of a resource to be loaded of the target sub-application;
determining paths of independent resources except the target dependent resource according to the path of the resource to be loaded;
and loading the independent resource of the target sub-application based on the path of the independent resource.
6. The method according to claim 5, wherein the mounting processing based on the target dependent resource and generating the sub-application instance to be displayed on a page comprises:
and carrying out mounting processing based on the target dependent resource and the independent resource, and generating a sub application example to be displayed on a page.
7. The method of claim 5, wherein if the target child application cannot share a resource-dependent path in the parent application information, the method further comprises:
carrying out full loading on the resource to be loaded based on the path configuration information;
updating the parent application information based on the resource-dependent path in the path configuration information.
8. The method of any of claims 1-7, wherein upon determining that the target child application does not share a dependent resource of the parent application, the method further comprises:
acquiring a configuration file of the target sub-application, wherein the configuration file comprises a plurality of compiling hook functions;
determining a target hook function corresponding to each target dependent resource in a plurality of compiling hook functions based on the target dependent resource of the sharable parent application;
separating the target dependent resource based on the target hook function;
and acquiring a script code corresponding to the target dependent resource, and injecting the script code into a source code of the target sub-application to realize the independent operation of the target sub-application.
9. The method according to any one of claim 3, wherein after the target dependent resource is loaded, the mount processing is performed based on the target dependent resource, and the sub-application instance is generated and displayed on the page, and the method further comprises:
judging whether the current target sub application is switched or closed;
and if so, unloading the current target sub-application based on an unloading event, wherein the unloading event is specifically an umount command and is used for forcibly unloading the sub-application information.
10. The method of claim 9, wherein the determining whether the current target sub-application is switched or closed comprises:
acquiring current sub-application information triggered by a user on a navigation page;
and if the current sub-application information is inconsistent with the acquired sub-application information, determining that the target sub-application is switched or closed.
11. An industrial PAAS-based dependency management apparatus, comprising:
the first loading module is used for loading the parent application information when the target child application is called; wherein the parent application information includes resource dependent paths of a plurality of child applications;
a first determining module, configured to determine whether the target child application can share a path of a dependent resource in the parent application information based on a dependent configuration table of the target child application; wherein the dependency configuration table stores resource-dependent paths usable by the target sub-application;
a second loading module, configured to determine a path of a sharable target dependent resource when the target child application can share the path of the dependent resource in the parent application information, and load the target dependent resource from a cache space based on the path of the target dependent resource, where the target dependent resource is a resource that is pre-stored in the cache space based on the path of the target dependent resource, and the cache space is used for caching a historically loaded dependent resource;
and the display module is used for carrying out mounting processing based on the target dependent resource after the target dependent resource is loaded, generating a sub application instance and displaying the sub application instance on a page.
12. The apparatus of claim 11, wherein the second load module is specifically configured to:
adding a plurality of target dependent resources to an asynchronous queue, and pulling the target dependent resources in the asynchronous queue according to a preset rule;
and after the target dependent resource is pulled, loading the target dependent resource based on a minimum system loading tool.
13. The apparatus of claim 11, further comprising:
the first acquisition module is used for acquiring sub-application information triggered by a user on a navigation page, wherein the sub-application information is a webpage address input by the user or a sub-application identifier selected by the user;
and the second determining module is used for determining the target sub-application to be called based on the sub-application information.
14. An electronic device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the memory-stored computer-executable instructions to cause the at least one processor to perform the PAAS-based dependency management method of any one of claims 1-10.
15. A computer-readable storage medium having stored thereon computer-executable instructions for implementing a PAAS-based dependency management method according to any one of claims 1-10 when executed by a processor.
CN202210410330.2A 2022-04-19 2022-04-19 PAAS-based dependency management method, PAAS-based dependency management device, electronic equipment and medium Active CN114764354B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210410330.2A CN114764354B (en) 2022-04-19 2022-04-19 PAAS-based dependency management method, PAAS-based dependency management device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210410330.2A CN114764354B (en) 2022-04-19 2022-04-19 PAAS-based dependency management method, PAAS-based dependency management device, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN114764354A true CN114764354A (en) 2022-07-19
CN114764354B CN114764354B (en) 2024-01-05

Family

ID=82364880

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210410330.2A Active CN114764354B (en) 2022-04-19 2022-04-19 PAAS-based dependency management method, PAAS-based dependency management device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN114764354B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117648179A (en) * 2023-11-23 2024-03-05 北京菱云科技有限公司 Resource allocation method and device, electronic equipment and storage medium

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105354049A (en) * 2015-09-29 2016-02-24 北京畅游天下网络技术有限公司 Resource loading method, apparatus and system for three-dimensional animation engine
CN107105336A (en) * 2017-04-19 2017-08-29 腾讯科技(深圳)有限公司 Data processing method and data processing equipment
US9928058B1 (en) * 2014-10-28 2018-03-27 Amazon Technologies, Inc. Optimized class loading
CN108108205A (en) * 2016-11-25 2018-06-01 腾讯科技(深圳)有限公司 Application page surface treatment method and apparatus
CN110298002A (en) * 2019-05-31 2019-10-01 福建新大陆软件工程有限公司 Client WEB method for managing resource and equipment
US20190347146A1 (en) * 2017-05-11 2019-11-14 Tencent Technology (Shenzhen) Company Limited Message processing method and apparatus, storage medium, and computer device
CN110865888A (en) * 2019-11-28 2020-03-06 米哈游科技(上海)有限公司 Resource loading method and device, server and storage medium
CN111198730A (en) * 2018-10-30 2020-05-26 广州腾讯科技有限公司 Method, device, terminal and computer storage medium for starting sub-application program
US20200278875A1 (en) * 2017-11-20 2020-09-03 Huawei Technologies Co., Ltd. Dynamic loading method, and target file creation method and apparatus
CN112306587A (en) * 2019-07-15 2021-02-02 腾讯科技(深圳)有限公司 Page display processing method and device and terminal equipment
CN113064676A (en) * 2020-12-29 2021-07-02 上海金融期货信息技术有限公司 Method for remote component sharing mechanism during front-end operation based on JS entrance
CN113065085A (en) * 2021-03-22 2021-07-02 北京沃东天骏信息技术有限公司 Data loading method and device, target server, target terminal and storage medium
CN113204726A (en) * 2021-07-07 2021-08-03 苏州浪潮智能科技有限公司 BS architecture page response time optimization method, device, equipment and medium
CN113254237A (en) * 2021-06-11 2021-08-13 海尔数字科技(青岛)有限公司 Front-end application calling method, device, storage medium and program product

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9928058B1 (en) * 2014-10-28 2018-03-27 Amazon Technologies, Inc. Optimized class loading
CN105354049A (en) * 2015-09-29 2016-02-24 北京畅游天下网络技术有限公司 Resource loading method, apparatus and system for three-dimensional animation engine
CN108108205A (en) * 2016-11-25 2018-06-01 腾讯科技(深圳)有限公司 Application page surface treatment method and apparatus
CN107105336A (en) * 2017-04-19 2017-08-29 腾讯科技(深圳)有限公司 Data processing method and data processing equipment
US20190347146A1 (en) * 2017-05-11 2019-11-14 Tencent Technology (Shenzhen) Company Limited Message processing method and apparatus, storage medium, and computer device
US20200278875A1 (en) * 2017-11-20 2020-09-03 Huawei Technologies Co., Ltd. Dynamic loading method, and target file creation method and apparatus
CN111198730A (en) * 2018-10-30 2020-05-26 广州腾讯科技有限公司 Method, device, terminal and computer storage medium for starting sub-application program
CN110298002A (en) * 2019-05-31 2019-10-01 福建新大陆软件工程有限公司 Client WEB method for managing resource and equipment
CN112306587A (en) * 2019-07-15 2021-02-02 腾讯科技(深圳)有限公司 Page display processing method and device and terminal equipment
CN110865888A (en) * 2019-11-28 2020-03-06 米哈游科技(上海)有限公司 Resource loading method and device, server and storage medium
CN113064676A (en) * 2020-12-29 2021-07-02 上海金融期货信息技术有限公司 Method for remote component sharing mechanism during front-end operation based on JS entrance
CN113065085A (en) * 2021-03-22 2021-07-02 北京沃东天骏信息技术有限公司 Data loading method and device, target server, target terminal and storage medium
CN113254237A (en) * 2021-06-11 2021-08-13 海尔数字科技(青岛)有限公司 Front-end application calling method, device, storage medium and program product
CN113204726A (en) * 2021-07-07 2021-08-03 苏州浪潮智能科技有限公司 BS architecture page response time optimization method, device, equipment and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117648179A (en) * 2023-11-23 2024-03-05 北京菱云科技有限公司 Resource allocation method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114764354B (en) 2024-01-05

Similar Documents

Publication Publication Date Title
CN110389936B (en) Method, equipment and computer storage medium for starting small program
US10761867B2 (en) Nested emulation and dynamic linking environment
CN111666497B (en) Application program loading method and device, electronic equipment and readable storage medium
US10019598B2 (en) Dynamic service discovery
CN111026491B (en) Interface display method, device, electronic equipment, server and storage medium
CN110069308B (en) Page starting method and device, electronic equipment and storage medium
CN112306587A (en) Page display processing method and device and terminal equipment
CN111475235A (en) Acceleration method, device and equipment for function computation cold start and storage medium
CN109684573B (en) Target picture display method and device, storage medium and electronic equipment
CN113010224B (en) Front-end micro-servitization method, front-end micro-servitization device, computer equipment and storage medium
CN107479868B (en) Interface loading method, device and equipment
CN111796860A (en) Micro front-end scheme implementation method and device
CN111581555A (en) Document loading method, device, equipment and storage medium
CN114764354B (en) PAAS-based dependency management method, PAAS-based dependency management device, electronic equipment and medium
CN113986402A (en) Function calling method and device, electronic equipment and storage medium
CN111400068A (en) Interface control method and device, readable medium and electronic equipment
CN114625536A (en) Video memory allocation method, device, medium and electronic equipment
CN113127430A (en) Mirror image information processing method and device, computer readable medium and electronic equipment
CN111797270A (en) Audio playing method and device, electronic equipment and computer readable storage medium
CN112988686A (en) Plug-in processing method, device, equipment and storage medium
CN113282363A (en) Method and device for optimizing hybrid APP
CN111796865A (en) Byte code file modification method and device, terminal equipment and medium
CN112612531A (en) Application program starting method and device, electronic equipment and storage medium
CN111142972A (en) Method, apparatus, system, and medium for extending functions of application program
CN113849248B (en) Applet loading method, device, storage medium and program product

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
CP03 Change of name, title or address

Address after: 266500 No. 1, Minshan Road, Qingdao area, China (Shandong) pilot Free Trade Zone, Qingdao, Shandong

Patentee after: CAOS industrial Intelligence Research Institute (Qingdao) Co.,Ltd.

Country or region after: China

Patentee after: Kaos Digital Technology (Qingdao) Co.,Ltd.

Patentee after: Karos IoT Technology Co.,Ltd.

Address before: 266500 No. 1, Minshan Road, Qingdao area, China (Shandong) pilot Free Trade Zone, Qingdao, Shandong

Patentee before: CAOS industrial Intelligence Research Institute (Qingdao) Co.,Ltd.

Country or region before: China

Patentee before: Haier digital technology (Qingdao) Co.,Ltd.

Patentee before: Haier Kaos IOT Technology Co.,Ltd.

Address after: 266500 No. 1, Minshan Road, Qingdao area, China (Shandong) pilot Free Trade Zone, Qingdao, Shandong

Patentee after: CAOS industrial Intelligence Research Institute (Qingdao) Co.,Ltd.

Country or region after: China

Patentee after: Haier digital technology (Qingdao) Co.,Ltd.

Patentee after: Haier Kaos IOT Technology Co.,Ltd.

Address before: 266500 No. 1, Minshan Road, Qingdao area, China (Shandong) pilot Free Trade Zone, Qingdao, Shandong

Patentee before: CAOS industrial Intelligence Research Institute (Qingdao) Co.,Ltd.

Country or region before: China

Patentee before: Haier digital technology (Qingdao) Co.,Ltd.

Patentee before: Haier CAOS IOT Ecological Technology Co.,Ltd.

CP03 Change of name, title or address