WO2018099292A1 - Process management method and apparatus - Google Patents

Process management method and apparatus Download PDF

Info

Publication number
WO2018099292A1
WO2018099292A1 PCT/CN2017/111997 CN2017111997W WO2018099292A1 WO 2018099292 A1 WO2018099292 A1 WO 2018099292A1 CN 2017111997 W CN2017111997 W CN 2017111997W WO 2018099292 A1 WO2018099292 A1 WO 2018099292A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
function
child
dynamic link
link library
Prior art date
Application number
PCT/CN2017/111997
Other languages
French (fr)
Chinese (zh)
Inventor
关志俊
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2018099292A1 publication Critical patent/WO2018099292A1/en

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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt

Definitions

  • the proxy process (called the cinit process) is used to link the dynamic link library in the embodiment of the present application, and the child process is created by the agent process, and the child process created by the agent process is called.
  • the entry function of the program loads the program.
  • Network interface 706 can include a receiver to provide device 700 with a wireless interface to communicate with one or more networks and/or any suitable device.
  • Network interface 706 can include any suitable hardware and/or firmware.
  • Network interface 706 can include multiple antennas to provide a multiple input multiple output wireless interface.
  • network interface 706 can include a network adapter, a wireless network adapter, a telephone modem, and/or a wireless modem.

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

Disclosed in the present application are a method and apparatus for process management, comprising: initiating an agent process, said agent process loading a dynamic link library linked by the agent process to a memory; said agent process creating a first sub-process, said first sub-process loading a first program by means of invoking an entry function of said program; said agent process creating a second sub-process, said second sub-process loading a second program by means of invoking an entry function of said second program. Said first and second programs share the memory occupied by said dynamic link library.

Description

