Process starting method and apparatus, and electronic device and storage medium

By allocating available started containers to function run requests, and starting the main process with superuser permissions, dynamically creating function processes with specified permissions, the problem of fixed container UIDs and GIDs is solved, cold start acceleration and dynamic permission assignment are realized, satisfying users need.

WO2024217337A1PCT designated stage expired Publication Date: 2024-10-24ALIBABA CLOUD COMPUTING CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/087327
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-17
Filing Date
2024-04-11
Publication Date
2024-10-24

AI Technical Summary

Technical Problem

In the function computing service, the UID and GID of the container are fixed at startup and cannot adapt to the UID and GID specified by the user. As a result, the pre-started resource pool container cannot be used to run functions, and the cold start delay problem is difficult to alleviate.

Method used

By allocating an available started container to the received function running request, its main process is started with superuser permissions, and a function process with specified user permissions is dynamically created based on the directory to be mounted to meet user permission requirements and is passed through the pre-started Containers implement cold start acceleration.

Benefits of technology

It realizes dynamically specifying the permissions of function processes based on function running requests to meet user needs, and reduces cold start delays through pre-started containers to improve the running efficiency of function codes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024087327_24102024_PF_FP_ABST
    Figure CN2024087327_24102024_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a process starting method and apparatus, and an electronic device and a storage medium. The method comprises: allocating a started available container for a received function operation request, wherein a main process in the available container is started with a superuser permission; according to the function operation request, determining a directory to be mounted, and mounting said directory into the available container; and by means of the main process and on the basis of said directory, creating in the available container a function process having a user permission specified in the function operation request. Since the superuser permission has full control over a system, after said directory is mounted into the available container, when the function process is created by the main process having the superuser permission, the permission of the function process can be dynamically specified, that is, the function process can be created according to the user permission specified by the function operation request, thereby meeting user requirements. Moreover, since the available container is a container which is started in advance, cold start acceleration can also be realized for a function code having a dynamically specified permission.
Need to check novelty before this filing date? Find Prior Art

Description

Process startup method, device, electronic device and storage medium

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on April 17, 2023, with application number CN202310430019.9 and invention name “A process startup method, device, electronic device and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of cloud computing technology, and in particular to a process startup method, device, electronic device, and storage medium. Background Art

[0003] Function Compute, a key product of Serverless technology, provides users with fully managed Serverless computing services, allowing them to focus solely on writing function code. Function Compute is triggered by various events, and when function code is triggered, it often experiences cold start delays. To alleviate this cold start issue, Function Compute currently pre-launches a batch of containers that are not bound to specific function code as a resource pool. When a function run request arrives, it simply allocates a pre-launched container from the resource pool and binds it to the specific function code.

[0004] However, the container of the resource pool is started in advance, and the UID (User ID) and GID (Group ID) of the main process in the container are fixed when the container is started. When the function code is subsequently bound, the main process starts a function process for the function code. The UID and GID of the function process also use the UID and GID of the main process. In this way, if the user specifies the UID and GID in the function running request, the container of the resource pool cannot be used.

[0005] Summary of the Invention

[0006] The purpose of this application is to propose a process startup method, device, electronic device and storage medium to address the deficiencies of the above-mentioned prior art, and this purpose is achieved through the following technical solutions.

[0007] A first aspect of the present application provides a process startup method, the method comprising:

[0008] Allocate an already started available container for the received function execution request, where the main process in the available container is started with superuser privileges;

[0009] Determine a directory to be mounted according to the function execution request, and mount the directory to be mounted into the available container;

[0010] A function process with the user permission specified in the function execution request is created in the available container based on the directory to be mounted by the main process.

[0011] In some embodiments of the present application, determining the directory to be mounted according to the function execution request includes:

[0012] The data related to the function code is downloaded locally according to the download address in the function execution request; the local storage directory of the data and the network storage directory in the function execution request are used as directories to be mounted.

