Inter-container memory read-write method and device, cloud platform, equipment and storage medium

By deploying and mapping inter-container memory reading and writing methods in the cloud platform and mapping the same physical memory space, the I/O service performance problems caused by high bandwidth data transmission between containers are solved, and efficient data access and performance improvement are achieved.

CN119690637APending Publication Date: 2025-03-25SHENZHEN HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411507864.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

When using a full memory service to save the model's checkpoints, high bandwidth data transmission between containers results in poor I/O service performance.

Method used

By deploying the first container and the second container in the cloud platform, the first container is used to run a process that executes tasks, the second container is used to run a process that manages memory, and maps the two virtual memory spaces to the same physical memory space, implementing the memory reading and writing method between containers. The method includes the first container sending a data access request to the second container, the second container returns the address of the target space, and the first container conducts data access according to the address, avoiding data transmission between containers.

Benefits of technology

It improves I/O service performance between containers, reduces communication overhead between containers, and improves data access efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690637A_ABST
    Figure CN119690637A_ABST
Patent Text Reader

Abstract

The invention discloses an inter-container memory read-write method and device, a cloud platform, equipment and a storage medium, and relates to the technical field of containers. The two virtual memory spaces of the first process and the second process are mapped to the same physical memory space. And when the first container needs to perform data access on the target data, the first container only sends the access request containing the data identifier of the target data to the second container. And the second container returns a first address of mapping the target space for storing the target data to the virtual memory space of the second process to the first container. The first container can determine a second address, mapped to a virtual memory space of the first process, of the target space according to the first address, and data access can be directly performed in the target space based on the second address. Therefore, compared with a scheme that the target data needs to be transmitted between a container for deploying the model training process and a container for deploying the memory service process, the target data does not need to be transmitted between the containers, so that the I / O service performance between the containers is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of container technology, and in particular to a method, device, cloud platform, equipment and storage medium for reading and writing memory between containers. Background Art

[0002] In order to reduce the coupling between memory service and model training tasks, when using full memory service to save model checkpoints (CKPT), the memory service process and model training process are deployed in different containers on a physical node. Among them, full memory refers to the memory in the container where the memory service process is deployed.

[0003] The memory service process provides a memory read and write interface through the software development kit (SDK). The model training process uses the memory read and write interface by integrating the SDK, realizes the data transmission of checkpoints through the I / O interaction of the inter-container network, and saves the checkpoints in the full memory.

[0004] Since the amount of checkpoint data is large, high-bandwidth data transmission is required between the container where the memory service process is deployed and the container where the model training process is deployed, resulting in poor performance of the (input / output, I / O) service between containers. Summary of the invention

[0005] The embodiments of the present application provide a method, apparatus, cloud platform, device and storage medium for reading and writing memory between containers, which can improve the I / O service performance between containers.

[0006] In a first aspect, a method for reading and writing memory between containers is provided, which is applied to a cloud platform. The cloud platform includes a first node, and a first container and a second container are deployed on the first node. The first container is used to run a first process for executing tasks, and the second container is used to run a second process for managing memory. The virtual memory space of the first process and the virtual memory space of the second process are mapped to the same physical memory space. The method includes: the first container sends a data access request to the second container, and the data access request is used to indicate data access to target data, and the data access request includes a data identifier of the target data. The second container sends a first address to the first container according to the data identifier information, and the first address is the address of the target address mapped to the virtual memory space of the second process, and the target address is the address of the target space storing the target data in the physical memory space. The first container converts the first address into a second address, and the second address is the address of the target address mapped to the virtual memory space of the first process, and data access is performed based on the second address.

[0007] Based on the above-mentioned inter-container memory reading and writing method, the two virtual memory spaces of the first process and the second process are mapped to the same physical memory space, that is, the first process and the second process share the same physical memory space. When the first container needs to access the target data, it only sends the access request containing the data identifier of the target data to the second container. The second container returns to the first container the first address of the target space storing the target data mapped to the virtual memory space of the second process. The first container can determine the second address of the virtual memory space of the first process mapped to the target space based on the first address, and can directly access the data in the target space based on the second address. In this way, compared with the solution that requires the target data to be transmitted between the container for deploying the model training process and the container for deploying the memory service process, the present application does not need to transmit the target data between containers, thereby improving the I / O service performance between containers.

[0008] As a possible implementation, the target data includes multiple target data, the multiple target data include first target data, and the data access request includes a first data identifier of the first target data. The second container determines the first address of the first target space corresponding to the first data identifier according to the first data identifier in the data access request, and sends the first address to the first container. The data access request is used to indicate data access to multiple target data, the first address is the address of the first target address mapped to the virtual memory space of the second process, and the first target address is the address of the first target space storing the first target data in the physical memory space. In this way, the first container can include data identifiers of multiple target data in one data access request. The second container determines multiple first addresses of multiple target spaces storing multiple target data according to multiple data identifiers, and the first container can perform batch data access to multiple target data based on multiple first addresses, thereby reducing communication overhead between containers.

[0009] As a possible implementation, the first container determines the second address corresponding to the first address according to the correspondence between the first address, the address of the virtual memory space mapped to the second process by the physical memory space, and the address mapped to the virtual memory space of the first process. In this way, the first container converts the first address of the target space into the second address according to the correspondence between the same address of the physical memory space mapped to two different addresses of the virtual memory spaces of the two processes, thereby enabling the first container to directly access data in the target space storing the target data, reducing the communication overhead between containers.

[0010] As a possible implementation, the first container determines the address offset as the difference between the first address and the first starting address; the first starting address is the starting address of the virtual memory space of the second process mapped from the physical memory; the second address is determined as the sum of the address offset and the second starting address, and the second starting address is the starting address of the virtual memory space of the first process mapped from the physical memory. In this way, after the same address of the physical memory space is mapped to the virtual memory spaces of the two processes respectively, the two different addresses obtained have the same address offset as the starting address of the virtual memory space of the two processes mapped from the physical memory space. The first container can directly convert the first address of the target space into the second address by determining the address offset, without pre-saving the corresponding relationship, thereby avoiding the first container storing the corresponding relationship and consuming storage resources.

[0011] As a possible implementation, the first address is the offset of the target address and the starting address of the physical memory space mapped to the address of the virtual memory space of the second process. The first container determines the second address as the sum of the first address and the second starting address, and the second starting address is the starting address of the physical memory space mapped to the virtual memory space of the first process. In this way, the second container determines the offset of the target address of the target space and the starting address of the physical memory space as the first address, and the first container determines the second address of the target address mapped to the virtual memory space of the first process based on the offset. The first container does not need to pre-save the first starting address of the physical memory space mapped to the virtual memory space of the second process, thereby reducing the waste of storage resources of the first container.

[0012] As a possible implementation, the data access request is a write request, which is used to indicate that data is written to the target space corresponding to the target address. In this way, the first container only needs to send a write request to the second container, and the first container directly writes data to the target space, thereby realizing the data writing function between containers.

[0013] Optionally, the data access request is a write request, and the write request includes the data identifier and the data length of the target data. The second container allocates the target space of the data length for the target data in the physical memory space; the target space corresponds to the data identifier. The second container determines that the target address is mapped to the first address of the virtual memory space of the second process; and sends the first address to the first container. In this way, when the second container receives the write request sent by the first container, it only needs to allocate a target space to the target data and return the first address of the target space to the first container. Compared with the solution in which the first container needs to write the target data carried in the write request into the memory of the second container, the present application does not need to transmit the target data between containers, thereby improving the I / O service performance between containers.

[0014] As a possible implementation, the data access request is a read request. The read request is used to indicate that data is read in the target space corresponding to the target address. In this way, the first container only needs to send a read request to the second container, and the first container directly reads data in the target space, thereby realizing the data reading function between containers.

