CN117539557A - Dynamic loading method and device for application program - Google Patents

Dynamic loading method and device for application program Download PDF

Info

Publication number
CN117539557A
CN117539557A CN202311715480.5A CN202311715480A CN117539557A CN 117539557 A CN117539557 A CN 117539557A CN 202311715480 A CN202311715480 A CN 202311715480A CN 117539557 A CN117539557 A CN 117539557A
Authority
CN
China
Prior art keywords
application program
package
customized
path
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311715480.5A
Other languages
Chinese (zh)
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.)
Fujian Huisibo Digital Technology Co ltd
Original Assignee
Fujian Huisibo Digital Technology 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 Fujian Huisibo Digital Technology Co ltd filed Critical Fujian Huisibo Digital Technology Co ltd
Priority to CN202311715480.5A priority Critical patent/CN117539557A/en
Publication of CN117539557A publication Critical patent/CN117539557A/en
Pending legal-status Critical Current

Links

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
    • 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/44536Selecting among different versions

Abstract

The invention discloses a dynamic loading method and a dynamic loading device for an application program, comprising the following steps: when receiving the starting signal, acquiring a user number from a user configuration table; scanning a first path corresponding to the user number; and judging whether the first path has a customized application program package, if so, acquiring the customized application program package and installing the customized application program package, and if not, acquiring a native application program package from a default path and installing the native application program package. By storing the customized application program package and the original application program package under different paths, a plurality of application programs with the same package name can exist in the terminal at the same time, and the default path is scanned after the first path is scanned based on the user number preferentially, so that the installation of the customized application program package or the original application program package can be realized in a dynamic loading mode according to the requirements of the user, and the requirements of the user on deep customization of the original application program are met.

Description