[0013] In some embodiments of the present application, mounting the to-be-mounted directory into the available container includes:

[0014] It is detected that the network storage directory does not exist in the network storage indicated by the network storage directory, and the network storage directory is created in the network storage using the specified user permission in the function execution request; and the default directory mounted when the available container is started is replaced by the local storage directory of the data and the network storage directory.

[0015] In some embodiments of the present application, after creating, by the main process, a function process with the user permissions specified in the function execution request in the available container based on the directory to be mounted, the method further includes:

[0016] The running data generated during the running of the function code is stored in the network storage indicated by the network storage directory through the function process.

[0017] In some embodiments of the present application, creating, by the main process, in the available container based on the directory to be mounted, a function process with the user permission specified in the function execution request, includes:

[0018] A function process is created in the available container for the function code in the directory to be mounted by the main process using the specified user authority.

[0019] In some embodiments of the present application, allocating a started available container to the received function execution request includes:

[0020] According to the preset resource pool being not empty, selecting a started container from the resource pool; adjusting the specifications of the container according to the configuration parameters in the function execution request; and using the adjusted container as an available container for the function execution request.

[0021] In some embodiments of the present application, before allocating a started available container to the received function execution request, the method further includes:

[0022] Based on receiving a function execution request and a preset resource pool being empty, the function execution request is used to determine a directory to be mounted; a new container is started using configuration parameters and specified user permissions in the function execution request and the directory to be mounted; the main process in the new container is started with the specified user permissions; and a function process is created in the new container based on the directory to be mounted by the main process of the new container.

[0023] A second aspect of the present application provides a process starting device, the device comprising:

[0024] A container allocation module is configured to allocate an already started available container to the received function execution request, wherein the main process in the available container is started with superuser privileges;

[0025] A directory mounting module, configured to determine a directory to be mounted according to the function execution request, and mount the directory to be mounted into the available container;

[0026] A process creation module is used to create a function process with user permissions specified in the function execution request in the available container based on the directory to be mounted through the main process.

[0027] The third aspect of the present application proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method described in the first aspect above.

[0028] The fourth aspect of the present application proposes a computer-readable storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement the steps of the method described in the first aspect above.

[0029] Based on the process startup method and device described in the first and second aspects above, this application has at least the following beneficial effects or advantages:

[0030] When a function run request is triggered, a pre-launched available container is assigned to the function run request, whose main process is started with superuser privileges. Since superuser privileges grant full control over the system, after the directory to be mounted in the function run request is mounted into the available container, the superuser-privileged main process can dynamically assign permissions to the function process when it is created. This means that the function process can be created with the user permissions specified in the function run request, thus meeting user needs. Furthermore, since the pre-launched available container also accelerates cold starts for function code with dynamically assigned permissions. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0032] FIG1 is a flow chart of an embodiment of a process starting method according to an exemplary embodiment;

[0033] FIG2 is a schematic diagram of a process tree structure in a container according to an exemplary embodiment;

[0034] FIG3 is a schematic diagram showing an application scenario of process startup according to an exemplary embodiment;

[0035] FIG4 is a schematic structural diagram of a process starting device according to an exemplary embodiment;

[0036] FIG5 is a schematic diagram showing a hardware structure of an electronic device according to an exemplary embodiment;

[0037] Fig. 6 is a schematic structural diagram of a storage medium according to an exemplary embodiment. DETAILED DESCRIPTION

[0038] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0039] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0040] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0041] In serverless scenarios, some code functions utilize Linux user permissions, such as function code with network storage. Network storage is often used for data sharing. If specific user permissions (UID and GID) are not specified when running the function code, then data generated during the function code execution and written to the network storage may not be readable or writable on other cloud products due to permission issues. Similarly, data generated by the function code on other cloud products may also be readable and writable on serverless products. Therefore, function code with network storage must be run with specified user permissions.

