WO2022100208A1 - Procédé de chargement de bibliothèques dynamiques, procédé de réglage de déploiement de noyau, et appareils associés - Google Patents

Procédé de chargement de bibliothèques dynamiques, procédé de réglage de déploiement de noyau, et appareils associés Download PDF

Info

Publication number
WO2022100208A1
WO2022100208A1 PCT/CN2021/115233 CN2021115233W WO2022100208A1 WO 2022100208 A1 WO2022100208 A1 WO 2022100208A1 CN 2021115233 W CN2021115233 W CN 2021115233W WO 2022100208 A1 WO2022100208 A1 WO 2022100208A1
Authority
WO
WIPO (PCT)
Prior art keywords
dynamic
dynamic library
loaded
libraries
linked
Prior art date
Application number
PCT/CN2021/115233
Other languages
English (en)
Chinese (zh)
Inventor
欧炜
陈计亮
江维财
徐高峰
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022100208A1 publication Critical patent/WO2022100208A1/fr

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
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/656Updates while running
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • 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
    • 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

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a method for loading a dynamic library, a method for adjusting core deployment, and a related device.
  • a multi-core processor can support multiple concurrent applications at the same time.
  • the multi-core processor in the base station supports the LTE standard of 4G and the NR standard of 5G.
  • Core 1, core 2, and core 3 of the processor are responsible for resource allocation for 4G users, and core 4 and core 5 of the processor are responsible for resource allocation for 5G users.
  • the number of 4G users and 5G users may change. For example, the number of 4G users drops to 50, and the number of 5G users rises to 100.
  • the relevant dynamic library may be pre-linked in the code compilation stage for relocation. This saves the time consumed by relocation when the dynamic library is loaded, and improves the loading speed of the dynamic library.
  • the present application provides a method for loading a dynamic library, a method for adjusting core deployment, and a related device, so as to improve the loading speed of the dynamic library when the core deployment is adjusted, and solve the problem that the dynamic library fails to be loaded.
  • the embodiment of the present application provides a dynamic library loading method, including:
  • the executable files of all the dynamic libraries to be loaded corresponding to the target kernel are obtained from the file system;
  • the executable files of all the dynamic libraries to be loaded include: the version associated with the first service dynamic library The executable file of the dynamic library and the executable file of the dynamic library associated with the first platform dynamic library version, wherein the first platform dynamic library version is the latest dynamic library version of the platform that supports the loading of the first application;
  • the executable file is stored in the file system;
  • the method further includes:
  • a dynamic library load request is received; the dynamic library load request indicates all dynamic libraries and target kernels to be loaded.
  • the method when loading the pre-linked executable file of each dynamic library to be loaded into the target kernel of the processor, the method further includes:
  • the pre-linked executable file of each dynamic library to be loaded is stored in the memory space corresponding to the target kernel in the memory with the pre-arranged storage address.
  • the method further includes:
  • the storage address of the pre-linked executable file of each dynamic library to be loaded is arranged.
  • the storage address of the pre-linked executable file of each dynamic library to be loaded is arranged, specifically including:
  • n is a positive integer
  • a dynamic library that can be stored in the remaining storage space and the segment size of the executable file is closest to the remaining storage space is determined from the n dynamic libraries whose storage addresses are not arranged.
  • the addresses are programmed into the address range of the remaining memory space.
  • the segment size of the executable file of the dynamic library includes: the size of the code segment and the size of the data segment in the executable file of the dynamic library.
  • the file system includes: at least one dynamic library version container;
  • At least one dynamic library version container includes: a dynamic library version first container; the dynamic library version first container includes executable files of all dynamic libraries related to loading of the first application; executable files of all dynamic libraries related to loading of the first application are included.
  • the executable files include: executable files of all dynamic libraries to be loaded corresponding to the target kernel;
  • the executable files of all dynamic libraries to be loaded corresponding to the target kernel are obtained from the first container of the dynamic library version.
  • the file system further includes: a dynamic library pre-linked version container corresponding to each dynamic library version container, including a dynamic library pre-linked version first container corresponding to the dynamic library version first container;
  • it also includes: when loading the first application on the target kernel again, directly obtaining the pre-linked executable files of all the dynamic libraries to be loaded corresponding to the target kernel from the file system, and converting each of the dynamic libraries to be loaded.
  • the pre-linked executable is loaded into the target kernel.
  • Embodiments of the present application also provide a method for adjusting core deployment, including:
  • the core deployment adjustment request indicates all dynamic libraries to be unloaded corresponding to the target kernel and all dynamic libraries to be loaded corresponding to the target kernel;
  • all dynamic libraries to be unloaded are unloaded from the target kernel, and the pre-linked executable files of all dynamic libraries to be loaded are obtained from the file system, and all dynamic libraries to be loaded are pre-linked.
  • the executable is loaded into the target kernel;
  • the pre-linked executable files of all the dynamic libraries to be loaded are obtained after pre-linking the executable files of all the dynamic libraries to be loaded; the executable files of all the dynamic libraries to be loaded include: the first service dynamic library version The executable file of the associated dynamic library and the executable file of the dynamic library associated with the first platform dynamic library version, wherein the first platform dynamic library version is the latest dynamic library version of the platform that supports the loading of the first application.
  • the embodiment of the present application also provides a dynamic library loading device, including:
  • the obtaining module is used to, when the first application is loaded in the target kernel, obtain the executable files of all dynamic libraries to be loaded corresponding to the target kernel from the file system; the executable files of all the dynamic libraries to be loaded include: the first service The executable file of the dynamic library associated with the dynamic library version and the executable file of the dynamic library associated with the first platform dynamic library version, wherein the first platform dynamic library version is the latest dynamic library version of the platform that supports the loading of the first application;
  • the pre-link module is used to pre-link the executable files of all the dynamic libraries to be loaded separately, obtain the pre-linked executable files of each dynamic library to be loaded in all the dynamic libraries to be loaded, and link each dynamic library to be loaded.
  • the pre-linked executable file of the dynamic library is stored in the file system;
  • the loading module is used to obtain the pre-linked executable file of each dynamic library to be loaded from the file system, and load the pre-linked executable file of each dynamic library to be loaded into the target kernel.
  • Embodiments of the present application also provide an apparatus for adjusting nuclear deployment, including:
  • the receiving module is used to receive a core deployment adjustment request;
  • the core deployment adjustment request indicates all dynamic libraries to be unloaded corresponding to the target kernel and all dynamic libraries to be loaded corresponding to the target kernel;
  • the deployment adjustment module is used to unload all the dynamic libraries to be unloaded from the target kernel according to the core deployment adjustment request, obtain the pre-linked executable files of all the dynamic libraries to be loaded from the file system, and load all the dynamic libraries to be loaded.
  • the executable file pre-linked by the dynamic library is loaded into the target kernel;
  • the pre-linked executable files of all the dynamic libraries to be loaded are obtained after pre-linking the executable files of all the dynamic libraries to be loaded; the executable files of all the dynamic libraries to be loaded include: the first service dynamic library version The executable file of the associated dynamic library and the executable file of the dynamic library associated with the first platform dynamic library version, wherein the first platform dynamic library version is the latest dynamic library version of the platform that supports the loading of the first application.
  • the embodiments of the present application at least have the following advantages:
  • the executable files of all the dynamic libraries to be loaded corresponding to the target kernel are obtained from the file system;
  • the executable files of all the dynamic libraries to be loaded include: : the executable file of the dynamic library associated with the first service dynamic library version and the executable file of the dynamic library associated with the first platform dynamic library version.
  • the first platform dynamic library version is the latest dynamic library version of the platform that supports the loading of the first application.
  • the executable file is stored in the file system; the pre-linked executable file of each dynamic library to be loaded is obtained from the file system, and the pre-linked executable file of each dynamic library to be loaded is loaded into the target kernel.
  • the application of the target kernel is usually switched frequently, for example, frequently switching from the second application to the first application, and frequently switching from the first application to the second application.
  • the pre-linked executable file of each dynamic library to be loaded is stored in the file system, when the first application needs to be switched and loaded on the target kernel in the future, it can be directly
  • the pre-linked executable files of these dynamic libraries to be loaded are obtained from the file system, without performing the pre-linking operation every time.
  • pre-linking can be performed based on the executable file of the dynamic library associated with the latest dynamic library version of the platform. In this way, the pre-linked executable file is compatible with the latest dynamic library version of the platform, avoiding the problem of dynamic library loading failure.
  • FIG. 1 is a schematic flowchart of a dynamic library loading method provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram comparing the storage effects of executable files after dynamic library pre-linking before memory arrangement and after memory arrangement according to an embodiment of the present application;
  • FIG. 3 is a schematic structural diagram of a file system according to an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a method for adjusting core deployment provided by an embodiment of the present application
  • FIG. 5 is a schematic diagram of an application scenario of a method for adjusting core deployment provided by an embodiment of the present application
  • FIG. 6 is a schematic structural diagram of another file system provided by an embodiment of the present application.
  • FIG. 7A is a signaling diagram of a dynamic library loading method provided by an embodiment of the present application.
  • 7B is a signaling diagram of a method for adjusting core deployment provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a dynamic library loading apparatus provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of an apparatus for adjusting core deployment according to an embodiment of the present application.
  • Dynamic library relocatable object files are packaged into a single file in a specific way, and when linking to generate an executable file, "copy” what it needs from this single file to the final executable file, and it is not necessary to "copy” all the binary code of the required content into the executable file at link time, but only “copy” some relocation and symbol table information, which can be completed when the program is running. the linking process.
  • This separate file is called a dynamic library.
  • GAT Global Offset Table
  • Pre-Link is a method to optimize application load time by resolving library symbols before startup.
  • the pre-linking process of the current dynamic library loading method is carried out in the compilation stage. If the version of the dynamic library is updated on the platform that supports the operation of the business application, the version of the executable file of the dynamic library obtained by the previous pre-linking will be the same as the actual version of the platform. The latest dynamic library version is not compatible, and the problem that the dynamic library loading fails sometimes occurs. At present, a technical solution of using GOT table to load dynamic library can also be adopted. In this scheme, all applications need to perform jump access through the GOT table, which increases the running consumption and thus affects the performance of the system.
  • the present application provides a dynamic library loading method, an adjustment method for core deployment, and a related device, which can ensure the successful loading of the dynamic library on the basis of improving the loading speed of the dynamic library. And compared with the GOT table loading dynamic library scheme, there will be no additional running consumption, so it will not have a negative impact on the performance of the system.
  • the embodiments of the present application will be described in further detail below with reference to the accompanying drawings and specific implementation manners. Referring to FIG. 1 , this figure is a schematic flowchart of a dynamic library loading method provided by an embodiment of the present application. As shown in FIG. 1 , the dynamic library loading method provided by the embodiment of the present application includes the following steps S101 to S103:
  • the dynamic library is loaded to at least one core of the multi-core processor.
  • the target kernel is one of at least one kernel that needs to load dynamic libraries. There are various reasons for loading the dynamic library into the target kernel, and the reasons for loading are described below with examples.
  • the target kernel is idle, and other kernels loaded with the first application are insufficient to support the current traffic of the first application.
  • the target kernel needs to be converted from an idle state to a working state supporting services related to the first application.
  • a dynamic library related to the first application needs to be loaded into the target kernel.
  • Another example reason is that the target kernel has previously loaded relevant dynamic libraries of other applications, but due to the adjustment of the kernel deployment, the target kernel needs to be switched from other applications to the first application. For this purpose, a dynamic library related to the first application needs to be loaded into the target kernel.
  • the file system is a system outside the processor that stores all dynamic library-related files, independent of memory.
  • the file system may store the platform-related dynamic library and the file system of the service-related dynamic library.
  • the business-related dynamic library is most closely related to the application switching of the target kernel.
  • the platform specifically refers to a system that supports loading and running of the first application, for example, an operating system.
  • Platform-related dynamic libraries may undergo version updates.
  • business-related dynamic libraries may also undergo version updates.
  • the version updates of dynamic libraries are embodied in the file system.
  • the target kernel needs to be switched to a working state that supports services related to the first application.
  • the processor obtains executable files of all dynamic libraries to be loaded corresponding to the target kernel from the file system.
  • it includes both the executable file of the dynamic library associated with the first service dynamic library version, and the executable file of the dynamic library associated with the first platform dynamic library version, wherein the first platform dynamic library version supports the loading of the first application The latest dynamic library version for the platform.
  • the first service dynamic library version refers to a dynamic library version formed by a collection of executable files of all service-related dynamic libraries to be loaded in order to load the first application.
  • the first platform dynamic library version refers to a dynamic library version formed by a collection of executable files of all the latest platform-related dynamic libraries in order to load the first application.
  • the executable files of all dynamic libraries to be loaded corresponding to the target kernel may change.
  • business-related dynamic libraries may change; platform-related dynamic libraries may change or remain unchanged.
  • all the executable files of the dynamic library to be loaded include: the executable file of the dynamic library associated with the second service dynamic library version and the executable file of the dynamic library associated with the second platform dynamic library version.
  • the second service dynamic library version refers to a dynamic library version formed by a collection of executable files of all service-related dynamic libraries to be loaded in order to load the second application.
  • the second platform dynamic library version refers to a dynamic library version formed by a collection of executable files of all the latest platform-related dynamic libraries in order to load the second application.
  • the dynamic library associated with the first service dynamic library version and the dynamic library associated with the second service dynamic library version may be partially the same, or may be completely different.
  • S102 Pre-link the executable files of all the dynamic libraries to be loaded respectively, obtain the pre-linked executable files of each dynamic library to be loaded in all the dynamic libraries to be loaded, and pre-link each dynamic library to be loaded.
  • the linked executable is stored in the file system.
  • Pre-linking an executable file of a dynamic library is a relatively mature technology in the art, so the implementation manner of pre-linking is not limited here, and the implementation process of pre-linking is not described in detail.
  • the occurrence period of the pre-link technology is implemented in the first application loading process. During the loading process of the first application, even if the dynamic library version associated with the platform is adjusted and updated in real time, it can respond in time, avoiding the problem of incompatibility with the platform version after pre-linking.
  • S103 Acquire the pre-linked executable file of each dynamic library to be loaded from the file system, and load the pre-linked executable file of each dynamic library to be loaded into the target kernel.
  • step S101 the executable files of all dynamic libraries to be loaded corresponding to the target kernel are obtained from the file system, including the executable files of the dynamic libraries p1, p2 and p3 and the executable files of the dynamic libraries s1, s2, s3 and s4.
  • the execution file wherein the dynamic libraries p1-p3 are dynamic libraries associated with the first service dynamic library version, and the dynamic libraries s1-s4 are dynamic libraries associated with the first platform dynamic library version.
  • Step S101 pre-links the executable files of the dynamic libraries p1-p3 and s1-s4 respectively, and imports the pre-linked executable files of the dynamic libraries p1-p3 and s1-s4 into the file system.
  • step S103 in order to load these dynamic libraries, the pre-linked executable files of the dynamic libraries p1-p3 and s1-s4 are taken out from the file system and loaded into the target kernel.
  • the above-mentioned p1-p3 and s1-s4 are not shown in the figure.
  • the executable file of the dynamic library to be loaded is pre-linked, and the pre-linked executable file is stored in the file system, so as to facilitate the retrieval again, Improved the loading speed of dynamic libraries.
  • pre-linking since the first pre-linking is performed when the target kernel loads the first application, pre-linking can be performed based on the executable file of the dynamic library associated with the dynamic library version of the platform at that time, so that the pre-linked platform dynamic library can be pre-linked.
  • the version is the latest. In this way, the problem that the pre-linked executable file does not match the latest dynamic library version of the platform is avoided, and the compatibility performance is guaranteed.
  • a dynamic library loading request may also be received; the dynamic library loading request indicates all the dynamic libraries to be loaded and the target kernel.
  • the information of all dynamic libraries to be loaded and the target kernel can be directly obtained according to the dynamic library loading request itself, or all the dynamic libraries to be loaded and the target kernel can be indicated according to the dynamic library loading request.
  • the ID information of the target kernel obtains all dynamic libraries to be loaded and the target kernel, which is not limited in this embodiment of the present application.
  • the method provided by the embodiment of the present application can obtain the dynamic library to be loaded as dynamic library A according to the ID information 001 in the dynamic library loading request and the mapping relationship between the ID information and the dynamic library, according to the ID information 002 and the ID information and the dynamic library A From the mapping relationship of the dynamic library, the dynamic library to be loaded can be obtained as dynamic library B.
  • the requested storage granularity is a fixed value. For example: when the storage granularity of the application is 4k, the storage granularity of each application is an integer multiple of 4k.
  • the order of loading the dynamic library is certain. After the action of loading the pre-linked executable files of the dynamic library in sequence is completed, there may be a large hole in the memory, so that the executable file after the dynamic library pre-linking is loaded as a whole. Occupy a lot of memory, or the problem of wasting memory space.
  • the storage addresses of these files in the memory can be arranged based on these linked executable files, so as to reduce the memory usage. Empty.
  • the storage address of the pre-linked executable file of each dynamic library to be loaded is arranged.
  • the storage addresses are arranged according to the segment size of the executable file of each dynamic library to be loaded because the corresponding segment size does not change significantly before and after pre-linking.
  • the segment size of the executable file of the dynamic library specifically includes: the size of the code segment and the size of the data segment.
  • Code segments and data segments have different properties. It should be noted that the essence of an executable file is a description file, and the size of the executable file itself does not represent the size of the memory occupied by the executable file after it is loaded into the memory.
  • the format of the executable file can be ELF (Executable and Linkable Format) format.
  • memory can be organized separately based on different attributes. For example, according to the size of the data segment in the executable file of the dynamic library 1 to be loaded and the size of the data segment in the executable file of the dynamic library 2 to be loaded, the memory arrangement is unified; according to the executable file of the dynamic library 1 to be loaded The size of the code segment and the size of the code segment in the executable file of the dynamic library 2 to be loaded are unified for memory arrangement.
  • FIG. 2 shows the storage effect of a pre-linked executable file of a dynamic library before memory arrangement (see section 2a) and the memory arrangement according to the technical solution of the present application.
  • the loading order of the dynamic library is predetermined, and it is necessary to load the dynamic library 0, the dynamic library 1, the dynamic library 2, and the dynamic library 3 in sequence.
  • the remaining storage space of dynamic library 0 is larger than the pre-linked executable file of dynamic library 2.
  • dynamic library 2 will be stored in the remaining storage space of dynamic library 0; when loading dynamic library 3, since the remaining space of dynamic libraries 0 to 2 is smaller than the segment size of the executable file pre-linked by dynamic library 3, Then the dynamic library 3 will re-apply for a granular memory to store in it. Since part 2b shows the technical effects of the technical solutions of the present application, the following will first introduce the technical solutions provided by the implementation of the present application and examples of application of the technical solutions.
  • the storage address of the pre-linked executable file of each dynamic library to be loaded may be stored according to the storage granularity of the memory and the segment size of the pre-linked executable file of each dynamic library to be loaded. Make arrangements.
  • An example implementation is provided below. It should be understood that the following examples do not constitute a limitation on the methods provided in the present application.
  • the storage address of the executable file after pre-linking of each dynamic library to be loaded is arranged, Can specifically include:
  • n is a positive integer (for example, n is 3, n is not limited here, and n can also be all remaining The total number of dynamic libraries with unprogrammed storage addresses); determine a dynamic library that can be stored in the remaining storage space and the segment size of the executable file is the closest to the remaining storage space from the n dynamic libraries with unprogrammed storage addresses.
  • the storage address of the executable file pre-linked by the dynamic library is programmed into the address range of the remaining storage space. If the smallest segment size of the executable files of the dynamic library whose storage addresses are not arranged cannot be stored in the remaining storage space, the storage granularity can be re-applied, or the value of n can be enlarged. In this way, it can be ensured that the remaining space in each granular memory can be used to the greatest extent possible, so that the memory occupied by the pre-linked executable files of all the dynamic libraries to be loaded can be reduced, and the dynamic libraries can be loaded and unloaded from the memory. speed increased.
  • part 2b in FIG. 2 is a schematic diagram of the storage effect of the pre-linked executable file of the arranged dynamic library in the memory.
  • the memory shown in part 2b arranges the storage address of each pre-linked executable file of the dynamic library to be loaded according to the storage granularity of the memory before loading, and then loads the pre-linked executable file of the dynamic library according to the arrangement result. .
  • the segment size of the executable file of dynamic library 3 is larger than the segment size of the executable file of dynamic library 2, the segment size of the executable file of dynamic library 1 is relatively too large, and the remaining storage space corresponding to dynamic library 0 is larger than The segment size of the executable file of the dynamic library 3, so in order to more fully utilize the remaining space corresponding to the dynamic library 0, the dynamic library 3 is loaded into the remaining space corresponding to the dynamic library 0 during the programming process. Dynamic libraries 1 and 2 will be loaded into the granular memory of the newly allocated memory. It can be seen from the above that the dynamic library 3 is loaded into the newly applied granular memory before the arrangement, and the dynamic library 3 is loaded into the remaining space corresponding to the dynamic library 0 after the arrangement. As shown in FIG. 2 , the segment size of dynamic library 3 is larger than that of dynamic library 2. Therefore, on the whole, dynamic library 0, dynamic library 1, dynamic library 2, and dynamic library 3 occupy less memory.
  • each dynamic library to be loaded is pre-
  • the method provided by the embodiment of the present application may further include: storing the pre-linked executable file of each dynamic library to be loaded into a pre-arranged storage address. into the storage space corresponding to the target kernel in memory.
  • the method provided by the embodiment of the present application arranges the storage address of the pre-linked executable file of each dynamic library to be loaded according to the storage granularity of the memory and the segment size of the executable file, which reduces the size of the executable file.
  • the memory hole when the execution file is stored in the memory can reduce the memory occupied by the pre-linked executable file, improve the memory performance, and improve the speed of loading and unloading the dynamic library in the memory.
  • the file system provided by the embodiment of the present application includes: at least one dynamic library version container;
  • the at least one dynamic library version container includes: a first dynamic library version container; the first dynamic library version container includes executable files of all dynamic libraries related to loading the first application; all dynamic library versions related to loading the first application
  • the executable files of the library include: executable files of all dynamic libraries to be loaded corresponding to the target kernel. Therefore, in the embodiment of the present application, obtaining executable files of all dynamic libraries to be loaded corresponding to the target kernel from the file system specifically includes: obtaining all the dynamic libraries to be loaded corresponding to the target kernel from the first container of the dynamic library version executable file.
  • the file system provided by the embodiment of the present application further includes: a dynamic library pre-linked version container corresponding to each dynamic library version container, including a dynamic library pre-linked version first container corresponding to the dynamic library version first container. Therefore, in the implementation of the present application, storing the pre-linked executable file of each dynamic library to be loaded into the file system specifically includes: storing the pre-linked executable file of each dynamic library to be loaded into the dynamic library Pre-linked version of the first container. In the embodiment of the present application, acquiring the pre-linked executable file of each dynamic library to be loaded from the file system specifically includes: acquiring the pre-linked executable file of each dynamic library to be loaded from the first container of the pre-linked version of the dynamic library executable file.
  • FIG. 3 is a schematic structural diagram of a file system provided by an embodiment of the present application.
  • the loading module 100 in the digital signal processor 1000 obtains the dynamic library loading request
  • the loading module 100 obtains all the pending files corresponding to the target kernel from the first container 300 of the dynamic library version. Loaded dynamic library executable.
  • the loading module 100 stores the pre-linked executable file of each dynamic library to be loaded into the first container 400 of the pre-linked version of the dynamic library.
  • the loading module 100 in the DSP processor 1000 obtains the pre-linked executable file of each dynamic library to be loaded from the first container 400 of the dynamic library pre-linked version.
  • loading the pre-linked executable file of each dynamic library to be loaded into the target kernel in this application may further include: the loading module 100 in the DSP processor 1000 pre-loads each dynamic library to be loaded.
  • the linked executable is loaded into the target kernel.
  • the method provided by this embodiment of the present application may further include: when the first application is loaded on the target kernel again, All pre-linked executable files of the dynamic library to be loaded corresponding to the target kernel are directly obtained from the file system, and each pre-linked executable file of the dynamic library to be loaded is loaded into the target kernel.
  • an embodiment of the present application further provides a method for adjusting core deployment.
  • this figure is a schematic flowchart of a method for adjusting core deployment provided by an embodiment of the present application.
  • the method for adjusting core deployment provided by this embodiment of the present application includes the following steps S401 to S403:
  • S401 Receive a core deployment adjustment request; the core deployment adjustment request indicates all dynamic libraries to be unloaded corresponding to the target kernel and all dynamic libraries to be loaded corresponding to the target kernel.
  • S402 Unload all dynamic libraries to be unloaded from the target kernel according to the core deployment adjustment request, obtain pre-linked executable files of all dynamic libraries to be loaded from the file system, and pre-link all dynamic libraries to be loaded After the executable is loaded into the target kernel.
  • the pre-linked executable files of all the dynamic libraries to be loaded are obtained after pre-linking the executable files of all the dynamic libraries to be loaded;
  • the executable files of all the dynamic libraries to be loaded include : the executable file of the dynamic library associated with the first service dynamic library version and the executable file of the dynamic library associated with the first platform dynamic library version, wherein the first platform dynamic library version is the latest update of the platform that supports the loading of the first application library version.
  • FIG. 5 is a schematic diagram of an application scenario of the method for adjusting core deployment provided by the embodiment of the present application.
  • the core deployment adjustment method provided by the present application can redeploy the core 3 in the processor 5 cores in the figure, and the core 3 is used as an example to illustrate: Specifically, the method provided by the present application will , application) 0 is unloaded from the core 3, and obtains all pre-linked executable files related to APP1 to be loaded from the file system, and loads all the pre-linked executable files related to APP1 to be loaded into the core 3. In this way, the core 3 originally deployed in APP0 can be deployed to APP1.
  • the method provided by the present application can also unload all pre-linked executable files related to APP1 to be loaded from core 3, and obtain all pre-linked executable files related to APP0 to be loaded from the file system. file, load all pre-linked executable files related to APP0 to be loaded into core 3, so that core 3 originally deployed in APP1 can be deployed to APP0.
  • the cores deployed by the methods provided in the embodiments of the present application are not limited to the core 3 in the above example, but include any one or more deployable cores.
  • the platform and application in this application do not limit the dynamic library for core deployment adjustment.
  • the method for core deployment provided by the present application can also be applied to the readjustment and deployment of the core deployed in the 4G service and the core deployed in the 5G service in the signal base station.
  • this figure is a schematic structural diagram of another file system provided by an embodiment of the present application.
  • the deployment adjustment module 200 after the deployment adjustment module 200 in the DSP 1000 receives the core deployment adjustment request, the deployment adjustment module 200 unloads all the dynamic libraries to be uninstalled from the target kernel according to the core deployment adjustment request, and pre-links the version from the dynamic library
  • the first container 400 obtains all pre-linked executable files of the dynamic library to be loaded, and loads all the pre-linked executable files of the dynamic library to be loaded into the target kernel.
  • this figure is a signaling diagram of a dynamic library loading method provided by an embodiment of the present application.
  • the loading module obtains the versions of all dynamic libraries through the first container of the dynamic library version; the loading module pre-links all the dynamic libraries together, and pre-links the The version is sent to the first container of the dynamic library pre-linked version for storage. Then, the loading module obtains the pre-linked version of the dynamic library stored in the first container from the pre-linked version of the dynamic library (including all pre-linked executable files of the dynamic library to be loaded), and loads the pre-linked version of the dynamic library. version of the executable is loaded onto the target kernel.
  • this figure is a signaling diagram of a method for adjusting core deployment provided by an embodiment of the present application.
  • the deployment adjustment module will unload the dynamic library on the corresponding target kernel, and obtain the pre-linked version of the dynamic library from the first container of the pre-linked version of the dynamic library , and load the executable file of the pre-linked version of the dynamic library into the target kernel.
  • the unloaded dynamic library is a dynamic library associated with other applications other than the first application.
  • the dynamic library associated with the other application can be unloaded, and then loaded again.
  • the executable file after all dynamic libraries related to the first application are pre-linked.
  • the APP in the embodiment of the present application may be an application program on a terminal, and may also be an application under different standards.
  • APP0 can be an application of 4G LTE standard
  • APP1 can be an application of 5G NR standard.
  • the form of application is not limited here.
  • the method provided by the embodiments of the present application pre-links the executable file of the dynamic library to be loaded, and stores the pre-linked executable file in the file system, so as to facilitate the retrieval again and improve the dynamic performance.
  • the loading speed of the library also avoids the problem that the pre-linked executable file does not match the latest dynamic library version of the platform.
  • the method provided by the embodiment of the present application also arranges the storage address of the executable file according to the storage granularity of the memory and the segment size of the executable file, so that the memory occupied by the pre-linked executable file can be reduced. , memory performance improvement, memory loading dynamic library and unloading dynamic library speed increase.
  • an embodiment of the present application further provides a dynamic library loading apparatus.
  • FIG. 8 this figure is a schematic structural diagram of a dynamic library loading apparatus provided by an embodiment of the present application.
  • the dynamic library loading device provided by the embodiment of the present application includes:
  • the obtaining module 801 is used to, when the first application is loaded in the target kernel, obtain from the file system the executable files of all the dynamic libraries to be loaded corresponding to the target kernel; the executable files of all the dynamic libraries to be loaded include: the first The executable file of the dynamic library associated with the service dynamic library version and the executable file of the dynamic library associated with the first platform dynamic library version, wherein the first platform dynamic library version is the latest dynamic library version of the platform that supports the loading of the first application;
  • the pre-linking module 802 is used to pre-link the executable files of all the dynamic libraries to be loaded respectively, obtain the pre-linked executable files of each dynamic library to be loaded in all the dynamic libraries to be loaded, and link each dynamic library to be loaded.
  • the pre-linked executable file of the loaded dynamic library is stored in the file system;
  • the loading module 803 is used to obtain the pre-linked executable file of each dynamic library to be loaded from the file system, and load the pre-linked executable file of each dynamic library to be loaded into the target kernel.
  • the dynamic library loading apparatus before obtaining the executable files of all the dynamic libraries to be loaded from the file system, the dynamic library loading apparatus provided in this embodiment of the present application further includes: a receiving module configured to receive a dynamic library loading request;
  • the dynamic library load request indicates all dynamic libraries and target kernels to be loaded.
  • the loading module 803 is further configured to: store the pre-linked executable file of each dynamic library to be loaded into the storage space corresponding to the target kernel in the memory with a pre-programmed storage address.
  • the dynamic library loading apparatus when all executable files of the dynamic library to be loaded are pre-linked, the dynamic library loading apparatus provided in this embodiment of the present application further includes: an orchestration module for, according to the storage granularity of the memory and each The segment size of the executable file of each dynamic library to be loaded is arranged, and the storage address of the pre-linked executable file of each dynamic library to be loaded is arranged.
  • the orchestration module is specifically configured to: determine, according to the storage granularity of the memory and the segment size of the executable file of the dynamic library whose storage address is newly arranged Remaining storage space; determine the dynamic libraries with the unarranged n storage addresses at the top of the loading order, and determine the segment size of the executable file of the dynamic libraries with n storage addresses unarranged; n is a positive integer; from n storage addresses A dynamic library that can be stored in the remaining storage space and the segment size of the executable file is closest to the remaining storage space is determined from the unprogrammed dynamic library, and the storage address of the executable file pre-linked to the dynamic library is arranged to the remaining storage space. within the address range of the space.
  • the dynamic library loading apparatus further includes: a direct acquisition module for directly acquiring all pending files corresponding to the target kernel from the file system when the first application is loaded on the target kernel again. Loading the pre-linked executable file of the loaded dynamic library, and loading the pre-linked executable file of each dynamic library to be loaded into the target kernel.
  • an embodiment of the present application further provides an apparatus for adjusting nuclear deployment.
  • FIG. 9 this figure is a schematic structural diagram of an apparatus for adjusting core deployment provided by an embodiment of the present application.
  • the apparatus for adjusting core deployment provided by the embodiment of the present application includes:
  • the receiving module 901 is configured to receive a core deployment adjustment request; the core deployment adjustment request indicates all dynamic libraries to be unloaded corresponding to the target kernel and all dynamic libraries to be loaded corresponding to the target kernel;
  • the deployment adjustment module 902 is configured to, according to the core deployment adjustment request, unload all the dynamic libraries to be unloaded from the target kernel, obtain the pre-linked executable files of all the dynamic libraries to be loaded from the file system, and load all the dynamic libraries to be loaded.
  • the pre-linked executable file of the dynamic library is loaded into the target kernel;
  • the pre-linked executable files of all the dynamic libraries to be loaded are obtained after pre-linking the executable files of all the dynamic libraries to be loaded; the executable files of all the dynamic libraries to be loaded include: the first service dynamic library version The executable file of the associated dynamic library and the executable file of the dynamic library associated with the first platform dynamic library version, wherein the first platform dynamic library version is the latest dynamic library version of the platform that supports the loading of the first application.
  • the method for loading a dynamic library, the method for adjusting core deployment, and the related apparatus provided in the above solution can be specifically applied to a multi-core processor.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

