CN106990993B - Multi-system basic library file loading method and device - Google Patents

Multi-system basic library file loading method and device Download PDF

Info

Publication number
CN106990993B
CN106990993B CN201710251413.0A CN201710251413A CN106990993B CN 106990993 B CN106990993 B CN 106990993B CN 201710251413 A CN201710251413 A CN 201710251413A CN 106990993 B CN106990993 B CN 106990993B
Authority
CN
China
Prior art keywords
library file
basic
application
file
operating system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710251413.0A
Other languages
Chinese (zh)
Other versions
CN106990993A (en
Inventor
李京
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yuanxin Information Technology Group Co ltd
Original Assignee
Yuanxin Technology
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 Yuanxin Technology filed Critical Yuanxin Technology
Priority to CN201710251413.0A priority Critical patent/CN106990993B/en
Publication of CN106990993A publication Critical patent/CN106990993A/en
Application granted granted Critical
Publication of CN106990993B publication Critical patent/CN106990993B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

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

Abstract

The embodiment of the invention provides a multi-system basic library file loading method and a multi-system basic library file loading device, wherein the method comprises the following steps: when an operation request of an application is received, a first improved basic library file loader of a first operating system to which the application belongs and a basic library file on which the application to be loaded depends are determined; determining an operating system to which a basic library file depended by the application belongs according to information contained in the executable file of the application; and when the operating system to which the basic library file depended by the application belongs is other operating systems, calling other basic library file loaders of other operating systems in the first improved basic library file loader, and acquiring the basic library file depended by the application from the public library for loading so as to supply the application call. Not only can the sharing of the basic library files among different operating systems be realized; and the same (redundant) basic library files in the public library can be reduced, and the storage space occupied by the basic library files is saved.

Description

Multi-system basic library file loading method and device
Technical Field
The invention relates to the technical field of terminals, in particular to a multi-system basic library file loading method and device.
Background
At present, terminal devices such as smart phones, tablet computers, two-in-one computers, intelligent wearable devices or electronic readers are increasingly popularized.
A considerable number of terminal devices have two operating systems installed therein. The switching mode between two operating systems is divided into a hot switching dual system and a cold switching dual system.
For a hot switching dual system, an L inux container virtualization technology is usually adopted to create two containers, two operating systems are respectively arranged in the two containers, the two operating systems share one kernel and can run simultaneously, and when the system is switched, the two operating systems can be directly switched without shutting down or restarting the operating systems.
The library file loading method for the hot-switch dual system generally comprises the following steps: when an application under the name of one operating system is started, the kernel acquires a library file depended by the running of the application from a basic file library corresponding to the operating system and loads the library file. When the application under the name of the other operating system is started, the kernel acquires a library file depended by the running of the application from a basic file library corresponding to the other operating system for loading.
For a cold-switch dual system, the two operating systems are in completely different file systems, and each operating system mounts a different file system when it is started. When switching from one operating system to another operating system is required, the system is usually required to be shut down and restarted; in the process, one operating system is closed, the other operating system is started, and the running states of the two operating systems are mutually exclusive.
The library file loading method for the cold-switching dual system generally comprises the following steps: when an application under the name of one operating system is started, the operating system acquires a library file depended by the running of the application from a corresponding basic file library for loading. Shutting down and restarting to enable the one operating system to be finished and the other operating system to be started; when the application under the name of the other operating system is started, the other operating system acquires the library file depended by the application operation from the corresponding basic file library for loading.
However, the inventor of the present invention finds that, with the existing library file loading method, in a terminal device with multiple operating systems, it is necessary to configure a corresponding basic file library for each operating system separately to support the startup and operation of an application under the operating system; a large number of identical library files exist in more than two basic file libraries, and redundant library files occupy a large amount of storage space, so that the utilization level of the storage space of the terminal equipment is low.
Disclosure of Invention
The invention provides a multi-system basic library file loading method and device aiming at the defects of the existing mode, and aims to solve the problem that basic libraries of at least two operating systems occupy more storage space in the prior art, so that the basic library files of the at least two operating systems are shared, and the storage space occupied by the basic libraries is reduced.
According to an aspect, an embodiment of the present invention provides a method for loading a multi-system base library file, including:
when an operation request of an application is received, determining a first improved basic library file loader of a first operating system to which the application belongs and a basic library file to be loaded, on which the application depends;
determining an operating system to which a basic library file depended by the application belongs according to information contained in the executable file of the application;
and when the operating system to which the basic library file depended by the application belongs is other operating systems, calling other basic library file loaders of the other operating systems in the first improved basic library file loader, and acquiring the basic library file depended by the application from a public library to load the basic library file for the application to call.
According to another aspect, an embodiment of the present invention further provides a multi-system base library file loading apparatus, including:
the basic library file determining module is used for determining a first improved basic library file loader of a first operating system to which the application belongs and a basic library file to be loaded, wherein the basic library file is depended by the application, when an operation request of the application is received;
a basic library file loading module, configured to determine, according to information included in the executable file of the application, an operating system to which the basic library file depended by the application belongs; and when the operating system to which the basic library file depended by the application belongs is other operating systems, calling other basic library file loaders of the other operating systems in the first improved basic library file loader, and acquiring the basic library file depended by the application from a public library to load the basic library file for the application to call.
In the embodiment of the invention, the corresponding loading relation between the base library file and the base library file loader is reserved, and the base library file loader of each operating system is expanded into an improved base library file loader. When the operating system to which the basic library file depended by the application sending the operation request belongs is other operating systems, other basic library file loaders of other operating systems in the first improved basic library file loader can be called to acquire and load the basic library file depended by the application and originally belonging to other operating systems in the public library; not only can the sharing of the basic library files among different operating systems be realized; and the same (redundant) basic library files in the public library can be reduced, and the storage space occupied by the basic library files is saved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic frame diagram of an internal structure of a terminal device according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a multi-system base library file loading method according to an embodiment of the present invention;
FIG. 3a and FIG. 3b are a schematic diagram and a partial detailed schematic diagram of an example of a multisystem base library file loading method according to an embodiment of the present invention;
fig. 4 is a schematic frame diagram of an internal structure of a multisystem base library file loading apparatus according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
As will be appreciated by those skilled in the art, a "terminal" as used herein includes both devices having a wireless signal receiver, which are devices having only a wireless signal receiver without transmit capability, and devices having receive and transmit hardware, which have devices having receive and transmit hardware capable of two-way communication over a two-way communication link. Such a device may include: a cellular or other communication device having a single line display or a multi-line display or a cellular or other communication device without a multi-line display; PCS (Personal Communications Service), which may combine voice, data processing, facsimile and/or data communication capabilities; a PDA (Personal Digital Assistant), which may include a radio frequency receiver, a pager, internet/intranet access, a web browser, a notepad, a calendar and/or a GPS (Global Positioning System) receiver; a conventional laptop and/or palmtop computer or other device having and/or including a radio frequency receiver. As used herein, a "terminal" or "terminal device" may be portable, transportable, installed in a vehicle (aeronautical, maritime, and/or land-based), or situated and/or configured to operate locally and/or in a distributed fashion at any other location(s) on earth and/or in space. As used herein, a "terminal Device" may also be a communication terminal, a web terminal, a music/video playing terminal, such as a PDA, an MID (Mobile Internet Device) and/or a Mobile phone with music/video playing function, or a smart tv, a set-top box, etc.
The inventor of the present invention has found through research that different operating systems have different ABIs (Application binary interfaces), that is, different basic data structures are required for running applications in different operating systems, and files related to the basic data structures include executable programs and (dynamic) basic library files. The application of different operating systems has different calling modes for calling the basic library file through the system; specifically, the operating systems and the loaders generally correspond one to one, and each application of the operating system generally designates the loader of the operating system to load the base library file on which the application depends during compilation; applications of different operating systems therefore specify different loaders during compilation, and different loaders typically correspond to different base library files and search paths of the base library. The loader of one operating system is typically unable to acquire and load the base library file corresponding to another loader.
The embodiment of the invention supports at least two operating systems, and for convenience of expression and understanding, the operating system to which an application sending an operation request belongs is selected as a first operating system; the operating systems of the at least two operating systems other than the first operating system are other operating systems. And each operating system corresponds to a loader and a base library file respectively.
When the kernel receives an operation request of an application, a first improved basic library file loader of a first operating system to which the application belongs and a basic library file which is depended by the application to be loaded by the first improved basic library file loader are determined; determining an operating system to which a basic library file depended by the application belongs according to information contained in the executable file of the application; and when the operating system to which the basic library file depended by the application belongs is other operating systems, calling other basic library file loaders of other operating systems in the first improved basic library file loader, and acquiring the basic library file depended by the application from the public library for loading so as to supply the application call. Therefore, in the embodiment of the present invention, the public library includes most of the basic library files on which the application in each operating system depends, and the application is started and run by identifying the operating system to which the basic library file on which the application depends belongs, and then calling the loader corresponding to the identified operating system, and obtaining and loading the basic library file on which the application depends from the public library. Compared with the sum of the traditional basic libraries allocated for each operating system, the public library reduces a large number of same basic library files, namely reduces a large number of redundant basic library files, reduces the storage space occupied by the basic libraries and improves the utilization rate of storage resources.
The technical solution of the embodiments of the present invention is specifically described below with reference to the accompanying drawings.
A frame schematic diagram of an internal structure of a terminal device according to an embodiment of the present invention is shown in fig. 1, and includes: a kernel and at least two operating systems.
The at least two operating systems include a first operating system, a second operating system, … …, and an Nth operating system. N is a positive integer of 2 or more.
The operating system of an embodiment of the present invention includes a container system.
The operating system in the embodiment of the present invention may be an operating system disposed in a container created by L inux container virtualization technology, such as a L inux operating system or a Unix operating system in the conventional sense, an Android system or an Ubuntu system derived from a L inux operating system, or a Windows system based on a Windows platform.
The kernel in the embodiment of the invention is improved on the basis of the traditional L inux kernel, the added main functions comprise that when an operation request of an application is received, an operating system to which a basic library file depended by the application belongs is determined, and a basic library file loader of the operating system is called to load the basic library file depended by the application, and the specific functions are described in detail in the following, and are not described again.
For ease of understanding, one of the at least two operating systems is taken as the first operating system, and the other of the at least two operating systems except the first operating system is taken as the other operating system. Each operating system corresponds to a respective base library file loader; each base library file loader corresponds to a respective base library file; all or most of the base library files are stored in a common library. Preferably, the public library comprises base library files other than base C (C language) library files.
Preferably, the base library file is a dynamic base library file.
The following develops and introduces a multisystem basic library file loading method according to an embodiment of the present invention, and a flow diagram of the method is shown in fig. 2, and includes the following steps:
s201: when the kernel receives an operation request of the application, a first improved basic library file loader of a first operating system to which the application belongs and a basic library file which is depended by the application to be loaded are determined.
And after receiving the instruction for starting operation, the application in the first operating system sends an operation request to the kernel.
When the kernel receives the running request of the application of the first operating system and the basic library file which is depended by the application of the first operating system is loaded in a dlopen mode, the first improved basic library file loader and the basic library file which is depended by the application to be loaded by the first improved basic library file loader are determined.
Preferably, the kernel determines the first modified base library file loader and the base library file, to which the application is to be loaded by the first modified base library file loader, according to an instruction for loading the base library file in a dlopen manner in the operation request of the application of the first operating system.
The standard usage is exemplified by: when the kernel receives a void handle (xxx) instruction of an application of the first operating system, determining that a base library file depended on by the application to be loaded is xxx. In the above instruction, handle represents a handle; dlopen represents a system call that is used primarily to open a dynamically linked base library file and return a handle.
The first improved base library file loader comprises: a base library file loader of the first operating system, and other base library file loaders. Further, the first modified base library loader comprises: the base library file loader of the first operating system, and the portion of the other base library file loaders used to load base library files specific to the other operating systems as compared to the first operating system.
It can be seen that, in the embodiment of the present invention, an application default of an operating system specifies that a base library file loader of the operating system loads a base library file on which the application depends; the embodiment of the invention can be implemented without changing the existing application; that is to say, the embodiment of the present invention has strong compatibility with a large number of existing applications.
S202: the kernel suspends the loading of the basic library file which is depended on by the application by the first improved basic library file loader, and judges whether the basic library file which is depended on by the application is a basic C library file or not; if not, executing step S203; if yes, go to step S207.
The inventor notices that in the conventional method for loading a base library file by using a dlopen mode, a dynamic base library is opened by using a dlopen function for a kernel, and the dlopen function directly triggers a loading process of a first L inker (base library file loader) of a first operating system, namely, the first L inker is called to load xxx.
In this embodiment of the present invention, steps S201 and S202 may be executed synchronously. In the embodiment of the invention, the function of the kernel is improved; in the process that the kernel loads the basic library file which is depended on by the application of the first operating system in a dlopen mode, determining the basic library file which is depended on by the application to be loaded by the first improved basic library file loader, and simultaneously suspending the loading of the basic library file which is depended on by the application by the first improved basic library file loader; judging whether a basic library file depended on by the application is a basic C library file or not; if not, executing step S203; if yes, go to step S207.
S203: and the kernel determines an operating system to which the basic library file depended by the application belongs according to the information contained in the executable file of the application.
And the kernel determines an operating system to which the basic library file depended by the application belongs according to the header information of the executable file of the application.
Preferably, the executable program of the application is loaded; analyzing header information of an executable program of the application; and determining a first improved type basic library file loader of a first operating system to which the application belongs according to the header information.
Preferably, the present inventors have noted that the compilation process may be divided into two steps, where the first step compiles the source code of the application into linkable intermediate files, for example, the linkable intermediate files may be files with the suffix name of.o, the second step compiles all linkable intermediate files corresponding to the application (for example, files with the name of. o, wildcard, representing several characters) into Executable files, during the linking process, the compiler fills in the header of the Executable program files with E L F (Executable and L in linkable Format) information, and in the E L F header information, a field called Interpreter is included, which specifies which L inker (basic library file loader) is used to load the dynamic basic library files.
Preferably, the kernel analyzes the E L F information in the header information of the executable program of the application after loading the executable program of the application into the memory, reads the content of the Interpreter field from the E L F information, and determines the operating system to which the basic library file depended by the application belongs according to the content of the Interpreter field.
S204: the kernel judges whether an operating system to which the basic library file depended by the application belongs is a first operating system; if not, go to step S205; if yes, go to step S206.
And the kernel judges whether the operating system to which the basic library file depended by the application belongs is the first operating system to which the application belongs according to the preset corresponding relation between the operating systems and the basic library files.
Wherein, one operating system can correspond to a plurality of basic library files; the same base library file may correspond to multiple operating systems.
Preferably, one operating system may correspond to multiple base library files in a common library; one base library file in the common library may correspond to multiple operating systems.
The corresponding relation between the operating systems and the base library files can also be preset in each L inker or operating system, and is transferred to the kernel when the base library file needs to be called (i.e. the base library file on which the application depends is determined).
S205: and the kernel calls other basic library file loaders of other operating systems in the first improved basic library file loader, acquires the basic library file depended by the application from the public library and loads the basic library file to be called by the application.
When the operating system to which the base library file depended by the application belongs is other operating systems (referring to operating systems other than the first operating system), the kernel calls other base library file loaders of other operating systems in the first improved base library file loader, and acquires the base library file depended by the application from the public library to load so as to supply the application call.
Preferably, the basic library file loaders of a plurality of operating systems in the terminal equipment can be detachably combined together to form a modified basic library file loader; the first, second and N operating systems correspond to the first, second and N modified base library file loaders, respectively. The first modified base library file loader, the second modified base library file loader, …, and the nth modified base library file loader are all the same. For the first modified base library file loader, the second, …, N modified base library file loader is the other modified base library file loader for the other operating systems.
When the operating system to which the basic library file depended by the application belongs is other operating systems, the kernel calls other basic library file loaders of other operating systems in the first improved basic library file loader from the comprehensive basic library file loader, and obtains the basic library file depended by the application from the public library to load so as to supply for calling.
It can be understood that in this step, the base library file on which the application depends in the public library is actually called by other base library file loaders; in the embodiment of the invention, the corresponding (loading) relationship between the basic library file and the basic library file loader is reserved; but the basic library file loader of each operating system is expanded, so that each operating system can call basic library files which belong to other operating systems in the public library according to the expanded basic library file loader. Not only can the sharing of the basic library files among different operating systems be realized; and the same (redundant) basic library files in the public library can be reduced, and the storage space occupied by the basic library files is saved.
Preferably, the inventor of the present invention considers that, in a plurality of base library files corresponding to base library file loaders of different operating systems in a terminal device, there exist both the same base library file and different base library files.
For each operating system, determining, for each other operating system except for the operating system, a base library file unique to the other operating system as compared to the operating system; further using the part of other base library file loader for loading the special base library file as the sub loader of other base library file of other operating system compared with the operating system; and then, combining the basic library file loader of the operating system and at least one other basic library file sub-loader to obtain the improved basic library file loader of the operating system.
It will be appreciated that the base library file loader of each operating system, and each other operating system, is different than the other base library file child loaders of that operating system.
And regarding the first operating system, using the part of the other base library file loader used for loading the base library file which is unique to the other operating system compared with the first operating system as the other base library file child loader of the other operating system. Therefore, the base library files corresponding to the other base library file sub-loaders are base library files specific to the other operating systems compared to the first operating system.
The kernel pre-combines the (first) base library file loader of the first operating system with other base library file child loaders into a first improved base library file loader. That is, the first modified base library file loader comprises: a (first) base library file loader of the first operating system, and other base library file child loaders other than the first operating system.
Further, a second modified base library file loader for a second operating system is similarly obtained, the second modified base library file loader comprising: a (second) base library file loader of the second operating system, and other base library file child loaders of other operating systems other than the second operating system. Similarly, a third modified base library file loader, … and an Nth modified base library file loader can be obtained. Preferably, the first modified base library file loader, the second modified base library file loader, the … and the nth modified base library file loader are the same.
And the kernel calls other preset basic library file sub-loaders of other operating systems from the first improved basic library file loader, and the other basic library file sub-loaders acquire basic library files depended by the application from the public library for loading.
It can be understood that in this step, the basic library file on which the application depends in the public library is actually called by other basic library file child loaders; in the embodiment of the invention, the corresponding (loading) relationship between the basic library file and the basic library file sub-loader is reserved; and according to the other basic library file sub-loaders, the basic library file loader of one operating system is expanded, so that the operating system can call the basic library files which belong to other operating systems in the public library according to the expanded basic library file loader. The method can further reduce the content expanded by the basic library file loader and reduce the storage space occupied by the expanded basic library file loader under the condition of sharing the basic library files of different operating systems and reducing the same (redundant) basic library files in the public library.
Furthermore, the inventor of the present invention found that different L inkers perform the loading process of the dynamic basic library files, then different L inkers have different dynamic basic library search path sequences, because the dynamic basic library files are placed in different positions, a configuration file is correspondingly arranged for each L inker to indicate L inkers need to search those paths to find the corresponding dynamic basic library files, for example, the search path of the dynamic basic library of one operating system includes (/ lib,/usr/lib), while the search path of the dynamic basic library of another operating system is (/ system/lib)
In the embodiment of the invention, the kernel calls other basic library file sub-loaders, and obtains the basic library file depended by the application from the public library to load according to the preset basic library file search path corresponding to the other basic library file sub-loaders.
And after loading the basic library file which the application depends on, calling the basic library file by the application.
For example, the kernel specifies a specific function XYZ in a base library file (xxx.so file pointed to by a handle) required by an application, based on a funcPtr (handle "XYZ") instruction, and assigns the address of this function to funcPtr. The application accesses this function address, i.e., the substantive call to the XYZ function, using the funcPtr () instruction. In the instruction, dlsym represents a system call, and is mainly used for returning an address corresponding to a symbol according to an operation handle and the symbol of the dynamic link basic library file. Not only the function address but also the variable address can be obtained using this function.
S206: and the kernel calls a first improved basic library file loader to acquire a basic library file depended by the application from the public library for loading.
And when the operating system to which the basic library file depended by the application belongs is the first operating system, calling a (first) basic library file loader of the first operating system in the first improved basic library file loader, and acquiring the basic library file depended by the application from the public library for loading.
Preferably, the first modified base library file loader is configured to resume from a suspended state, in which the (first) base library file loader of the first operating system loads the base library file that the application depends on, to a loaded state, that is, obtain the base library file that the application depends on from the common library to load.
S207: and the kernel calls the first improved basic library file loader to acquire the basic C library file depended by the application for loading.
Preferably, the base library files in the public library in the embodiment of the present invention are all dynamic base library files except the base c library file.
In the embodiment of the invention, different operating systems are correspondingly preset with different libc base libraries, for example, one operating system depends on a glibc base c library, and the other operating system depends on bionic L ibc, glibc and bionic and is a file name obtained by compiling an open source library.
The kernel calls a (first) basic library file loader of a first operating system in the first improved basic library file loader, acquires a basic C library file on which the application depends through a traditional path, and loads the acquired basic C library file.
A specific example of the multi-system base library file loading method according to the embodiment of the present invention is described below, and a schematic diagram of the specific example is shown in fig. 3a, applications 1 and 2 are applications of a first operating system and a second operating system, respectively, L inker1 and 2 are a base library file loader of the first operating system and a base library file loader of the second operating system, respectively, base C libraries 1 and 2 are base C library files of the first operating system and base C library files of the second operating system, respectively, other base library files of the first operating system and the second operating system except the base C library files are all preset in a common library, and L inker1 and 2 acquire and load the base C library 1 and the base C library 2 through respective conventional paths.
When it is determined that the base library file on which the application 1 depends is not the base C library file and the base library file belongs to the second operating system, L inker2 is called from L inker1 or a second base library file sub-loader (not shown) acquires the base library file from the common library and loads the base library file.
Fig. 3b is a partially detailed schematic diagram of a specific example of a multi-system base library file loading method according to an embodiment of the present invention, in fig. 3b, L inker1 except L inker2.a and L0 inker2 except L inker1.a represent a base library file loader of a first operating system and a base library file loader of a second operating system, respectively, a dynamic library of system 2 represents a base library file specific to the second operating system as compared to the first operating system, L inker2.a represents L inker2 a portion for loading a base library file specific to the second operating system as compared to the first operating system, a dynamic library of system 1 represents a library base file specific to the first operating system as compared to the second operating system, L inker1.a represents L inker1 for loading a base library file specific to the first operating system as compared to the second operating system, and a base library file loader of the second operating system is represented by a base library base file loader of the first operating system, a base library base file loader of the second operating system, and a base library file loader of the second operating system, and the base library file loader of the first operating system, the second operating system, the base loader, the base library file loader of the second operating system, the base library file loader of the type 395968, the second operating system, the base library file loader, the base library file of the second operating system, the base file type L, the base file of the second operating system.
When it is determined that the base library file on which application 1 depends is not the base C library file and that the base library file belongs to the second operating system, L inker2.a is called from L inker1 to obtain the base library file from the public library and load the same.
Based on the above multi-system basic library file loading method, an embodiment of the present invention further provides a multi-system basic library file loading apparatus, where the apparatus is disposed in a terminal device, and a frame diagram of an internal structure of the apparatus is shown in fig. 4, and the method includes: a base library file determination module 401 and a base library file loading module 402.
The basic library file determining module 401 is configured to determine, when receiving an operation request of an application, a first improved basic library file loader of a first operating system to which the application belongs and a basic library file on which the application to be loaded depends.
The base library file loading module 402 is configured to determine, according to information included in the executable file of the application, an operating system to which the base library file dependent on the application belongs; and when the operating system to which the basic library file depended by the application belongs is other operating systems, calling other basic library file loaders of other operating systems in the first improved basic library file loader, and acquiring the basic library file depended by the application from the public library for loading so as to supply the application call.
Preferably, the basic library file determining module 401 is further configured to suspend loading of the basic library file depended on by the application by the first modified basic library file loader when determining the basic library file depended on by the application to be loaded by the first modified basic library file loader, and determine whether the basic library file depended on by the application is the basic library C file.
The base library file loading module 402 is further configured to call the first improved base library file loader to acquire the base C library file on which the application depends for loading when the base library file determination module determines that the base library file on which the application depends is the base C library file; when the basic library file determining module judges that the basic library file on which the application depends is not the basic C library file, determining an operating system to which the basic library file on which the application depends belongs according to information contained in the executable file of the application; wherein the public library comprises base library files other than the base C library file.
Preferably, the basic library file loading module 402 is specifically configured to invoke other basic library file child loaders of other preset operating systems from the first improved basic library file loader, and obtain a basic library file depended by the application from the public library for loading; and the base library files corresponding to the other base library file sub-loaders are base library files which are unique to other operating systems compared with the first operating system.
Preferably, the basic library file loading module 402 is specifically configured to invoke other basic library file sub-loaders, and obtain a basic library file depended by the application from the public library for loading according to a preset basic library file search path corresponding to the basic library file sub-loader.
Preferably, the base library file loading module 402 is specifically configured to determine, according to header information of an executable file of the application, an operating system to which the base library file depended by the application belongs.
Preferably, the base library file loading module 402 is further configured to, after determining, according to information included in the executable file of the application, an operating system to which the base library file depended by the application belongs, and when the operating system to which the base library file depended by the application belongs is the first operating system, call the first improved base library file loader to obtain, from the public library, the base library file depended by the application for loading.
The method for implementing the functions of the basic library file determining module 401 and the basic library file loading module 402 may be configured to parameter the contents of the specific process and steps of the multi-system basic library file loading method, which is not described herein again.
In the embodiment of the invention, the corresponding loading relation between the base library file and the base library file loader is reserved, and the base library file loader of each operating system is expanded into an improved base library file loader. When the operating system to which the basic library file depended by the application sending the operation request belongs is other operating systems, other basic library file loaders of other operating systems in the first improved basic library file loader can be called to acquire and load the basic library file depended by the application and originally belonging to other operating systems in the public library; not only can the sharing of the basic library files among different operating systems be realized; and the same (redundant) basic library files in the public library can be reduced, and the storage space occupied by the basic library files is saved.
Moreover, in the embodiment of the invention, the corresponding loading relation between the basic library file and the basic library file sub-loader is reserved; and for each operating system, expanding the basic library file loader of the operating system into an improved basic library file loader according to other basic library file sub-loaders. When the operating system to which the basic library file depended by the application sending the operation request belongs is other operating systems, other basic library file sub-loaders of other operating systems in the first improved basic library file loader can be called to acquire and load the basic library file depended by the application and originally belonging to other operating systems in the public library; the method can further reduce the content expanded by the basic library file loader and reduce the storage space occupied by the expanded basic library file loader under the condition of sharing the basic library files of different operating systems and reducing the same (redundant) basic library files in the public library.
In addition, in the embodiment of the invention, the well is mainly carried out on the loader of the kernel and the basic library file, the application itself does not need to be improved, and the method has good compatibility for a large number of applications.
Those skilled in the art will appreciate that the present invention includes apparatus directed to performing one or more of the operations described in the present application. These devices may be specially designed and manufactured for the required purposes, or they may comprise known devices in general-purpose computers. These devices have stored therein computer programs that are selectively activated or reconfigured. Such a computer program may be stored in a device (e.g., computer) readable medium, including, but not limited to, any type of disk including floppy disks, hard disks, optical disks, CD-ROMs, and magnetic-optical disks, ROMs (Read-Only memories), RAMs (Random Access memories), EPROMs (Erasable programmable Read-Only memories), EEPROMs (Electrically Erasable programmable Read-Only memories), flash memories, magnetic cards, or optical cards, or any type of media suitable for storing electronic instructions, and each coupled to a bus. That is, a readable medium includes any medium that stores or transmits information in a form readable by a device (e.g., a computer).
It will be understood by those within the art that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. Those skilled in the art will appreciate that the computer program instructions may be implemented by a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, implement the features specified in the block or blocks of the block diagrams and/or flowchart illustrations of the present disclosure.
Those of skill in the art will appreciate that various operations, methods, steps in the processes, acts, or solutions discussed in the present application may be alternated, modified, combined, or deleted. Further, various operations, methods, steps in the flows, which have been discussed in the present application, may be interchanged, modified, rearranged, decomposed, combined, or eliminated. Further, steps, measures, schemes in the various operations, methods, procedures disclosed in the prior art and the present invention can also be alternated, changed, rearranged, decomposed, combined, or deleted.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1.A multi-system basic library file loading method is characterized by comprising the following steps:
when an operation request of an application is received, determining a first improved basic library file loader of a first operating system to which the application belongs and a basic library file to be loaded, on which the application depends;
determining an operating system to which a basic library file depended by the application belongs according to information contained in the executable file of the application;
when the operating system to which the basic library file depended by the application belongs is other operating systems, calling other basic library file loaders of the other operating systems in the first improved basic library file loader, and acquiring the basic library file depended by the application from a public library to load the basic library file for the application to call; the public library comprises part of or all of the base library files.
2. The method of claim 1, wherein determining the base library file on which the application to be loaded depends further comprises:
suspending the loading of the basic library file which is depended on by the application by a first improved basic library file loader, and judging whether the basic library file which is depended on by the application is a basic C library file; and
determining an operating system to which a base library file depended by the application belongs according to information contained in the executable file of the application, wherein the method comprises the following steps:
when the basic library file depended on by the application is judged to be a basic C library file, calling a first improved basic library file loader to acquire the basic C library file depended on by the application for loading;
when the basic library file depended on by the application is judged not to be the basic C library file, determining an operating system to which the basic library file depended on by the application belongs according to information contained in the executable file of the application;
wherein the public library comprises base library files other than base C library files.
3. The method according to claim 1 or 2, wherein said calling other base library file loaders of said other operating systems in the first improved base library file loader to obtain the base library file depended by said application from the common library for loading comprises:
calling preset other basic library file sub-loaders of other operating systems from a first improved basic library file loader, and acquiring basic library files depended by the application from the public library for loading;
and the base library file corresponding to the other base library file sub-loader is a base library file which is unique to the other operating system compared with the first operating system.
4. The method according to claim 3, wherein said calling a preset other base library file sub-loader of the other operating system to obtain the base library file depended by the application from the common library for loading comprises:
and calling the other basic library file sub-loaders, and acquiring the basic library file depended by the application from the public library for loading according to a preset basic library file search path corresponding to the other basic library file sub-loaders.
5. The method according to claim 1 or 2, wherein the determining an operating system to which a base library file depended by the application belongs according to information contained in an executable file of the application comprises:
and determining an operating system to which the basic library file depended by the application belongs according to the header information of the executable file of the application.
6. The method according to claim 1 or 2, wherein after determining an operating system to which a base library file depended by the application belongs according to information contained in the executable file of the application, the method further comprises:
and when the operating system to which the basic library file depended by the application belongs is the first operating system, calling a first improved basic library file loader to acquire the basic library file depended by the application from the public library for loading.
7. A multisystem base library file loading device is characterized by comprising:
the basic library file determining module is used for determining a first improved basic library file loader of a first operating system to which the application belongs and a basic library file to be loaded, wherein the basic library file is depended by the application, when an operation request of the application is received;
a basic library file loading module, configured to determine, according to information included in the executable file of the application, an operating system to which the basic library file depended by the application belongs; when the operating system to which the basic library file depended by the application belongs is other operating systems, calling other basic library file loaders of the other operating systems in the first improved basic library file loader, and acquiring the basic library file depended by the application from a public library to load the basic library file for the application to call; the public library comprises part of or all of the base library files.
8. The apparatus of claim 7,
the basic library file determining module is further configured to suspend loading of the basic library file relied on by the application by the first improved basic library file loader when determining the basic library file relied on by the application to be loaded by the first improved basic library file loader, and determine whether the basic library file relied on by the application is a basic C library file; and
the basic library file loading module is further used for calling a first improved basic library file loader to acquire the basic library file on which the application depends for loading when the basic library file determination module determines that the basic library file on which the application depends is the basic C library file; when the basic library file determining module determines that the basic library file on which the application depends is not the basic C library file, determining an operating system to which the basic library file on which the application depends belongs according to information contained in the executable file of the application; wherein the public library comprises base library files other than base C library files.
9. The apparatus according to claim 7 or 8,
the basic library file loading module is specifically used for calling preset other basic library file sub-loaders of other operating systems from a first improved basic library file loader and acquiring a basic library file depended by the application from the public library for loading; and the base library file corresponding to the other base library file sub-loader is a base library file which is unique to the other operating system compared with the first operating system.
10. The apparatus of claim 9,
the basic library file loading module is specifically configured to invoke the other basic library file sub-loaders, and obtain, from the public library, the basic library file on which the application depends for loading according to a preset basic library file search path corresponding to the basic library file sub-loader.
CN201710251413.0A 2017-04-18 2017-04-18 Multi-system basic library file loading method and device Active CN106990993B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710251413.0A CN106990993B (en) 2017-04-18 2017-04-18 Multi-system basic library file loading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710251413.0A CN106990993B (en) 2017-04-18 2017-04-18 Multi-system basic library file loading method and device

Publications (2)

Publication Number Publication Date
CN106990993A CN106990993A (en) 2017-07-28
CN106990993B true CN106990993B (en) 2020-07-28

Family

ID=59415519

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710251413.0A Active CN106990993B (en) 2017-04-18 2017-04-18 Multi-system basic library file loading method and device

Country Status (1)

Country Link
CN (1) CN106990993B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110276173A (en) * 2019-06-18 2019-09-24 福州数据技术研究院有限公司 Dual system termi-nal with server prevents bis- packing operation methods of apk
CN110471870B (en) * 2019-08-14 2022-01-07 Oppo广东移动通信有限公司 Multi-system operation method and device, electronic equipment and storage medium
CN111290999B (en) * 2020-01-10 2023-06-13 高新兴物联科技股份有限公司 Library file self-adaptive matching method, device and computer readable storage medium
CN114168203B (en) * 2020-09-10 2024-02-13 成都鼎桥通信技术有限公司 Dual-system running state control method and device and electronic equipment
CN114579193B (en) * 2022-03-08 2024-01-12 国泰新点软件股份有限公司 Multi-system loading method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101894042A (en) * 2010-06-24 2010-11-24 宇龙计算机通信科技(深圳)有限公司 Realization method for sharing application among a plurality of operating systems, system and mobile terminal
CN103365668A (en) * 2012-03-26 2013-10-23 联想(北京)有限公司 Loading and linking method and device of dynamic link library
CN104123146A (en) * 2013-04-25 2014-10-29 深圳市天方信安电子科技有限公司 Method for achieving hot switching between two systems
CN106126438A (en) * 2016-06-06 2016-11-16 北京珠穆朗玛移动通信有限公司 Data sharing method between dual user system and mobile terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6339793B1 (en) * 1999-04-06 2002-01-15 International Business Machines Corporation Read/write data sharing of DASD data, including byte file system data, in a cluster of multiple data processing systems

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101894042A (en) * 2010-06-24 2010-11-24 宇龙计算机通信科技(深圳)有限公司 Realization method for sharing application among a plurality of operating systems, system and mobile terminal
CN103365668A (en) * 2012-03-26 2013-10-23 联想(北京)有限公司 Loading and linking method and device of dynamic link library
CN104123146A (en) * 2013-04-25 2014-10-29 深圳市天方信安电子科技有限公司 Method for achieving hot switching between two systems
CN106126438A (en) * 2016-06-06 2016-11-16 北京珠穆朗玛移动通信有限公司 Data sharing method between dual user system and mobile terminal

Also Published As

Publication number Publication date
CN106990993A (en) 2017-07-28

Similar Documents

Publication Publication Date Title
CN106990993B (en) Multi-system basic library file loading method and device
CN101452402B (en) Software operation system and software operation method
US9042877B1 (en) System and method for retrofitting a branding framework into a mobile communication device
US8448187B2 (en) Conflict resolution apparatus
US11853820B2 (en) Cross-process communication method, apparatus, and device
US20080119178A1 (en) Allocating Compression-Based Firmware Over the Air
US8260355B2 (en) Portable communication terminal, program executed by portable communication terminal
JP5658283B2 (en) Application operating method, apparatus and system
US20080098054A1 (en) Methods and apparatus for concurrently executing a garbage collection process during execution of a primary application program
CN104731622B (en) The loading method of a kind of application program, device and mobile terminal
CN111316230B (en) Method and equipment for generating patch package
CN114721719B (en) Method and system for containerized deployment of heterogeneous applications in cluster
US20120093075A1 (en) Multiple SIM support with single modem software architecture
CN106547628B (en) Multi-system resource release method and device
CN106776013B (en) Multi-system resource scheduling method and device
KR20140031831A (en) Isa bridging including support for call to overidding virtual functions
CN102968321A (en) Application program installation device and application program installation method
CN101339508B (en) Java2 miniature edition application operation method and device
CN106844206B (en) Method and device for debugging multiple systems in mobile terminal
CN104572485A (en) Allocation method and device of memory shared by two systems
CN115495158B (en) Dynamic construction method for system service in microkernel operating system
KR100960505B1 (en) Method for managing heterogeneity application in mobile communication terminal and mobile communication terminal using the same
CN102137122B (en) Method and device for downloading data
CN106851535B (en) Method and device for sharing Bluetooth by multiple systems
CN106843895B (en) Method, system and readable storage medium for processing requests

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20210202

Address after: 101300 room 153, 1 / F, building 17, 16 Caixiang East Road, Nancai Town, Shunyi District, Beijing

Patentee after: Yuanxin Information Technology Group Co.,Ltd.

Address before: 100176 room 2222, building D, building 33, 99 Kechuang 14th Street, Beijing Economic and Technological Development Zone, Beijing

Patentee before: BEIJING YUANXIN SCIENCE & TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20170728

Assignee: Beijing Yuanxin Junsheng Technology Co.,Ltd.

Assignor: Yuanxin Information Technology Group Co.,Ltd.

Contract record no.: X2021110000018

Denomination of invention: Loading method and device of basic library file in multi system

Granted publication date: 20200728

License type: Common License

Record date: 20210531

EE01 Entry into force of recordation of patent licensing contract