Dynamic loading method and device for application program
Technical Field
The present invention relates to the field of application program management technologies, and in particular, to a method and an apparatus for dynamically loading an application program.
Background
To reduce the number of releases of system versions, multiple users of the same platform typically use the same system version, i.e., maintain the same set of code. But different users have different demands on the native application, one part of the users needs to deeply customize part of the native application, and another part of the users may not need to deeply customize the native application. Thus, native applications cannot be directly modified to meet user customization needs. At present, the customized application program in the terminal is started mainly by reading the configuration file to determine the mode of starting the application program. In the method, the starting of the customized application program is realized by using a native default application program loading path, and the Android system is taken as an example, wherein the application program loading path of the Android native system mainly comprises/system/priv-app,/system/app,/product/priv-app and/product/app.
Because different users have different application programs, if a plurality of customized application programs with different package names exist in the same default path, the application programs with different package names scanned by a PMS (package manager service) in the terminal starting process can be installed on the terminal. After entering the system, the terminal desktop can present application programs of different clients. The same level default path cannot have multiple customized applications of different package names at the same time. If a plurality of application programs with the same package name exist in the terminal, the PMS finally only selects one application program which accords with the installation. The PMS records application information according to the application package name during the scanning process. Therefore, if the version information of the application is the same, the system defaults to install one application program, and cannot control which application program is to be installed, so that the same-level default path is an application program without a plurality of same package names.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: the application program dynamic loading method and device are provided, the fact that a plurality of application programs with the same package name exist at the same time in the terminal is achieved, and the requirement of users on deep customization of the original application programs is met conveniently.
In order to solve the technical problems, the invention adopts the following technical scheme:
a method for dynamically loading an application program, comprising:
when receiving the starting signal, acquiring a user number from a user configuration table;
scanning a first path corresponding to the user number;
and judging whether the first path has a customized application program package, if so, acquiring the customized application program package and installing the customized application program package, and if not, acquiring a native application program package from a default path and installing the native application program package.
In order to solve the technical problems, the invention adopts another technical scheme that:
an application dynamic loading device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
when receiving the starting signal, acquiring a user number from a user configuration table;
scanning a first path corresponding to the user number;
and judging whether the first path has a customized application program package, if so, acquiring the customized application program package and installing the customized application program package, and if not, acquiring a native application program package from a default path and installing the native application program package.
The invention has the beneficial effects that: by storing the customized application program package and the original application program package under different paths, a plurality of application programs with the same package name can exist in the terminal at the same time, and the default path is scanned after the first path is scanned based on the user number preferentially, so that the installation of the customized application program package or the original application program package can be realized in a dynamic loading mode according to the requirements of the user, and the requirements of the user on deep customization of the original application program are met.
Drawings
FIG. 1 is a flowchart illustrating steps of a method for dynamically loading an application program according to an embodiment of the present invention;
FIG. 2 is a system architecture diagram of a dynamic loading method of an application program according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating another step of a method for dynamically loading an application program according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an application dynamic loading device according to an embodiment of the present invention.
Detailed Description
In order to describe the technical contents, the achieved objects and effects of the present invention in detail, the following description will be made with reference to the embodiments in conjunction with the accompanying drawings.
Referring to fig. 1, a method for dynamically loading an application program includes:
when receiving the starting signal, acquiring a user number from a user configuration table;
scanning a first path corresponding to the user number;
and judging whether the first path has a customized application program package, if so, acquiring the customized application program package and installing the customized application program package, and if not, acquiring a native application program package from a default path and installing the native application program package.
From the above description, the beneficial effects of the invention are as follows: by storing the customized application program package and the original application program package under different paths, a plurality of application programs with the same package name can exist in the terminal at the same time, and the default path is scanned after the first path is scanned based on the user number preferentially, so that the installation of the customized application program package or the original application program package can be realized in a dynamic loading mode according to the requirements of the user, and the requirements of the user on deep customization of the original application program are met.
Further, the user configuration table is preset in a user customized resource partition;
the customized application package and the native application package are preset in the basic system partition.
As can be seen from the above description, the user configuration table is preset in the user customized resource partition, so that not only can the security of the user configuration table be improved, but also the user configuration table is distinguished from system resources such as native application packages in the basic system partition, thereby being more beneficial to configuring the user configuration table; meanwhile, the customized application program package is preset in the basic system partition, so that the customized application program can be directly operated through the resources of the basic system partition.
Further, the customized application program package is preset in a user customized resource partition;
the native application package is preset in a basic system partition.
As can be seen from the above description, by presetting the customized application package in the customized resource partition, and presetting the native application package in the basic system partition, that is, placing all the content related to the customized application package in the customized resource partition, the customized resource and the system resource can be better distinguished.
Further, the method further comprises the following steps:
receiving an update request, and acquiring an update customization application program package and an update native application program package;
updating the native application in the base system partition with the update-custom application package;
and updating the native application package in the basic system partition through the updated native application package.
As can be seen from the above description, when the customized resources and the system resources are stored in different partitions, the problem of application program operation failure caused by incompatibility of the basic system may occur in the system application of the customized resource partition, and the problem of incompatibility is effectively solved by publishing the versions of the basic system and the customized resources together during updating, so that the customized resource partition is compatible with the system in the basic system partition.
Further, the first path is a next-stage path of the default path.
According to the description, a first-level path is newly added on the loading path of the original default application program, and the path is associated with the user number, so that a plurality of application programs with the same package name exist at the same time in the terminal, and the requirements of users on deep customization of the original application programs and management of customized application program packages are conveniently met.
Another embodiment of the present invention provides an application program dynamic loading device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the following steps when executing the computer program:
when receiving the starting signal, acquiring a user number from a user configuration table;
scanning a first path corresponding to the user number;
and judging whether the first path has a customized application program package, if so, acquiring the customized application program package and installing the customized application program package, and if not, acquiring a native application program package from a default path and installing the native application program package.
As can be seen from the above description, by storing the custom application package and the native application package in different paths, a plurality of applications with the same package name can exist in the terminal at the same time, and by scanning the first path based on the user number preferentially and then scanning the default path, the custom application package or the native application package can be installed in a dynamic loading manner according to the user requirement, so as to meet the user requirement for deep customization of the native application.
Further, the user configuration table is preset in a user customized resource partition;
the customized application package and the native application package are preset in the basic system partition.
As can be seen from the above description, the user configuration table is preset in the user customized resource partition, so that not only can the security of the user configuration table be improved, but also the user configuration table is distinguished from system resources such as native application packages in the basic system partition, thereby being more beneficial to configuring the user configuration table; meanwhile, the customized application program package is preset in the basic system partition, so that the customized application program can be directly operated through the resources of the basic system partition.
Further, the customized application program package is preset in a user customized resource partition;
the native application package is preset in a basic system partition.
As can be seen from the above description, by presetting the customized application package in the customized resource partition, and presetting the native application package in the basic system partition, that is, placing all the content related to the customized application package in the customized resource partition, the customized resource and the system resource can be better distinguished.
Further, the method further comprises the following steps:
receiving an update request, and acquiring an update customization application program package and an update native application program package;
updating the native application in the base system partition with the update-custom application package;
and updating the native application package in the basic system partition through the updated native application package.
As can be seen from the above description, when the customized resources and the system resources are stored in different partitions, the problem of application program operation failure caused by incompatibility of the basic system may occur in the system application of the customized resource partition, and the problem of incompatibility is effectively solved by publishing the versions of the basic system and the customized resources together during updating, so that the customized resource partition is compatible with the system in the basic system partition.
Further, the first path is a next-stage path of the default path.
According to the description, a first-level path is newly added on the loading path of the original default application program, and the path is associated with the user number, so that a plurality of application programs with the same package name exist at the same time in the terminal, and the requirements of users on deep customization of the original application programs and management of customized application program packages are conveniently met.
The dynamic loading method and the dynamic loading device for the application program can be applied to intelligent products of Android, hong Meng and other systems, and can meet the use scene with special requirements for loading the application program of the system, and the method and the device are described in the following specific embodiments:
example 1
In the embodiment, an Android system is taken as an example to explain an application program dynamic loading method; for Android and hong-and-Monte systems, the difference is only that the packaging formats of the application programs are different; if the Android system application program uses an apk format, and the hong Monte system application program uses a hap format; however, the mechanism or the characteristics of the system for scanning the application programs according to different catalogues are the same, namely, the Android system and the hong Monte system can scan the application programs of the appointed catalogues; the scheme in the present embodiment can be applied.
Referring to fig. 1, a method for dynamically loading an application program includes:
s0, presetting a user configuration table, customizing an application program package and a native application program package;
in this embodiment, a new customres partition (user-customized resource partition) is created, and the rights are modified to read-only; referring to fig. 2, the system architecture adopted in the present example includes a basic system and user-customized resources, and the basic system and the user-customized resources may be separately released; the basic system comprises partitions such as system, product and vendor, and the system application program and the native application program package are mainly stored in the system and product partitions; the user customized resources comprise custom mres partitions (user customized resource partitions) which belong to user customized resources and are mainly used for storing the preset user configuration table, wherein the preset user configuration table is internally provided with configuration information related to users such as user names, user numbers and the like; from the security point of view, the user number needs to be stored in a safer partition, while the security of the read-only partition that opens dm-quality is highest, such as system partition, product partition, vendor partition, and include customres partition; although partial catalogues and files of the data partition have certain strategy management and control, a certain degree of dynamic setting of some configuration files is convenient, the data partition is a readable and writable partition, so that the risk of modification of a user configuration table (such as a user number) exists; meanwhile, from the aspect of product planning, the user configuration table belongs to the category related to user customization, the system, the product and other partitions mainly belong to the basic system category, the vendor partition mainly belongs to the chip manufacturer customization category, and the custom mres user customization resource partition provided by the embodiment is a partition newly added by the embodiment and belongs to the user customization category; thus, in this embodiment the user configuration table is stored in a custom res user-customized resource partition; and a basic system only corresponds to one custom res user customized resource partition; each custom res custom resource partition only contains a corresponding user configuration table; in this embodiment, the custom application package is preset in the basic system partition.
TABLE 1 abbreviation and key term definition table
Referring to fig. 3, S1, when receiving a start signal, acquiring a user number from a user configuration table; taking an Android system as an example, some key services, such as a Package Manager Service (PMS), are started in the startup process of the Android system; and then the PMS acquires the user configuration table from the customres partition in the starting process, and acquires the user number of the current terminal.
S2, scanning a first path corresponding to the user number; wherein the first path is a next stage path of the default path; taking an Android system as an example, an application program loading path of the Android native system mainly comprises/system/priv-app,/system/app,/product/priv-app and/product/app; wherein the/system/priv-app and/system/app paths mainly store applications that are Android native and not customized by the vendor or user, and the/product/priv-app and/product/app paths mainly store applications that are Android native and possibly customized by the vendor or user; if the Android native setting application program loading path is/product/priv-app/Settings, when the user needs to deeply customize the native system application program, the loading path of the application program needing to be customized is newly added; each user has a unique corresponding user number, such as the number of user A is 001, the number of user B is 002, the number of user C is 003, and so on; when the C user needs to deeply customize the native setting application program, the newly added loading path is/product/priv-app/003/Settings; when the deep customization of the native setting application is not needed, the directory is not generated, i.e. the path does not exist; at this time, the terminal may include setting applications (Settings) under two directories of product/priv-app/Settings and product/priv-app/003/Settings at the same time; similarly, if other users have depth customization requirements, a loading path is newly added according to the rule; however, in order to follow the google original design intention, in general, the user is customized to an application program under a product catalog, so the embodiment will be described by taking the product catalog as an example; if the user number is 003, the corresponding first path is: product/priv-app/003/Settings.
S3, judging whether the first path has a customized application program package, if so, acquiring the customized application program package and installing the customized application program package, and if not, acquiring a native application program package from a default path and installing the native application program package;
if the first path/product/priv-app/003 comprises a custom application package Settings application, acquiring and installing the custom application package under the path; otherwise, acquiring and installing the customized application package from a default path/product/priv-app/Settings;
after the application program is acquired, the PMS analyzes the scanned application program, analyzes an android management.xml file, and stores data information into a memory; before starting up to enter the system, the PMS installs the application program meeting the expectations.
In another alternative embodiment, the custom application package is preset in a custom resource partition; the native application package is preset in a basic system partition; i.e., the newly added custom resource partition (custom partition) specifically stores custom applications, such as/custom res/priv-app and/custom res/app; meanwhile, the/customre/priv-app and/customres/app directories need to be added to the PMS boot scan directory; i.e. after starting up, the catalog of the system default is loaded by priority and then loaded by the catalog of the system; the principle is the same as the above steps; however, this embodiment requires release of the base system together with the version of the custom resource, and cannot be released separately; because the customres partition integrates the system application, and the system application program needs to depend on the basic system, otherwise, the problem of application program operation failure caused by incompatibility of the basic system by the system application of the customres partition possibly occurs; after receiving the update request, acquiring an update customized application program package and an update original application program package at the same time; updating the native application in the base system partition with the update-custom application package; and updating the native application package in the basic system partition through the updated native application package.
Example two
Referring to fig. 4, an application program dynamic loading device includes a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the following steps when executing the computer program:
s1, when a starting signal is received, a user number is obtained from a user configuration table; the user configuration table is preset in the user customized resource partition.
S2, scanning a first path corresponding to the user number; the first path is the next-stage path of the default path.
S3, judging whether the first path has a customized application program package, if so, acquiring the customized application program package and installing the customized application program package, and if not, acquiring a native application program package from a default path and installing the native application program package;
the native application package is preset in a basic system partition, and the customized application package is preset in a user customized resource partition or a basic system partition.
When the customized application package is preset in the customized resource partition, the basic system and the version of the customized resource are required to be issued together, namely, after receiving the update request, the updated customized application package and the updated original application package are required to be acquired simultaneously; updating the native application in the base system partition with the update-custom application package; and updating the native application package in the basic system partition through the updated native application package.
In summary, the invention discloses a method and a device for dynamically loading an application program, which acquire a user number from a user configuration table when receiving a starting signal; scanning a first path corresponding to the user number; and judging whether the first path has a customized application program package, if so, acquiring the customized application program package and installing the customized application program package, and if not, acquiring a native application program package from a default path and installing the native application program package. By storing the customized application program package and the original application program package under different paths, a plurality of application programs with the same package name can exist in the terminal at the same time, and by scanning the first path based on the user number preferentially and then scanning the default path, the customized application program package or the original application program package can be installed in a dynamic loading mode according to the requirement of a user, namely, the application programs of different users are preset in the basic system at the same time, the application programs with the same package name are integrated in the same version, the application programs of the specified users can be loaded according to the user number in the starting process, the application programs of other users are not loaded, so that a basic system is not required to be maintained for each user for a development and design manufacturer, the release of the version of the basic system is effectively reduced, and the requirement of the user on deep customization of the original application program is met.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent changes made by the specification and drawings of the present invention, or direct or indirect application in the relevant art, are included in the scope of the present invention.