一种进程管理方法及装置Process management method and device
本申请要求2016年11月29日递交的申请号为201611078446.1、发明名称为“一种进程管理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application Serial No. No. No. No. No. No. No. No. No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种进程管理方法及装置。The present application relates to the field of computer technologies, and in particular, to a process management method and apparatus.
背景技术Background technique
进程(Process)是计算机中的程序关于某数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位,是操作系统结构的基础。程序是指令、数据及其组织形式的描述,进程是程序的实体。A process is a running activity of a program on a computer on a data set. It is the basic unit of the system for resource allocation and scheduling, and is the basis of the operating system structure. A program is a description of instructions, data, and its organizational form. A process is an entity of a program.
在Linux系统中,init进程是Linux系统中所有进程的父进程。init进程由Linux内核引导运行,是系统中的第一个进程。init进程生成子进程,此时子进程共享父进程的内存空间,一旦父进程或子进程修改了某页内存,则Linux内核会创建该页内存专属于该进程的副本,这样父子进程即可共享内容相同的内存页,又互不干扰。In Linux systems, the init process is the parent of all processes in the Linux system. The init process is run by the Linux kernel and is the first process in the system. The init process generates a child process. At this time, the child process shares the memory space of the parent process. Once the parent process or the child process modifies a page of memory, the Linux kernel creates a copy of the page memory exclusive to the process, so that the parent and child processes can share. Memory pages with the same content do not interfere with each other.
发明内容Summary of the invention
本申请实施例提供了一种进程管理方法及装置。The embodiment of the present application provides a process management method and apparatus.
本申请实施例提供的方法,包括:启动代理进程,所述代理进程加载所述代理进程所链接的动态链接库到内存;所述代理进程创建第一子进程,所述第一子进程通过调用所述第一程序的入口函数,加载所述第一程序;所述代理进程创建第二子进程,所述第二子进程通过调用所述第二程序的入口函数,加载所述第二程序;其中,所述第一程序和所述第二程序共享所述动态链接库占用的内存。The method provided by the embodiment of the present application includes: starting an agent process, where the agent process loads a dynamic link library linked by the agent process into a memory; the agent process creates a first child process, and the first child process invokes The entry function of the first program loads the first program; the proxy process creates a second child process, and the second child process loads the second program by calling an entry function of the second program; The first program and the second program share the memory occupied by the dynamic link library.
附图说明DRAWINGS
图1为现有技术中Linux系统加载程序的过程示意图;1 is a schematic diagram of a process of loading a program in a Linux system in the prior art;
图2为现有技术中Linux系统加载程序后的内存分布示意图;2 is a schematic diagram of memory distribution after loading a program in a Linux system in the prior art;
图3为本申请实施例中Linux系统加载程序的过程示意图;3 is a schematic diagram of a process of loading a Linux system in the embodiment of the present application;
图4为本申请实施例中Linux系统加载程序后的内存分布示意图;4 is a schematic diagram of memory distribution after a Linux system loading program in an embodiment of the present application;
图5为本申请实施例中应用程序的启动流程示意图; FIG. 5 is a schematic diagram of a startup process of an application in an embodiment of the present application;
图6为本申请实施例提供的装置的结构示意图;FIG. 6 is a schematic structural diagram of an apparatus according to an embodiment of the present disclosure;
图7为本申请另外的实施例提供的装置的结构示意图。FIG. 7 is a schematic structural diagram of an apparatus according to another embodiment of the present application.
具体实施方式detailed description
虽然本申请的概念易于进行各种修改和替代形式,但是其具体实施例已经通过附图中的示例示出并且将在本文中详细描述。然而,应当理解,没有意图将本申请的概念限制为所公开的特定形式,而是相反,意图是覆盖与本申请以及所附权利要求一致的所有修改、等同物和替代物。While the concept of the present application is susceptible to various modifications and alternatives, the specific embodiments thereof are illustrated by the examples in the drawings and will be described in detail herein. It should be understood, however, that the invention is not intended to be limited to the details of the invention.
说明书中对“一个实施例”、“实施例”、“说明性实施例”等的引用,指示所描述的实施例可包括特定特征、结构或特性,但是每个实施例可以或可以不必包括特定特征、结构或特性。此外,这样的短语不一定指的是相同的实施例。进一步地,认为在本领域技术人员的知识范围内,当结合实施例描述特定特征、结构或特性时,结合无论是否明确描述的其它实施例影响这样的特征,结构或特性。另外,应当理解,以“A,B和C中的至少一个”的形式包括在列表中的项目可以表示(A);(B);(C);(A和B);(A和C);(B和C);或(A,B和C)。类似地,以“A,B或C中的至少一个”的形式列出的项目可以表示(A);(B);(C);(A和B);(A和C);(B和C)或(A,B和C)。References to "an embodiment", "an embodiment", "an illustrative embodiment" or the like in the specification are intended to mean that the described embodiments may include specific features, structures, or characteristics, but each embodiment may or may not necessarily include a particular Feature, structure or characteristic. Moreover, such phrases are not necessarily referring to the same embodiments. Further, it is to be understood that the specific features, structures, or characteristics may be combined with other embodiments, whether explicitly described or not, in conjunction with the embodiments. In addition, it should be understood that items included in the list in the form of "at least one of A, B, and C" may represent (A); (B); (C); (A and B); (A and C) ; (B and C); or (A, B and C). Similarly, items listed in the form of "at least one of A, B or C" may represent (A); (B); (C); (A and B); (A and C); (B and C) or (A, B and C).
在一些情况下,所公开的实施例可以在硬件、固件、软件或其任何组合中实现。所公开的实施例还可以被实现为由一个或多个暂时性或非暂时性机器可读(例如,计算机可读)存储介质携带或存储的指令,其可以由一个或多个处理器读取和执行。机器可读存储介质可以体现为用于以机器可读形式(例如,易失性或非易失性存储器、介质盘或其他介质)存储或传输信息的任何存储设备,机制或其他物理结构的设备)。In some cases, the disclosed embodiments can be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments can also be implemented as instructions carried or stored by one or more transitory or non-transitory machine readable (eg, computer readable) storage media, which can be read by one or more processors And execution. A machine-readable storage medium may be embodied in any storage device, mechanism or other physical structure for storing or transmitting information in a machine readable form (eg, a volatile or nonvolatile memory, media disk or other medium). ).
在附图中,一些结构或方法特征可以以特定布置和/或顺序示出。然而,应当理解,可能不需要这样的具体布置和/或排序。相反,在一些实施例中,这些特征可以以与说明性附图中所示不同的方式和/或顺序来布置。另外,在特定图中包括结构或方法特征并不意味着暗示这种特征在所有实施例中都是需要的,并且在一些实施例中可以不包括或可以与其他特征组合。In the figures, some structural or method features may be shown in a particular arrangement and/or order. However, it should be understood that such specific arrangements and/or ordering may not be required. Rather, in some embodiments, these features may be arranged in a different and/or sequential manner than shown in the illustrative figures. In addition, the inclusion of structural or method features in a particular figure is not meant to imply that such a feature is required in all embodiments, and may not include or be combined with other features in some embodiments.
参见图1,为目前Linux系统中,由init进程启动程序a和程序b的示意图。如图所示,系统首先启动init进程,init进程调用fork函数以生成子进程a,子进程a调用exec函数以加载程序a。程序b的加载过程类似。 Referring to FIG. 1, a schematic diagram of a program a and a program b started by an init process in a current Linux system. As shown in the figure, the system first starts the init process, the init process calls the fork function to generate the child process a, and the child process a calls the exec function to load the program a. The loading process of program b is similar.
子进程调用exec函数加载一个新程序时,该子进程的内存空间会被完全清除并重建,即该子进程与init进程不再存在共享的内存页。目前所有的Linux系统中的init进程创建新程序时均通过调用exec函数实现。图2示出了程序a和程序b启动后系统中的内存分布示意图,可以看到动态链接库内存在程序a、程序b两个子进程中都有一份副本。When the child process calls the exec function to load a new program, the memory space of the child process is completely cleared and rebuilt, that is, the child process and the init process no longer have shared memory pages. At present, all init processes in the Linux system are created by calling the exec function when creating a new program. Figure 2 shows the memory distribution in the system after the program a and the program b are started. It can be seen that there is a copy in the two processes of the program a and the program b in the dynamic link library.
其中,动态链接库是实现共享函数库的一种方式,使进程可以调用不属于其可执行代码的函数。系统中存在大量动态链接库,大部分可执行程序均会使用动态链接库。这些动态链接库占用大量内存。因此,如何减少动态链接库的内存开销是目前需要解决的问题。Among them, the dynamic link library is a way to implement the shared function library, so that the process can call functions that are not part of its executable code. There are a large number of dynamic link libraries in the system, and most executable programs use dynamic link libraries. These dynamic link libraries take up a lot of memory. Therefore, how to reduce the memory overhead of the dynamic link library is a problem that needs to be solved currently.
由于在Linux系统中,init进程无法链接动态链接库,因此本申请实施例中使用代理进程(称为cinit进程)链接动态链接库,由该代理进程创建子进程,由代理进程创建的子进程调用程序的入口函数来加载程序,由于由代理进程创建的子进程通过调用程序的入口函数来加载程序,而非调用exec()函数来加载程序,因此不同程序的内存避免了被完全隔离;又由于该代理进程链接了动态链接库,在代理进程启动时该动态链接库被加载到内存,因此通过上述方式加载的多个程序可以共享代理进程所加载的动态链接库的内存,从而与现有技术中每个程序均需保存动态链接库的副本相比,减少了动态链接库的内存开销。Since the init process cannot link the dynamic link library in the Linux system, the proxy process (called the cinit process) is used to link the dynamic link library in the embodiment of the present application, and the child process is created by the agent process, and the child process created by the agent process is called. The entry function of the program loads the program. Since the child process created by the agent process loads the program by calling the program's entry function instead of calling the exec() function to load the program, the memory of different programs is completely isolated; The agent process links the dynamic link library, and the dynamic link library is loaded into the memory when the agent process starts, so the multiple programs loaded by the above manner can share the memory of the dynamic link library loaded by the agent process, thereby Each program in the program needs to save a copy of the dynamic link library, reducing the memory overhead of the dynamic link library.
本申请实施例提供的原理,可程序于Linux系统,也可程序于有类似需求的其他系统。The principles provided by the embodiments of the present application can be programmed in a Linux system or in other systems with similar requirements.
下面以在Linux系统中应用本申请实施例为例,对本申请实施例的具体实现过程进行描述。The specific implementation process of the embodiment of the present application is described below by taking an embodiment of the present application in a Linux system as an example.
当计算机开机的时候,系统内核(kernel)只建立了一个init进程。Linux内核并不提供直接建立新进程的系统调用,其他的所有进程都是init进程通过fork机制建立的。fork是一个系统调用,通过调用fork函数,老进程(父进程)可通过复制自身得到新进程(子进程)。进程存活于内存中,每个进程都在内存中分配有属于自己的地址空间(address space)。当调用fork函数的时候,Linux在内存中开辟出新的内存空间给新进程,并将老进程内存空间中的内容复制到该新的空间中,此后两个进程同时运行。When the computer is powered on, the kernel (kernel) only creates an init process. The Linux kernel does not provide a system call to directly create a new process. All other processes are created by the init process through the fork mechanism. Fork is a system call. By calling the fork function, the old process (parent process) can get the new process (child process) by copying itself. The process lives in memory, and each process is allocated its own address space in memory. When the fork function is called, Linux opens up new memory space in memory to the new process, and copies the contents of the old process memory space into the new space, after which the two processes run simultaneously.
由于init进程无法链接动态链接库,因此本申请实施例中引入了代理进程(称为cinit进程)。代理进程在编译时链接了动态链接库,该动态链接库可以包括Linux系统提供的基本动态链接库,一般应用程序运行时均会用到。在init进程启动的过程中,该代理进程被启动,从而将该代理进程所链接的动态链接库加载到内存中。系统中其他的程序 可由该代理进程启动。Since the init process cannot link the dynamic link library, an agent process (referred to as a cinit process) is introduced in the embodiment of the present application. The agent process links the dynamic link library at compile time. The dynamic link library can include the basic dynamic link library provided by the Linux system, which is generally used by the application runtime. During the startup process of the init process, the agent process is started, thereby loading the dynamic link library linked by the agent process into the memory. Other programs in the system Can be started by the agent process.
当需要加载新的程序时(比如用户通过移动终端的屏幕触摸操作,点击了一个应用程序的图标,或者发生了其他触发加载应用程序的操作),由代理进程创建子进程,该子进程通过调用该程序的入口函数,加载该程序。When a new program needs to be loaded (such as a user touching a screen through a mobile terminal, clicking an application's icon, or another action that triggers an application to load), a child process is created by the proxy process, and the child process is called. The program's entry function loads the program.
该过程中,代理进程仍可通过调用fork函数创建子进程。当代理进程调用fork函数后,系统给新的进程(子进程)分配资源,比如Linux在内存中开辟出一片新的内存空间给新的进程,用于存储数据和代码,并将老的进程空间中的内容复制到新的空间中,其中,只有少数参数与老进程的参数不同,这样,新的进程和老的进程可实现基本相同的功能。当然,调用fork函数时输入的初始参数或者传入的变量也可以不同,这样,新的进程和老的进程可实现不同的功能。During this process, the agent process can still create child processes by calling the fork function. When the agent process calls the fork function, the system allocates resources to the new process (child process). For example, Linux opens up a new memory space in memory for the new process, which is used to store data and code, and the old process space. The content in the content is copied to the new space, where only a few parameters are different from the parameters of the old process, so that the new process and the old process can achieve basically the same function. Of course, the initial parameters or the variables passed in when the fork function is called can be different, so that the new process and the old process can implement different functions.
新创建得到的进程作为代理进程的子进程,获取应用程序的入口函数的地址,调用该应用程序的入口函数,从而加载该应用程序。其中,应用程序通常具有main函数,它是应用程序的入口函数,是启动应用程序时首先被调用的函数,从而开始运行该应用程序。在另外的一些实施例中,启动应用程序时,可先于该应用程序的main函数而执行其他函数,比如gcc编译器编译的可执行程序中都存在__libc_start_main函数,该函数调用了main函数,即该函数先于main函数执行。在这种情况下,代理进程创建子进程后,该子进程可通过调用应用程序的__libc_start_main函数来加载该应用程序。The newly created process acts as a child of the agent process, gets the address of the application's entry function, calls the application's entry function, and loads the application. Among them, the application usually has a main function, which is the application's entry function, which is the function that is called first when the application is started, so that the application starts running. In other embodiments, when the application is launched, other functions may be executed before the main function of the application. For example, the __libc_start_main function exists in the executable compiled by the gcc compiler, and the function calls the main function. That is, the function is executed before the main function. In this case, after the agent process creates the child process, the child process can load the application by calling the application's __libc_start_main function.
其中,入口函数的地址可从经过编译和链接的可执行程序中获得。应用程序的源代码需要经过编译器进行编译以及链接器进行链接后,形成可执行程序,可执行程序通常以可执行和可链接格式(Executable and Linkable Format,简称ELF)文件存储。ELF文件中包括编译后的机器指令代码、数据、符号表、调试信息、字符串等。一般ELF文件将这些文件信息按不同的属性,以“段”或“节”的形式存储。其中,ELF文件中的dynsym段主要用于存储操作系统相关的信息,比如变量名、函数名等。可通过调用dlsym函数获得ELF文件中的dynsym段中的main函数地址。Among them, the address of the entry function can be obtained from the compiled and linked executable program. The source code of the application needs to be compiled by the compiler and linked by the linker to form an executable program, which is usually stored in an Executable and Linkable Format (ELF) file. The ELF file includes compiled machine instruction code, data, symbol table, debugging information, and string. General ELF files store these file information in the form of "segments" or "sections" according to different attributes. Among them, the dynsym segment in the ELF file is mainly used to store operating system related information, such as variable names, function names, and the like. The main function address in the dynsym section of the ELF file can be obtained by calling the dlsym function.
默认情况下,在将源代码编译为可执行文件时,main函数的地址不导出到dynsym段中,也就是说,无法通过调用dlsym函数得到main函数的地址。本申请实施例中,可通过修改链接器,使链接器进行链接时将main函数的地址导出到dynsym段中。针对不同的链接器,其修改方法不尽相同。当然也可以采用其他任何能够导出main函数的地址的方法。本申请实施例对获得入口函数的地址的方法不作限制。By default, when the source code is compiled into an executable file, the address of the main function is not exported to the dynsym section, that is, the address of the main function cannot be obtained by calling the dlsym function. In the embodiment of the present application, the linker may be modified to export the address of the main function to the dynsym segment when the linker performs the link. The modification method is different for different linkers. Of course, any other method that can export the address of the main function can be used. The method of obtaining the address of the entry function is not limited in the embodiment of the present application.
进一步地,在一些实施例中,由代理进程创建的子进程调用程序的入口函数之前, 将该子进程的名称修改为与该程序的名称相同。在Linux系统中,默认情况下,子进程的名称与父进程(这里为代理进程cinit)的名称相同,否则进程名会显示错误。具体可通过以下方式修改进程的名称:Further, in some embodiments, the child process created by the proxy process calls the program's entry function before Modify the name of the child process to be the same as the name of the program. On Linux systems, by default, the name of the child process is the same as the name of the parent process (here the agent process cinit), otherwise the process name will display an error. Specifically, you can modify the name of the process in the following ways:
方式1:子进程调用用于修改进程名称的系统调用函数。在Linux系统中,prctl函数为系统调用函数,具有较高的权限,可用于设置进程的名称。因此该子进程可向操作系统内核请求调用prctl函数,通过执行prctl函数对该子进程的名称进行设置。Method 1: The child process calls the system call function that modifies the process name. In Linux systems, the prctl function is a system call function with higher privileges and can be used to set the name of the process. Therefore, the child process can request the operating system kernel to call the prctl function, and set the name of the child process by executing the prctl function.
方式2:子进程获取该子进程中用于存储进程名称的内存区域的地址,并修改该地址对应的内存区域中存储的参数值(即将进程名称修改为应用程序的名称)。本申请实施例中,子进程内存空间中,在地址为argv[0]的区域存储有该子进程的名称,如果该区域中存储的参数值改变,则该子进程的名称也会改变。因此,如果将子进程中地址为argv[0]的区域中存储的参数值修改为需要启动的应用程序的名称,则可以使得该子进程的名称与应用程序的名称相同。后续创建的子进程,均可在该子进程中修改地址为argv[0]的区域中存储的参数值,这样每个子进程都可以设置自己的名称,而不干扰其他子进程。Manner 2: The child process obtains the address of the memory area in the child process for storing the process name, and modifies the parameter value stored in the memory area corresponding to the address (ie, the process name is changed to the name of the application). In the embodiment of the present application, in the memory space of the child process, the name of the child process is stored in the area with the address argv[0], and if the value of the parameter stored in the area changes, the name of the child process also changes. Therefore, if you modify the parameter value stored in the area of the child process with the address argv[0] to the name of the application that needs to be started, you can make the name of the child process the same as the name of the application. Subsequently created child processes can modify the parameter values stored in the area with the address argv[0] in the child process, so that each child process can set its own name without interfering with other child processes.
进一步地,在一些实施例中,在应用程序启动后,如果需要修改应用程序名称(比如需要在用户界面中为当前应用程序显示一个特别的名称时),即修改该应用程序的进程名称,则还可以采用以下方式进行修改:该应用程序的进程从该进程独有的内存中存储的启动参数中,获得用于存储进程名称的内存区域的地址(该内存区域的地址为变量argv[0]的取值),并修改该地址对应的内存区域中存储的参数值(即将进程名称修改为应用程序的新名称)。Further, in some embodiments, after the application is started, if the application name needs to be modified (for example, when a special name needs to be displayed in the user interface for the current application), that is, the process name of the application is modified, It can also be modified in such a way that the application's process obtains the address of the memory area used to store the process name from the boot parameters stored in the process's unique memory (the address of the memory area is the variable argv[0] Value) and modify the parameter value stored in the memory area corresponding to the address (ie, modify the process name to the new name of the application).
进一步地,在一些实施例中,有些环境变量与进程相关,在启动新程序时需要重置,具体哪些环境变量需要重置则可视平台而定。本申请实施例中,代理进程创建子进程后,该子进程可重置该子进程对应的程序所使用的环境变量,子进程重置环境变量的操作可在调用入口函数之前或者在其他需要修改环境变量的时候。比如,有一个环境变量的值是该应用在系统中存放的文件名,显然每个应用对应的文件是不一样的,需要对每个应用重设该环境变量。Further, in some embodiments, some environment variables are process dependent, need to be reset when starting a new program, and specific environment variables need to be reset depending on the platform. In the embodiment of the present application, after the agent process creates the child process, the child process may reset the environment variable used by the program corresponding to the child process, and the operation of resetting the environment variable by the child process may be performed before the entry function is called or other needs to be modified. When the environment variable. For example, the value of an environment variable is the name of the file that the application stores in the system. Obviously, the file corresponding to each application is different, and the environment variable needs to be reset for each application.
进一步地,在一些实施例中,考虑到某些不能被继承的资源若被子进程继承,则会产生错误,比如文件描述符这样的资源。因此,本申请实施例中,代理进程在创建子进程之前,可关闭不能被该子进程继承的资源。其中,代理进程可确定哪些资源不能被子进程继承。具体实施时,在一些例子中,可预先设置哪些资源不能被子进程继承,需要代理进程在创建子进程前将这些资源关闭或释放。在另外的例子中,子进程的父进程可 根据预先设置的规则确定哪些资源不能被子进程继承,比如,当父进程监听一个网络端口,它不希望子进程也监听该端口,因为两个进程同时监听同一个端口通常会出现错误,那么它就需要在关闭该端口,关闭的时机是在该父进程调用fork函数之后、在运行子进程之前。Further, in some embodiments, it is contemplated that certain resources that cannot be inherited, if inherited by a child process, will generate an error, such as a resource such as a file descriptor. Therefore, in the embodiment of the present application, the agent process may close the resources that cannot be inherited by the child process before creating the child process. Among them, the agent process can determine which resources cannot be inherited by the child process. In specific implementations, in some examples, it may be pre-set which resources cannot be inherited by the child process, and the agent process is required to close or release the resources before creating the child process. In another example, the parent process of the child process can According to the preset rules to determine which resources can not be inherited by the child process, for example, when the parent process listens to a network port, it does not want the child process to also listen to the port, because two processes usually listen to the same port at the same time, usually an error occurs, then it The port needs to be closed. The time to close is after the parent process calls the fork function and before the child process is run.
需要说明的是,如果代理进程启动的程序又使用exec函数启动了其他程序(以及其后启动的所有程序),则它们的内存无法共享。因此,凡是希望子进程可以与其父进程共享内存的,均需要按上述方式创建子进程以及加载程序。由于上述方案是通用的,为了让系统的其他程序遵守该方案,本申请实施例可提供一个辅助函数来实现上述方案,以供其他程序调用该函数,这样,每个需要使用上述方案节省内存的进程均可使用该函数,而不需要针对每个进程编写用于实现上述方案的代码。It should be noted that if the program started by the agent process uses the exec function to start other programs (and all programs started afterwards), their memory cannot be shared. Therefore, any child process that wants a child process to share memory with its parent process needs to create a child process and loader as described above. Since the foregoing solution is universal, in order to allow other programs of the system to comply with the solution, the embodiment of the present application may provide a helper function to implement the above solution, so that other programs call the function, so that each of the solutions needs to save memory. This function can be used by processes without having to write code for implementing the above scheme for each process.
下面结合图3和图4,以应用程序a和应用程序b的加载过程为例,对上述实施例的具体实现过程进行描述。The specific implementation process of the foregoing embodiment will be described by taking the loading process of the application a and the application b as an example in conjunction with FIG. 3 and FIG.
如图3和图4所示,Linux系统启动时,Linux内核为init进程分配init进程独有的内存空间,并引导运行init进程。init进程启动后启动代理进程(cinit),代理进程具有其独有的内存空间,该内存空间在init进程启动该代理进程时,由Linux内核分配。由于代理进程在编译时链接了Linux系统的基本动态链接库,因此该动态链接库被加载到内存中。As shown in Figure 3 and Figure 4, when the Linux system starts, the Linux kernel allocates the memory space unique to the init process for the init process and boots the init process. After the init process starts, the agent process (cinit) is started. The agent process has its own unique memory space, which is allocated by the Linux kernel when the init process starts the agent process. Since the proxy process links the basic dynamic link library of the Linux system at compile time, the dynamic link library is loaded into memory.
加载应用程序a的过程,如图3所示,代理进程(cinit)调用fork函数,创建得到子进程a。此过程中,如图4所示,Linux在内存中开辟出一片新的内存空间给子进程a(即图中所示的a独有的内存),用于存储数据和代码,并将代理进程中的内容复制到新的空间中。如图3所示,子进程a调用dlopen函数,输入参数中包括动态链接库的文件名(该文件名与代理进程所连接的动态链接库的文件名相同),从而在子进程a中打开该动态链接库。通过调用dlopen函数,可以将dlopen函数返回的动态链接库句柄传入dlsym函数中的参数,以获得符号在该动态链接库中的地址,使用这个地址,可以获得该动态链接库中对应函数的指针,并且调用该动态链接库中的相应函数。子进程a调用应用程序a的main函数,从而启动应用程序a。The process of loading the application a, as shown in Figure 3, the proxy process (cinit) calls the fork function to create the child process a. In this process, as shown in Figure 4, Linux opens up a new memory space in memory to the child process a (that is, the unique memory shown in the figure), used to store data and code, and the proxy process The contents of the content are copied to the new space. As shown in FIG. 3, the child process a calls the dlopen function, and the input parameter includes the file name of the dynamic link library (the file name is the same as the file name of the dynamic link library to which the agent process is connected), thereby opening the file in the child process a. Dynamic link library. By calling the dlopen function, the dynamic link library handle returned by the dlopen function can be passed to the parameter in the dlsym function to obtain the address of the symbol in the dynamic link library. Using this address, a pointer to the corresponding function in the dynamic link library can be obtained. And call the corresponding function in the dynamic link library. The child process a calls the main function of the application a to start the application a.
加载应用程序b的过程,如图3所示,代理进程(cinit)调用fork函数,创建得到子进程b。此过程中,如图4所示,Linux在内存中开辟出一片新的内存空间给子进程b(即图中所示的b独有的内存),用于存储数据和代码,并将代理进程中的内容复制到新的空间中。如图3所示,子进程b调用dlopen函数,输入参数中包括动态链接库的文 件名(该文件名与代理进程所连接的动态链接库的文件名相同),从而在子进程a中打开该动态链接库。子进程b调用应用程序b的main函数,从而启动应用程序b。The process of loading the application b, as shown in Figure 3, the proxy process (cinit) calls the fork function to create the child process b. In this process, as shown in Figure 4, Linux opens up a new memory space in memory for child process b (the b-only memory shown in the figure) for storing data and code, and will proxy the process. The contents of the content are copied to the new space. As shown in Figure 3, the child process b calls the dlopen function, and the input parameter includes the text of the dynamic link library. The name of the file (the file name is the same as the file name of the dynamic link library to which the agent process is connected), thereby opening the dynamic link library in child process a. The child process b calls the main function of the application b, thereby starting the application b.
从图4可以看出,子进程a和子进程b启动应用程序时未使用exec函数,而是调用入口函数,并且应用程序a和应用程序b所打开的动态链接库已经被代理进程加载到内存中,因此应用程序a和应用程序b可以共享该动态链接库的内存,而不必各自保存一份该动态链接库的副本。As can be seen from Figure 4, the child process a and the child process b start the application without using the exec function, but call the entry function, and the dynamic link library opened by the application a and the application b has been loaded into the memory by the proxy process. Therefore, application a and application b can share the memory of the dynamic link library without having to save a copy of the dynamic link library.
当应用程序调用由代理进程加载的动态链接库中的函数时,该函数所修改的数据可被存储于该应用程序(或该应用程序对应的进程)所独有的内存空间。例如,若应用程序a(子进程a)调用动态链接库中的方法(函数),且在该方法(函数)执行过程中需要修改数据(比如修改变量的值),操作系统会将该数据存储在应用程序a(子进程a)的独有内存空间;若应用程序b(子进程b)调用动态链接库中的该方法(函数),且在该方法(函数)执行过程中需要修改名称相同的变量,操作系统会将该变量存储在应用程序b(子进程b)的独有内存空间。这样,应用程序a和应用程序b可共享动态链接库,但调用动态链接库所修改的变量会存储在各自独有的内存空间,避免数据冲突。When an application calls a function in a dynamic link library loaded by a proxy process, the data modified by the function can be stored in a memory space unique to the application (or the process corresponding to the application). For example, if application a (child process a) calls a method (function) in the dynamic link library, and the data needs to be modified during the execution of the method (such as modifying the value of the variable), the operating system stores the data. The unique memory space in application a (child process a); if application b (child process b) calls the method (function) in the dynamic link library, and needs to modify the same name during the execution of the method (function) The variable, the operating system will store the variable in the unique memory space of application b (child process b). In this way, application a and application b can share the dynamic link library, but the variables modified by calling the dynamic link library are stored in their own unique memory space to avoid data conflicts.
参见图5,该流程以上述应用程序a为例,描述了该应用程序的启动过程。应用程序b的启动过程与此类似。如图5所示,当需要启动应用程序a时,该流程可包括:Referring to FIG. 5, the process uses the above application a as an example to describe the startup process of the application. The startup process for application b is similar. As shown in FIG. 5, when the application a needs to be started, the process may include:
方框501:代理进程确定不能被子进程继承的资源,将这些资源关闭。Block 501: The agent process determines resources that cannot be inherited by the child process and closes the resources.
方框502:代理进程调用fork函数,创建子进程a。在该过程中,系统给新创建的子进程分配该子进程独有的内存空间,该内存空间专属于该子进程。Block 502: The proxy process invokes the fork function to create the child process a. In the process, the system allocates a newly created child process with a memory space unique to the child process, and the memory space belongs to the child process.
方框503:子进程a调用prctl函数,通过执行该函数将子进程a的名称修改为应用程序a的名称。Block 503: The child process a calls the prctl function, and the name of the child process a is modified to the name of the application a by executing the function.
方框504:子进程a重置部分环境变量,比如重置用于存储系统中存放的文件名的变量值。Block 504: The child process a resets some of the environment variables, such as resetting the value of the variable used to store the file name stored in the system.
方框505:子进程a调用dlopen函数,并将被代理进程加载到内存的动态链接库的名称作为该函数的输入参数,从而通过执行该函数,在子进程a中打开该动态链接库。Block 505: The child process a calls the dlopen function and loads the name of the dynamic link library loaded into the memory by the proxy process as an input parameter of the function, thereby opening the dynamic link library in the child process a by executing the function.
方框506:子进程a调用dlsym函数,得到应用程序a的main函数地址。Block 506: The child process a calls the dlsym function to get the main function address of the application a.
方框507:子进程a根据应用程序a的main函数地址,调用应用程序a的main函数,从而加载应用程序a。Block 507: The child process a calls the main function of the application a according to the main function address of the application a, thereby loading the application a.
上述流程中,方框503至方框506的顺序可做调整,本申请实施例对此不做限制。In the above process, the order of the blocks 503 to 506 can be adjusted, and the embodiment of the present application does not limit this.
上述流程具体实现过程,可参见前述实施例,在此不再重复。 For the specific implementation process of the foregoing process, refer to the foregoing embodiment, which is not repeated here.
通过以上描述可以看出,本申请的上述实施例中,系统中的init进程启动时启动代理进程,代理进程启动时,加载该代理进程所链接的动态链接库到内存;当需要加载某个程序时,代理进程创建一个子进程,该子进程通过调用该程序的入口函数,加载该程序,这样,通过上述方式加载的多个程序可以共享该代理进程所加载的动态链接库占用的内存,而不必每个程序保存一份动态链接库的副本,减少了动态链接库的内存开销。As can be seen from the above description, in the above embodiment of the present application, the init process in the system starts the agent process when starting, and when the agent process starts, the dynamic link library linked by the agent process is loaded into the memory; when a program needs to be loaded When the agent process creates a child process, the child process loads the program by calling the entry function of the program, so that multiple programs loaded by the above manner can share the memory occupied by the dynamic link library loaded by the agent process, and It is not necessary for each program to save a copy of the dynamic link library, which reduces the memory overhead of the dynamic link library.
基于相同的技术构思,本申请实施例还提供了一种装置,该装置可实现前述实施例描述的流程。Based on the same technical concept, the embodiment of the present application further provides a device, which can implement the process described in the foregoing embodiment.
参见图6,为本申请实施例提供的装置的结构示意图。该装置可包括:启动模块601、进程创建模块602,其中:FIG. 6 is a schematic structural diagram of an apparatus according to an embodiment of the present application. The apparatus can include: a startup module 601, a process creation module 602, wherein:
启动模块601,用于启动代理进程,所述代理进程加载所述代理进程所链接的动态链接库到内存;进程创建模块602,用于创建第一子进程,所述第一子进程通过调用所述第一程序的入口函数,加载所述第一程序;以及,创建第二子进程,所述第二子进程通过调用所述第二程序的入口函数,加载所述第二程序;其中,所述第一程序和所述第二程序共享所述动态链接库占用的内存。The startup module 601 is configured to start a proxy process, where the proxy process loads the dynamic link library linked by the proxy process to the memory; the process creation module 602 is configured to create a first child process, where the first child process is invoked by An entry function of the first program, loading the first program; and, creating a second child process, the second child process loading the second program by calling an entry function of the second program; The first program and the second program share the memory occupied by the dynamic link library.
可选地,启动模块601为操作系统中的第一个进程,被所述启动模块启动的所述代理进程用于代理所述第一个进程创建子进程。Optionally, the startup module 601 is the first process in the operating system, and the proxy process initiated by the startup module is used to proxy the first process to create a child process.
可选地,进程创建模块602还用于:调用所述第一程序的入口函数之前,通过调用用于打开动态链接库的函数,在所述第一子进程中打开所述动态链接库,其中,该函数的输入参数中包括所述动态链接库的文件名;以及,调用所述第二程序的入口函数之前,通过调用用于打开动态链接库的函数,在所述第二子进程中打开所述动态链接库,其中,该函数的输入参数中包括所述动态链接库的文件名。Optionally, the process creation module 602 is further configured to: before calling the entry function of the first program, open the dynamic link library in the first sub-process by calling a function for opening a dynamic link library, where The input parameter of the function includes a file name of the dynamic link library; and, before calling the entry function of the second program, opening in the second child process by calling a function for opening the dynamic link library The dynamic link library, wherein the input parameter of the function includes a file name of the dynamic link library.
可选地,进程创建模块602创建的所述第一子进程调用所述第一程序的入口函数之前,将所述第一子进程的名称修改为与所述第一程序的名称相同;进程创建模块602创建的所述第二子进程调用所述第二程序的入口函数之前,将所述第二子进程的名称修改为与所述第二程序的名称相同。Optionally, before the first sub-process created by the process creation module 602 invokes the entry function of the first program, modify the name of the first sub-process to be the same as the name of the first program; Before the second sub-process created by the module 602 calls the entry function of the second program, the name of the second sub-process is modified to be the same as the name of the second program.
可选地,进程创建模块602还用于:创建所述第一子进程之前,关闭不能被所述第一子进程继承的资源;以及,创建所述第二子进程之前,关闭不能被所述第二子进程继承的资源。Optionally, the process creation module 602 is further configured to: before the first child process is created, shut down a resource that cannot be inherited by the first child process; and before the second child process is created, the shutdown cannot be performed. The resource inherited by the second child process.
可选地,进程创建模块602创建的所述第一子进程调用所述第一程序的入口函数之前,重置所述第一程序所使用的环境变量;进程创建模块602创建的所述第二子进程调 用所述第二程序的入口函数之前,重置所述第二程序所使用的环境变量。Optionally, the environment variable used by the first program is reset before the first child process created by the process creation module 602 calls the entry function of the first program; the second created by the process creation module 602 Child process The environment variable used by the second program is reset before the entry function of the second program.
可选地,所述第一程序在被编译时,所述第一程序的入口函数地址被导出到所述第一程序的可执行文件中;所述进程创建模块创建的所述第一子进程调用所述第一程序的入口函数之前,根据所述第一程序的可执行文件获取所述第一程序的入口函数地址;所述第二程序在被编译时,所述第二程序的入口函数地址被导出到所述第二程序的可执行文件中;所述进程创建模块创建的所述第二子进程调用所述第二程序的入口函数之前,根据所述第二程序的可执行文件获取所述第二程序的入口函数地址。Optionally, when the first program is compiled, an entry function address of the first program is exported to an executable file of the first program; the first sub-process created by the process creation module Before invoking the entry function of the first program, acquiring an entry function address of the first program according to an executable file of the first program; and when the second program is compiled, an entry function of the second program The address is exported to the executable file of the second program; before the second child process created by the process creation module calls the entry function of the second program, according to the executable file of the second program The entry function address of the second program.
可选地,上述装置中还可包括处理模块(未在图中示出),该处理模块可用于在加载所述第一程序之后,将被所述第一程序调用的所述动态链接库中的函数所修改的数据,存储于所述第一子进程独有的内存空间;以及,在加载所述第二程序之后,将被所述第二程序调用的所述动态链接库中的函数所修改的数据,存储于所述第二子进程独有的内存空间。Optionally, the foregoing apparatus may further include a processing module (not shown in the figure), where the processing module is configured to: after loading the first program, the dynamic link library to be called by the first program The modified data of the function is stored in a memory space unique to the first sub-process; and, after loading the second program, a function in the dynamic link library to be called by the second program The modified data is stored in a memory space unique to the second subprocess.
基于相同的技术构思,本申请实施例还提供了一个或多个计算机可读介质,所述可读介质上存储有指令,所述指令被一个或多个处理器执行时,使得用户设备执行前述实施例描述的流程。Based on the same technical concept, the embodiment of the present application further provides one or more computer readable media having instructions stored thereon, when the instructions are executed by one or more processors, such that the user equipment performs the foregoing The process described in the examples.
基于相同的技术构思,本申请实施例还提供了一种装置700,该装置700可实现前述实施例描述的流程。Based on the same technical concept, the embodiment of the present application further provides a device 700, which can implement the process described in the foregoing embodiment.
图7示例性地示出了根据各种实施例的示例装置700.装置700可包括一个或多个处理器702,系统控制逻辑701耦合于至少一个处理器702,非易失性存储器(non-volatile memory,NMV)/存储器704耦合于系统控制逻辑701,网络接口706耦合于系统控制逻辑701。FIG. 7 exemplarily illustrates an example apparatus 700 in accordance with various embodiments. Apparatus 700 can include one or more processors 702 coupled to at least one processor 702, non-volatile memory (non- A volatile memory (NMV)/memory 704 is coupled to system control logic 701, which is coupled to system control logic 701.
处理器702可包括一个或多个单核处理器或多核处理器。处理器702可包括任何一般用途处理器或专用处理器(如图像处理器、应用处理器基带处理器等)的组合。 Processor 702 can include one or more single core processors or multi-core processors. Processor 702 can include any general purpose processor or combination of special purpose processors (eg, image processor, application processor baseband processor, etc.).
一个实施例中的系统控制逻辑701,可包括任何适当的接口控制器,以提供到处理器702中的至少一个的任何合适的接口,和/或提供到与系统控制逻辑701通信的任何合适的设备或组件的任何合适的接口。 System control logic 701 in one embodiment may include any suitable interface controller to provide any suitable interface to at least one of processors 702, and/or to any suitable communication in communication with system control logic 701. Any suitable interface to the device or component.
一个实施例中的系统控制逻辑701,可包括一个或多个内存控制器,以提供到系统内存703的接口。系统内存703用来加载以及存储数据和/或指令。例如,对应装置700,在一个实施例中,系统内存703可包括任何合适的易失性存储器。 System control logic 701 in one embodiment may include one or more memory controllers to provide an interface to system memory 703. System memory 703 is used to load and store data and/or instructions. For example, corresponding device 700, in one embodiment, system memory 703 can include any suitable volatile memory.
NVM/存储器704可包括一个或多个有形的非暂时的计算机可读介质,用于存储数据 和/或指令。例如,NVM/存储器704可包括任何合适的非易失性存储装置,如一个或多个硬盘(hard disk device,HDD),一个或多个光盘(compact disk,CD),和/或一个或多个数字通用盘(digital versatile disk,DVD)。NVM/memory 704 can include one or more tangible, non-transitory computer readable media for storing data And / or instructions. For example, NVM/memory 704 can include any suitable non-volatile storage device, such as one or more hard disk devices (HDDs), one or more compact disks (CDs), and/or one or more Digital versatile disk (DVD).
NVM/存储器704可包括存储资源,该存储资源物理上是该系统所安装的或者可以被访问的设备的一部分,但不一定是设备的一部分。例如,NVM/存储器704可经由网络接口706被网络访问。NVM/memory 704 can include a storage resource that is physically part of, but not necessarily part of, the device that the system is installed on or can be accessed. For example, NVM/memory 704 can be accessed by the network via network interface 706.
系统内存703以及NVM/存储器704可分别包括临时的或持久的指令710的副本。指令710可包括当由处理器702中的至少一个执行时导致装置700实现图2至图5描述的方法之一或组合的指令。各实施例中,指令710或硬件、固件,和/或软件组件可另外地/可替换地被置于系统控制逻辑701,网络接口706和/或处理器702。 System memory 703 and NVM/memory 704 can each include a copy of temporary or persistent instructions 710. The instructions 710 can include instructions that, when executed by at least one of the processors 702, cause the apparatus 700 to implement one or a combination of the methods described in FIGS. 2-5. In various embodiments, instructions 710 or hardware, firmware, and/or software components may additionally/alternatively be placed in system control logic 701, network interface 706, and/or processor 702.
网络接口706可包括一个接收器来为装置700提供无线接口来与一个或多个网络和/或任何合适的设备进行通信。网络接口706可包括任何合适的硬件和/或固件。网络接口706可包括多个天线来提供多输入多输出无线接口。在一个实施例中,网络接口706可包括一个网络适配器、一个无线网络适配器、一个电话调制解调器,和/或无线调制解调器。 Network interface 706 can include a receiver to provide device 700 with a wireless interface to communicate with one or more networks and/or any suitable device. Network interface 706 can include any suitable hardware and/or firmware. Network interface 706 can include multiple antennas to provide a multiple input multiple output wireless interface. In one embodiment, network interface 706 can include a network adapter, a wireless network adapter, a telephone modem, and/or a wireless modem.
在一个实施例中,处理器702中的至少一个可以与用于系统控制逻辑的一个或多个控制器的逻辑一起封装。在一个实施例中,处理器中的至少一个可以与用于系统控制逻辑的一个或多个控制器的逻辑一起封装以形成系统级封装。在一个实施例中,处理器中的至少一个可以与用于系统控制逻辑的一个或多个控制器的逻辑集成在相同的管芯上。在一个实施例中,处理器中的至少一个可以与用于系统控制逻辑的一个或多个控制器的逻辑集成在相同的管芯上以形成系统芯片。In one embodiment, at least one of the processors 702 can be packaged with logic for one or more controllers of system control logic. In one embodiment, at least one of the processors may be packaged with logic for one or more controllers of system control logic to form a system level package. In one embodiment, at least one of the processors can be integrated on the same die as the logic of one or more controllers for system control logic. In one embodiment, at least one of the processors can be integrated on the same die as the logic of one or more controllers for system control logic to form a system chip.
装置700可进一步包括输入/输出装置705。输入/输出装置705可包括用户接口旨在使用户与装置700进行交互,可包括外围组件接口,其被设计为使得外围组件能够与系统交互,和/或,可包括传感器,旨在确定环境条件和/或有关装置700的位置信息。 Device 700 can further include input/output device 705. Input/output device 705 can include a user interface intended to enable a user to interact with device 700, can include a peripheral component interface that is designed to enable peripheral components to interact with the system, and/or can include sensors for determining environmental conditions And/or location information about the device 700.
本公开可以包括以下公开的各种示例实施例。The present disclosure can include various example embodiments disclosed below.
示例实施例1中,采用的方法可以进行合并:启动代理进程,所述代理进程加载所述代理进程所链接的动态链接库到内存;所述代理进程创建第一子进程,所述第一子进程通过调用所述第一程序的入口函数,加载所述第一程序;所述代理进程创建第二子进程,所述第二子进程通过调用所述第二程序的入口函数,加载所述第二程序;其中,所述第一程序和所述第二程序共享所述动态链接库占用的内存。 In the example embodiment 1, the method employed may be combined: starting an agent process, the agent process loading a dynamic link library linked by the agent process into memory; the agent process creating a first child process, the first child The process loads the first program by calling an entry function of the first program; the proxy process creates a second child process, and the second child process loads the first by calling an entry function of the second program a second program; wherein the first program and the second program share memory occupied by the dynamic link library.
示例实施例2中,根据示例实施例1,所述代理进程由操作系统中的第一个进程启动,所述代理进程用于代理所述第一个进程创建子进程。In example embodiment 2, according to example embodiment 1, the agent process is initiated by a first process in an operating system, the agent process is used to proxy the first process to create a child process.
示例实施例3中,根据示例实施例1-2,还包括:通过调用用于打开动态链接库的函数,在所述第一子进程中打开所述动态链接库,其中,该函数的输入参数中包括所述动态链接库的文件名;和/或,还包括:通过调用用于打开动态链接库的函数,在所述第二子进程中打开所述动态链接库,其中,该函数的输入参数中包括所述动态链接库的文件名。In example embodiment 3, according to example embodiment 1-2, further comprising: opening the dynamic link library in the first sub-process by calling a function for opening a dynamic link library, wherein input parameters of the function Include the file name of the dynamic link library; and/or, further comprising: opening the dynamic link library in the second child process by calling a function for opening the dynamic link library, wherein the function input The file name of the dynamic link library is included in the parameter.
示例实施例4中,根据示例实施例1-3,还包括:将所述第一子进程的名称修改为与所述第一程序的名称相同;和/或,还包括:将所述第二子进程的名称修改为与所述第二程序的名称相同。In example embodiment 1-3, according to example embodiments 1-3, further comprising: modifying a name of the first sub-process to be the same as a name of the first program; and/or further comprising: The name of the child process is modified to be the same as the name of the second program.
示例实施例5中,根据示例实施例4,通过以下方式修改子进程的名称:子进程调用用于修改进程名称的系统调用函数;或者,子进程获取所述子进程中用于存储进程名称的内存区域的地址,并修改所述地址对应的内存区域中存储的参数值。In the exemplary embodiment 5, according to the exemplary embodiment 4, the name of the child process is modified by the child process calling a system call function for modifying the process name; or the child process acquiring the name of the child process for storing the process name. The address of the memory area, and modify the parameter value stored in the memory area corresponding to the address.
示例实施例6中,根据示例实施例1-5,所述代理进程创建所述第一子进程之前,还包括:关闭不能被所述第一子进程继承的资源;所述代理进程创建所述第二子进程之前,还包括:关闭不能被所述第二子进程继承的资源。In the example embodiment 6, according to the example embodiment 1-5, before the proxy process creates the first sub-process, the method further includes: closing a resource that cannot be inherited by the first sub-process; the proxy process creates the Before the second sub-process, the method further includes: closing a resource that cannot be inherited by the second sub-process.
示例实施例7中,根据示例实施例1-6,还包括:重置所述第一程序所使用的环境变量;和/或,还包括:重置所述第二程序所使用的环境变量。In example embodiment 7, according to example embodiments 1-6, further comprising: resetting an environment variable used by the first program; and/or further comprising: resetting an environment variable used by the second program.
示例实施例8中,根据示例实施例1-7,还包括:所述第一子进程获取用于存储第一子进程名称的内存区域的地址,并修改所述地址对应的内存区域中存储的参数值;和/或,还包括:所述第二子进程向所述代理进程发送请求;所述代理进程根据所述请求,获取用于存储第二子进程名称的参数的地址,并修改所述地址中的参数值。In the example embodiment 8, according to the example embodiments 1-7, the method further includes: the first sub-process acquiring an address of a memory area for storing the first sub-process name, and modifying the memory area corresponding to the address a parameter value; and/or, further comprising: the second sub-process sending a request to the proxy process; the proxy process acquiring an address of a parameter for storing a second sub-process name according to the request, and modifying the The parameter value in the address.
示例实施例9中,根据示例实施例1-8,还包括:将被所述第一程序调用的所述动态链接库中的函数所修改的数据,存储于所述第一子进程独有的内存空间;和/或,还包括:将被所述第二程序调用的所述动态链接库中的函数所修改的数据,存储于所述第二子进程独有的内存空间。In the example embodiment 9, according to the example embodiments 1-8, further comprising: storing data modified by a function in the dynamic link library called by the first program, which is unique to the first subprocess And a memory space; and/or, further comprising: storing data modified by a function in the dynamic link library called by the second program, in a memory space unique to the second sub-process.
示例实施例10中,根据示例实施例1-9,所述第一程序在被编译时,所述第一程序的入口函数地址被导出到所述第一程序的可执行文件中;所述第一子进程调用所述第一程序的入口函数之前,根据所述第一程序的可执行文件获取所述第一程序的入口函数地址;所述第二程序在被编译时,所述第二程序的入口函数地址被导出到所述第二程序的 可执行文件中;所述第二子进程调用所述第二程序的入口函数之前,根据所述第二程序的可执行文件获取所述第二程序的入口函数地址。In example embodiment 10, according to example embodiments 1-9, when the first program is compiled, an entry function address of the first program is exported to an executable file of the first program; Before a child process calls the entry function of the first program, acquiring an entry function address of the first program according to an executable file of the first program; when the second program is compiled, the second program Entry function address is exported to the second program In the executable file, before the second sub-process calls the entry function of the second program, the entry function address of the second program is obtained according to the executable file of the second program.
本公开还可以包括以下公开的各种示例实施例。The present disclosure may also include various example embodiments disclosed below.
示例实施例1中,装置可以进行合并,该装置可包括:启动模块,用于启动代理进程,所述代理进程加载所述代理进程所链接的动态链接库到内存;进程创建模块,用于创建第一子进程,所述第一子进程通过调用所述第一程序的入口函数,加载所述第一程序;以及,创建第二子进程,所述第二子进程通过调用所述第二程序的入口函数,加载所述第二程序;其中,所述第一程序和所述第二程序共享所述动态链接库占用的内存。In the example embodiment 1, the device may be merged, the device may include: a startup module, configured to start an agent process, the agent process loads a dynamic link library linked by the agent process to a memory; and a process creation module, configured to create a first child process, the first child process loading the first program by calling an entry function of the first program; and, creating a second child process, the second child process calling the second program The entry function loads the second program; wherein the first program and the second program share memory occupied by the dynamic link library.
示例实施例2中,根据示例实施例1,所述启动模块为操作系统中的第一个进程,被所述启动模块启动的所述代理进程用于代理所述第一个进程创建子进程。In example embodiment 2, according to example embodiment 1, the startup module is a first process in an operating system, and the proxy process initiated by the startup module is used to proxy the first process to create a child process.
示例实施例3中,根据示例实施例1-2,所述进程创建模块还用于:通过调用用于打开动态链接库的函数,在所述第一子进程中打开所述动态链接库,其中,该函数的输入参数中包括所述动态链接库的文件名;和/或,通过调用用于打开动态链接库的函数,在所述第二子进程中打开所述动态链接库,其中,该函数的输入参数中包括所述动态链接库的文件名。In the third embodiment, according to the example embodiment 1-2, the process creation module is further configured to: open the dynamic link library in the first sub-process by calling a function for opening a dynamic link library, where Entering a file name of the dynamic link library in an input parameter of the function; and/or opening the dynamic link library in the second child process by calling a function for opening the dynamic link library, where The file name of the dynamic link library is included in the input parameters of the function.
示例实施例4中,根据示例实施例1-3,所述进程创建模块创建的所述第一子进程将所述第一子进程的名称修改为与所述第一程序的名称相同;和/或,所述进程创建模块创建的所述第二子进程将所述第二子进程的名称修改为与所述第二程序的名称相同。In example embodiment 4, according to example embodiments 1-3, the first sub-process created by the process creation module modifies the name of the first sub-process to be the same as the name of the first program; and / Or the second sub-process created by the process creation module modifies the name of the second sub-process to be the same as the name of the second program.
示例实施例5中,根据示例实施例1-4,所述进程创建模块还用于:创建所述第一子进程之前,关闭不能被所述第一子进程继承的资源;以及,创建所述第二子进程之前,关闭不能被所述第二子进程继承的资源。In the example embodiment 5, according to the example embodiment 1-4, the process creation module is further configured to: before creating the first sub-process, close a resource that cannot be inherited by the first sub-process; and create the Before the second child process, the resources that cannot be inherited by the second child process are closed.
示例实施例6中,根据示例实施例1-5,所述进程创建模块创建的所述第一子进程重置所述第一程序所使用的环境变量;和/或,所述进程创建模块创建的所述第二子进程重置所述第二程序所使用的环境变量。In example embodiment 6, according to example embodiments 1-5, the first sub-process created by the process creation module resets an environment variable used by the first program; and/or, the process creation module creates The second child process resets an environment variable used by the second program.
示例实施例7中,根据示例实施例1-6,还包括处理模块,用于将被所述第一程序调用的所述动态链接库中的函数所修改的数据,存储于所述第一子进程独有的内存空间;和/或,将被所述第二程序调用的所述动态链接库中的函数所修改的数据,存储于所述第二子进程独有的内存空间。In the example embodiment 7, according to the example embodiments 1-6, further comprising: a processing module, configured to store data modified by a function in the dynamic link library called by the first program, in the first child a memory space unique to the process; and/or storing data modified by a function in the dynamic link library called by the second program in a memory space unique to the second child process.
示例实施例8中,根据示例实施例1-7,所述第一程序在被编译时,所述第一程序的入口函数地址被导出到所述第一程序的可执行文件中;所述进程创建模块创建的所述第 一子进程根据所述第一程序的可执行文件获取所述第一程序的入口函数地址;所述第二程序在被编译时,所述第二程序的入口函数地址被导出到所述第二程序的可执行文件中;和/或,所述进程创建模块创建的所述第二子进程根据所述第二程序的可执行文件获取所述第二程序的入口函数地址。In example embodiment 8, according to example embodiments 1-7, when the first program is compiled, an entry function address of the first program is exported to an executable file of the first program; the process Create the module created by the first a child process acquires an entry function address of the first program according to an executable file of the first program; when the second program is compiled, an entry function address of the second program is exported to the second In the executable file of the program; and/or, the second sub-process created by the process creation module acquires an entry function address of the second program according to the executable file of the second program.
本公开还可以包括以下公开的各种示例实施例。The present disclosure may also include various example embodiments disclosed below.
示例实施例1中,计算机可读介质可以进行合并,其可包括:一个或多个计算机可读介质,所述可读介质上存储有指令,所述指令被一个或多个处理器执行时,使得通信设备执行如上述任一实施例所述的方法。In the example embodiment 1, the computer readable medium may be combined, which may include: one or more computer readable media having instructions stored thereon, the instructions being executed by one or more processors, The communication device is caused to perform the method as described in any of the above embodiments.
本公开还可以包括以下公开的各种示例实施例。The present disclosure may also include various example embodiments disclosed below.
示例实施例1中,装置可以进行合并,其可包括:一个或多个处理器;以及,一个或多个计算机可读介质,所述可读介质上存储有指令,所述指令被所述一个或多个处理器执行时,使得所述装置执行如上述任一实施例所述的方法。 In example embodiment 1, the apparatus may be combined, which may include: one or more processors; and one or more computer readable media having instructions stored thereon, the instructions being by the one When executed by a plurality of processors, the apparatus is caused to perform the method as described in any of the above embodiments.

Claims (20)

  1. 一种进程管理方法,其特征在于,包括:A process management method, comprising:
    启动代理进程,所述代理进程加载所述代理进程所链接的动态链接库到内存;Starting an agent process, the agent process loading a dynamic link library linked by the agent process into a memory;
    所述代理进程创建第一子进程,所述第一子进程通过调用第一程序的入口函数,加载所述第一程序;The agent process creates a first child process, and the first child process loads the first program by calling an entry function of the first program;
    所述代理进程创建第二子进程,所述第二子进程通过调用第二程序的入口函数,加载所述第二程序;The agent process creates a second child process, and the second child process loads the second program by calling an entry function of the second program;
    其中,所述第一程序和所述第二程序共享所述动态链接库占用的内存。The first program and the second program share the memory occupied by the dynamic link library.
  2. 如权利要求1所述的方法,其特征在于,所述代理进程由操作系统中的第一个进程启动,所述代理进程用于代理所述第一个进程创建子进程。The method of claim 1 wherein said proxy process is initiated by a first one of operating systems for proxying said first process to create a child process.
  3. 如权利要求1所述的方法,其特征在于,还包括:通过调用用于打开动态链接库的函数,在所述第一子进程中打开所述动态链接库,其中,该函数的输入参数中包括所述动态链接库的文件名;和/或The method of claim 1 further comprising: opening said dynamic link library in said first child process by invoking a function for opening a dynamic link library, wherein input parameters of said function are Include the filename of the dynamic link library; and/or
    还包括:通过调用用于打开动态链接库的函数,在所述第二子进程中打开所述动态链接库,其中,该函数的输入参数中包括所述动态链接库的文件名。The method further includes: opening the dynamic link library in the second child process by calling a function for opening a dynamic link library, wherein a file name of the dynamic link library is included in an input parameter of the function.
  4. 如权利要求1所述的方法,其特征在于,还包括:将所述第一子进程的名称修改为与所述第一程序的名称相同;和/或The method of claim 1 further comprising: modifying a name of said first sub-process to be the same as a name of said first program; and/or
    还包括:将所述第二子进程的名称修改为与所述第二程序的名称相同。The method further includes modifying the name of the second sub-process to be the same as the name of the second program.
  5. 如权利要求4所述的方法,其特征在于,通过以下方式修改子进程的名称:The method of claim 4 wherein the name of the child process is modified in the following manner:
    子进程调用用于修改进程名称的系统调用函数;或者,The child process calls the system call function that modifies the process name; or,
    子进程获取所述子进程中用于存储进程名称的内存区域的地址,并修改所述地址对应的内存区域中存储的参数值。The child process acquires an address of the memory area in the child process for storing the process name, and modifies the parameter value stored in the memory area corresponding to the address.
  6. 如权利要求1所述的方法,其特征在于,所述代理进程创建所述第一子进程之前,还包括:关闭不能被所述第一子进程继承的资源;和/或The method of claim 1, wherein before the proxy process creates the first child process, the method further comprises: closing a resource that cannot be inherited by the first child process; and/or
    所述代理进程创建所述第二子进程之前,还包括:关闭不能被所述第二子进程继承的资源。Before the proxy process creates the second child process, the method further includes: closing a resource that cannot be inherited by the second child process.
  7. 如权利要求1所述的方法,其特征在于,还包括:重置所述第一程序所使用的环境变量;和/或The method of claim 1 further comprising: resetting an environment variable used by said first program; and/or
    还包括:重置所述第二程序所使用的环境变量。Also included is: resetting an environment variable used by the second program.
  8. 如权利要求1所述的方法,其特征在于,还包括: The method of claim 1 further comprising:
    所述第一子进程获取用于存储第一子进程名称的内存区域的地址,并修改所述地址对应的内存区域中存储的参数值;The first sub-process obtains an address of a memory area for storing a first sub-process name, and modifies a parameter value stored in a memory area corresponding to the address;
    和/或,还包括:And/or, also includes:
    所述第二子进程向所述代理进程发送请求;The second sub-process sends a request to the proxy process;
    所述代理进程根据所述请求,获取用于存储第二子进程名称的参数的地址,并修改所述地址中的参数值。The agent process acquires an address of a parameter for storing a name of the second child process according to the request, and modifies a parameter value in the address.
  9. 如权利要求1所述的方法,其特征在于,还包括:The method of claim 1 further comprising:
    将被所述第一程序调用的所述动态链接库中的函数所修改的数据,存储于所述第一子进程独有的内存空间;和/或Storing data modified by a function in the dynamic link library called by the first program in a memory space unique to the first subprocess; and/or
    将被所述第二程序调用的所述动态链接库中的函数所修改的数据,存储于所述第二子进程独有的内存空间。The data modified by the function in the dynamic link library called by the second program is stored in a memory space unique to the second sub-process.
  10. 如权利要求1至9中任一项所述的方法,其特征在于,所述第一程序在被编译时,所述第一程序的入口函数地址被导出到所述第一程序的可执行文件中;所述第一子进程调用所述第一程序的入口函数之前,根据所述第一程序的可执行文件获取所述第一程序的入口函数地址;The method according to any one of claims 1 to 9, wherein, when the first program is compiled, an entry function address of the first program is exported to an executable file of the first program Before the first sub-process calls the entry function of the first program, acquiring an entry function address of the first program according to the executable file of the first program;
    所述第二程序在被编译时,所述第二程序的入口函数地址被导出到所述第二程序的可执行文件中;所述第二子进程调用所述第二程序的入口函数之前,根据所述第二程序的可执行文件获取所述第二程序的入口函数地址。When the second program is compiled, the entry function address of the second program is exported to the executable file of the second program; before the second child process calls the entry function of the second program, Obtaining an entry function address of the second program according to the executable file of the second program.
  11. 一种进程管理装置,其特征在于,包括:A process management device, comprising:
    启动模块,用于启动代理进程,所述代理进程加载所述代理进程所链接的动态链接库到内存;a startup module, configured to start an agent process, where the agent process loads a dynamic link library linked by the agent process into a memory;
    进程创建模块,用于创建第一子进程,所述第一子进程通过调用第一程序的入口函数,加载所述第一程序;以及a process creation module, configured to create a first child process, the first child process loading the first program by calling an entry function of the first program;
    创建第二子进程,所述第二子进程通过调用第二程序的入口函数,加载所述第二程序;Creating a second child process, the second child process loading the second program by calling an entry function of the second program;
    其中,所述第一程序和所述第二程序共享所述动态链接库占用的内存。The first program and the second program share the memory occupied by the dynamic link library.
  12. 如权利要求11所述的装置,其特征在于,所述启动模块为操作系统中的第一个进程,被所述启动模块启动的所述代理进程用于代理所述第一个进程创建子进程。The apparatus according to claim 11, wherein said startup module is a first process in an operating system, and said proxy process initiated by said startup module is configured to proxy said first process to create a child process .
  13. 如权利要求11所述的装置,其特征在于,所述进程创建模块还用于:通过调用用于打开动态链接库的函数,在所述第一子进程中打开所述动态链接库,其中,该函数 的输入参数中包括所述动态链接库的文件名;和/或The device according to claim 11, wherein the process creation module is further configured to: open the dynamic link library in the first sub-process by calling a function for opening a dynamic link library, where The function The input parameter includes the file name of the dynamic link library; and/or
    通过调用用于打开动态链接库的函数,在所述第二子进程中打开所述动态链接库,其中,该函数的输入参数中包括所述动态链接库的文件名。The dynamic link library is opened in the second child process by calling a function for opening a dynamic link library, wherein a file name of the dynamic link library is included in an input parameter of the function.
  14. 如权利要求11所述的装置,其特征在于,所述进程创建模块创建的所述第一子进程将所述第一子进程的名称修改为与所述第一程序的名称相同;和/或The apparatus according to claim 11, wherein said first sub-process created by said process creation module modifies a name of said first sub-process to be the same as a name of said first program; and/or
    所述进程创建模块创建的所述第二子进程将所述第二子进程的名称修改为与所述第二程序的名称相同。The second sub-process created by the process creation module modifies the name of the second sub-process to be the same as the name of the second program.
  15. 如权利要求11所述的装置,其特征在于,所述进程创建模块还用于:创建所述第一子进程之前,关闭不能被所述第一子进程继承的资源;以及The device according to claim 11, wherein the process creation module is further configured to: before creating the first child process, shut down resources that cannot be inherited by the first child process;
    创建所述第二子进程之前,关闭不能被所述第二子进程继承的资源。Before the second child process is created, resources that cannot be inherited by the second child process are closed.
  16. 如权利要求11所述的装置,其特征在于,所述进程创建模块创建的所述第一子进程调用所述第一程序的入口函数之前,重置所述第一程序所使用的环境变量;和/或The device according to claim 11, wherein the environment variable used by the first program is reset before the first child process created by the process creation module calls the entry function of the first program; and / or
    所述进程创建模块创建的所述第二子进程调用所述第二程序的入口函数之前,重置所述第二程序所使用的环境变量。The environment variable used by the second program is reset before the second child process created by the process creation module calls the entry function of the second program.
  17. 如权利要求11所述的装置,其特征在于,还包括:The device of claim 11 further comprising:
    处理模块,用于将被所述第一程序调用的所述动态链接库中的函数所修改的数据,存储于所述第一子进程独有的内存空间;和/或,将被所述第二程序调用的所述动态链接库中的函数所修改的数据,存储于所述第二子进程独有的内存空间。a processing module, configured to store data modified by a function in the dynamic link library called by the first program, in a memory space unique to the first sub-process; and/or, to be The data modified by the function in the dynamic link library called by the second program is stored in a memory space unique to the second sub-process.
  18. 如权利要求11至17中任一项所述的装置,其特征在于,所述第一程序在被编译时,所述第一程序的入口函数地址被导出到所述第一程序的可执行文件中;所述进程创建模块创建的所述第一子进程根据所述第一程序的可执行文件获取所述第一程序的入口函数地址;The apparatus according to any one of claims 11 to 17, wherein when the first program is compiled, an entry function address of the first program is exported to an executable file of the first program The first sub-process created by the process creation module acquires an entry function address of the first program according to an executable file of the first program;
    所述第二程序在被编译时,所述第二程序的入口函数地址被导出到所述第二程序的可执行文件中;所述进程创建模块创建的所述第二子进程根据所述第二程序的可执行文件获取所述第二程序的入口函数地址。When the second program is compiled, the entry function address of the second program is exported to the executable file of the second program; the second sub-process created by the process creation module is according to the The executable file of the second program acquires the entry function address of the second program.
  19. 一个或多个计算机可读介质,所述可读介质上存储有指令,所述指令被一个或多个处理器执行时,使得通信设备执行如权利要求1-10中任一项所述的方法。One or more computer readable mediums having stored thereon instructions that, when executed by one or more processors, cause the communication device to perform the method of any of claims 1-10 .
  20. 一种进程管理装置,包括:A process management device comprising:
    一个或多个处理器;以及One or more processors;
    一个或多个计算机可读介质,所述可读介质上存储有指令,所述指令被所述一个或 多个处理器执行时,使得所述装置执行如权利要求1-10中任一项所述的方法。 One or more computer readable media having instructions stored thereon, the instructions being by the one or The plurality of processors, when executed, cause the apparatus to perform the method of any of claims 1-10.
PCT/CN2017/111997 2016-11-29 2017-11-21 Process management method and apparatus WO2018099292A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611078446.1A CN108121594B (en) 2016-11-29 2016-11-29 Process management method and device
CN201611078446.1 2016-11-29

Publications (1)

Publication Number Publication Date
WO2018099292A1 true WO2018099292A1 (en) 2018-06-07

Family

ID=62226976

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/111997 WO2018099292A1 (en) 2016-11-29 2017-11-21 Process management method and apparatus

Country Status (3)

Country Link
CN (1) CN108121594B (en)
TW (1) TW201820131A (en)
WO (1) WO2018099292A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112083998A (en) * 2019-06-14 2020-12-15 中车株洲电力机车研究所有限公司 Dynamic configuration method and device for task parameters in RTP of VxWorks system
CN112256339A (en) * 2019-07-22 2021-01-22 百度在线网络技术(北京)有限公司 Multi-process management method and device, electronic equipment and storage medium
CN113282380A (en) * 2020-02-18 2021-08-20 深圳信可通讯技术有限公司 Method and device for calling multi-channel control interface and computer readable medium
CN115589503A (en) * 2022-10-28 2023-01-10 惠州市德赛西威汽车电子股份有限公司 Vehicle-mounted host startup animation implementation method, system, host and storage medium
WO2024021477A1 (en) * 2022-07-28 2024-02-01 青岛云天励飞科技有限公司 Data processing method and apparatus, electronic device, and storage medium

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109086136A (en) * 2018-07-26 2018-12-25 广东浪潮大数据研究有限公司 A kind of request processing method and relevant apparatus of Samba software
CN109408147B (en) * 2018-10-22 2022-04-19 深圳市元征科技股份有限公司 Protocol determination method, system, device and readable storage medium
CN111083195B (en) * 2019-11-12 2022-09-13 烽火通信科技股份有限公司 Virtual single disk proxy system and method
CN111596970B (en) * 2020-05-12 2023-04-28 广州市百果园信息技术有限公司 Method, device, equipment and storage medium for dynamic library delay loading
CN113377543A (en) * 2021-06-28 2021-09-10 上海商汤科技开发有限公司 Task processing system, electronic device, and storage medium
CN114385261A (en) * 2021-12-23 2022-04-22 湖南小算科技信息有限公司 Method for loading program in process

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101382953A (en) * 2008-09-19 2009-03-11 中兴通讯股份有限公司 Interface system for accessing file system in user space and file reading and writing method
CN101576912A (en) * 2009-06-03 2009-11-11 中兴通讯股份有限公司 System and reading and writing method for realizing asynchronous input and output interface of distributed file system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8819676B2 (en) * 2007-10-30 2014-08-26 Vmware, Inc. Transparent memory-mapped emulation of I/O calls
US9104504B2 (en) * 2013-03-13 2015-08-11 Dell Products Lp Systems and methods for embedded shared libraries in an executable image

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101382953A (en) * 2008-09-19 2009-03-11 中兴通讯股份有限公司 Interface system for accessing file system in user space and file reading and writing method
CN101576912A (en) * 2009-06-03 2009-11-11 中兴通讯股份有限公司 System and reading and writing method for realizing asynchronous input and output interface of distributed file system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
LIU SHENGPING ET AL.: "Improved algorithms for desktop linux operating system memory management", SYSTEM ENGINEERING AND ELECTRONICS, vol. 27, no. 3, 31 March 2005 (2005-03-31), pages 557 - 559 *
WANG RENTANG ET AL.: "The design and implementation of preloading DLL algorithm under linux platform", JOURNAL OF ARID METEOROLOGY, vol. 24, no. 1, 31 March 2006 (2006-03-31), pages 71 - 74, XP055606308 *
YANG ZIWEI ET AL.: "Research and application of message post and DLL memory technology in one certain fire control system software", PROCEEDINGS OF THE SECOND CHINA COMMAND AND CONTROL CONFERENCE- COMMAND AND CONTROL IN DEVELOPMENT, 31 December 2014 (2014-12-31), pages 303 - 304 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112083998A (en) * 2019-06-14 2020-12-15 中车株洲电力机车研究所有限公司 Dynamic configuration method and device for task parameters in RTP of VxWorks system
CN112083998B (en) * 2019-06-14 2024-05-17 中车株洲电力机车研究所有限公司 Dynamic configuration method and device for task parameters in RTP of VxWorks system
CN112256339A (en) * 2019-07-22 2021-01-22 百度在线网络技术(北京)有限公司 Multi-process management method and device, electronic equipment and storage medium
CN112256339B (en) * 2019-07-22 2023-11-03 百度在线网络技术(北京)有限公司 Multi-process management method, device, electronic equipment and storage medium
CN113282380A (en) * 2020-02-18 2021-08-20 深圳信可通讯技术有限公司 Method and device for calling multi-channel control interface and computer readable medium
CN113282380B (en) * 2020-02-18 2024-05-24 深圳信可通讯技术有限公司 Method, device and computer readable medium for calling multipath control interface
WO2024021477A1 (en) * 2022-07-28 2024-02-01 青岛云天励飞科技有限公司 Data processing method and apparatus, electronic device, and storage medium
CN115589503A (en) * 2022-10-28 2023-01-10 惠州市德赛西威汽车电子股份有限公司 Vehicle-mounted host startup animation implementation method, system, host and storage medium

Also Published As

Publication number Publication date
CN108121594B (en) 2020-10-20
CN108121594A (en) 2018-06-05
TW201820131A (en) 2018-06-01

Similar Documents

Publication Publication Date Title
WO2018099292A1 (en) Process management method and apparatus
US10157268B2 (en) Return flow guard using control stack identified by processor register
JP6293657B2 (en) Dynamic redirection of boot behavior to other operating systems
US9928010B2 (en) Methods and apparatus to re-direct detected access requests in a modularized virtualization topology using virtual hard disks
US10101915B2 (en) Methods and apparatus to manage inter-virtual disk relations in a modularized virtualization topology using virtual hard disks
TWI715762B (en) Method and apparatus for creating virtual machine
US10228993B2 (en) Data dump for a memory in a data processing system
US9063805B2 (en) Method and system for enabling access to functionality provided by resources outside of an operating system environment
US20180239624A1 (en) Preloading enhanced application startup
US9804789B2 (en) Methods and apparatus to apply a modularized virtualization topology using virtual hard disks
WO2023124968A1 (en) Method for calling android dynamic library hal interface by software operating system, device and medium
US8200938B2 (en) Computer system and method providing a memory buffer for use with native and platform-independent software code
US11709931B2 (en) Shadow stack violation enforcement at module granularity
CN110780930A (en) Method and device for starting Android system, electronic equipment and storage medium
JP5511874B2 (en) Systems and methods implemented in security services
US11861364B2 (en) Circular shadow stack in audit mode
EP2511820A1 (en) Bypassing user mode redirection
US11500981B2 (en) Shadow stack enforcement range for dynamic code
CN111290740B (en) Application program development method and device, computer equipment and storage medium
CN114880076B (en) Dynamic loading method and device for dynamic mapping file of user-mode virtual machine
US10126983B2 (en) Methods and apparatus to enforce life cycle rules in a modularized virtualization topology using virtual hard disks
JP2011008753A (en) Method and system for executing file stored in hidden storage area of storage device
US10521592B2 (en) Application translocation
WO2023071786A1 (en) Inter-process function calling method and related device
WO2024103258A1 (en) Code execution method and apparatus, and device

Legal Events

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

Ref document number: 17876172

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17876172

Country of ref document: EP

Kind code of ref document: A1