Procédé de chargement de bibliothèques dynamiques, procédé de réglage de déploiement de noyau, et appareils associés. Le procédé de chargement de bibliothèques dynamiques comporte les étapes consistant: lorsqu'une première application est chargée dans un noyau cible, à obtenir, à partir d'un système de fichiers, des fichiers exécutables de toutes les bibliothèques dynamiques à charger correspondant au noyau cible, le fichier exécutable d'une bibliothèque dynamique qui est associée à un première version de bibliothèque dynamique de plate-forme dans les fichiers exécutables de toutes lesdites bibliothèques dynamiques est la version de bibliothèque dynamique la plus récente d'une plate-forme qui prend en charge le chargement de la première application; à procéder respectivement à la pré-édition de liens puis au stockage de les fichiers exécutables de toutes lesdites bibliothèques dynamiques; puis à acquérir un fichier exécutable pré-lié de chacune desdites bibliothèques dynamiques, et à charger le fichier exécutable pré-lié de chacune desdites bibliothèques dynamiques dans le noyau cible. Par conséquent, lors de chaque instance subséquente où il est nécessaire qu'une première application soit commutée et chargée sur un noyau cible, un fichier exécutable pré-lié qui est compatible et concorde avec la version de bibliothèque dynamique la plus récente d'une plate-forme peut être directement obtenu à partir d'un système de fichiers, ce qui permet de prévenir le problème d'un échec de chargement d'une bibliothèque dynamique.
PCT/CN2021/115233 2020-11-13 2021-08-30 Procédé de chargement de bibliothèques dynamiques, procédé de réglage de déploiement de noyau, et appareils associés WO2022100208A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011268494.3 2020-11-13
CN202011268494.3A CN114489827B (zh) 2020-11-13 2020-11-13 动态库加载方法、核部署的调整方法及相关装置