Claims (10)

1. A method for dynamically loading an application program, comprising:
when receiving the starting signal, acquiring a user number from a user configuration table;
scanning a first path corresponding to the user number;
and judging whether the first path has a customized application program package, if so, acquiring the customized application program package and installing the customized application program package, and if not, acquiring a native application program package from a default path and installing the native application program package.
2. The method for dynamically loading an application program according to claim 1, wherein the user configuration table is preset in a user customized resource partition;
the customized application package and the native application package are preset in the basic system partition.
3. The method for dynamically loading an application program according to claim 1, wherein the custom application package is preset in a custom resource partition;
the native application package is preset in a basic system partition.
4. A method of dynamically loading an application according to claim 3, further comprising:
receiving an update request, and acquiring an update customization application program package and an update native application program package;
updating the native application in the base system partition with the update-custom application package;
and updating the native application package in the basic system partition through the updated native application package.
5. The method according to claim 1, wherein the first path is a next-level path of the default path.
6. An application program dynamic loading device, comprising a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor implements the following steps when executing the computer program:
when receiving the starting signal, acquiring a user number from a user configuration table;
scanning a first path corresponding to the user number;
and judging whether the first path has a customized application program package, if so, acquiring the customized application program package and installing the customized application program package, and if not, acquiring a native application program package from a default path and installing the native application program package.
7. The apparatus according to claim 6, wherein the user configuration table is preset in a user customized resource partition;
the customized application package and the native application package are preset in the basic system partition.
8. The application dynamic loading device according to claim 6, wherein the custom application package is preset in a custom resource partition;
the native application package is preset in a basic system partition.
9. The application dynamic loading device of claim 8, further comprising:
receiving an update request, and acquiring an update customization application program package and an update native application program package;
updating the native application in the base system partition with the update-custom application package;
and updating the native application package in the basic system partition through the updated native application package.
10. The apparatus of claim 6, wherein the first path is a next level path of the default path.
CN202311715480.5A 2023-12-13 2023-12-13 Dynamic loading method and device for application program Pending CN117539557A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311715480.5A CN117539557A (en) 2023-12-13 2023-12-13 Dynamic loading method and device for application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311715480.5A CN117539557A (en) 2023-12-13 2023-12-13 Dynamic loading method and device for application program