[0015] As a possible implementation method, the data access request is a read request. The second container determines the first address of the target space corresponding to the data identifier based on the data identifier and the identifier corresponding to each allocated space in the physical memory space; and sends the first address to the first container. In this way, when the second container receives the read request sent by the first container, it only needs to return the first address of the target space allocated during the write request to the first container. Compared with the solution in which the second container needs to transfer the target data in the target space to the first container, the present application does not need to transfer the target data between containers, thereby improving the I / O service performance between containers.

[0016] In a second aspect, a method for reading and writing memory between containers is provided, which is applied to a cloud platform. The cloud platform includes a first node, and a first container and a second container are deployed on the first node. The first container is used to run a first process for executing tasks, and the second container is used to run a second process for managing memory. The virtual memory space of the first process and the virtual memory space of the second process are mapped to the same physical memory space. The method can be executed by the first container, and the method includes: the first container sends a data access request to the second container; the data access request is used to indicate data access to target data, and the data access request includes a data identifier of the target data. The first container receives a first address sent by the second container; the first address is the address of the target address mapped to the virtual memory space of the second process, and the target address is the address of the target space storing the target data in the physical memory space. The first container converts the first address to a second address; the second address is the address of the target address mapped to the virtual memory space of the first process, and data access is performed based on the second address.

[0017] Based on the above-mentioned inter-container memory reading and writing method, the two virtual memory spaces of the first process and the second process are mapped to the same physical memory space, that is, the first process and the second process share the same physical memory space. When the first container needs to access the target data, it only sends an access request containing the data identifier of the target data to the second container. According to the first address returned by the second container, it can determine that the target space is mapped to the second address of the virtual memory space of the first process, and based on the second address, data access can be performed directly in the target space. In this way, compared with the solution that requires the target data to be transmitted between the container for deploying the model training process and the container for deploying the memory service process, the present application does not need to transmit the target data between containers, thereby improving the I / O service performance between containers.

[0018] As a possible implementation, the target data includes multiple target data, the multiple target data include first target data, the data access request includes a first data identifier of the first target data; the data access request is used to indicate data access to the multiple target data. In this way, the first container can include the data identifiers of the multiple target data in one data access request, and the first container can perform batch data access to the multiple target data, thereby reducing communication overhead between containers.

[0019] As a possible implementation, the first container determines the second address corresponding to the first address according to the correspondence between the first address, the address of the virtual memory space mapped to the second process by the physical memory space, and the address mapped to the virtual memory space of the first process. In this way, the first container converts the first address of the target space into the second address according to the correspondence between the same address of the physical memory space mapped to two different addresses of the virtual memory spaces of the two processes, thereby enabling the first container to directly access data in the target space storing the target data, reducing the communication overhead between containers.

[0020] As a possible implementation, the first container determines the address offset as the difference between the first address and the first starting address; the first starting address is the starting address of the virtual memory space mapped from the physical memory space to the second process; the second address is determined as the sum of the address offset and the second starting address, and the second starting address is the starting address of the virtual memory space mapped from the physical memory space to the first process. In this way, after the same address of the physical memory space is mapped to the virtual memory spaces of the two processes respectively, the two different addresses obtained are respectively the same as the address offsets of the starting addresses of the virtual memory spaces mapped from the physical memory space to the two processes. The first container can directly convert the first address of the target space into the second address by determining the address offset, without pre-saving the corresponding relationship, thereby avoiding the first container from consuming storage resources by storing the corresponding relationship.

[0021] As a possible implementation, the first address is the offset of the target address and the starting address of the physical memory space respectively mapped to the address of the virtual memory space of the second process. The first container determines the second address as the sum of the first address and the second starting address, and the second starting address is the starting address of the physical memory space mapped to the virtual memory space of the first process. In this way, the offset of the target address of the target space and the starting address of the physical memory space is the first address, and the first container determines the second address of the target address mapped to the virtual memory space of the first process based on the offset. The first container does not need to pre-save the first starting address of the physical memory space mapped to the virtual memory space of the second process, thereby reducing the waste of storage resources of the first container.

[0022] As a possible implementation, the data access request is a write request, which is used to indicate that data is written to the target space corresponding to the target address. In this way, the first container only needs to send a write request to the second container, and the first container directly writes data to the target space, thereby realizing the data writing function between containers.

[0023] As a possible implementation, the data access request is a read request, which is used to indicate to read data in the target space corresponding to the target address. In this way, the first container only needs to send a read request to the second container, and the first container directly reads data in the target space, thereby realizing the data reading function between containers.

[0024] In a third aspect, a method for reading and writing memory between containers is provided, which is applied to a cloud platform. The cloud platform includes a first node, and a first container and a second container are deployed on the first node. The first container is used to run a first process for executing tasks, and the second container is used to run a second process for managing memory. The virtual memory space of the first process and the virtual memory space of the second process are mapped to the same physical memory space. The method can be executed by the second container, and the method includes: the second container receives a data access request sent by the first container; the data access request is used to indicate data access to the target data, and the data access request includes a data identifier of the target data. The second container sends a first address to the first container according to the data identifier, and the first address is the address of the virtual memory space of the second process mapped to the target address, and the target address is the address of the target space storing the target data in the physical memory space.

[0025] Based on the above-mentioned inter-container memory reading and writing method, the two virtual memory spaces of the first process and the second process are mapped to the same physical memory space, that is, the first process and the second process share the same physical memory space. The second container receives an access request containing the data identifier of the target data sent by the first container when it needs to access the target data, and only needs to return the first address to the first container. In this way, compared with the solution that requires the target data to be transmitted between the container for deploying the model training process and the container for deploying the memory service process, the present application does not need to transmit the target data between containers, thereby improving the I / O service performance between containers.

[0026] As a possible implementation, the target data includes multiple target data, the multiple target data include first target data, and the data access request includes a first data identifier of the first target data. The second container determines the first address of the first target space corresponding to the first data identifier according to the first data identifier in the data access request, and sends the first address to the first container. The data access request is used to indicate data access to multiple target data, the first address is the address of the first target address mapped to the virtual memory space of the second process, and the first target address is the address of the first target space storing the first target data in the physical memory space. In this way, a data access request can include data identifiers of multiple target data. The second container determines multiple first addresses of multiple target spaces storing multiple target data according to multiple data identifiers, and the first container can perform batch data access to multiple target data based on multiple first addresses, thereby reducing communication overhead between containers.

[0027] As a possible implementation method, the data access request is a write request, and the write request is used to indicate that data is written to the target space corresponding to the target address, and the write request includes a data identifier and the data length of the target data. The second container allocates the target space of the data length for the target data in the physical memory space; the target space corresponds to the data identifier. The second container determines that the target address is mapped to the first address of the virtual memory space of the second process; and sends the first address to the first container. In this way, when the second container receives the write request sent by the first container, it only needs to allocate a target space to the target data and return the first address of the target space to the first container. Compared with the solution in which the first container needs to write the target data carried in the write request into the memory of the second container, the present application does not need to transmit the target data between containers, thereby improving the I / O service performance between containers.

[0028] As a possible implementation method, the data access request is a read request, and the read request is used to indicate that data is read in the target space corresponding to the target address. The second container determines the first address of the target space corresponding to the data identifier based on the data identifier and the identifier corresponding to each space allocated in the physical memory space; and sends the first address to the first container. In this way, when the second container receives the read request sent by the first container, it only needs to return the first address of the target space allocated during the write request to the first container. Compared with the solution in which the second container needs to transfer the target data in the target space to the first container, the present application does not need to transfer the target data between containers, thereby improving the I / O service performance between containers.

[0029] In a fourth aspect, a device for reading and writing memory between containers is provided, the device comprising modules for executing the method for reading and writing memory between containers in the second aspect or any possible implementation manner of the second aspect.

[0030] The inter-container memory reading and writing device described in the fourth aspect may be a terminal device or a network device, or may be a chip (system), a network card or other parts or components that can be set in the terminal device or the network device, or may be a device including a terminal device or a network device, which is not limited in this application.

