CN106990993A - 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
CN106990993A
CN106990993A CN201710251413.0A CN201710251413A CN106990993A CN 106990993 A CN106990993 A CN 106990993A CN 201710251413 A CN201710251413 A CN 201710251413A CN 106990993 A CN106990993 A CN 106990993A
Authority
CN
China
Prior art keywords
library file
basic
library
relied
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710251413.0A
Other languages
Chinese (zh)
Other versions
CN106990993B (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

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

The base library file loading method and device of multisystem
Technical field
The present invention relates to field of terminal technology, specifically, the present invention relates to a kind of loading of the basic library file of multisystem Method and device.
Background technology
At present, the terminal device such as smart mobile phone, tablet personal computer, two-in-one computer, Intelligent worn device or electronic reader Increasingly popularize.
Two operating systems are mounted with the terminal device of quite a few quantity.With the switching between two operating systems Mode, is divided into hot-swap dual system and dual system is changed in cold cut.
For hot-swap dual system, linux container virtualization technology is generally used, two containers are created, by two operations System is respectively arranged in two containers;Two operating systems share a kernel, can run simultaneously;During switching system, nothing It need to close or reboot operation system, directly two operating systems can be switched over.
The library file loading method of hot-swap dual system, is generally included:It is interior when the application of one operating system under one's name starts Core obtains the relied on library file of application operation and loaded from the corresponding basic document storehouse of an operating system.Separately When the application of one operating system under one's name starts, kernel is from the corresponding basic document storehouse of another operating system, and obtaining should Loaded using the library file for running relied on.
Dual system is changed for cold cut, two operating systems are in entirely different file system, and each operating system is opened All can the different file system of carry when dynamic.When needing to switch to another operating system from an operating system, generally need Shut down and restart again;Operating system is closed during this, then another os starting, the operation of two operating system State is mutual exclusion.
The library file loading method of dual system is changed in cold cut, is generally included:, should when the application of one operating system under one's name starts One operating system obtains the relied on library file of application operation and loaded from its corresponding basic document storehouse.Shutdown Restart so that an operating system is finished, another os starting;The application of another operating system under one's name starts When, another operating system obtains the relied on library file of application operation and added from its corresponding basic document storehouse Carry.
However, it was found by the inventors of the present invention that using existing library file loading method, being provided with the end of multiple operating system , it is necessary to which corresponding basic document storehouse is separately configured for each operating system in end equipment, answering under the operating system could be supported Startup optimization;There are a large amount of identical library files in two or more basic document storehouse, the library file of redundancy is occupied largely Memory space, cause the utilization low SI of the memory space of terminal device.
The content of the invention
The present invention is directed to the shortcoming of existing mode, proposes a kind of the base library file loading method and device of multisystem, uses To solve the problem of prior art takes more memory space in the presence of the base library of at least two operating systems, to realize at least two Shared, the memory space that reduction base library takes of the basic library file of individual operating system.
Embodiments of the invention according to one side there is provided a kind of base library file loading method of multisystem, including:
When receiving the operation request of application, the first modified form basis of the first operating system belonging to the application is determined The basic library file that library file loader and the application to be loaded are relied on;
The information included according to the executable file of the application, determines the basic library file applied and relied on Affiliated operating system;
When the operating system belonging to the basic library file applied and relied on is other operating systems, first is called to change Other base library file loaders of other operating systems in good figure base library file loader, are obtained from public library It is described to apply the basic library file relied on to be loaded, for the application call.
Embodiments of the invention additionally provide a kind of basic library file loading device of multisystem according on the other hand, Including:
Basic library file determining module, when the operation for receiving application is asked, is determined first belonging to the application The basic library file that first modified form base library file loader of operating system and the application to be loaded are relied on;
Base library file load module, for the information included according to the executable file of the application, determines institute State using the operating system belonging to the basic library file relied on;When the operation belonging to the basic library file applied and relied on When system is other operating systems, the other of other operating systems in the first modified form base library file loader are called Base library file loader, obtained from public library it is described apply the basic library file that is relied on to be loaded, answered for described With calling.
In the embodiment of the present invention, the corresponding loading relation between basic library file and base library file loader is remained, The base library file loader of each operating system is extended for modified form base library file loader.Request is run when sending During using the operating system belonging to the basic library file relied on for other operating systems, the first modified form base library can be called Other base library file loaders of other operating systems in file loader, be to originally belonging to other operations in public library System, the basic library file that the application is relied on, are obtained and are loaded;Both the basis between different operating system can be realized Library file it is shared;The basic library file of identical in public library (redundancy) can be reduced again, save what basic library file took Memory space.
The additional aspect of the present invention and advantage will be set forth in part in the description, and these will become from the following description Obtain substantially, or recognized by the practice of the present invention.
Brief description of the drawings
Of the invention above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments Substantially and be readily appreciated that, wherein:
Fig. 1 is the block schematic illustration of the internal structure of the terminal device of the embodiment of the present invention;
Fig. 2 is the schematic flow sheet of the base library file loading method of the multisystem of the embodiment of the present invention;
Fig. 3 a and Fig. 3 b are respectively an example of the base library file loading method of the multisystem of the embodiment of the present invention Schematic diagram and local refinement schematic diagram;
Fig. 4 is the block schematic illustration of the internal structure of the basic library file loading device of the multisystem of the embodiment of the present invention.
Embodiment
Embodiments of the invention are described below in detail, the example of the embodiment is shown in the drawings, wherein from beginning to end Same or similar label represents same or similar element or the element with same or like function.Below with reference to attached The embodiment of figure description is exemplary, is only used for explaining the present invention, and is not construed as limiting the claims.
Those skilled in the art of the present technique are appreciated that unless expressly stated, singulative " one " used herein, " one It is individual ", " described " and "the" may also comprise plural form.It is to be further understood that what is used in the specification of the present invention arranges Diction " comprising " refer to there is the feature, integer, step, operation, element and/or component, but it is not excluded that in the presence of or addition Other one or more features, integer, step, operation, element, component and/or their group.It should be understood that when we claim member Part is " connected " or during " coupled " to another element, and it can be directly connected or coupled to other elements, or can also exist Intermediary element.In addition, " connection " used herein or " coupling " can include wireless connection or wireless coupling.It is used herein to arrange Taking leave "and/or" includes one or more associated wholes or any cell for listing item and all combines.
Those skilled in the art of the present technique are appreciated that unless otherwise defined, all terms used herein (including technology art Language and scientific terminology), with the general understanding identical meaning with the those of ordinary skill in art of the present invention.Should also Understand, those terms defined in such as general dictionary, it should be understood that with the context with prior art The consistent meaning of meaning, and unless by specific definitions as here, otherwise will not use idealization or excessively formal implication To explain.
Those skilled in the art of the present technique are appreciated that " terminal " used herein above, " terminal device " both include wireless communication The equipment of number receiver, it only possesses the equipment of the wireless signal receiver of non-emissive ability, includes receiving again and transmitting hardware Equipment, its have can on bidirectional communication link, carry out two-way communication reception and launch hardware equipment.This equipment It can include:Honeycomb or other communication equipments, it has single line display or multi-line display or shown without multi-line The honeycomb of device or other communication equipments;PCS (Personal Communications Service, PCS Personal Communications System), it can With combine voice, data processing, fax and/or its communication ability;PDA (Personal Digital Assistant, it is personal Digital assistants), it can include radio frequency receiver, pager, the Internet/intranet access, web browser, notepad, day Go through and/or GPS (Global Positioning System, global positioning system) receiver;Conventional laptop and/or palm Type computer or other equipment, its have and/or conventional laptop and/or palmtop computer including radio frequency receiver or its His equipment." terminal " used herein above, " terminal device " they can be portable, can transport, installed in the vehicles (aviation, Sea-freight and/or land) in, or be suitable for and/or be configured in local runtime, and/or with distribution form, operate in the earth And/or any other position operation in space." terminal " used herein above, " terminal device " can also be communication terminal, on Network termination, music/video playback terminal, for example, can be PDA, MID (Mobile Internet Device, mobile Internet Equipment) and/or the equipment such as mobile phone or intelligent television with music/video playing function, set top box.
The present inventor has found by research, ABI (the Application Binary of different operating system Interface, ABI) it is different, that is, during application operation in different operating system, required basic data Structure is different, and the file that basic data structure is related to includes executable program and (dynamic) basic library file.Different operating system The application of system calls the method for calling of basic library file different by system;Specifically, operating system and loader are usual one by one Correspondence, the applying of each operating system generally designated during compiling the operating system loader be used to loading the application according to Bad basic library file;Therefore different operating system applies the loader specified during compiling different, and different loadings Device generally corresponds to the searching route of different basic library file and base library.The loader of one operating system can not generally be obtained And load the corresponding basic library file of another loader.
Embodiments of the invention, support at least two operating systems, for the ease of stating and understanding, select one and send fortune The operating system that the application of row request is affiliated is the first operating system;In at least two operating systems except the first operating system it Outer operating system is other operating systems.Each operating system corresponds to respective loader and basic library file respectively.
When kernel receives the operation request of application, the first modified form basis using affiliated first operating system is determined The basic library file that library file loader and the application to be loaded of the first modified form base library file loader are relied on;Root The information included according to the executable file of application, is determined using the operating system belonging to the basic library file relied on;When During using the operating system belonging to the basic library file relied on for other operating systems, the basic library file of the first modified form is called Other base library file loaders of other operating systems in loader, obtain from public library and apply relied on base library File is loaded, for application call.It can be seen that, in the embodiment of the present invention, public library includes the application fortune in each operating system The relied on most of basic library file of row, by identifying using the operating system belonging to the basic library file relied on, enters And the corresponding loader of the operating system identified is called, the basic library file that the application relied on is obtained from public library and is gone forward side by side Row loading, so as to realize the startup optimization of application.Public library is compared to traditional base library being each equipped with for each operating system Summation, reduce the basic library file of a large amount of identicals, that is, reduce the basic library file of bulk redundancy, reduce basic place The memory space of occupancy, improves the utilization rate level of storage resource.
The technical scheme of the embodiment of the present invention is specifically introduced below in conjunction with the accompanying drawings.
The block schematic illustration of the internal structure of the terminal device of the embodiment of the present invention as shown in figure 1, including:Kernel and at least Two operating systems.
Wherein, at least two operating systems include the first operating system, the second operating system ..., N operating systems.N For more than 2 positive integer.
The operating system of the embodiment of the present invention includes containment system.
It is preferred that the operating system in the embodiment of the present invention, can be provided in empty with Linux container (container) Operating system in the container that planization technology is created.Operating system can be traditional (SuSE) Linux OS or Unix Operating system or the android system being derived based on (SuSE) Linux OS or Ubuntu systems etc., can be with For windows systems based on windows platform etc..In fact, the operating system in the present invention is not limited to previous example The operating system of act, can cover all operating systems that can be run in a reservoir.For ease of understanding, grasped below with Linux Make exemplified by system or its derivation operation system, introduce the technical scheme of the embodiment of the present invention.
Kernel in the embodiment of the present invention, is improved based on traditional linux kernel.Increased major function Including:When receiving the operation request of application, the operating system belonging to the basic library file that the application is relied on is determined, is called The basic library file that the base library file loader of the operating system is relied on the application is loaded;Concrete function will be rear Continuous to describe in detail, here is omitted.
For ease of understanding, an operating system at least two operating systems is regard as the first operating system, at least two Operating system in individual operating system in addition to the first operating system is used as other operating systems.Each operating system correspondence is respective Base library file loader;The respective basic library file of each base library file loader correspondence;All or most basis Library file is deposited in public library.It is preferred that public library includes the basic library file in addition to basic C (C language) library file.
It is preferred that basic library file is dynamic basic library file.
The base library file loading method for the multisystem for introducing the embodiment of the present invention, the flow signal of this method developed below Figure is as shown in Fig. 2 comprise the steps:
S201:When kernel receives the operation request of application, the first improvement using affiliated first operating system is determined The basic library file that type base library file loader and application to be loaded are relied on.
Application in first operating system is received after the instruction of startup optimization, and operation request is sent to kernel.
When kernel receives the operation request of the application of the first operating system, the first operation system is loaded using dlopen modes During the basic library file that the application of system is relied on, the first modified form base library file loader and the first modified form are determined The basic library file that the application to be loaded of base library file loader is relied on.
It is preferred that kernel loads base library according in the operation of the application of the first operating system request, in dlopen modes The instruction of file, determines that the first modified form base library file loader and the first modified form base library file loader are to be added The basic library file that the application carried is relied on.
Normal usage is exemplified below:Kernel receives the void*handle=of the application for the first operating system When dlopen (" xxx.so ") is instructed, determine that the basic library file that application to be loaded is relied on is xxx.so and is responsible for The base library file loader loaded to xxx.so is the first modified form base library file loader of the first operating system. In above-mentioned instruction, handle represents handle;Dlopen represents that a kind of system is called, and is mainly used in open (opening) dynamic link base Plinth library file, and return to a handle.
First modified form base library file loader is included:The base library file loader of first operating system, Yi Jiqi Its base library file loader.Further, the first modified form base library loader is included:The basic library file of first operating system It is peculiar compared to the first operating system institute to load other operating systems in loader and other base library file loaders Basic library file part.
It can be seen that, in the embodiment of the present invention, the application acquiescence of an operating system specifies the basic library text by the operating system Part loader, loads the basic library file that the application is relied on;Without being modified to existing application, it is possible to implement this hair Bright embodiment;That is, the embodiment of the present invention is stronger to the compatibility of substantial amounts of existing application.
S202:Kernel suspends adding for the basic library file that the first modified form base library file loader is relied on application Carry, judge whether using the basic library file relied on be basic C library files;If it is not, then performing step S203;If so, then holding Row step S207.
Inventor notices that traditional use dlopen modes load base library document method, is that kernel uses dlopen letters Number opens dynamic basis storehouse, and this function of dlopen can directly trigger the first Linker (basic library files of the first operating system Loader) loading procedure, that is, call the first Linker that xxx.so loads to the process space into application program, supply is adjusted With.
In the embodiment of the present invention, step S201 and S202 can be performed synchronously.In the embodiment of the present invention, to the function of kernel Improved;The process for the basic library file that the application that kernel loads the first operating system using dlopen modes is relied on In, the basic library file that the application to be loaded of the first modified form base library file loader is relied on is determined, and suspend simultaneously The loading for the basic library file that first modified form base library file loader is relied on application;Judge to apply relied on basis Whether library file is basic C library files;If it is not, then performing step S203;If so, then performing step S207.
S203:The information that kernel is included according to the executable file of application, is determined using the basic library text relied on Operating system belonging to part.
Kernel is determined using belonging to the basic library file relied on according to the header information of the executable file of application Operating system.
It is preferred that the executable program of loading application;Parse the header information of the executable program of application;According to head Information, determines the first modified form base library file loader using affiliated first operating system.
It is preferred that present inventors noted that apply in compilation process, the source code of application is compiled using compiler It is translated into executable program.Compilation process can be divided into two steps, and the source code of application is compiled into by the first step can link intermediate file;Example It can be the file that suffix name is .o that intermediate file, which can such as be linked,;Second step compiler links this using corresponding all Intermediate file (such as entitled * .o file, * is asterisk wildcard, represents some characters) is linked into executable file.Taken in chain Cheng Zhong, compiler can fill in ELF on the head of executable program file, and (Executable and Linkable Format, can Perform with form can be linked) information;In ELF header information, a field for being called Interpreter (interpreter) can be included, This field just specifies using which Linker (base library file loader) to load dynamic basis library file.
It is preferred that after the executable program of kernel loads application is into internal memory, parsing the head of the executable program of application ELF information in portion's information;The content of Interpreter fields is read from ELF information, according to Interpreter fields Content, determines the operating system belonging to the basic library file that the application is relied on.
S204:Kernel judges whether using the operating system belonging to the basic library file relied on be the first operating system; If it is not, then performing step S205;If so, then performing step S206.
Kernel is judged in above-mentioned steps according to default multiple operating systems and the corresponding relation of multiple basic library files Whether the operating system belonging to basic library file that the application determined is relied on is that this applies the first affiliated operating system.
Wherein, an operating system can correspond to multiple basic library files;Same basic library file may be with multiple behaviour Make system corresponding.
It is preferred that an operating system can be corresponding with multiple basic library files in public library;One in public library Basic library file can be corresponding with multiple operating systems.
It is preferred that multiple operating systems and the corresponding relation of multiple basic library files can be preset in kernel.Multiple behaviour Make the corresponding relation of system and multiple basic library files, can also be preset in each Linker or operating system, and it is determined that Go out when needs call basic library file (determining using the basic library file relied on) and be transferred to kernel.
S205:Other basic library texts of other operating systems in kernel calls the first modified form base library file loader Part loader, obtains from public library and is loaded using the basic library file relied on, for application call.
When the operating system belonging to the basic library file that is relied on of application for other operating systems (refer to the first operating system it Outer operating system) when, other bases of other operating systems in kernel calls the first modified form base library file loader Library file loader, obtains from public library and is loaded using the basic library file relied on, for application call.
It is preferred that the base library file loader of multiple operating systems in terminal device detachably can be combined in advance Together, a modified version base library file loader is formed;First and secondth, N operating systems correspond to first and second, N improvement respectively Type base library file loader.First modified form base library file loader, the second modified form base library file loader ..., All it is identical with N modified form base library file loaders.For the first modified form base library file loader, the 2nd ..., N modified forms base library file loader is all other modified form base library file loaders of other operating systems.
When the operating system belonging to the basic library file that is relied on of application is other operating systems, kernel is from composite basis In library file loader, other basic library files of other operating systems in the first modified form base library file loader are called Loader, obtains from public library and is loaded using the basic library file relied on, for application call.
It is appreciated that being actually originally by other bases using the basic library file relied in public library in this step Plinth library file loader is called;Remained in the embodiment of the present invention between basic library file and base library file loader Correspondence (loading) relation;But expanded the base library file loader of each operating system so that each operation system System can be according to the base library file loader after expansion, the basic library file to originally belonging to other operating systems in public library It is called.Both sharing for the basic library file between different operating system can have been realized;It can reduce again identical in public library (redundancy) basic library file, save the memory space that basic library file takes.
It is preferred that the present inventor it is considered that in terminal device different operating system base library file loader In each self-corresponding multiple basic library files, both there is the basic library file of identical, and there are different basic library files again.
For each operating system, for each other operating systems in addition to the operating system, determine this its Its operating system is compared to basic library file specific to the operating system;And then will be used in other base library file loaders The part of the distinctive basic library file is loaded, other basic library texts as other operating systems compared to the operating system Part loader;Afterwards, loaded by the base library file loader and at least one other basic library file of the operating system Device, combination obtains the modified form base library file loader of the operating system.
It is appreciated that the base library file loader of each operating system and each other operating systems are compared to this Other basic sub- loaders of library file of operating system are all different.
For the first operating system, by other base library file loaders, to load other operating systems compared to The part of basic library file specific to first operating system, is loaded as other basic library file of other operating systems Device.Therefore, the corresponding basic library file of other sub- loaders of basic library file is other operating systems compared to the first operation system The specific basic library file of system.
Kernel by (first) the base library file loader of the first operating system, it is pre- with other basic sub- loaders of library file First it is combined as the first modified form base library file loader.That is, the first modified form base library file loader is included:The (first) the base library file loader of one operating system and other basic library file in addition to the first operating system Loader.
Further, the second modified form base library file loader of the second operating system, the second modified form base can similarly be obtained Plinth library file loader is included:(second) the base library file loader of second operating system and except the second operating system Outside other operating systems other basic sub- loaders of library file.The basic library file loading of the 3rd modified form can similarly be obtained Device ..., N modified form base library file loaders.It is preferred that changing for the first modified form base library file loader, second Good figure base library file loader ..., N modified form base library file loaders, be all identical between any two.
Kernel calls other base libraries of default other operating systems from the first modified form base library file loader The sub- loader of file, is obtained from public library by other basic sub- loaders of library file and is carried out using the basic library file relied on Loading.
It is appreciated that being actually originally by other bases using the basic library file relied in public library in this step Plinth library file loader is called;Remained in the embodiment of the present invention basic library file and the basic sub- loader of library file it Between correspondence (loading) relation;And according to other basic sub- loaders of library file, the basic library file of an operating system is added Carry device to be expanded so that an operating system can be according to the base library file loader after expansion, in public library The basic library file for originally belonging to other operating systems is called.Can shared different operating system basic library file and In the case of reducing the basic library file of identical (redundancy) in public library, further reduce and be directed to base library file loader institute The content of expansion, reduces the memory space shared by the base library file loader after expanding.
Further, it was found by the inventors of the present invention that different Linker performs the loading procedure of dynamic basis library file. So different Linker also just has different dynamic basis library search path orders, because the placement position of dynamic basis library file Put indefinite, so a configuration file can be correspondingly arranged on for each Linker, to indicate that Linker needs to search for those roads Corresponding dynamic basis library file is found in footpath, such as the searching route in the dynamic basis storehouse of a certain operating system include (/ Lib ,/usr/lib), and the searching route in the dynamic basis storehouse of another operating system is then (/system/lib)
In the embodiment of the present invention, the other basic sub- loaders of library file of kernel calls, according to default and other base libraries The corresponding base library file search path of the sub- loader of file, obtains the basic library file progress that application is relied on from public library Loading.
After the basic library file that loading application is relied on, it is called using to the basic library file.
For example, kernel is instructed according to funcPtr=dlsym (handle, " XYZ "), determine using the base library needed Specific function XYZ in file (the xxx.so files pointed to by handle), funcPtr is assigned by the address of this function.Should Instructed with using funcPtr (), access this function address, that is, the essence of XYZ functions is called.In the instruction, dlsym Expression system is called, the main operation handle and symbol being used to according to the basic library file of dynamic link, and return character is correspondingly Location.Function address can be not only obtained using this function, address of variable can also be obtained.
S206:Kernel calls the first modified form base library file loader is obtained from public library using relied on basis Library file is loaded.
When the operating system belonging to basic library file relied on when application is the first operating system, the first modified form is called In base library file loader, the first operating system (first) base library file loader, obtains application from public library The basic library file relied on is loaded.
It is preferred that from (first) base library of the first operating system in above-mentioned first modified form base library file loader File loader, the halted state loaded to the basic library file that application is relied on, return to stress state, i.e., from public Obtain and loaded using the basic library file relied in storehouse.
S207:Kernel calls the first modified form base library file loader is obtained to be entered using the basic C library files relied on Row loading.
It is preferred that the basic library file in the public library of the embodiment of the present invention is all dynamic in addition to basic c library files State basis library file.
In the embodiment of the present invention, different operating system has correspondence to be preset with different libc base libraries.For example it is a certain Plant operating system and rely on glibc bases c storehouses, and another operating system then relies on bionic.Libc, glibc and bionic are The file name that storehouse compiling of increasing income is obtained.
The basic library file of (first) of in kernel calls the first modified form base library file loader, the first operating system Loader, obtains the basic C library files that application is relied on, and the basic C library files of acquisition are loaded by legacy paths.
It is described below a special case of the base library file loading method of the multisystem of the embodiment of the present invention, the special case is shown It is intended to as shown in Figure 3 a.It is respectively the application of the first operating system, the second operating system using 1,2 in Fig. 3 a;Linker1、2 The base library file loader of respectively the first operating system, the base library file loader of the second operating system;Basic C storehouses 1, 2 be respectively basic C library files, the basic C library files of the second operating system of the first operating system;First and second operating system Other basic library files in addition to basic C library files are all defaulted in public library.Linker1,2 are passed by respective respectively System path obtains basis C storehouses 1, basis C storehouses 2 and loaded.
When determining that using the 1 basic library file relied on be not basic C library files and the basic library file belongs to second During operating system, the basic sub- loader (not shown) of library file of Linker2 or second is called from Linker1 from public library Middle acquisition basic library file is simultaneously loaded.Antisense is as the same.
Fig. 3 b show for the local refinement of a special case of the base library file loading method of the multisystem of the embodiment of the present invention It is intended to.In Fig. 3 b, in Linker1 except in Linker2.a part, Linker2 except Linker1.a part, table respectively Show base library file loader, the base library file loader of the second operating system of the first operating system;The dynamic base of system 2 The second operating system is represented compared to basic library file specific to the first operating system, Linker2.a represents to use in Linker2 To load part of second operating system compared to basic library file specific to the first operating system;The dynamic base table of system 1 Show the first operating system compared to basic library file specific to the second operating system, Linker1.a represents to be used in Linker1 Load part of first operating system compared to basic library file specific to the second operating system.Linker1 is represented by first The first of the base library file loader of operating system and Linker2.a compositions as the second basic sub- loader of library file First modified form base library file loader of operating system;Linker2 represents to be added by the basic library file of the second operating system Carry device and the second basic library texts of the second operating system for constituting of Linker1.a as the sub- loader of first foundation library file Part loader.
When determining that using the 1 basic library file relied on be not basic C library files and the basic library file belongs to second During operating system, Linker2.a is called to obtain the basic library file from public library and loaded from Linker1.Antisense It is as the same.
Base library file loading method based on above-mentioned multisystem, the embodiment of the present invention additionally provides the base library of multisystem File loading device, the device is arranged in terminal device, and the block schematic illustration of the internal structure of the device is as shown in figure 4, bag Include:Basic library file determining module 401 and base library file load module 402.
Wherein, when basic library file determining module 401 is used for the operation request for receiving application, determine using affiliated the The basic library file that first modified form base library file loader of one operating system and application to be loaded are relied on.
Base library file load module 402 is used for the information included according to the executable file of application, determines application The operating system belonging to basic library file relied on;The operating system belonging to basic library file relied on when application is other During operating system, other basic library file loadings of other operating systems in the first modified form base library file loader are called Device, obtains from public library and is loaded using the basic library file relied on, for application call.
It is preferred that basic library file determining module 401 is additionally operable to determine that the first modified form base library file loader is treated During the basic library file that the application of loading is relied on, the first modified form base library file loader of pause is to applying relied on base The loading of plinth library file, judges whether using the basic library file relied on be basic C library files.
And, base library file load module 402 is additionally operable to judge to apply when basic library file determining module to be relied on Basic library file when being basic C library files, call the first modified form base library file loader to obtain and apply relied on base Plinth C library files are loaded;When basic library file determining module judges that using the basic library file relied on be not basic C storehouses During file, the information included according to the executable file of application is determined using the behaviour belonging to the basic library file relied on Make system;Wherein, public library includes the basic library file in addition to basic C library files.
It is preferred that base library file load module 402 from the first modified form base library file loader specifically for adjusting With other basic sub- loaders of library file of default other operating systems, obtained from public library and apply relied on base library File is loaded;The corresponding basic library file of other sub- loaders of basic library file is other operating systems compared to first Basic library file specific to operating system.
It is preferred that base library file load module 402 is specifically for calling other sub- loaders of basic library file, according to pre- If corresponding base library file search path, the basic library file that is relied on of application is obtained from public library and is added Carry.
It is preferred that header information of the base library file load module 402 specifically for the executable file according to application, really Make using the operating system belonging to the basic library file relied on.
It is preferred that base library file load module 402 is additionally operable to the information included according to the executable file of application, really Make using the behaviour belonging to basic library file after the operating system belonging to the basic library file relied on, relied on when application When making system for the first operating system, call the first modified form base library file loader to obtain application from public library and relied on Basic library file loaded.
The implementation method of above-mentioned basic library file determining module 401 and the function of base library file load module 402, Ke Yican The idiographic flow and the content of step of the base library file loading method of the above-mentioned multisystem of number, here is omitted.
In the embodiment of the present invention, the corresponding loading relation between basic library file and base library file loader is remained, The base library file loader of each operating system is extended for modified form base library file loader.Request is run when sending During using the operating system belonging to the basic library file relied on for other operating systems, the first modified form base library can be called Other base library file loaders of other operating systems in file loader, be to originally belonging to other operations in public library System, the basic library file that the application is relied on, are obtained and are loaded;Both the basis between different operating system can be realized Library file it is shared;The basic library file of identical in public library (redundancy) can be reduced again, save what basic library file took Memory space.
Moreover, in the embodiment of the present invention, remain between basic library file and the sub- loader of basic library file corresponding adds Load relation;And for each operating system, according to other basic sub- loaders of library file, by the basic library file of the operating system Loader is extended for modified form base library file loader.Belonging to the basic library file relied on when the application for sending operation request Operating system be other operating systems when, other operating systems in the first modified form base library file loader can be called Other basic sub- loaders of library file, to originally belonging to other operating systems, the basis that the application is relied in public library Library file, is obtained and is loaded;Can shared different operating system basic library file and reduce identical in public library In the case of the library file of (redundancy) basis, the content expanded for base library file loader is further reduced, reduces and expands The memory space shared by base library file loader after filling.
In addition, in the embodiment of the present invention, mainly carrying out the well to the loader of kernel and basic library file, to application originally Body need not be improved, and have good compatibility to substantial amounts of application.
Those skilled in the art of the present technique are appreciated that the present invention includes being related to for performing in operation described herein One or more of equipment.These equipment can be for needed for purpose and specially design and manufacture, or can also include general Known device in computer.These equipment have the computer program being stored in it, and these computer programs are optionally Activation is reconstructed.Such computer program can be stored in equipment (for example, computer) computer-readable recording medium or be stored in E-command and it is coupled to respectively in any kind of medium of bus suitable for storage, the computer-readable medium is included but not Be limited to any kind of disk (including floppy disk, hard disk, CD, CD-ROM and magneto-optic disk), ROM (Read-Only Memory, only Read memory), RAM (Random Access Memory, immediately memory), EPROM (Erasable Programmable Read-Only Memory, Erarable Programmable Read only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory, EEPROM), flash memory, magnetic card or light card Piece.It is, computer-readable recording medium includes storing or transmitting any Jie of information in the form of it can read by equipment (for example, computer) Matter.
Those skilled in the art of the present technique be appreciated that can be realized with computer program instructions these structure charts and/or The combination of each frame and these structure charts and/or the frame in block diagram and/or flow graph in block diagram and/or flow graph.This technology is led Field technique personnel be appreciated that these computer program instructions can be supplied to all-purpose computer, special purpose computer or other The processor of programmable data processing method is realized, so as to pass through the processing of computer or other programmable data processing methods The scheme that device is specified in the frame or multiple frames to perform structure chart disclosed by the invention and/or block diagram and/or flow graph.
Those skilled in the art of the present technique are appreciated that in the various operations discussed in the present invention, method, flow Step, measure, scheme can be replaced, changed, combined or deleted.Further, it is each with what is discussed in the present invention Kind operation, method, other steps in flow, measure, scheme can also be replaced, changed, reset, decomposed, combined or deleted. Further, it is of the prior art to have and the step in the various operations disclosed in the present invention, method, flow, measure, scheme It can also be replaced, changed, reset, decomposed, combined or deleted.
Described above is only some embodiments of the present invention, it is noted that for the ordinary skill people of the art For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should It is considered as protection scope of the present invention.

Claims (10)

1. a kind of base library file loading method of multisystem, it is characterised in that including:
When receiving the operation request of application, the basic library text of the first modified form of the first operating system belonging to the application is determined The basic library file that part loader and the application to be loaded are relied on;
The information included according to the executable file of the application, is determined belonging to the basic library file applied and relied on Operating system;
When the operating system belonging to the basic library file applied and relied on is other operating systems, the first modified form is called Other base library file loaders of other operating systems in base library file loader, obtain described from public library Loaded using the basic library file relied on, for the application call.
2. according to the method described in claim 1, it is characterised in that described to determine the base that the application to be loaded is relied on During plinth library file, in addition to:
Suspend the loading for the basic library file that the first modified form base library file loader is relied on the application, judge described Whether it is basic C library files using the basic library file relied on;And
The information included according to the executable file of the application, is determined belonging to the basic library file applied and relied on Operating system, including:
When the basic library file for judging that the application is relied on is basic C library files, the basic library text of the first modified form is called The acquisition of part loader is described to apply the basic C library files relied on to be loaded;
When the basic library file for judging that the application is relied on is not basic C library files, according to the executable of the application The information that file is included, determines the operating system belonging to the basic library file applied and relied on;
Wherein, the public library includes the basic library file in addition to basic C library files.
3. method according to claim 1 or 2, it is characterised in that described to call the basic library file loading of the first modified form Other base library file loaders of other operating systems in device, obtain the relied on base of the application from public library Plinth library file is loaded, including:
Other basic library files of default other operating systems are called from the first modified form base library file loader Sub- loader, obtains from the public library and described applies the basic library file that is relied on to be loaded;
The corresponding basic library file of other basic sub- loaders of library file is other operating systems compared to the first behaviour Make basic library file specific to system.
4. method according to claim 3, it is characterised in that described to call the other of default other operating systems The basic sub- loader of library file, obtained from the public library it is described apply the basic library file that is relied on to be loaded, including:
Other basic sub- loaders of library file are called, according to default corresponding base library file search path, from Obtained in the public library and described apply the basic library file that is relied on to be loaded.
5. method according to claim 1 or 2, it is characterised in that the executable file according to the application is wrapped The information contained, determines the operating system belonging to the basic library file applied and relied on, including:
According to the header information of the executable file of the application, determine belonging to the basic library file applied and relied on Operating system.
6. the method according to claim 1 or 2, it is characterised in that the executable file institute according to the application Comprising information, after determining the operating system applied belonging to the basic library file that is relied on, in addition to:
When the operating system belonging to the basic library file applied and relied on is the first operating system, the first modified form is called Base library file loader is obtained from the public library described applies the basic library file that is relied on to be loaded.
7. a kind of basic library file loading device of multisystem, it is characterised in that including:
Basic library file determining module, when the operation for receiving application is asked, determines the first operation belonging to the application The basic library file that first modified form base library file loader of system and the application to be loaded are relied on;
Base library file load module, for the information included according to the executable file of the application, determines described answer With the operating system belonging to the basic library file relied on;When the operating system belonging to the basic library file applied and relied on During for other operating systems, other bases of other operating systems in the first modified form base library file loader are called Library file loader, obtained from public library it is described apply the basic library file that is relied on to be loaded, for application tune With.
8. device according to claim 7, it is characterised in that
The basic library file determining module is additionally operable to determine to be loaded described of the first modified form base library file loader During using the basic library file relied on, the first modified form base library file loader of pause basis relied on to the application The loading of library file, judges whether the basic library file that the application is relied on is basic C library files;And
The base library file load module is additionally operable to when the basic library file determining module judges that the application is relied on Basic library file when being basic C library files, call the first modified form base library file loader to obtain the application and relied on Basic C library files loaded;When the basic library file determining module judges the basic library text applied and relied on When part is not basic C library files, the information included according to the executable file of the application determines that the application is relied on Basic library file belonging to operating system;Wherein, the public library includes the basic library text in addition to basic C library files Part.
9. the device according to claim 7 or 8, it is characterised in that
The base library file load module from the first modified form base library file loader specifically for calling default institute Other basic sub- loaders of library file of other operating systems are stated, the relied on basis of the application is obtained from the public library Library file is loaded;The corresponding basic library file of other basic sub- loaders of library file, is other operating systems Compared to basic library file specific to the first operating system.
10. device according to claim 9, it is characterised in that
The base library file load module specifically for calling other basic sub- loaders of library file, according to it is default with Its corresponding base library file search path, obtains from the public library and described applies the basic library file that is relied on to be added Carry.
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 true CN106990993A (en) 2017-07-28
CN106990993B 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)