[0042] If you want to avoid cold start delays when running function code with network storage, you can bind the function code to a pre-started container in the resource pool. However, the UID and GID of the main process in the pre-started container are fixed when the container is started. The UID and GID are immutable, and the user-specified UID and GID are unpredictable. As a result, containers pre-started with fixed UIDs and GIDs are not suitable for running function code with network storage.

[0043] In order to solve the above technical problems, this application proposes a process startup method. When a function run request is triggered, a pre-started available container is allocated to the function run request, and the main process is started with superuser privileges. Since superuser privileges have full control over the system, after the directory to be mounted of the function run request is mounted to the available container, when the main process with superuser privileges creates the function process, the privileges of the function process can be dynamically specified, that is, the function process can be created according to the user privileges specified in the function run request, thereby meeting user needs. And because the available container is a pre-started container, it can also achieve cold start acceleration for function code with dynamically specified permissions.

[0044] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application.

[0045] Figure 1 is a flowchart of an embodiment of a process startup method according to an exemplary embodiment. The process startup method can be applied on a Serverless function computing platform. The function computing platform provides a container for running function code, and the container runs the function code according to specified user permissions.

[0046] As shown in Figure 1, the process startup method includes the following steps:

[0047] Step 101: Allocate an already started available container to the received function execution request, where the main process in the available container is started with superuser privileges.

[0048] The function execution request may be a user-triggered request event that includes a download address for data related to the function code. In this embodiment, the function execution request may be a request event with network storage, that is, in addition to including the download address for data related to the function code, it also includes a network storage directory where the data generated by the function code is to be written.

[0049] Furthermore, since launching a container is equivalent to launching an application, and launching an application spawns a process, the primary process of a launched, available container is the first process spawned when the container is launched. Generally, the first process spawned when a container is launched is called process 1, with a PID of 1. Subsequent processes launched within the container are also created by process 1.

[0050] Before executing step 101, it is necessary to start a batch of containers with superuser privileges in advance as a resource pool, so that when a function run request is triggered, a pre-started container can be allocated to the function run request to reduce the delay of the container cold start.

[0051] If a container is started with superuser privileges, the main process in the container is also started with superuser privileges. Usually, the superuser has UID=0 and GID=0, so the main process in the container has UID=0 and GID=0.

[0052] It is understandable that the UID and GID of a process can represent the permissions of the process. When a process attempts to operate a file or directory, the UID and GID of the process are compared with the UID and GID of the file or directory to confirm whether the process has the permission to operate.

[0053] In an optional embodiment, for the specific implementation process of step 101, it can be determined whether the resource pool is empty. If it is not empty, it means that there are still containers available in the resource pool. A started container is selected from the resource pool, and the specifications of the container are adjusted according to the configuration parameters in the function running request. The adjusted container is then used as an available container for the function running request.

[0054] Among them, since the containers started in advance in the resource pool are all started according to a unified configuration, and users usually specify the container configuration required to run the function code in the function running request, it is necessary to adjust the specifications of the initially allocated containers according to the configuration parameters specified by the user so that the running performance of the available containers meets the user's needs.

[0055] For example, the configuration parameters of the container may include storage size, CPU resources, etc.

[0056] Step 102: Determine a directory to be mounted according to the function execution request, and mount the directory to be mounted into an available container.

[0057] The directory to be mounted is the directory that the container needs to use to run the function code. Therefore, the directory to be mounted needs to be mounted to the container before the container can use it.

[0058] Exemplarily, the directory to be mounted may include a storage directory for the function code and a storage directory for code-dependent files. For a function execution request with network storage, the directory to be mounted may also include a network storage directory.

[0059] In an optional embodiment, in the process of determining the directory to be mounted based on a function execution request, data related to the function code can be downloaded locally according to the download address in the function execution request, so as to facilitate the container to load the data related to the function code, thereby using the local storage directory of these data and the network storage directory in the function execution request as the directory to be mounted.