Publications (1)

Publication Number Publication Date
CN117539557A true CN117539557A (en) 2024-02-09

Family

ID=89788098

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311715480.5A Pending CN117539557A (en) 2023-12-13 2023-12-13 Dynamic loading method and device for application program

Country Status (1)

Country Link
CN (1) CN117539557A (en)

Similar Documents

Publication Publication Date Title
CN111596969B (en) Software architecture method based on microkernel plus plug-in mode
CN105657191B (en) Application increment upgrading method and system based on Android system
KR101343148B1 (en) Automated device driver management
US8997089B2 (en) Computer system and a method of deploying an application in a computer system
US7330967B1 (en) System and method for injecting drivers and setup information into pre-created images for image-based provisioning
US6871345B1 (en) Self managing software agents with introspection
US20080222160A1 (en) Method and system for providing a program for execution without requiring installation
US20030221094A1 (en) Method and system for configuring a computer
US20090328025A1 (en) Automatically managing versioning of mashup widgets
US20060020937A1 (en) System and method for extraction and creation of application meta-information within a software application repository
US20090216811A1 (en) Dynamic composition of an execution environment from multiple immutable file system images
US6385623B1 (en) System and method for ensuring proper execution of scheduled file updates
US10599542B2 (en) Device configuration with cached pre-assembled driver state
US20040088397A1 (en) System and method for management of software applications
US20080256534A1 (en) Method for improved image-customization by use of embedded metadata
KR20030095975A (en) Image-based software installation
US9116770B2 (en) Recipe-based application conversion
US20050091259A1 (en) Framework to build, deploy, service, and manage customizable and configurable re-usable applications
CN106775876B (en) Method for quickly starting application by android system
JP4975222B2 (en) Multilingual user interface for operating system
US20100064284A1 (en) Satisfying Missing Dependencies on a Running System
CN112256351B (en) Method for realizing Feign component, method and device for calling micro-service
CN117539557A (en) Dynamic loading method and device for application program
CN112230976A (en) Method for simultaneously supporting two software package managers and supporting mutual dependence and conflict detection of software packages
US20040205744A1 (en) Management of co-processor information by integrating non-program information with program information

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