Cited By (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
CN110471870A (en) * 2019-08-14 2019-11-19 Oppo广东移动通信有限公司 Method, apparatus, electronic equipment and the storage medium of multisystem operation
CN111290999A (en) * 2020-01-10 2020-06-16 高新兴物联科技有限公司 Library file adaptive matching method, device and computer readable storage medium
CN114168203A (en) * 2020-09-10 2022-03-11 成都鼎桥通信技术有限公司 Dual-system running state control method and device and electronic equipment
CN114579193A (en) * 2022-03-08 2022-06-03 国泰新点软件股份有限公司 Multi-system loading method, device, equipment and storage medium

Citations (5)

* 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
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

Patent Citations (5)

* 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
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

Cited By (8)

* 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
CN110471870A (en) * 2019-08-14 2019-11-19 Oppo广东移动通信有限公司 Method, apparatus, electronic equipment and the storage medium of multisystem operation
CN111290999A (en) * 2020-01-10 2020-06-16 高新兴物联科技有限公司 Library file adaptive matching method, device and computer readable storage medium
CN111290999B (en) * 2020-01-10 2023-06-13 高新兴物联科技股份有限公司 Library file self-adaptive matching method, device and computer readable storage medium
CN114168203A (en) * 2020-09-10 2022-03-11 成都鼎桥通信技术有限公司 Dual-system running state control method and device and electronic equipment
CN114168203B (en) * 2020-09-10 2024-02-13 成都鼎桥通信技术有限公司 Dual-system running state control method and device and electronic equipment
CN114579193A (en) * 2022-03-08 2022-06-03 国泰新点软件股份有限公司 Multi-system loading method, device, equipment and storage medium
CN114579193B (en) * 2022-03-08 2024-01-12 国泰新点软件股份有限公司 Multi-system loading method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN106990993B (en) 2020-07-28

Similar Documents

Publication Publication Date Title
CN106990993A (en) Multi-system basic library file loading method and device
CN105100191B (en) The method, apparatus and system of Java application installations are realized in a kind of cloud compiling
CN105677335B (en) Improve the method and device that mobile terminal first powers on speed
JP5192118B2 (en) Platform system for mobile terminals
CN104699537B (en) Control method and movable component dispatching method and its corresponding device
CN107741851A (en) Compilation Method, device and the terminal device of compiling system
NZ534345A (en) System and method for updating dataset versions resident on a wireless device
CN102681893B (en) The cross-platform implementation method of executable program and mobile terminal
EP1869924A1 (en) Method for providing contents for mobile communication terminal
CN106201600A (en) Application program for mobile terminal progress control method and operating system
CN106445549A (en) Method and device for adjusting functional module layout in application program interface
CN104699536B (en) Moving component process space distribution method and its corresponding device
CN105553961A (en) Mandatory access control method and system for application program and management server
CN101729753A (en) Method and device for loading pictures during java application
CN101526902B (en) Executable file compression and loading technologies for movable terminal
CN106295326A (en) A kind of inline hook method and system for obtaining video card content
US8966108B2 (en) Portable data carrier comprising a CAT interpreter
US8438351B2 (en) Binary level update of compressed read-only file systems
CN102083016A (en) Information processing method and device
CN114840214A (en) Program compiling and starting method, device and storage medium
CN101257515A (en) System and method for transformation of syndicated content for mobile delivery
CN106919391A (en) Towards the embedded system of the customizable operating system component of smart mobile phone
CN112702373B (en) Micro-service upgrade file sending method, micro-service upgrade file receiving device and storage medium
CN105991818A (en) File downloading method and terminal
CN100464300C (en) ARM based binary operation circumstance platform and loading method using the same

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