[0060] The data related to the function code includes information such as the function code and code-dependent files.

[0061] It's worth noting that when dynamically mounting a directory into an available container, the mounted directory must actually exist. The storage directory for function code-related data is a local directory and a real directory. A network storage directory is a user-specified external network storage location, a non-local directory that may or may not exist.

[0062] Based on this, when mounting the directory to be mounted to an available container, it is necessary to check whether the network storage directory exists in the network storage indicated by the network storage directory. If it exists, it can be mounted directly. If it does not exist, the specified user permissions in the function running request can be further used to create the network storage directory in the corresponding network storage, and then mount it. That is, the local storage directory and network storage directory of the data related to the function code are used to replace the default directory mounted when starting the available container.

[0063] It should be noted that the UID and GID of the local storage directory and network storage directory for data related to the function code are the UID and GID of the user permissions specified in the function execution request.

[0064] Step 103: Create a function process with the user permissions specified in the function execution request in an available container based on the directory to be mounted by the main process.

[0065] Specifically, the main process uses the specified user permission to create a function process in the available container for the function code in the directory to be mounted.

[0066] The function process started in the available container is the process that runs the function code in the directory to be mounted.

[0067] Based on the process from step 101 to step 103 above, it can be seen that in the container ready stage of the resource pool, only the main process is started inside the container. In the stage of binding the container to the specific function code, storage directories, network storage directories, function processes, etc. related to the function code appear inside the container.

[0068] After starting a function process within a container, as the function process runs, the process tree structure generated within the container is shown in Figure 2. PID represents the process ID, and PPID represents the parent process ID of the process. For the main process, UID = 0 and GID = 0 indicate superuser privileges. The function process with PID = a is the process started by the main process, so the parent process ID of the function process is 1. The function process's UID = b and GID = c indicate user-specified privileges. userProcess is a user process started by the function process during the execution of the function code. "PID = ?" indicates an indeterminate value, but the value is not a. Since userProcess is a user process started by the function process, the parent process ID of userProcess is always a.

[0069] It should be noted that, during the execution of the above step 101, if it is determined that the resource pool is empty, it means that there are no containers available in the resource pool. At this time, cold start acceleration cannot be achieved, and a cold start process needs to be executed to start the function process with specified permissions. The implementation process includes: using the function run request to determine the directory to be mounted, and using the configuration parameters in the function run request and the specified user permissions and the directory to be mounted to start a new container, and then using the main process of the new container to create a function process in the new container based on the directory to be mounted.

[0070] Among them, since the new container is started with specified user permissions, the main process in the new container is also started with specified user permissions. Therefore, the function process started by the main process inherits the user permissions of the main process.

[0071] It should be further explained that after executing step 103, the running data generated during the running of the function code is stored in the network storage indicated by the network storage directory through the function process. Since the function process is a specified user permission and the network storage directory is also a specified user permission, the function process has the operation permission to the network storage directory, and the data generated by the function code is written to the network storage with the specified user permission.

[0072] At this point, the process startup flow shown in Figure 1 is complete. When a function run request is triggered, a pre-launched available container is assigned to the function run request, and the main process is started with superuser privileges. Since superuser privileges have full control over the system, after the directory to be mounted for the function run request is mounted to the available container, when the main process with superuser privileges creates the function process, the permissions of the function process can be dynamically specified. That is, the function process can be created according to the user permissions specified in the function run request, thus meeting user needs. And because the available container is a pre-launched container, it can also achieve cold start acceleration for function code with dynamically specified permissions.

[0073] Based on the process startup embodiment shown in Figure 1 above, the following is a specific application scenario for implementing process startup on the Function Compute platform:

[0074] As shown in Figure 3, the relationship between the various components of the function computing platform is shown. Among them, the host is a computing node used to deploy resource pool containers, such as a bare metal server. Several resource pool containers are deployed on the host. These resource pool containers can all adopt secure container technology. Usually, the function computing platform contains many such hosts. The execution engine component is responsible for processing various call requests. The agent component runs in the container. For example, when the resource pool container adopts a secure container, the agent component runs in the micro-vm (lightweight virtual machine) environment of the secure container. The agent component is responsible for managing the life cycle of the user function and communicating with the execution engine component and the loader component through RPC (Remote Procedure Call). The loader component, that is, the module implemented by the main process in the resource pool container, is used to create the user's function process. It can dynamically load user functions in different languages. In this application scheme, the user's function process can be started according to the UID and GID of the specified user permissions. The bootstrap component is used to load a section of code for UserFunction.

[0075] Based on the relationships between the above components, the specific implementation process of binding the function code of the specified user permissions to the resource pool container includes the following steps 1 to 4:

[0076] Step 1: On the host machine, the execution engine uses superuser privileges to launch a batch of containers as a resource pool, with process #1 within the container acting as the loader component. When the execution engine receives a request to borrow a container, it matches the request with an available container in the resource pool and proceeds to step 2. If the resource pool is empty, the execution engine proceeds to the cold start process, directly creating a new container to bind the function code. The cold start process is described in the previous embodiment.

[0077] The container borrowing request is generated by the function computing platform based on the received function running request.

[0078] Step 2: The execution engine determines the directory to be mounted of the available container and passes the directory to be mounted to the available container. The directory to be mounted includes the storage directory and the network storage directory for data related to the function code.

[0079] Step 3: The available container checks whether the network storage directory exists. If so, it directly mounts the directory to be mounted into the available container. If not, it uses the specified user permissions in the function run request to create the network storage directory in the corresponding network storage, and then mounts the directory to be mounted into the available container.

[0080] Step 4: The execution engine initiates a request to the loader component through the agent component to instruct it to create a function process. The loader component loads the user's function code through the bootstrap component and starts the function process based on the UID and GID of the specified user permissions.

[0081] This completes the process of binding the function code with specified user permissions to the resource pool container.

[0082] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0083] Corresponding to the aforementioned embodiment of the process starting method, the present application also provides an embodiment of a process starting device.

[0084] Figure 4 is a structural diagram of a process starting device according to an exemplary embodiment, which is used to execute the process starting method provided by any of the above embodiments. As shown in Figure 4, the process starting device includes: a container allocation module 410, which is used to allocate an already started available container to the received function execution request, and the main process in the available container is started with super user permissions; a directory mounting module 420, which is used to determine the directory to be mounted according to the function execution request, and mount the directory to be mounted into the available container; a process creation module 430, which is used to create a function process with the user permissions specified in the function execution request in the available container based on the directory to be mounted through the main process.

[0085] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0086] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0087] The embodiment of the present application further provides an electronic device corresponding to the process starting method provided in the above embodiment, so as to execute the above process starting method.

[0088] Figure 5 is a hardware structure diagram of an electronic device according to an exemplary embodiment. The electronic device includes a communication interface 601, a processor 602, a memory 603, and a bus 604. The communication interface 601, the processor 602, and the memory 603 communicate with each other via the bus 604. The processor 602 executes the process startup method described above by reading and executing machine-executable instructions corresponding to the control logic of the process startup method in the memory 603. The details of this method are described in the above embodiments and will not be repeated here.

[0089] The memory 603 mentioned in this application can be any electronic, magnetic, optical, or other physical storage device, and can contain stored information, such as executable instructions, data, and the like. Specifically, the memory 603 can be RAM (Random Access Memory), flash memory, a storage drive (such as a hard disk drive), any type of storage disk (such as an optical disk, DVD, etc.), or similar storage media, or a combination thereof. The communication connection between the system network element and at least one other network element is achieved through at least one communication interface 601 (which can be wired or wireless), and can use the Internet, a wide area network, a local area network, a metropolitan area network, etc.