[0031] In addition, the technical effects of the inter-container memory reading and writing device described in the fourth aspect can refer to the technical effects of the inter-container memory reading and writing method described in the second aspect, which will not be repeated here.

[0032] In a fifth aspect, a device for reading and writing memory between containers is provided, wherein the device includes modules for executing the method for reading and writing memory between containers in the third aspect or any possible implementation manner of the third aspect.

[0033] The inter-container memory reading and writing device described in the fifth aspect may be the same terminal device or network device as the inter-container memory reading and writing device described in the third aspect, or may be a chip (system), a network card or other parts or components that can be set in a terminal device or a network device, or may be a device including a terminal device or a network device, and this application does not limit this.

[0034] In addition, the technical effects of the inter-container memory reading and writing device described in the fifth aspect can refer to the technical effects of the inter-container memory reading and writing method described in the third aspect, which will not be repeated here.

[0035] In a sixth aspect, a cloud platform is provided, comprising a first node, wherein the first node executes the operation steps of the method described in any possible implementation manner in the first aspect.

[0036] In the seventh aspect, a computing device is provided, which includes a processor and a memory; the processor is coupled to the memory; the memory is used to store computer instructions, and the computer instructions are loaded and executed by the processor to enable the computing device to implement the operating steps of the method described in any possible implementation method of the first to third aspects above.

[0037] In an eighth aspect, a computer-readable storage medium is provided, comprising: computer software instructions; when the computer software instructions are executed in a computer, the computer executes the operating steps of the method described in any possible implementation of the first aspect to the third aspect.

[0038] In a ninth aspect, a chip system is provided. The chip system includes a memory and at least one processor. The memory is used to store a set of computer instructions, and when the processor executes the set of computer instructions, the operation steps of the method described in any possible implementation of the first aspect to the third aspect are performed.

[0039] In a tenth aspect, a computer program product is provided. When the computer program product is run on a computer, the computer is caused to execute the operation steps of the method described in any possible implementation manner of the first to third aspects.

[0040] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A schematic diagram of the architecture of a cloud platform 100 provided in an embodiment of the present application;

[0042] Figure 2 A schematic diagram of a layered structure of a cloud platform 100 provided in an embodiment of the present application;

[0043] Figure 3 An architecture diagram of a cloud platform 300 provided in an embodiment of the present application;

[0044] Figure 4 A schematic diagram of the architecture of a cloud platform 400 provided in an embodiment of the present application;

[0045] Figure 5 A flowchart of a method for reading and writing memory between containers provided in an embodiment of the present application;

[0046] Figure 6 A schematic diagram of a shared memory creation process provided in an embodiment of the present application;

[0047] Figure 7 A schematic diagram of a flow chart of a method for writing memory between containers provided in an embodiment of the present application;

[0048] Figure 8 A schematic diagram of a flow chart of a method for reading memory between containers provided in an embodiment of the present application;

[0049] Fig. 9 A schematic diagram of the structure of a possible inter-container memory reading and writing device 900 provided in an embodiment of the present application;

[0050] Fig.10 A schematic diagram of the structure of a possible inter-container memory reading and writing device 1000 provided in an embodiment of the present application;

[0051] Fig.11 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] This application can be applied not only to existing model training scenarios, model reasoning scenarios, big data computing scenarios, and other high-bandwidth I / O scenarios that require the storage of a large amount of data, but can also be applied to future model training scenarios, model reasoning scenarios, big data computing scenarios, and other high-bandwidth I / O scenarios that require the storage of a large amount of data. For ease of understanding, the following first introduces the relevant terms involved in the embodiments of this application.

[0053] (1) Container

[0054] Containers are a lightweight and portable virtualization technology.

[0055] Containers package an application and its associated dependencies into a self-contained unit.

[0056] The container contains the necessary elements for the successful execution of the application, such as code, environment variables, processes and execution environment, and software dependencies.

[0057] (2) Cloud computing platform

[0058] Cloud platform, also known as cloud computing platform, refers to services based on hardware resources and software resources, providing computing, network and storage capabilities. That is, the platform provider combines cloud (remote hardware resources) and computing (remote software resources) to form a platform to provide various services to users.

[0059] The services provided by the cloud platform may include software as a service (SaaS), platform as a service (PaaS) and infrastructure as a service (IaaS). SaaS is a service provider that uniformly deploys application software on the cloud platform's servers, and users order application software services from the service provider through the Internet based on their needs. PaaS is the provision of development environment as a service, that is, the service provider provides services such as development environment, server platform and hardware resources to users, and users develop applications in the development environment provided by the cloud platform and share them with other users through the cloud platform and the Internet. IaaS is a service provider that provides a cloud infrastructure consisting of multiple servers to users as a service, that is, integrates memory, input / output devices, storage and computing resources into a virtual resource pool to provide users with storage resources and virtualized servers, etc.

[0060] Currently, the models being trained are getting larger and larger, and the fault recovery time of model training is getting longer and longer. When the checkpoints of the models are saved, they are usually saved to an external file system through the portable operating system interface (POSIX) interface.

[0061] Among them, the POSIX portable operating system interface is an operating system interface standard developed by the Institute of Electrical and Electronics Engineers (IEEE), which aims to provide a unified interface so that programs can be portable on different operating systems. The POSIX standard covers interface specifications in many aspects, such as file operations, process control, thread management, signal processing, and network communication.

[0062] The above solution requires an external file system to provide extremely large read and write bandwidth, and it takes a long time to save the checkpoint.

[0063] The solution of deploying the memory service process and the model training process in the same container on the same physical node can avoid cross-container data transmission, but the memory service process and the model training process are severely coupled.

[0064] To solve the above problems, the memory service process and the model training process are deployed in different containers on the same physical node, and the full memory is used to save the checkpoints. This solution can transmit data through the inter-container network, but due to the large amount of checkpoint data, the performance of the I / O service between containers is poor.

[0065] In order to solve the above problems, the embodiment of the present application provides a method for reading and writing memory between containers, and in particular provides a method for realizing memory reading and writing between containers by address conversion based on shared memory. The method is applied to a cloud platform, which includes a first node, a first container and a second container are deployed on the first node, the first container is used to run a first process for executing tasks, and the second container is used to run a second process for managing memory, and the virtual memory space of the first process and the virtual memory space of the second process are mapped to the same physical memory space. The two virtual memory spaces of the first process and the second process are mapped to the same physical memory space, that is, the first process and the second process share the same physical memory space. When the first container needs to access the target data, it only sends an access request containing the data identifier of the target data to the second container. The second container returns to the first container the first address of the target space storing the target data mapped to the virtual memory space of the second process. The first container can determine the second address of the target space mapped to the virtual memory space of the first process based on the first address, and can directly access data in the target space based on the second address. In this way, compared with the solution that requires transferring the target data between the container where the model training process is deployed and the container where the memory service process is deployed, the present application does not require the transfer of target data between containers, thereby improving the I / O service performance between containers.

[0066] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0067] Figure 1 Schematic diagram of the architecture of a cloud platform 100 provided in an embodiment of the present application. Figure 1 As shown, the cloud platform 100 includes a computing server cluster 110, a storage server cluster 120, a management server cluster 130, a network device cluster 140 and a user terminal 150. The computing server cluster 110, the storage server cluster 120 and the management server cluster 130 communicate with the user terminal 150 through the network device cluster 140 respectively.

[0068] The computing server cluster 110 includes one or more computing servers ( Figure 1 Two computing servers, namely computing server 111 and computing server 112, are shown in FIG. 1 , but are not limited to two computing servers).