Publications (1)

Publication Number Publication Date
WO2022100208A1 true WO2022100208A1 (fr) 2022-05-19

Family

ID=81489915

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/115233 WO2022100208A1 (fr) 2020-11-13 2021-08-30 Procédé de chargement de bibliothèques dynamiques, procédé de réglage de déploiement de noyau, et appareils associés

Country Status (2)

Country Link
CN (1) CN114489827B (fr)
WO (1) WO2022100208A1 (fr)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117234963A (zh) * 2023-11-14 2023-12-15 海马云(天津)信息技术有限公司 动态库处理方法和装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6363436B1 (en) * 1997-01-27 2002-03-26 International Business Machines Corporation Method and system for loading libraries into embedded systems
US20050144608A1 (en) * 2003-12-26 2005-06-30 Hiroshi Oyama Operating system allowing running of real-time application programs, control method therefor, and method of loading dynamic link libraries
CN110471690A (zh) * 2019-06-25 2019-11-19 珠海格力电器股份有限公司 动态链接库so文件的加载方法、装置及存储介质
CN111813423A (zh) * 2020-08-31 2020-10-23 腾讯科技(深圳)有限公司 应用安装包处理方法及装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102147743A (zh) * 2011-03-28 2011-08-10 博视联(苏州)信息科技有限公司 加快嵌入式系统应用程序启动速度的方法
EP2788864B1 (fr) * 2011-12-07 2016-09-21 Intel Corporation Techniques pour la préliaison d'un logiciel visant à améliorer la déduplication dans une mémoire d'un système virtuel
US10025602B2 (en) * 2014-06-03 2018-07-17 Mentor Graphics Corporation Prelinked embedding
CN110765493B (zh) * 2018-12-28 2021-05-25 北京安天网络安全技术有限公司 一种基于Linux预链接的文件基线防御方法、装置及存储设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6363436B1 (en) * 1997-01-27 2002-03-26 International Business Machines Corporation Method and system for loading libraries into embedded systems
US20050144608A1 (en) * 2003-12-26 2005-06-30 Hiroshi Oyama Operating system allowing running of real-time application programs, control method therefor, and method of loading dynamic link libraries
CN110471690A (zh) * 2019-06-25 2019-11-19 珠海格力电器股份有限公司 动态链接库so文件的加载方法、装置及存储介质
CN111813423A (zh) * 2020-08-31 2020-10-23 腾讯科技(深圳)有限公司 应用安装包处理方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117234963A (zh) * 2023-11-14 2023-12-15 海马云(天津)信息技术有限公司 动态库处理方法和装置
CN117234963B (zh) * 2023-11-14 2024-01-23 海马云(天津)信息技术有限公司 动态库处理方法和装置