[0090] The bus 604 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 603 is used to store programs, and the processor 602 executes the programs after receiving an execution instruction.

[0091] The processor 602 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by an integrated logic circuit of the hardware in the processor 602 or an instruction in the form of software. The above-mentioned processor 602 can be a general-purpose processor, including a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The various methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or can be completed by a combination of hardware and software modules in the decoding processor.

[0092] The electronic device provided in the embodiment of the present application and the process startup method provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by them.

[0093] An embodiment of the present application also provides a computer-readable storage medium corresponding to the process startup method provided in the aforementioned embodiment. Please refer to Figure 6, where the computer-readable storage medium shown is a CD 30 on which a computer program (i.e., a program product) is stored. When the computer program is run by the processor, it will execute the process startup method provided in any of the aforementioned embodiments.

[0094] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.

[0095] The computer-readable storage medium provided in the above-mentioned embodiment of the present application and the process startup method provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the method adopted, run or implemented by the application program stored therein.

[0096] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0097] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0098] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A process startup method, characterized in that: The method comprises: Allocate a started available container for the received function execution request, where the main process in the available container is started with super user privileges; Determine a directory to be mounted according to the function execution request, and mount the directory to be mounted into the available container; A function process with user permissions specified in the function execution request is created in the available container through the main process based on the directory to be mounted.

2. The method according to claim 1, characterized in that The step of determining the directory to be mounted according to the function execution request includes: Downloading data related to the function code to the local computer according to the download address in the function execution request; The local storage directory of the data and the network storage directory in the function execution request are used as directories to be mounted.

3. The method according to claim 2, characterized in that The step of mounting the directory to be mounted into the available container includes: Checking that the network storage directory does not exist in the network storage indicated by the network storage directory, creating the network storage directory in the network storage using the specified user authority in the function execution request; The local storage directory of the data and the network storage directory are used to replace the default directory mounted when the available container is started.

4. The method according to claim 2, characterized in that: After creating, by the main process, in the available container a function process with the user authority specified in the function execution request based on the directory to be mounted, the method further includes: The operation data generated during the execution of the function code is stored in the network storage indicated by the network storage directory through the function process.

5. The method according to claim 1, characterized in that The creating, by the main process, a function process with the user authority specified in the function execution request in the available container based on the directory to be mounted includes: A function process is created in the available container for the function code in the directory to be mounted by the main process using the specified user authority.

6. The method according to claim 1, characterized in that The allocating a started available container to the received function running request includes: According to the preset resource pool not being empty, selecting a started container from the resource pool; Adjusting the specification of the container according to the configuration parameters in the function execution request; The adjusted container is used as an available container for the function run request.

7. The method according to any one of claims 2 to 6, characterized in that: Before allocating a started available container to the received function execution request, the method further includes: According to receiving the function execution request and the preset resource pool being empty, determining the directory to be mounted by using the function execution request; Using the configuration parameters in the function run request, the specified user permissions, and the directory to be mounted, a new container is started; the main process in the new container is started with the specified user permissions; A function process is created in the new container based on the directory to be mounted by the main process of the new container.

8. A process starting device, characterized in that: The device comprises: A container allocation module, used to allocate an already started available container to the received function execution request, wherein the main process in the available container is started with super user privileges; A directory mounting module, used to determine a directory to be mounted according to the function execution request, and mount the directory to be mounted into the available container; A process creation module is used to create a function process with user permissions specified in the function execution request in the available container based on the directory to be mounted through the main process.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: The processor executes the program to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Browser and client

    CN102663318A

  • Method for realizing function computing service based on container technology

    CN112328362A

  • Non-service container starting method and related equipment

    CN114546581A

  • Process starting method and device, electronic equipment and storage medium

    CN116643804A

  • Method and system for constructing lightweight container-based user environment (CUE), and medium

    US20210011740A1