[0069] Computing servers are computing resources in the cloud platform 100, such as servers and desktop computers, and are used to generate and allocate computing resources based on virtualization technology according to user needs. At the hardware level, the computing server is equipped with a processor and memory ( Figure 1The computing function of the computing server is realized by the processor running the program in the memory. The computing node server can also read / write data in each storage server in the storage server cluster 120 according to user needs.

[0070] The storage server cluster 120 includes one or more storage servers ( Figure 1 Two storage servers, storage server 121 and storage server 122, are shown in FIG. 1 , but are not limited to two storage servers).

[0071] The storage server is a storage resource in the cloud platform 100, such as a server, desktop computer or storage array controller, hard disk frame, etc., which is used to provide logical disk storage, unstructured data storage, integrated backup and other services for the cloud virtual machines in the cloud platform 100. In terms of hardware, the storage server is provided with a network card, a processor and a memory. The processor in the storage server is used to process data from outside the storage server. The network card is used to control the access process of the memory, such as the control of address signals, data signals and various command signals, so that the storage server can provide the memory as a storage resource to the user. The memory is used to store data and may include memory and / or hard disk. Memory refers to an internal memory that directly exchanges data with the processor. The memory can read and write data quickly at any time and serve as a temporary data storage for the operating system or other running programs. Unlike memory, the hard disk reads and writes data slower than memory and is usually used to store data persistently.

[0072] The management server cluster 130 includes one or more management servers ( Figure 1 Two management servers, namely, management server 131 and management server 132, are shown in FIG. 1 , but are not limited to two management servers).

[0073] The management server is used to manage all computing services, shared storage, and networks of the entire cloud platform 100, and provide users or administrators with an API for managing the entire node.

[0074] The network device cluster 140 includes one or more switches and routers, such as Figure 1As shown, in this embodiment, the network device cluster 140 includes a router 141, a switch 142, a switch 143, a switch 144, and a switch 145. Among them, the user terminal 150 is connected to the router 141 through the Internet, and the router 141 is connected to the switch 143 through the switch 142, and the switch 143 is connected to each computing server in the computing server cluster 110. The switch 144 is respectively connected to each computing server in the computing server cluster 110 and each storage server in the storage server cluster 120. The switch 145 is respectively connected to each computing server in the computing server cluster 110, each storage server in the storage server cluster 120, and each management server in the management server cluster 130.

[0075] Optionally, the number and type of switches included in the network device cluster 140 can be adjusted according to the needs of the cloud platform 100, and the switches 142, 143, 144, and 145 can be switches with different functions, for example, the switch 142 is a core switch, and the switches 143, 144, and 145 are switches for managing specific network segments. For example, the switch 142 can be a core switch, the switch 143 can be an internal and external switching network segment switch, the switch 144 can be a storage network segment switch, and the switch 145 can be a management network segment switch.

[0076] The user terminal 150 includes one or more user terminals ( Figure 1 Two user terminals, namely user terminal 151 and user terminal 152, are shown in FIG. 1 , but are not limited to two user terminals. The user terminal includes an interface and application required for accessing the cloud platform 100.

[0077] It is worth noting that Figure 1 This is just a schematic diagram and should not be construed as limiting the present application. The cloud platform 100 may also include other devices. Figure 1 Not drawn in.

[0078] In such Figure 1 Based on the equipment of the cloud platform 100 shown, the cloud platform 100 implements the function of the service node based on the container in the physical node that provides the physical basic resources, and provides services (e.g., computing services, storage services, network services, and data access services) to users through the service node. The service node can be a cloud node obtained by virtualizing the resources (e.g., computing resources and storage resources) of the cloud platform 100.

[0079] Next, combine Figure 2 The layered structure of the cloud platform 100 is described.

[0080] Figure 2A schematic diagram of a hierarchical structure of a cloud platform 100 provided in an embodiment of the present application. Figure 2 As shown, the infrastructure as a service platform 210 is used to virtualize all infrastructure resources in the cloud platform 100, and provide virtual resources (e.g., computing resources, network resources, and storage resources) to users in a software-defined manner. The infrastructure resources refer to the resources provided by the computing server cluster 110, the storage server cluster 120, the management server cluster 130, and / or the network device cluster 140 in the cloud platform 100.

[0081] The platform as a service platform 220 is used to implement the runtime environment and application support functions of the cloud platform 100, so that users can apply for computing units within the quota instead of virtual resources to run their own services. Optionally, the computing unit can be a container, and the cloud platform 100 deploys and runs the user's code by scheduling the container. It should be noted that the number of containers in the platform as a service platform 220 can be one or more. Figure 2 Only two containers are used as examples.

[0082] As a possible implementation, the cloud platform 100 can inject one or more components into the container to implement code deployment and operation. Optionally, the resources (computing resources or storage resources) used by multiple components in the same container can belong to the same hardware device (e.g., computing server, storage server, or management server) in the cloud platform 100.

[0083] Among them, the components may include database components, message queue components, orchestration components, log components, virtualization components, business database components, configuration database components, permission management components, etc.

[0084] The SaaS application 230 is used to provide services to users by composing user-deployed applications in the form of API responses based on the IaaS platform 210 and the PaaS platform 220. The application of the SaaS application 230 and the container can communicate through a web server.

[0085] It is worth noting that Figure 2 This is only a schematic diagram and should not be construed as limiting the present application. The hierarchical structure of the cloud platform 100 may also include other modules. Figure 2 Not drawn in.

[0086] The steps of the inter-container memory reading and writing method provided in the embodiment of the present application are performed by a physical node (for example, the first node) in the cloud platform 100 for providing physical basic resources. Figure 3 The inter-container memory reading and writing method provided in the embodiment of the present application is described.

[0087] The container management method provided in the embodiment of the present application can be applied to a cloud platform, which can be composed of multiple physical nodes, such as Figure 3 As shown, Figure 3 The present invention provides an architecture diagram of a cloud platform 300 provided in an embodiment of the present application. The multiple physical nodes of the cloud platform 300 include a first node, which is a physical node. The first node is deployed with a first container 310 and a second container 320. The first container 310 is used to run a first process 311 for executing tasks, and the second container 320 is used to run a second process 321 for managing memory. The virtual memory space of the first process 311 and the virtual memory space of the second process 321 are mapped to the same physical memory space.

[0088] The first container 310 sends a data access request to the second container 320 .

[0089] The data access request is used to instruct data access to target data, and the data access request includes a data identifier of the target data. The data identifier is information that uniquely identifies the target data, for example, the data access request includes a keyword (key) of the target data.

[0090] The data access request may be a read request or a write request, which is not limited in the embodiments of the present application.

[0091] The second container 320 sends the first address to the first container 310 according to the data identifier in the data access request.

[0092] The first address is the address of the virtual memory space of the second process 321 mapped to the target address, and the target address is the address of the target space storing the target data in the physical memory space.

[0093] The specific implementation method of the second container 320 determining the first address according to the data identifier can be referred to below. Figure 5 The relevant description of this embodiment of the present application will not be repeated here.

[0094] The first container 310 converts the first address into the second address.

[0095] The second address is the address of the virtual memory space of the first process 311 mapped from the target address.

[0096] The specific method of converting the first address into the second address by the first container 310 can be referred to below. Figure 5 The relevant description of the embodiments of the present application will not be repeated here.

[0097] The first container 310 performs data access based on the second address.

[0098] For the above Figure 3The specific implementation of each component in the cloud platform 300 provided is as follows Figure 4 An optional example is provided. Figure 4 A schematic diagram of the architecture of a cloud platform 400 provided in an embodiment of the present application. Figure 4 The cloud platform 400 shown is an example of the cloud platform 300 described above.

[0099] like Figure 4 As shown, the cloud platform 400 includes a physical node, which is the physical node Figure 3 The first node, the physical node, includes a first container 410 and a second container 420. The first container 410 deploys the task process, the second container 420 deploys the memory service process, and the virtual memory space of the task process and the virtual memory space of the memory service process are mapped to the same physical memory space.

[0100] Among them, the task process can be a model training task process, a model reasoning task process, an application process that executes other task applications, and other processes that need to save a large amount of data. For example, the data can be checkpoints, model reasoning results, calculation results, and other data. The memory service process refers to the process responsible for managing memory. The same physical memory space can be shared memory, and shared memory refers to the physical memory space on the same end shared by the task process and the memory service process.

[0101] The task process is run in the first container 410 . The task process integrates the SDK of the memory service process. The SDK includes a read-write memory module 411 , a shared memory management module 412 , and a shared memory address management module 413 .

[0102] A memory service process is run in the second container 420 , and the memory service process includes a read-write memory module 421 , a metadata management module 422 , a shared memory space management module 423 , a shared memory management module 424 , and a shared memory address management module 425 .

[0103] Physical nodes can be terminals, such as mobile terminals, tablet computers, laptops, virtual reality (VR) devices, augmented reality (AR) devices, mixed reality (MR) devices, extended reality (ER) devices, etc. ( Figure 4 ), may also be an edge device (e.g., a box carrying a chip with processing capabilities), etc. ( Figure 4 It may also be other computing devices or network devices, such as routers, optical modems, gateways, servers and other network devices ( Figure 4 not shown).

[0104] Next, the specific functions of the first container 410 and the second container 420 are briefly introduced.

[0105] The first container 410 sends a data access request to the second container 420 .

[0106] The data access request is a read request or a write request. The data access request is used to indicate data access to target data. The data access request includes a data identifier of the target data. For example, the data identifier may be a key of the target data.

[0107] The second container 420 sends a first address to the first container 410 according to the data identifier. The first address is the address of the target address mapped to the virtual memory space of the memory service process. The target address is the address of the target space storing the target data in the physical memory space.

[0108] The first container 410 converts the first address into a second address, and performs data access based on the second address.

[0109] The second address is the address of the virtual memory space of the task process mapped to the target address.

[0110] The read-write memory module 411 of the first container 410 and the read-write memory module 421 of the second container 420 are used to provide read-write memory functions.

[0111] The shared memory management module 412 of the first container 410 and the shared memory management module 424 of the second container 420 are used to create a shared memory and negotiate the shared memory between the first container 410 and the second container 420 .

[0112] The shared memory address management module 413 of the first container and the shared memory address management module 425 of the second container are used for address conversion of the shared memory address in the process space of the container.

[0113] The metadata management module 422 of the second container is used to manage the data stored in the shared memory.

[0114] The shared memory space management module 423 of the second container is used to manage the allocation and release of the shared memory.

[0115] Below Figure 3 The first container 310 and the second container 320 in the example of inter-container memory reading and writing are described in detail. Figure 5 A flowchart of a method for reading and writing memory between containers provided in an embodiment of the present application. Figure 5 The specific implementation of the functions of the first container 310 and the second container 320 can refer to the aforementioned Figure 3 The relevant description is not repeated here. Figure 5As shown, the inter-container memory reading and writing method may include steps 501 to 506.

[0116] Step 501: The first container 310 sends a data access request to the second container 320.

[0117] As a possible implementation manner, the number of target data is one, and the data access request includes the data identifier of the one target data.

[0118] As a possible implementation manner, the target data includes multiple target data, the multiple target data include first target data, the data access request includes a first data identifier of the first target data, and the data access request is used to indicate data access to the multiple target data.

[0119] As a possible implementation, the first process 311 of the first container 310 integrates the SDK of the second process 321, and sends a request to the second container 320 by calling the memory read and write interface provided by the SDK and adopting the inter-process communication (IPC) method.

[0120] As a possible implementation, before the first container 310 sends a data access request to the second container 320, the first container 310 and the second container 320 may also negotiate to create a shared memory. The shared memory is the same physical memory space mapped by the virtual memory space of the first process 311 and the virtual memory space of the second process 321.

[0121] Optionally, when the second process 321 is started, the second container 320 creates a shared memory, and records the file identification information of the shared memory and the first starting address of the shared memory mapped to the second process 321. The file identification information may be a file descriptor (fd) of the shared memory. The first container 310 obtains the file identification information of the shared memory, maps the shared memory to the virtual memory space of the first process 311 through the file identification information, and records the second starting address of the shared memory mapped to the first process 311.

[0122] The first container 310 uses memory mapping (mmap) to implement mapping between the shared memory and the virtual memory space of the first process 311 .

[0123] The process of creating a shared memory between the first container 310 and the second container 320 can be referred to as follows: Figure 6 The embodiments of the present application do not limit this.

[0124] Step 502 : The second container 320 receives a data access request sent by the first container 310 .

[0125] As a possible implementation manner, the second container 320 receives the data access request through an IPC communication manner.

[0126] Step 503: The second container 320 sends the first address to the first container 310 according to the data identifier.

[0127] As a possible implementation manner, the number of target data is one, and the second container 320 determines the first address of the target space corresponding to the target data according to the data identifier of the target data.

[0128] As a possible implementation, the target data includes multiple target data, the multiple target data includes first target data, and the data access request includes a first data identifier of the first target data. The second container 320 determines the first address of the first target space corresponding to the first data identifier according to the first data identifier.

[0129] The first address is the address of the first target address mapped to the virtual memory space of the second process 321, and the first target address is the address of the first target space storing the first target data in the physical memory space.

[0130] As a possible implementation, the data access request is a write request, which is used to instruct data to be written in the target space corresponding to the target address, and the write request includes a data identifier of the target data and a data length of the target data. The second container 320 allocates a target space of the data length for the target data in the physical memory space, and the target space corresponds to the data identifier. The second container 320 determines that the target address is mapped to the first address of the virtual memory space of the second process 321, and sends the first address to the first container 310.

[0131] Optionally, the second container 320 may record metadata of the write request, where the metadata index is a data identifier of the write request, and the metadata value is a first address of the target space and a data length of the target data.

[0132] The implementation method of the second container 320 allocating target space for target data and determining the first address can be referred to below. Figure 7 The relevant description of the embodiments of the present application will not be repeated here.

[0133] As a possible implementation, the data access request is a read request, which is used to instruct to read data in the target space corresponding to the target address. The second container 320 determines the first address of the target space corresponding to the data identifier according to the data identifier and the identifier corresponding to each space allocated in the physical memory space, and sends the first address to the first container 310.

[0134] The implementation method of the second container 320 determining the first address according to the data identifier can be referred to below. Figure 8 The relevant description of the embodiments of the present application will not be repeated here.

[0135] Step 504 : The first container 310 receives the first address sent by the second container 320 .

[0136] Step 505: The first container 310 converts the first address into a second address.

[0137] As a possible implementation method, the second container 320 determines the second address corresponding to the first address according to the correspondence between the first address, the address of the virtual memory space mapped to the second process 321 by the physical memory space, and the address mapped to the virtual memory space of the first process 311.

[0138] Optionally, the first container 310 determines the address offset as the difference between the first address and the first start address, where the first start address is the start address of the virtual memory space mapped from the physical memory space to the second process 321. The first container 310 determines the second address as the sum of the address offset and the second start address, where the second start address is the start address of the virtual memory space mapped from the physical memory space to the first process 311.

[0139] Optionally, the first address is an offset of the target address and the start address of the physical memory space respectively mapped to the address of the virtual memory space of the second process 321. The first container 310 determines the second address as the sum of the first address and the second start address, and the second start address is the start address of the physical memory space mapped to the virtual memory space of the first process.

[0140] Step 506: The first container 310 accesses data based on the second address.

[0141] As a possible implementation manner, when the data access request is a write request, the first container 310 determines a target space based on the second address and writes data into the target space.

[0142] As a possible implementation manner, when the data access request is a read request, the first container 310 determines a target space based on the second address and reads data in the target space.

[0143] Based on the above Figure 5As described in steps 501 to 506, the two virtual memory spaces of the first process 311 and the second process 321 are mapped to the same physical memory space, that is, the first process 311 and the second process 321 share the same physical memory space. When the first container 310 needs to access the target data, it only sends the access request containing the data identifier of the target data to the second container 320. The second container 320 returns to the first container 310 the first address of the target space storing the target data mapped to the virtual memory space of the second process 321. The first container can determine the second address of the virtual memory space of the first process 311 mapped to the target space based on the first address, and can directly access the data in the target space based on the second address. In this way, compared with the solution that requires the target data to be transmitted between the container for deploying the model training process and the container for deploying the memory service process, the present application does not need to transmit the target data between containers, thereby improving the I / O service performance between containers.

[0144] The above describes Figure 3 The complete process of reading and writing memory between the first container 310 and the second container 320 in the cloud platform 300 is shown in FIG. Figure 4 The process of creating a shared memory for the first container 410 and the second container 420 in FIG. Figure 6 A schematic diagram of a shared memory creation process provided in an embodiment of the present application. Figure 6 The first container 410 and the second container 420 can refer to the aforementioned Figure 4 The relevant description is not repeated here. Figure 6 As shown, the shared memory creation process may include steps 601 to 609.

[0145] Step 601: The shared memory management module 424 of the second container 420 creates a shared memory using memory mapping when the memory service process is started.

[0146] Step 602: The shared memory address management module 425 of the second container 420 records the first starting address of the shared memory mapped to the virtual memory space in the memory service process.

[0147] Step 603 : The shared memory management module 424 of the second container 420 hands over the created shared memory to the shared memory space management module 423 for management.

[0148] Step 604: The shared memory space management module 423 of the second container 420 manages the allocation and release of the shared memory.

[0149] Step 605: When the task process is started, the shared memory management module 412 of the first container 410 calls the memory read / write interface of the SDK of the memory service process to trigger the shared memory negotiation.

[0150] Step 606: The shared memory management module 424 of the second container 420 fills in the file descriptor of the shared memory.

[0151] Step 607: The shared memory management module 412 of the first container 410 obtains the file descriptor of the shared memory using multi-process (domain socket) communication.

[0152] Step 608: The shared memory management module 412 of the first container 410 uses the acquired file descriptor to complete the mapping of the shared memory through memory mapping of the file descriptor.

[0153] Step 609: The shared memory address management module 413 of the first container 410 records the second starting address of the shared memory mapped to the virtual memory space of the task process.

[0154] Based on the above Figure 6 As described in steps 601 to 609, the first container 410 and the second container 420 map the virtual memory space of the task process and the virtual memory space of the memory service process to the same physical memory space by means of memory mapping. According to the recorded first starting address and second starting address, the address conversion from the first address to the second address can be realized, and data can be directly accessed in the target space based on the second address. This avoids data transmission between containers. The memory service process and the task process are respectively deployed in different containers of the physical node, which has the advantages of low coupling and fault domain isolation, and the physical node can provide high-bandwidth I / O services.

[0155] The above describes Figure 4 The first container 410 and the second container 420 in the cloud platform 400 shown in FIG. 4 perform a shared memory creation process. Next, a specific example is given. Figure 4 The process of performing an inter-container memory writing method on the first container 410 and the second container 420 in FIG. 4 is described. Figure 7 A flowchart of a method for writing memory between containers provided in an embodiment of the present application. Figure 7 The first container 410 and the second container 420 can refer to the aforementioned Figure 4 The relevant description is not repeated here. Figure 7 As shown, the inter-container memory writing method may include steps 701 to 711.

[0156] Step 701: The read / write memory module 411 of the first container 410 calls the batch write memory service interface provided by the SDK of the memory service process.

[0157] Step 702 : The read / write memory module 411 of the first container 410 sends a batch write request to the second container 420 .

[0158] Step 703: The read / write memory module 421 of the second container 420 receives a batch write request.

[0159] Step 704: The read / write memory module 421 of the second container 420 applies for a target space for each first key in the batch write request.

[0160] Step 705: The shared memory space management module 423 of the second container 420 allocates a target space for each first key in the shared memory.

[0161] Step 706: The metadata management module 422 of the second container 420 records the metadata of the batch write request.

[0162] Among them, the metadata index is each first key value, the metadata value is the first address of the target space allocated to the target data identified by each first key and the corresponding data length, and the first address is the target address of the target space mapped to the address of the virtual memory space of the memory service process.

[0163] Step 707: The shared memory address management module 425 of the second container 420 obtains the address offset corresponding to each first address according to each first address and the first start address.

[0164] Step 708 : The read / write memory module 421 of the second container 420 returns each address offset to the first container 410 .

[0165] Step 709 : The read / write memory module 411 of the first container 410 receives each address offset returned by the second container 420 .

[0166] Step 710: The shared memory address management module 413 of the first container 410 obtains each second address according to each address offset and the second starting address.

[0167] Step 711: The read / write memory module 411 of the first container 410 writes data into the target space corresponding to each second address.

[0168] Based on the above Figure 7As described in steps 701 to 711, the memory service process running in the second container 420 provides the ability to write memory in batches, and a write request can carry multiple keys, thereby further reducing the communication overhead between the SDK and the memory service process.

[0169] The above describes Figure 4 The method for performing inter-container memory writing between the first container 410 and the second container 420 in the cloud platform 400 shown in FIG. 4 is described below with a specific example. Figure 4 The process of performing an inter-container memory read method on the first container 410 and the second container 420 in FIG. 4 is described. Figure 8 A flowchart of a method for reading memory between containers provided in an embodiment of the present application. Figure 8 The first container 410 and the second container 420 can refer to the aforementioned Figure 4 The relevant description is not repeated here. Figure 8 As shown, the inter-container memory writing method may include steps 801 to 810.

[0170] Step 801: The read / write memory module 411 of the first container 410 calls the batch read memory service interface provided by the SDK of the memory service process.

[0171] Step 802 : The read / write memory module 411 of the first container 410 sends a batch read request to the second container 420 .

[0172] Step 803: The read / write memory module 421 of the second container 420 receives a batch read request.

[0173] Step 804: The read / write memory module 421 of the second container 420 queries metadata information according to each second key in the batch read request.

[0174] Step 805: The metadata management module 422 of the second container 420 reads the first address and data length of the target space corresponding to each second key.

[0175] Step 806: The shared memory address management module 425 of the second container 420 obtains the address offset corresponding to each first address according to each first address and the first start address.

[0176] Step 807 : The read / write memory module 421 of the second container 420 returns each address offset to the first container 410 .

[0177] Step 808 : The read / write memory module 411 of the first container 410 receives each address offset returned by the second container 420 .

[0178] Step 809: The shared memory address management module 413 of the first container 410 obtains each second address according to each address offset and the second starting address.

[0179] Step 810: The read / write memory module 411 of the first container 410 reads data in the target space corresponding to each second address, and outputs and displays it on the read request interface.

[0180] Based on the above Figure 8 As described in steps 801 to 810, the memory service process running in the second container 420 provides the ability to read memory in batches, and a read request can carry multiple keys, thereby further reducing the communication overhead between the SDK and the memory service process.

[0181] The above describes in detail the method for reading and writing memory between containers provided by this embodiment. Fig. 9 , describing the inter-container memory reading and writing device provided by this embodiment.

[0182] Fig. 9 Schematic diagram of the structure of a possible inter-container memory read / write device 900 provided in an embodiment of the present application. The inter-container memory read / write device 900 can be used to implement the inter-container memory read / write function of the physical node in the above method embodiment, so as to achieve the beneficial effects of the above method embodiment. In this embodiment, the inter-container memory read / write device 900 can be Figure 3 The first container 310 or Figure 4 The first container 410 in the embodiment may also be a module (such as a chip) applied to the first container 310 or the first container 410.

[0183] The inter-container memory reading and writing device 900 includes a transceiver module 901 , an address conversion module 902 and a data access module 903 .

[0184] The transceiver module 901 is used to send a data access request to the second container; the data access request is used to indicate data access to the target data, and the data access request includes the data identifier of the target data; receive the first address sent by the second container; the first address is the address of the target address mapped to the virtual memory space of the second process, and the target address is the address of the target space storing the target data in the physical memory space. For example, the transceiver module 901 is used to execute the above Figure 5 The transceiver module 901 may be the step 501 and step 504 in the above Figure 4 The read-write memory module 411 in.

[0185] The address conversion module 902 is used to convert the first address into a second address; the second address is the address of the virtual memory space of the first process mapped to the target address. Figure 5 The address conversion module 902 may be the above Figure 4 The shared memory address management module 413 in.

[0186] The data access module 903 is used to access data based on the second address. For example, the data access module 903 is used to execute the above Figure 5 Step 506 in the above. Data access module 903 can be Figure 4 The read-write memory module 411 in.

[0187] As a possible implementation manner, the target data includes multiple target data, the multiple target data include first target data, and the data access request includes a first data identifier of the first target data; the data access request is used to indicate data access to the multiple target data.

[0188] As a possible implementation method, the address conversion module 902 is specifically used to determine the second address corresponding to the first address based on the correspondence between the first address, the address of the virtual memory space mapped to the second process by the physical memory space, and the address mapped to the virtual memory space of the first process.

[0189] As a possible implementation method, the address conversion module 902 is specifically used to determine the address offset as the difference between the first address and the first starting address; the first starting address is the starting address of the virtual memory space mapped from the physical memory space to the second process; and determine the second address as the sum of the address offset and the second starting address, and the second starting address is the starting address of the virtual memory space mapped from the physical memory space to the first process.

[0190] As a possible implementation method, the first address is the offset of the target address and the starting address of the physical memory space mapped to the address of the virtual memory space of the second process respectively; the address conversion module 902 is specifically used to determine that the second address is the sum of the first address and the second starting address, and the second starting address is the starting address of the physical memory space mapped to the virtual memory space of the first process.

[0191] It should be understood that the inter-container memory reading and writing device 900 of the embodiment of the present application can be implemented by hardware. For example, the hardware may refer to a processor or a controller, etc. For example, the processor or controller may include a graphics processing unit (GPU), a neural network processing unit (NPU), an application specific integrated circuit (ASIC), or a programmable logic device (PLD), and the above-mentioned PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. Implementation by software Figure 5 In the method shown, the inter-container memory reading and writing device 900 and its various modules may also be software modules.

[0192] Fig.10 A schematic diagram of the structure of a possible inter-container memory read / write device 1000 provided in an embodiment of the present application. The inter-container memory read / write device 1000 can be used to implement the inter-container memory read / write function of the physical node in the above method embodiment, and thus can also achieve the beneficial effects of the above method embodiment. In this embodiment, the inter-container memory read / write device 1000 can be Figure 3 The second container 320 or Figure 4 The second container 420 in the embodiment may also be a module (such as a chip) applied to the second container 320 or the second container 420.

[0193] The inter-container memory reading and writing device 1000 includes a receiving module 1001 and a sending module 1002 .

[0194] The receiving module 1001 is used to receive a data access request sent by the first container; the data access request is used to indicate data access to the target data, and the data access request includes a data identifier of the target data. Figure 5 The receiving module 1001 may be the step 502 of the above Figure 4 The read-write memory module 421 in.

[0195] The sending module 1002 is used to send a first address to the first container according to the data identifier, wherein the target address is the address of the target space storing the target data in the physical memory space. Figure 5 The sending module 1002 may be the step 503 of the above Figure 4 The shared memory space management module 423 in.

[0196] As a possible implementation, the target data includes multiple target data, the multiple target data include first target data, and the data access request includes a first data identifier of the first target data; the sending module 1002 is specifically used to determine, according to the first data identifier in the data access request, a first address of a first target space corresponding to the first data identifier; the data access request is used to indicate data access to the multiple target data, the first address is an address of the first target address mapped to the virtual memory space of the second process, and the first target address is an address of the first target space storing the first target data in the physical memory space; the first address is sent to the first container.

[0197] As a possible implementation method, the data access request is a write request, and the write request includes the data identifier and the data length of the target data; the sending module 1002 is specifically used to allocate the target space of the data length for the target data in the physical memory space; the target space corresponds to the data identifier; determines that the target address is mapped to the first address of the virtual memory space of the second process; and sends the first address to the first container.

[0198] As a possible implementation method, the data access request is a read request, and the sending module 1002 specifically determines the first address of the target space corresponding to the data identifier based on the data identifier and the identifier corresponding to each allocated space in the physical memory space; and sends the first address to the first container.

[0199] It should be understood that the inter-container memory reading and writing device 1000 of the embodiment of the present application can be implemented by hardware. For example, the hardware may refer to a processor or a controller, etc. For example, the processor or controller may include a graphics processing unit (GPU), a neural network processing unit (NPU), an application specific integrated circuit (ASIC), or a programmable logic device (PLD), and the above-mentioned PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. Implementation by software Figure 5 In the method shown, the inter-container memory reading and writing device 1000 and its various modules may also be software modules.

[0200] The present application also provides a computing device, please refer to Fig.11 , Fig.11 A schematic diagram of a computing device provided in an embodiment of the present application. The computing device 1100 includes a memory 1101, a processor 1102, a communication interface 1103, and a bus 1104. The memory 1101, the processor 1102, and the communication interface 1103 are connected to each other through the bus 1104.

[0201] The memory 1101 may be a read-only memory, a static storage device, a dynamic storage device or a random access memory. The memory 1101 may store computer instructions. When the computer instructions stored in the memory 1101 are executed by the processor 1102, the processor 1102 and the communication interface 1103 are used to execute the steps in the inter-container memory reading and writing method. For example, the processor 1102 is used to execute the above Figure 5 The steps in the method for reading and writing memory between containers shown in the figure, and the above Fig. 9 The inter-container memory reading and writing device 900 or Fig.10 The function of the inter-container memory reading and writing device 1000.

[0202] The processor 1102 may be a general-purpose CPU, an application specific integrated circuit (ASIC), a GPU or any combination thereof. The processor 1102 may include one or more chips.

[0203] The communication interface 1103 uses a transceiver module such as, but not limited to, a transceiver to implement communication between the computing device 1100 and other devices or communication networks.

[0204] The bus 1104 may include a path for transmitting information between various components of the computing device 1100 (eg, the memory 1101 , the processor 1102 , and the communication interface 1103 ).

[0205] The computing device 1100 may be a computer (e.g., a server) in a cloud data center, or a computer in an edge data center, or a terminal. Figure 3 or Figure 4 Nodes in .

[0206] The method steps in this embodiment can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a terminal device. Of course, the processor and the storage medium can also exist as discrete components in a network device or a terminal device.

[0207] The present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the following steps: Figure 5 The method for reading and writing memory between containers is shown.

[0208] The present application also provides a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to store data such as Figure 5 The method for reading and writing memory between containers is shown.

[0209] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instruction may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a digital video disc (DVD); it may also be a semiconductor medium, for example, a solid state drive (SSD). The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for reading and writing memory between containers, characterized in that: Applied to a cloud platform, the cloud platform includes a first node, the first node is deployed with a first container and a second container, the first container is used to run a first process for executing tasks, the second container is used to run a second process for managing memory, the virtual memory space of the first process and the virtual memory space of the second process are mapped to the same physical memory space, the method includes: The first container sends a data access request to the second container; the data access request is used to instruct data access to target data, and the data access request includes a data identifier of the target data; The second container sends a first address to the first container according to the data identifier; the first address is an address of a target address mapped to a virtual memory space of the second process, and the target address is an address of a target space storing the target data in the physical memory space; The first container converts the first address into a second address; the second address is an address of the virtual memory space of the first process mapped with the target address; The first container accesses data based on the second address.

2. The method according to claim 1, characterized in that: The target data includes a plurality of target data, the plurality of target data includes first target data, and the data access request includes a first data identifier of the first target data; The second container sends the first address to the first container according to the data identifier, including: The second container determines, according to the first data identifier in the data access request, a first address of a first target space corresponding to the first data identifier; the data access request is used to instruct data access to the multiple target data, the first address is an address of the first target address mapped to the virtual memory space of the second process, and the first target address is an address of the first target space storing the first target data in the physical memory space; The second container sends the first address to the first container.

3. The method according to claim 1 or 2, characterized in that: The first container converts the first address into a second address, including: The first container determines a second address corresponding to the first address according to a correspondence between the first address, an address of a virtual memory space of the second process mapped from the physical memory space, and an address mapped to the virtual memory space of the first process.

4. The method according to claim 3, characterized in that: The first container determines, according to the first address, a correspondence between an address of the virtual memory space of the second process mapped from the physical memory space and an address mapped to the virtual memory space of the first process, a second address corresponding to the first address, including: The first container determines that the address offset is the difference between the first address and a first starting address; the first starting address is the starting address of the virtual memory space of the second process mapped from the physical memory space; The first container determines that the second address is the sum of the address offset and a second starting address, where the second starting address is a starting address of the physical memory space mapped to the virtual memory space of the first process.

5. The method according to claim 3, characterized in that: The first address is an offset of the target address and the start address of the physical memory space respectively mapped to the address of the virtual memory space of the second process; the first container determines the second address corresponding to the first address according to the first address, the correspondence between the address of the physical memory space mapped to the virtual memory space of the second process and the address mapped to the virtual memory space of the first process, including: The first container determines that the second address is the sum of the first address and a second starting address, where the second starting address is a starting address of the virtual memory space of the first process mapped from the physical memory space.

6. The method according to any one of claims 1 to 5, characterized in that: The data access request is a write request, and the write request includes the data identifier and the data length of the target data; the second container sends the first address to the first container according to the data identifier, including: The second container allocates the target space of the data length for the target data in the physical memory space; the target space corresponds to the data identifier; The second container determines that the target address is mapped to a first address in the virtual memory space of the second process; The second container sends the first address to the first container.

7. The method according to any one of claims 1 to 5, characterized in that: The data access request is a read request, and the second container sends a first address to the first container according to the data identifier, including: The second container determines, according to the data identifier and an identifier corresponding to each allocated space in the physical memory space, a first address of the target space corresponding to the data identifier; The second container sends the first address to the first container.

8. A method for reading and writing memory between containers, characterized in that: The method is applied to a cloud platform and executed by a first container deployed in a first node of the cloud platform, wherein the first node is also deployed with a second container, wherein the first container is used to run a first process for executing tasks, and the second container is used to run a second process for managing memory, wherein the virtual memory space of the first process and the virtual memory space of the second process are mapped to the same physical memory space, and the method comprises: Sending a data access request to the second container; the data access request is used to instruct data access to target data, and the data access request includes a data identifier of the target data; receiving a first address sent by the second container; the first address is an address of a target address mapped to a virtual memory space of the second process, and the target address is an address of a target space storing the target data in the physical memory space; Convert the first address to a second address; the second address is an address of the virtual memory space of the first process mapped with the target address; Data access is performed based on the second address.

9. The method according to claim 8, characterized in that The target data includes multiple target data, the multiple target data includes first target data, and the data access request includes a first data identifier of the first target data; the data access request is used to instruct data access to the multiple target data.

10. The method according to claim 8 or 9, characterized in that: The converting the first address into a second address comprises: The second address corresponding to the first address is determined according to the correspondence between the first address, the address of the virtual memory space mapped to the second process by the physical memory space, and the address mapped to the virtual memory space of the first process.

11. The method according to claim 10, characterized in that The determining, according to the first address, a correspondence between an address of the physical memory space mapped to the virtual memory space of the second process and an address mapped to the virtual memory space of the first process, a second address corresponding to the first address comprises: Determine the address offset as a difference between the first address and a first starting address; the first starting address is a starting address of the virtual memory space mapped from the physical memory space to the second process; The second address is determined to be the sum of the address offset and a second starting address, where the second starting address is a starting address of the virtual memory space mapped from the physical memory space to the first process.

12. The method according to claim 10, characterized in that The first address is an offset of the target address and the starting address of the physical memory space respectively mapped to the address of the virtual memory space of the second process; the determining the second address corresponding to the first address according to the correspondence between the first address, the address mapped from the physical memory space to the virtual memory space of the second process, and the address mapped to the virtual memory space of the first process comprises: The second address is determined to be the sum of the first address and a second starting address, where the second starting address is a starting address of the virtual memory space mapped from the physical memory space to the first process.

13. A method for reading and writing memory between containers, characterized in that: The method is applied to a cloud platform and executed by a second container deployed in a first node of the cloud platform, wherein the first node is also deployed with a first container, the first container is used to run a first process for executing tasks, the second container is used to run a second process for managing memory, and the virtual memory space of the first process and the virtual memory space of the second process are mapped to the same physical memory space. The method includes: receiving a data access request sent by the first container; the data access request is used to instruct data access to target data, and the data access request includes a data identifier of the target data; According to the data identifier, a first address is sent to the first container, where the first address is an address of a target address mapped to a virtual memory space of the second process, and the target address is an address of a target space storing the target data in the physical memory space.

14. The method according to claim 13, characterized in that The target data includes a plurality of target data, the plurality of target data includes first target data, and the data access request includes a first data identifier of the first target data; The sending the first address to the first container according to the data identifier includes: Determine, according to the first data identifier in the data access request, a first address of a first target space corresponding to the first data identifier; the data access request is used to instruct data access to the multiple target data, the first address is an address of the first target address mapped to the virtual memory space of the second process, and the first target address is an address of the first target space storing the first target data in the physical memory space; The first address is sent to the first container.

15. The method according to claim 13 or 14, characterized in that The data access request is a write request, and the write request includes the data identifier and the data length of the target data; and sending the first address to the first container according to the data identifier includes: Allocate the target space of the data length for the target data in the physical memory space; the target space corresponds to the data identifier; Determine that the target address is mapped to a first address of the virtual memory space of the second process; The first address is sent to the first container.

16. The method according to claim 13 or 14, characterized in that The data access request is a read request, and sending the first address to the first container according to the data identifier includes: Determine a first address of the target space corresponding to the data identifier according to the data identifier and an identifier corresponding to each allocated space in the physical memory space; The first address is sent to the first container.

17. A container-to-container memory reading and writing device, characterized in that: The device comprises: a transceiver module, configured to send a data access request to a second container; the data access request is used to indicate data access to target data, and the data access request includes a data identifier of the target data; receive a first address sent by the second container; the first address is an address of a virtual memory space of a second process mapped with the target address, and the target address is an address of a target space storing the target data in a physical memory space; An address conversion module, used for converting the first address into a second address; the second address is an address of the virtual memory space of the first process mapped with the target address; A data access module is used to access data based on the second address.

18. A memory reading and writing device between containers, characterized in that: The device comprises: A receiving module, configured to receive a data access request sent by the first container; the data access request is used to instruct data access to target data, and the data access request includes a data identifier of the target data; A sending module is used to send a first address to the first container according to the data identifier, wherein the target address is an address of a target space storing the target data in the physical memory space.

19. A cloud platform, characterized in that: comprising a first node, the first node being used to perform the operation steps of the method described in any one of claims 8 to 16; Alternatively, the first node of the cloud platform includes a first container and a second container. When the cloud platform is used to execute an inter-container memory read and write process, the first container and the second container execute the operation steps of the method described in any one of claims 1 to 7.

20. A computing device, characterized in that It comprises a memory and a processor, wherein the memory is used to store at least one set of computer instructions; when the processor executes the at least one set of computer instructions, the operation steps of the method described in any one of claims 1 to 16 are performed.

21. A computer-readable storage medium, characterized in that: include: Computer software instructions; when the computer software instructions are executed in a controller, the controller executes the method according to any one of claims 1 to 16.