Also Published As

Publication number Publication date
CN114489827B (zh) 2023-11-03
CN114489827A (zh) 2022-05-13

Similar Documents

Publication Publication Date Title
US8448187B2 (en) Conflict resolution apparatus
US20170308369A1 (en) Data processing method and device of preset application after upgrading
US7657886B1 (en) Mobile device with a MMU for faster firmware updates in a wireless network
CN107832100B (zh) 一种apk插件的加载方法及其终端
US5511192A (en) Method and apparatus for managing thread private data in a parallel processing computer
US9710288B2 (en) Method and device for loading application program
US8739147B2 (en) Class isolation to minimize memory usage in a device
US20040098427A1 (en) Device memory management during electronic file updating
CN111309785B (zh) 基于Spring框架的数据库访问方法、装置、计算机设备和介质
CN111045714B (zh) 一种固件更新方法、装置、耳机及计算机可读存储介质
CN109614167B (zh) 一种管理插件的方法和系统
US9405697B2 (en) Memory management method and apparatus
KR100871778B1 (ko) 중앙집중형 동적 어드레싱 매니저를 이용한 동적 어드레싱방법 및 장치
CN104699537A (zh) 程序控制方法与活动组件调度方法及其相应的装置
US20120198431A1 (en) Method for upgrading hypervisor component and computer system
US10224972B2 (en) Systems, methods, and computer-readable media for tracking updates and loading data
WO2022100208A1 (fr) Procédé de chargement de bibliothèques dynamiques, procédé de réglage de déploiement de noyau, et appareils associés
CN111258587A (zh) 一种安卓应用插件化的实现方法、装置、设备及存储介质
US20030037323A1 (en) Method for upgrading data
JP2007510211A (ja) コンピュータ装置におけるダイナミック・リンク・ライブラリのマッピング
US20230359450A1 (en) Cloud application engine deployment method for shielding web framework from users and apparatus, device and storage medium thereof
CN111367577A (zh) 加载应用的插件的方法、装置和终端
CN114679465A (zh) 资源操作方法、装置、电子设备及存储介质
CN115374083A (zh) 数据源的切换方法、装置、电子设备及存储介质
CN113626094A (zh) 一种VxWorks下网卡MAC地址的操作方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21890737

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21890737

Country of ref document: EP

Kind code of ref document: A1