WO2023065809A1 - Cdn网元容器配置方法、读写方法、装置、设备及存储介质 - Google Patents

Cdn网元容器配置方法、读写方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2023065809A1
WO2023065809A1 PCT/CN2022/114284 CN2022114284W WO2023065809A1 WO 2023065809 A1 WO2023065809 A1 WO 2023065809A1 CN 2022114284 W CN2022114284 W CN 2022114284W WO 2023065809 A1 WO2023065809 A1 WO 2023065809A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
network element
file system
cdn network
distributed file
Prior art date
Application number
PCT/CN2022/114284
Other languages
English (en)
French (fr)
Inventor
毛文庆
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2023065809A1 publication Critical patent/WO2023065809A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Definitions

  • the embodiments of the present application relate to the technical field of communications, and in particular to a method for configuring a CDN network element container, a method for reading and writing, a device, a device, and a storage medium.
  • a content distribution network (virtual Content Delivery Network, CDN) is a related technology that pushes content to the service node closest to the user, so that the user can access the content nearby.
  • CDN virtual Content Delivery Network
  • Using CDN for content transmission can greatly improve the corresponding speed for users to obtain content, and also greatly reduce the bandwidth pressure of content transmission on the backbone network.
  • the operator sinks the CDN edge nodes to the mobile edge computing platform, switches from the deployment mode based on physical machines to the virtualization deployment mode of the edge computing platform, and the virtualized CDN edge nodes can release most of the central processing unit, memory and disk Resource sharing with edge computing.
  • the virtualization technology based on hardware resources of virtual machines has a greater performance loss, so the container method is usually the best choice for CDN deployment of edge cloud platforms.
  • the container-based CDN storage method mainly adopts the following solutions: (1) Specify a privileged mode for the container, mount a specific host disk to the container, and the cache software directly writes to the raw disk through the container; (2) Create a data volume And mount it to the corresponding container to realize the association between the process in the container and the host file system, and realize the reading and writing of data.
  • the above two schemes need to copy each other between user memory and kernel memory during file reading and writing. When faced with a large number of file reading and writing, the performance of file reading and writing will be seriously affected. Therefore, for I/O-intensive services such as CDN , has been difficult to meet the needs of current network users.
  • Embodiments of the present application provide a CDN network element container configuration method, reading and writing method, device, equipment, and storage medium.
  • the embodiment of the present application provides a CDN network element container instantiation configuration method.
  • the CDN network element container is deployed on a host machine, and the host machine kernel platform is installed on the host machine.
  • the method includes: initializing Configure one or more CDN network element containers; obtain inter-process communication configuration information and distributed file system capability information; configure inter-process communication configuration parameters according to the inter-process communication configuration information, so that the CDN network element container and the destination
  • the host kernel platform implements inter-process communication; according to the capability information of the distributed file system, a data interaction channel between the CDN network element container and the distributed file system is established to complete the instantiation configuration of the CDN network element container.
  • the embodiment of the present application provides a method for writing data in a CDN network element container, which is applied to a CDN network element container communicated with a host kernel platform, and the host kernel platform includes a distributed file system server and a shared memory , the CDN network element container includes a distributed file system client, and both the distributed file system client and the distributed file system server can access the shared memory; the method includes: obtaining a logical storage path; Using the distributed file system client, write the data to be written into the shared memory; using the distributed file system client, send the logical storage path and data write request information to the distributed file through inter-process communication The system server, so that the distributed file system server obtains the data to be written in the shared memory to perform a data write operation according to the data write request information.
  • the embodiment of the present application provides a method for writing data in a CDN network element container, which is applied to a host kernel platform that communicates with a CDN network element container, and the host kernel platform includes a distributed file system server and a shared memory , the CDN network element container includes a distributed file system client, and the distributed file system client and the distributed file system server access the shared memory; the method includes: obtaining a logical storage path and writing data Request information, the logical storage path is generated by the CDN network element container according to the file storage identifier and the corresponding container path; the distributed file system server obtains the data to be written from the shared memory according to the data write request information Data: write the data to be written into the corresponding disk space according to the logical storage path.
  • the embodiment of the present application provides a method for reading data of a CDN network element container, which is applied to a CDN network element container.
  • the CDN network element container is located on a host machine, and a host machine kernel platform is installed on the host machine.
  • the CDN network element container communicates with the host kernel platform, the host kernel platform includes a distributed file system server and shared memory, the CDN network element container includes a distributed file system client, and the distributed The file system client and the distributed file system server access the shared memory; the method includes: obtaining a logical storage path; sending the logical storage path and data read request information to the distributed file system through inter-process communication The file system server, so that the distributed file system server obtains the data to be read from the shared memory to perform a data read operation according to the data read request information.
  • the embodiment of the present application provides a method for reading data of a CDN network element container, which is applied to a host machine.
  • the CDN network element container is located on the host machine, and the host machine kernel platform is installed on the host machine.
  • the CDN network element container communicates with the host kernel platform, the host kernel platform includes a distributed file system server and shared memory, the CDN network element container includes a distributed file system client, and the distributed file system The client and the distributed file system server access the shared memory;
  • the method includes: obtaining a logical storage path and data read request information, the logical storage path is the CDN network element container according to the file storage identifier and the corresponding container path generation;
  • the distributed file system server uses the logical storage path to obtain the location identifier of the data to be read according to the data read request information; copies the data to be read to the shared location according to the location identifier memory, so that the distributed file system client can read the data to be read from the shared memory by means of inter-process communication.
  • the embodiment of the present application provides a CDN network element container instantiation configuration device, the CDN network element container is deployed on a host machine, a host machine kernel platform is installed on the host machine, and the host machine kernel platform Including a distributed file system server, the device includes: an initial configuration module for initial configuration of one or more CDN network element containers; a configuration information acquisition module for obtaining configuration information of the CDN network element container, the The configuration information includes: inter-process communication configuration information and distributed file system capability information; an inter-process communication configuration module configured to configure inter-process communication configuration parameters according to the inter-process communication configuration information, so that the CDN network element container and The host kernel platform implements inter-process communication; the distributed file system server configuration module is used to configure the distributed file system server according to the distributed file system capability information, so as to complete the instantiation of the CDN network element container configuration.
  • the embodiment of the present application provides a device for writing data to a CDN network element container, which is applied to a host kernel platform that communicates with a CDN network element container, and the host kernel platform includes a distributed file system server and a shared memory , the CDN network element container includes a distributed file system client, and the distributed file system client and the distributed file system server access the shared memory;
  • the device includes: a first acquisition logical storage path module , used to obtain a logical storage path and data write request information, the logical storage path is generated by the CDN network element container according to the file storage identifier and the corresponding container path; obtain a data module to be written, used for the distributed file system service
  • the terminal obtains the data to be written from the shared memory according to the data write request information; the writing disk space module is used to write the data to be written into the corresponding disk space according to the logical storage path.
  • the embodiment of the present application provides a device for reading data of a CDN network element container, which is applied to a host machine, the CDN network element container is located on the host machine, the host machine kernel platform is installed on the host machine, and the CDN network element container is installed on the host machine.
  • the network element container communicates with the host kernel platform, the host kernel platform includes a distributed file system server and shared memory, the CDN network element container includes a distributed file system client, and the distributed file system The client and the distributed file system server access the shared memory; the device includes: a second acquiring logical storage path module, configured to acquire logical storage paths and data read request information, the logical storage paths being the The CDN network element container is generated according to the file storage identifier and the corresponding container path; the acquisition location identifier module is used for the distributed file system server to obtain the location identifier of the data to be read by using the logical storage path according to the data read request information ; The module for reading the data to be read is used to copy the data to be read to the shared memory according to the location identifier, so that the distributed file system client can use the inter-process communication method from the shared memory Read the data to be read.
  • an embodiment of the present application provides a computer device, including a processor and a memory; the memory is used to store a program; and the processor is used to execute any one of the first to fifth aspects according to the program.
  • the described image processing method to be diagnosed is used to diagnose a ninth aspect.
  • the embodiment of the present application provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to execute the waiting image described in any one of the first aspect to the fifth aspect. Approach.
  • FIG. 1 is a schematic diagram of a CDN network element container storage architecture provided by an embodiment of the present application
  • Fig. 2 is a flowchart of a CDN network element container instantiation configuration method provided by an embodiment of the present application
  • Fig. 3 is another flow chart of the CDN network element container instantiation configuration method provided by one embodiment of the present application.
  • Fig. 4 is another flow chart of the CDN network element container instantiation configuration method provided by one embodiment of the present application.
  • Fig. 5 is another schematic diagram of the CDN network element container storage architecture provided by an embodiment of the present application.
  • FIG. 6 is another flow chart of a CDN network element container instantiation configuration method provided by an embodiment of the present application.
  • FIG. 7 is a flowchart of a method for writing data to a CDN network element container provided by an embodiment of the present application.
  • FIG. 8 is another flowchart of a method for writing data to a CDN network element container provided by an embodiment of the present application.
  • FIG. 9 is a flowchart of a method for writing data to a CDN network element container provided by an embodiment of the present application.
  • FIG. 10 is another flowchart of a method for writing data to a CDN network element container provided by an embodiment of the present application.
  • FIG. 11 is another flow chart of a method for writing data to a CDN network element container provided by an embodiment of the present application.
  • FIG. 12 is a flowchart of a method for reading data from a CDN network element container provided by an embodiment of the present application
  • FIG. 13 is another flowchart of a method for reading data by a CDN network element container provided by an embodiment of the present application
  • Fig. 14 is a CDN network element container reading data method provided by an embodiment of the present application.
  • FIG. 15 is another flow chart of a method for reading data from a CDN network element container provided by an embodiment of the present application.
  • FIG. 16 is another flowchart of a method for reading data by a CDN network element container provided by an embodiment of the present application.
  • FIG. 17 is a structural block diagram of a CDN network element container instantiation configuration device provided by an embodiment of the present application.
  • FIG. 18 is a structural block diagram of an apparatus for writing data to a CDN network element container provided by an embodiment of the present application.
  • FIG. 19 is a structural block diagram of an apparatus for reading data from a CDN network element container provided by an embodiment of the present application.
  • references to “one embodiment” or “some embodiments” described in the description of the embodiments of the present application mean that specific features described in conjunction with the embodiments of the present application are included in one or more embodiments of the embodiments of the present application. , structure or characteristics.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically stated otherwise.
  • the terms “including”, “comprising”, “having” and variations thereof mean “including but not limited to”, unless specifically stated otherwise.
  • a content distribution network (virtual Content Delivery Network, CDN) is a related technology that pushes content to the service node closest to the user, so that the user can access the content nearby.
  • CDN virtual Content Delivery Network
  • Using CDN for content transmission can greatly improve the corresponding speed for users to obtain content, and also greatly reduce the bandwidth pressure of content transmission on the backbone network.
  • the operator sinks the CDN edge node to the mobile edge computing platform, for example, sharing the underlying hardware of the edge computing platform with computing applications such as face recognition and edge transcoding.
  • the virtual content delivery network (virtual content delivery network, VCDN) solution based on the edge cloud architecture has gradually become the choice of major operators.
  • the virtualized CDN edge nodes can release most of the CPU, memory, and disk resources, and share resources with edge computing.
  • virtual machines based on hardware resource virtualization technology have greater performance loss, so containers are usually the best choice for edge cloud platform CDN deployment.
  • CDN is a node that provides streaming services in audio and video related services.
  • network users there are more and more network users based on operators and Internet-based video users.
  • the complexity of service categories and the scale of tasks are becoming larger and larger. Therefore, it will bring about a problem that the task execution time is too long, which greatly affects the user experience.
  • containerized CDN scenarios if only improving the performance of CDN node equipment will lead to high CDN costs, it is unacceptable for CDN operators. How to use limited equipment resources in the current CDN network to improve the service quality of vCDN users at the system level has become a problem that needs to be solved.
  • the container-based CDN storage method mainly adopts the following solutions: (1) Specify a privileged mode for the container, mount a specific host disk to the container, and the cache software directly writes to the raw disk through the container; (2) Create The data volume is mounted to the corresponding container to realize the association between the process in the container and the host file system, and realize the reading and writing of data.
  • the above two container storage solutions are general storage solutions for containerized application data persistence, and are implemented using the Portable Operating System Interface of UNIX (POSIX) standard. Although they can meet the needs of users in many application scenarios, However, due to the traditional POSIX standard interface scheme, the user memory and the kernel memory need to be copied to each other during file reading and writing.
  • the embodiment of the present application provides a CDN network element container instantiation configuration method.
  • one or more CDN network element containers are configured through initialization, and then inter-process communication configuration information and distributed file system capabilities are obtained. information, configure inter-process communication configuration parameters according to the inter-process communication configuration information, so that the CDN network element container and the host kernel platform can realize inter-process communication, and establish the CDN network element container and the distributed file system according to the distributed file system capability information
  • the data exchange channel to complete the CDN network element container instantiation configuration.
  • the storage-related services of the CDN network element container can be directly operated from the kernel state during the service process, avoiding the need for storage-related services in related technologies to be processed by the user.
  • the memory and kernel memory are copied to each other, which affects the performance of file reading and writing.
  • Fig. 1 shows a schematic diagram of an exemplary CDN network element container storage architecture to which the technical solutions of the embodiments of the present application can be applied.
  • the CDN container storage architecture is deployed on a host machine, and the host machine includes: an edge cloud platform 110 , a host machine hardware module 200 and a host machine kernel platform 300 .
  • the edge cloud platform 100 is a platform for providing containerized deployment of CDN network elements, that is, the CDN network element container is deployed on the edge cloud platform 100, and the edge cloud platform 100 includes: an orchestration component 110 and a container that is communicatively connected to the orchestration component 110 Set 120, the orchestration component 110 is used to realize the containerized deployment of CDN network elements, the container set 120 contains one or more containers, and each container may also include one or more CDN network element containers 130, CDN network element containers 130 Include distributed file system client 131 in.
  • the host hardware module 200 includes: one or more memories 210 .
  • the storage 210 may be a hard disk, such as a mechanical hard disk (Hard Disk Drive, HDD) and a solid state disk (Solid State Disk, SDD), or may be entirely composed of solid state disks.
  • HDD Hard Disk Drive
  • SDD Solid State Disk
  • the host computer kernel platform 300 runs in the host computer, and it includes: a disk management module 310, a distributed file system server 320 and a shared memory 330, and both the distributed file system client 131 and the distributed file system server 320 can be interprocess
  • the communication mode accesses the shared memory 330 .
  • the disk management module 310 is used to integrate one or more storages 210, such as integrating HDD hard disks and SSD hard disks, and the distributed file system server 320 is used to improve the I/O performance of the storage storage 210, and jointly implement the CDN network element container storage architecture .
  • the edge cloud platform 100 uses kubernetes as a container orchestration system to implement a containerized deployment solution for CDN network elements.
  • the container set 120 may be a pod unit in the kubernetes container system, and the CDN network element container 130 may be a Server container.
  • K8s kubernetes
  • Kubernetes provides an application deployment, planning, update and maintenance mechanism for containers. In the container deployment method, each container is isolated from each other, and each container has its own file system. The processes between containers will not affect each other, and computing resources can be distinguished.
  • Kubernetes is an open source container orchestration engine that supports automated deployment, large-scale scalability, and application container management. When an application is deployed in a production environment, multiple instances of the application are usually deployed to load balance application requests. In Kubernetes, multiple containers can be created, each container runs an application instance, and then through the built-in load balancing strategy, the management, discovery, and access of this group of application instances can be realized.
  • CDN network element containers and storages in Fig. 1 are only illustrative. According to implementation requirements, there may be any number of CDN network element containers and storages.
  • the orchestration component 110 can instantiate and configure the CDN network element container, for example, configure one or more CDN network element containers through initialization, and then obtain the inter-process Communication configuration information and distributed file system capability information, configure the inter-process communication configuration parameters according to the inter-process communication configuration information, so that the CDN network element container and the host kernel platform realize inter-process communication, and establish The data exchange channel between the CDN network element container and the distributed file system to complete the instantiation configuration of the CDN network element container.
  • the storage-related business of the CDN network element container can be directly operated from the kernel state during the service process, avoiding the need for storage-related business in related technologies to be stored in user memory and kernel memory Copying between each other affects the performance of file reading and writing.
  • the storage performance of the CDN network element container can be maximized, which can effectively reduce the delay of CDN-related storage services and improve service performance.
  • system architecture and application scenarios described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute limitations on the technical solutions provided by the embodiments of the present application.
  • Those skilled in the art know that with the system architecture The evolution of the technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
  • the system architecture shown in Figure 1 does not constitute a limitation to the embodiment of the present application, and may include more or less components than those shown in the illustration, or combine some components, or different components layout.
  • the orchestration component can execute the CDN network element container instantiation configuration method of this embodiment.
  • FIG. 2 is a flowchart of a CDN network element container instantiation configuration method provided by an embodiment of the present application, including but not limited to step S1110 and step S1140 .
  • Step S1110 initialize and configure one or more CDN network element containers.
  • the process of initially configuring one or more CDN network element containers includes but is not limited to the following steps:
  • Step S1111 obtaining initial configuration information of one or more CDN network element containers.
  • the initialization configuration information includes: basic information, resource information and service information, wherein the basic information may be network element information, resource information may be CPU information or storage requirement information, etc., and service information may be service type or IP Port information, etc., using the initialization configuration information to implement the initialization work before instantiating the CDN network element container.
  • the classification of the initialization configuration information in the embodiment of the present application is only an illustration, and does not represent a limitation on it. Any information required to complete the initialization of a CDN network element may be the initialization configuration information.
  • Step S1112 generating resource creation information according to the initialization configuration information.
  • Step S1113 initialize and configure one or more CDN network element containers according to the resource creation information.
  • the API server of k8s is requested to generate resource creation information, and then the API server of k8s generates the resource creation information, and initializes the configuration according to the resource creation information
  • One or more CDN network element containers are provided.
  • the resource creation information may be a string in json format, the following is an example of the resource creation information:
  • Step S1120 acquiring the configuration information of the CDN network element container.
  • the configuration information of the CDN network element container is obtained according to the resource creation request, and the configuration information includes: inter-process communication configuration information and distributed file system capability information.
  • the distributed file system capability information can be obtained from the above ("ifdfs":"1").
  • Step S1130 configure inter-process communication configuration parameters according to the inter-process communication configuration information, so that the CDN network element container and the host kernel platform realize inter-process communication.
  • the CDN network element container cannot directly operate in the kernel state of the host machine, so it is necessary to configure the inter-process communication configuration parameters according to the inter-process communication configuration information to realize the CDN network element
  • the container and the host kernel platform implement inter-process communication.
  • the isolation mechanism of the CDN network element container when it performs storage-related operations with the host, it mostly uses the POSIX standard interface.
  • the data read and write in the network element container needs to be read from the kernel buffer of the host to the user buffer of the storage. , and then copy between the core socket buffers of the CDN according to the read and write requirements.
  • the efficiency of this storage copy process is too low, which reduces the storage performance of the CDN network element container.
  • the inter-process communication configuration parameter is a hostIPC parameter.
  • Step S130 configures the inter-process communication configuration parameters according to the inter-process communication configuration information, specifically including: configuring the hostIPC parameter as true.
  • the hostIPC parameter in k8s is set to true, the CDN network element container can communicate with the host kernel platform in the kernel state to realize inter-process communication.
  • the inter-process communication method enables the CDN network element container to be directly carried out in the kernel state during the storage business service process, and the data transmission does not need to be between the user memory (such as the user buffer) and the kernel memory (such as the kernel buffer and the kernel socket buffer). copy each other, and the kernel socket buffer is the buffer related to the kernel socket.
  • the embodiment of the present application can realize the high performance of containerized storage at the system level by using limited equipment resources in the current CDN network without improving the performance of CDN network element node equipment and resulting in high CDN costs, ensuring edge cloud High-performance service of CDN business in the scenario.
  • Step S1140 establishing a data exchange channel between the CDN network element container and the distributed file system according to the capability information of the distributed file system, so as to complete the instantiation configuration of the CDN network element container.
  • the distributed file system capability information is known and the host supports the distributed file system, install the distributed file system server in the host kernel platform, install the corresponding distributed file system client in the CDN network element container, and Create a shared memory in the host kernel platform to establish a data interaction channel, so that both the distributed file system client and the distributed file system server can use the data interaction channel to access the shared memory.
  • the communication between the host container distributed file system client and the distributed file system server is realized through inter-process communication and shared memory.
  • data read and write Perform copy operations between kernel caches and directly operate in kernel mode, without switching between user memory and kernel memory, and without copying data between user memory and kernel memory to implement CDN network elements Container performance maximization processing.
  • step S1140 includes but is not limited to the following steps:
  • Step S1141 Configure a corresponding data volume for the storage directory of the distributed file system server.
  • the distributed file system server is installed on the host kernel platform, and the distributed file directory arrangement is required to configure the corresponding data for the storage directory of the distributed file system server.
  • Volumes implement the mapping between container directories and physical storage.
  • Step S1142 Mount the data volume to the corresponding container path, so that the CDN network element container can perform data interaction with the corresponding data volume of the distributed file system server through the container path.
  • the data volume includes: a first data volume and a second data volume, wherein the first data volume is used to store the first type of data that meets the first performance constraints, and the second data volume is used to store data that does not meet the Data of the second type for the first performance constraint.
  • the first performance constraints include but are not limited to: the frequency of use is less than the first preset frequency of use, the size of the data is smaller than the first preset data size, the data type is the first preset data type, or the delay requirement is greater than The first preset time delay and so on.
  • the first type of data may be: configuration files, data files, and log files. This type of data is relatively small and does not require high latency performance, and is mainly for configuring application scenarios.
  • the second type of data may be streaming media data such as video, audio, etc., and the size of this type of data is large and requires high delay performance.
  • step S1142 the data volume is mounted to the corresponding container path, including but not limited to the following steps:
  • Step S1143 Mount the first data volume to the first container path, so that the first data volume can be called by using the hostpath calling method.
  • the HostPath calling method mounts the files or directories on the host to the CDN network element container in the Pod, and supports the following four mounting modes: 1) DirectoryOrCreate, which means: if the given path None exists on the directory, an empty directory will be created as needed, the permissions are set to 0755, and it has the same group and owner information as Kubelet. 2) Directory, this mode means: a directory must exist on the given path. 3) FileOrCreate, this mode means: if nothing exists on the given path, then an empty file will be created as needed at the given path, the permission is set to 0644, and it has the same group and ownership as Kubelet. 4) File, this mode means: a file must exist on the given path.
  • the first data volume of the host can be mounted on the corresponding path on the CDN network element container where the Pod is located, so that the first data volume is mapped to the inside of the Pod, and in the CDN network element container Dynamically mount the first data volume.
  • Step S1144 Mount the second data volume to the second container path, so that the second data volume can be read and written by using the sendfile read and write method.
  • socket transmission is required for reading and writing.
  • the specific process details are as follows:
  • the write function is called to copy the file data from the user buffer to the kernel socket buffer
  • the sendfile calling method is to call the sendfile function.
  • the sendfile function is an I/O function used to store related services and can transfer data between two file descriptors. Its operation is completely in the kernel , thereby avoiding the data copy between the kernel buffer and the user buffer, and improving the copy efficiency.
  • sendfile (int out_fd, int in_fd, off_t*offset, size_t count), where the in_fd parameter is the file descriptor of the content to be read, and the out_fd parameter is the file description of the content to be written character, the offset parameter specifies where to start reading from the read file stream, if it is empty, the default starting position of the read file stream is used, and the count parameter specifies the number of bytes transferred between the file descriptor in_fd and out_fd. And in_fd must be a file descriptor that supports mmap-like functions, that is, it must point to a real file, not a socket or a pipe, and out_fd must be a socket.
  • the above-mentioned embodiment adopts the sendfile calling method, and the host kernel platform calls sendfile() to copy the hard disk data to the kernel buffer through direct memory access (Direct Memory Access, DMAP), and then the data is directly copied to another by the kernel in the kernel state.
  • the kernel socket buffer is directly operated in the kernel mode, and the copy from one kernel buffer to another kernel buffer is directly completed in the kernel, and data does not need to be copied between the user memory and the kernel memory.
  • direct memory access directly copies data from the kernel buffer to the user's protocol stack, without switching between user memory and kernel mode memory. Since this calling method can improve the storage performance of the CDN network element container, the data in the second data volume that requires high latency performance is read and written to the second data volume in the second container path using the sendfile read and write method .
  • FIG. 5 is another schematic diagram of a CDN network element container storage architecture in an embodiment of the present application.
  • Figure 5 adds related directories of the first data volume and the second data volume, wherein the first data volume directory can be a Linux OS directory, and the first data volume is used to store data that meets the first performance constraints.
  • the first type of data indicates that the second data volume is mounted in the relevant container path of the host kernel platform.
  • the directory of the second data volume may be a DFS directory, and the second data volume is used to store the second type of data that does not meet the first performance constraint condition.
  • This directory indicates that the second data volume is mounted in the relevant container path of the distributed file system server of the host kernel platform. It can be seen from FIG. 5 that the first data volume is mounted in the corresponding container path by using the hostpath calling method, and the second data volume is read and written on the second data volume in the second container path by using the sendfile read and write method.
  • the first data volume can also be mounted in the relevant container path of the distributed file system server of the host kernel platform, that is, the first type of data can also be read by calling sendfile.
  • FIG. 6 it is a flowchart of a CDN network element container instantiation configuration method according to an embodiment of the present application, including but not limited to the following steps.
  • Step S110 Initially configure one or more CDN network element containers.
  • Step S120 Obtain configuration information of the CDN network element container, and perform inter-process communication configuration.
  • the inter-process communication configuration is realized, so that the CDN network element container and the host kernel platform can implement inter-process communication in the kernel state.
  • Step S130 According to the capability information of the distributed file system, determine whether the host machine supports the distributed file system, for example, through the ifdfs parameter, if it supports the distributed file system, proceed to step S140, otherwise proceed to step S160.
  • Step S140 Configure the distributed file system server, and configure the corresponding data volume for the storage directory of the distributed file system server.
  • Step S150 Mount the data volume to the corresponding container path.
  • This step includes mounting the first data volume in the corresponding container path by using the hostpath calling method, and performing read and write operations on the second data volume in the second container path by using the sendfile read and write method, so that the CDN network element
  • the container can exchange data with the data volume corresponding to the distributed file system server through the container path.
  • Step S160 Complete CDN network element container instantiation configuration.
  • the instantiation can be determined according to the actual deployment situation, which is not explicitly limited in this embodiment of the present application.
  • the CDN network element container instantiation configuration method in the embodiment of the present application enables the storage-related services of the CDN network element container to be directly operated from the kernel mode during the service process through the inter-process communication between the CDN network element container and the host platform. Avoid the problem that storage-related services in related technologies need to be copied between user memory and kernel memory, which affects the performance of file reading and writing, and maximize the storage performance of CDN network element containers by reducing the CDN network element container service data processing flow processing, which can effectively reduce the delay of CDN-related storage services and improve service performance.
  • a CDN network element container write data method referring to the CDN network element container storage architecture in Figure 1, the method is applied to the CDN network element container connected to the host machine kernel platform through communication, the host machine
  • the kernel platform includes a distributed file system server and shared memory
  • the CDN network element container includes a distributed file system client. Both the distributed file system client and the distributed file system server can access the shared memory.
  • FIG. 7 is a flowchart of a method for writing data to a CDN network element container provided by an embodiment of the present application, including but not limited to step S2110 and step S2140 .
  • Step S2110 obtaining a logical storage path.
  • step S2110 includes but not limited to the following steps.
  • Step S2111 acquire the file storage identifier.
  • the file storage identifier can be acquired in the following two ways. 1) Obtain the requested service resource type according to the url in the user request information, and extract the file storage identifier from the user request information according to the preset extraction rules.
  • the preset extraction rules can be negotiated and determined in advance with business participants such as operators. For example, extraction rules corresponding to different types of business resources may be specified in advance, or url resource classification rules commonly used in related technologies may be used to obtain file storage identifiers respectively according to different types of business resources.
  • the preset extraction rules are not limited here. 2) Obtain the file storage identifier according to the service characteristics.
  • the service characteristics may be negotiated and determined in advance with service participants such as operators.
  • the file storage identifier may be composed of a preset prefix identifier + url path, each file storage identifier corresponds to a unique code, and the file storage identifier is used as a unique resource file index in the subsequent reading and writing process.
  • Step S2112 generating a logical storage path according to the file storage identifier and the corresponding container path.
  • the container path in the corresponding container mounting directory pre-configured with the above file storage identifier is combined into a logical storage path.
  • Step S2120 using the distributed file system client to write the data to be written into the shared memory.
  • the distributed file system client of the CDN network element container accesses the shared memory by means of inter-process communication, and writes the data to be written into the shared memory.
  • Step S2130 using the distributed file system client to send the logical storage path and data write request information to the distributed file system server through inter-process communication, so that the distributed file system server can write data in the shared memory according to the data write request information Obtain the data to be written in and perform the data writing operation.
  • the distributed file system client of the CDN network element container sends the generated logical storage path and data write request information to the distributed file system server of the host kernel platform through inter-process communication, and the subsequent read
  • the distributed file system server can obtain the data to be written written by the distributed file system client in the shared memory according to the received data write request information, and perform data writing operations.
  • the CDN network element container uses inter-process communication to access the shared memory, writes the data to be written into the shared memory, and then sends the generated logical storage path and data write request information to The distributed file system server, so that the distributed file system server obtains data to be written in the shared memory according to the data write request information to perform data write operations. Since the operation is performed directly from the kernel state, the CDN network element container service data processing flow is reduced, and the storage performance of the CDN network element container is maximized, which can effectively reduce the delay of CDN-related storage services and improve the efficiency of data writing.
  • a CDN network element container write data method referring to the storage architecture of the CDN network element container in Figure 1, the method is applied to the host kernel platform connected to the CDN network element container in communication, the host machine
  • the kernel platform includes a distributed file system server and shared memory
  • the CDN network element container includes a distributed file system client. Both the distributed file system client and the distributed file system server can access the shared memory.
  • FIG. 9 is a flowchart of a method for writing data to a CDN network element container provided by an embodiment of the present application, including but not limited to step S3110 and step S3130 .
  • Step S3110 obtain the logical storage path and data write request information, the logical storage path is generated by the CDN network element container according to the file storage identifier and the corresponding container path, and the logical storage path can be converted into a physical storage path of the storage on the host machine.
  • the distributed file system server receives the logical storage path and data write request information sent by the distributed file system client of the CDN network element container through inter-process communication.
  • Step S3120 the distributed file system server obtains the data to be written from the shared memory according to the data write request information.
  • the data to be written is written by the distributed file system client of the CDN network element container accessing the shared memory by means of inter-process communication.
  • Step S3130 write the data to be written into the corresponding disk space according to the logical storage path.
  • step S3130 includes but is not limited to the following steps.
  • step S3131 the distributed file system server writes the data to be written into the kernel cache according to the data write request information, and generates a memory occupation identifier.
  • the client agent module of the distributed file system server obtains the data to be written from the shared memory by means of inter-process communication, writes the data to be written into the kernel cache according to the data write request information, and generates memory occupancy sign. For example, copy a page of data to be written from the shared memory to the kernel cache (it can be a pre-opened kernel memory area, which is not limited here), and then perform a dirty operation on the relevant area in the kernel cache to identify the area The memory space is already occupied.
  • Step S3132 write the data to be written in the kernel cache into the corresponding disk space according to the logical storage path and the memory occupation identifier.
  • the background server of the distributed file system server fetches the above-mentioned dirty pages according to the memory occupation identifier, and then writes them into the corresponding file access server according to the logical storage path, that is, uses inter-process communication to send the dirty pages to the distributed file system.
  • the system client returns the write success information and releases the relevant pages of the shared memory.
  • the file access server disk thread of the distributed file system server executes an asynchronous write operation, and asynchronously writes the data to be written into the corresponding disk.
  • This asynchronous write operation can guarantee a disk Serving multiple users in parallel improves write efficiency.
  • FIG. 11 is a flowchart of a method for writing data to a CDN network element container provided by an embodiment of the present application, including but not limited to the following steps.
  • Step S210 acquiring logical storage paths and data write request information.
  • the logical storage path is generated by the CDN network element container according to the file storage identifier and the corresponding container path, and the logical storage path can be converted into a physical storage path of the storage on the host machine.
  • step S220 the distributed file system server determines whether there is a logical storage path, and if so, proceeds to step S230, otherwise proceeds to step S250.
  • step S230 the distributed file system server acquires data to be written from the shared memory according to the data write request information.
  • Step S240 write the data to be written into the corresponding disk space according to the logical storage path.
  • step S250 if the logical storage path does not exist, create a logical storage path. After the logical storage path is created, proceed to step S230 to perform data writing operation.
  • the inter-process communication method is used to obtain the data to be written from the shared memory , and then write the data to be written to the corresponding disk space according to the logical storage path. Since the operation is performed directly from the kernel state, the CDN network element container service data processing flow is reduced, and the storage performance of the CDN network element container is maximized, which can effectively reduce the delay of CDN-related storage services and improve the efficiency of data writing.
  • a CDN network element container reading data method referring to the CDN network element container storage architecture in Figure 1, the method is applied to the CDN network element container connected to the host machine kernel platform through communication, the host machine
  • the kernel platform includes a distributed file system server and shared memory
  • the CDN network element container includes a distributed file system client. Both the distributed file system client and the distributed file system server can access the shared memory.
  • FIG. 12 is a flowchart of a method for reading data from a CDN network element container provided by an embodiment of the present application, including but not limited to step S4110 and step S4140 .
  • Step S4110 obtaining a logical storage path.
  • step S4110 includes but not limited to the following steps.
  • Step S4111 acquire the file storage identifier.
  • the file storage identifier can be acquired in the following two ways. 1) Obtain the requested service resource type according to the url in the user request information, and extract the file storage identifier from the user request information according to the preset extraction rules.
  • the preset extraction rules can be negotiated and determined in advance with business participants such as operators. For example, extraction rules corresponding to different service resource types may be specified in advance, or url resource classification rules commonly used in related technologies may be used to obtain file storage identifiers respectively according to different service resource types, and the preset extraction rules are not limited here. 2) Obtain the file storage identifier according to the service characteristics.
  • the service characteristics may be negotiated and determined in advance with service participants such as operators.
  • the file storage identifier may be composed of a preset prefix identifier + url path, each file storage identifier corresponds to a unique code, and the file storage identifier is used as a unique resource file index in the subsequent reading and writing process.
  • Step S4112 generating a logical storage path according to the file storage identifier and the corresponding container path.
  • the container path in the corresponding container mounting directory pre-configured with the above file storage identifier is combined into a logical storage path.
  • Step S4120 send the logical storage path and data read request information to the distributed file system server through inter-process communication, so that the distributed file system server can obtain the data to be read in the shared memory according to the data read request information for data read operate.
  • the distributed file system client of the CDN network element container sends the generated logical storage path and data read request information to the distributed file system server of the host kernel platform through inter-process communication.
  • the distributed file system server can obtain the data to be read in the shared memory according to the received data read request information for data read operation.
  • the CDN network element container sends the generated logical storage path and data read request information to the distributed file system server by means of inter-process communication, so that the distributed file system server According to the data read request information, the data to be read is obtained in the shared memory to perform a data read operation. Since the operation is performed directly from the kernel state, the CDN network element container service data processing flow is reduced, and the storage performance of the CDN network element container is maximized, which can effectively reduce the delay of CDN-related storage services and improve data reading efficiency.
  • the CDN network element container sends the generated logical storage path and data read request information to the distributed file system server by means of inter-process communication, so that the distributed file system server According to the received data read request information, the data to be read can be written into the shared memory for subsequent data read operations. Since the operation is performed directly from the kernel state, the CDN network element container service data processing flow is reduced, and the storage performance of the CDN network element container is maximized, which can effectively reduce the delay of CDN-related storage services and improve the efficiency of data writing.
  • a CDN network element container data reading method referring to the CDN network element container storage architecture in Figure 1, the method is applied to the host kernel platform that communicates with the CDN network element container, the host The kernel platform includes a distributed file system server and shared memory, and the CDN network element container includes a distributed file system client. Both the distributed file system client and the distributed file system server can access the shared memory.
  • FIG. 14 is a flowchart of a method for reading data from a CDN network element container provided by an embodiment of the present application, including but not limited to step S5110 and step S5130 .
  • Step S5110 obtain the logical storage path and data read request information, the logical storage path is generated by the CDN network element container according to the file storage identifier and the corresponding container path, and the logical storage path can be converted into a physical storage path of the storage on the host machine.
  • the distributed file system server receives the logical storage path and data read request information sent by the distributed file system client of the CDN network element container through inter-process communication.
  • Step S5120 the distributed file system server obtains the location identifier of the data to be read by using the logical storage path according to the data read request information.
  • the distributed file system server uses the client proxy module according to the data read request information to access the file location register of the distributed file system corresponding to the logical storage path, and obtains the location identifier from the file location register.
  • the location identifier is obtained by obtaining the chunkid of the file to be read through the file location register, where chunk represents a file, and chunkId is a unique identification id for each file, so the specific storage location of the file to be read can be located according to the chunkid of the file to be read .
  • Step S5130 copy the data to be read to the shared memory according to the location identifier, so that the distributed file system client can read the data to be read from the shared memory by means of inter-process communication.
  • step S5130 includes but is not limited to the following steps.
  • Step S5131 obtain the current data to be read according to the location identifier.
  • Step S5132 obtaining the access frequency value of the current data to be read:
  • the access frequency value of the current data to be read is greater than or equal to the preset access frequency
  • the data to be read is considered to belong to a high-frequency access file, and the high-frequency access file is stored in the shared memory according to a preset access rule Therefore, the file to be read can be obtained directly in the shared memory.
  • the data to be read is considered to be a low-frequency access file.
  • the file access server at the distributed file system server will apply for A piece of kernel cache, the data to be read is written into the kernel cache, the disk thread copies the data to be read from the kernel cache to the shared memory, and the corresponding access frequency value is increased by 1, and the data in the kernel cache can be set according to the preset Cleanup rules for release.
  • the distributed file system server searches for the data to be read according to the logical storage path. If the file does not exist, it sends an error message and the corresponding error code. If the file exists, it sends the data to be read according to the above method. Write to shared memory for read by Distributed File System clients.
  • FIG. 16 is a flowchart of a method for reading data from a CDN network element container provided by an embodiment of the present application, including but not limited to the following steps.
  • Step S310 acquiring logical storage paths and data read request information.
  • the logical storage path is generated by the CDN network element container according to the file storage identifier and the corresponding container path, and the logical storage path can be converted into a physical storage path of the storage on the host machine.
  • step S320 the distributed file system server obtains the data to be written from the shared memory according to the data read request information.
  • step S330 the distributed file system server determines whether the data to be read is frequently accessed data, and if so, proceeds to step S340, otherwise proceeds to step S350.
  • Step S340 copy the data to be read belonging to the high-frequency access data to the shared memory.
  • Step S350 write the data to be read into the kernel cache, and increase the access frequency value, and then enter step S340, copy the data to be read to the shared memory.
  • the distributed file system server uses the inter-process communication method to write the data to be read into the shared memory, so that the CDN network element
  • the distributed file system client of the container can use the inter-process communication method to read the data to be read from the shared memory. Since the operation is performed directly from the kernel state, the CDN network element container service data processing flow is reduced, and the storage performance of the CDN network element container is maximized, which can effectively reduce the delay of CDN-related storage services and improve the efficiency of data writing.
  • a CDN network element container instantiation configuration device is provided.
  • the CDN network element container is deployed on the host machine, and the host machine kernel platform is installed on the host machine.
  • the host machine kernel platform includes distribution Type file system server, the device includes:
  • Initial configuration module 410 configured to initialize and configure one or more CDN network element containers
  • Configuration information acquisition module 420 configured to acquire inter-process communication configuration information and distributed file system capability information
  • the inter-process communication configuration module 430 is used to establish a data interaction channel between the CDN network element container and the distributed file system according to the distributed file system capability information, so as to complete the instantiation configuration of the CDN network element container;
  • the distributed file system server configuration module 440 is configured to configure the distributed file system server according to the distributed file system capability information, so as to complete the CDN network element container instantiation configuration.
  • a device for writing data to a CDN network element container is applied to a host kernel platform that communicates with a CDN network element container.
  • the host kernel platform includes a distributed file system server and a shared Memory
  • the CDN network element container includes the distributed file system client, the distributed file system client and the distributed file system server access the shared memory; the device includes:
  • the first obtaining logical storage path module 510 is used to obtain the logical storage path and data write request information, and the logical storage path is generated by the CDN network element container according to the file storage identifier and the corresponding container path;
  • Obtaining the data to be written module 520 used for the distributed file system server to obtain the data to be written from the shared memory according to the data write request information;
  • the disk space writing module 530 is configured to write the data to be written into the corresponding disk space according to the logical storage path.
  • a CDN network element container data reading device is applied to a host machine.
  • the CDN network element container is located on the host machine, and the host machine kernel platform is installed on the host machine.
  • Devices include:
  • the second obtaining logical storage path module 610 is used to obtain the logical storage path and data read request information, and the logical storage path is generated by the CDN network element container according to the file storage identifier and the corresponding container path;
  • the acquisition location identification module 620 is used for the distributed file system server to obtain the location identification of the data to be read by using the logical storage path according to the data read request information;
  • the read data to be read module 630 is configured to copy the data to be read to the shared memory according to the location identifier, so that the distributed file system client can read the data to be read from the shared memory by means of inter-process communication.
  • CDN network element container instantiation configuration device CDN network element container data writing device
  • CDN network element container data reading device CDN network element container data reading device
  • the CDN network element container instantiation configuration device in the embodiment of the present application may execute the CDN network element container instantiation configuration method in the embodiment shown in FIG. 2 . That is, the CDN network element container instantiation configuration device in the embodiment of the present application and the CDN network element container instantiation configuration method in the embodiment shown in Figure 2 all belong to the same inventive concept, so these embodiments have the same implementation The principles and technical effects will not be described in detail here.
  • the device for writing data to the CDN network element container in the embodiment of the present application may execute the method for writing data in the CDN network element container in the embodiment shown in FIG. 9 . That is, the CDN network element container writing data device in the embodiment of the present application and the CDN network element container writing data method in the embodiment shown in Figure 9 all belong to the same inventive concept, so these embodiments have the same implementation principle and The technical effect will not be described in detail here.
  • the device for reading data of a CDN network element container in the embodiment of the present application may execute the method for reading data of a CDN network element container in the embodiment shown in FIG. 13 . That is, the CDN network element container data reading device in the embodiment of the present application and the CDN network element container data reading method in the embodiment shown in Figure 13 all belong to the same inventive concept, so these embodiments have the same implementation principle and The technical effect will not be described in detail here.
  • an embodiment of the embodiment of the present application further provides computer equipment, and the computer equipment includes: a memory, a processor, and a computer program stored in the memory and operable on the processor.
  • the processor and memory can be connected by a bus or other means.
  • memory can be used to store non-transitory software programs and non-transitory computer-executable programs.
  • the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage devices.
  • the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the non-transitory software programs and instructions required to implement the CDN network element container instantiation configuration method, the CDN network element container writing data method, or the CDN network element container reading data method of the above embodiments are stored in the memory, and when executed by the processor , executing the CDN network element container instantiation configuration method, the CDN network element container writing data method, or the CDN network element container reading data method in the foregoing embodiments.
  • an embodiment of the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by a processor or a controller, for example, Executed by a processor in the embodiment of the computer device, the processor can execute the CDN network element container instantiation configuration method, the CDN network element container write data method or the CDN network element container read data method in the above embodiment.
  • being executed by a processor in the above-mentioned computer device embodiment can make the above-mentioned processor execute the CDN network element container instantiation configuration method, CDN network element container writing data method or CDN network element container reading data in the above embodiment method.
  • the first aspect of the embodiment of the present application provides a CDN network element container instantiation configuration method.
  • one or more CDN network element containers are configured through initialization, and then inter-process communication configuration information and distributed file system are obtained. Capability information, configure the inter-process communication configuration parameters according to the inter-process communication configuration information, so that the CDN network element container and the host kernel platform can realize inter-process communication, and establish the CDN network element container and distributed files according to the distributed file system capability information
  • the data exchange channel of the system to complete the instantiation configuration of the CDN network element container.
  • the storage-related services of the CDN network element container can be directly operated from the kernel state during the service process, avoiding the need for storage-related services in related technologies to be processed by the user.
  • the memory and kernel memory are copied to each other, which affects the performance of file reading and writing.
  • Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, tape, magnetic disk storage or other magnetic storage devices, or can Any other medium used to store desired information and which can be accessed by a computer.
  • communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .

Abstract

本申请实施例提出一种CDN网元容器配置方法、读写方法、装置、设备及存储介质,涉及通信技术领域,其中CDN网元容器实例化配置方法包括:初始化配置一个或多个CDN网元容器,根据进程间通信配置信息对进程间通信配置参数进行配置,使得CDN网元容器与宿主机内核平台实现进程间通信,根据分布式文件系统能力信息,建立CDN网元容器与分布式文件系统的数据交互通道,以完成CDN网元容器实例化配置。

Description

CDN网元容器配置方法、读写方法、装置、设备及存储介质
相关申请的交叉引用
本申请基于申请号为202111228686.6、申请日为2021年10月21日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本申请实施例涉及通信技术领域,尤其涉及一种CDN网元容器配置方法、读写方法、装置、设备及存储介质。
背景技术
内容分发网络(virtual Content Delivery Network,CDN)是相关技术中将内容推送到离用户最近的服务节点上,使得用户就近访问内容的一种技术。使用CDN进行内容传输能够极大的提高用户对于内容获取的相应速度,也极大的减少了内容在骨干网络上传输的带宽压力。
随着新生代移动通信技术(如5G,5th Generation Mobile Networks)商用以及4K/8K高清视频、虚拟现实(Virtual Reality,VR)和增强现实(Augmented Reality,AR)等大流量低时延业务的引入,运营商将CDN边缘节点下沉到移动边缘计算平台,从基于物理机的部署模式切换到边缘计算平台虚拟化部署模式,虚拟化后的CDN边缘节点可以释放中央处理器、内存和磁盘大部分资源,与边缘计算实现资源共享。由于相比容器而言虚拟机基于硬件资源的虚拟化技术有较大的性能损耗,因此容器方式通常作为边缘云平台CDN部署的最佳选择。
目前,容器方式部署CDN的存储方式主要采取以下方案:(1)为容器指定特权模式,将特定的主机磁盘挂载到容器上,缓存软件通过容器直写裸磁盘;(2)通过创建数据卷并挂载到对应容器中来实现容器内进程与宿主机文件系统建立关联关系,实现数据的读写。上述两种方案由于在文件读写中需要在用户内存和内核内存互相拷贝,当面对大量文件读写时,严重影响文件读写的性能,因此对于CDN这样的I/O密集型业务来说,已经难以满足当前网络用户需求。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本申请实施例提供一种CDN网元容器配置方法、读写方法、装置、设备及存储介质。
第一方面,本申请实施例提供一种CDN网元容器实例化配置方法,所述CDN网元容器部署在宿主机上,所述宿主机上安装有宿主机内核平台,所述方法包括:初始化配置一个或多个CDN网元容器;获取进程间通信配置信息和分布式文件系统能力信息;根据所述进程间通信配置信息对进程间通信配置参数进行配置,使得所述CDN网元容器与宿主机内核平台实现进程间通信;根据所述分布式文件系统能力信息,建立CDN网元容器与分布式文件系统的数据交互通道,以完成所述CDN网元容器实例化配置。
第二方面,本申请实施例提供一种CDN网元容器写数据方法,应用于与宿主机内核平台通信连接的CDN网元容器,所述宿主机内核平台包括分布式文件系统服务端和共享内存,所述CDN网元容器包括分布式文件系统客户端,所述分布式文件系统客户端和所述分布式文件系统服务端均可访问所述共享内存;所述方法包括:获取逻辑存储路径;利用分布式文件系统客户端,将待写数据写入所述共享内存中;利用分布式文件系统客户端,将所述逻辑存储路径和数据写请求信息通过进程间通信发送至所述分布式文件系统服务端,以使得所述分布式文件系统服务端根据所述数据写请求信息,在所述共享内存中获取所述待写数据进行数据写操作。
第三方面,本申请实施例提供一种CDN网元容器写数据方法,应用于与CDN网元容器通信连接的宿主机内核平台,所述宿主机内核平台包括分布式文件系统服务端和共享内存,所述CDN网元容器包括分布式文件系统客户端,所述分布式文件系统客户端和所述分布式文件系统服务端访问所述共享内存;所述方法包括:获取逻辑存储路径和数据写请求信息,所述逻辑存储路径为所述CDN网元容器根据文件存储标识和对应容器路径生成;所述分布式文件系统服务端根据所述数据写请求信息,从所述共享内存中获取待写数据;根据所述逻辑存储路径将所述待写数据写入对应磁盘空间。
第四方面,本申请实施例提供一种CDN网元容器读数据方法,应用于CDN网元容器,所述CDN网元容器位于宿主机上,所述宿主机上安装有宿主机内核平台,所述CDN网元容器与所述宿主机内核平台通信连接,所述宿主机内核平台包括分布式文件系统服务端和共享内存,所述CDN网元容器包括分布式文件系统客户端,所述分布式文件系统客户端和所述分布式文件系统服务端访问所述共享内存;所述方法包括:获取逻辑存储路径;将所述逻辑存储路径和数据读请求信息通过进程间通信发送至所述分布式文件 系统服务端,以使得所述分布式文件系统服务端根据所述数据读请求信息,在所述共享内存中获取所述待读数据进行数据读操作。
第五方面,本申请实施例提供一种CDN网元容器读数据方法,应用于宿主机,所述CDN网元容器位于宿主机上,所述宿主机上安装有宿主机内核平台,所述CDN网元容器与所述宿主机内核平台通信连接,所述宿主机内核平台包括分布式文件系统服务端和共享内存,所述CDN网元容器包括分布式文件系统客户端,所述分布式文件系统客户端和所述分布式文件系统服务端访问所述共享内存;所述方法包括:获取逻辑存储路径和数据读请求信息,所述逻辑存储路径为所述CDN网元容器根据文件存储标识和对应容器路径生成;所述分布式文件系统服务端根据所述数据读请求信息,利用所述逻辑存储路径获取待读数据的位置标识;根据所述位置标识将所述待读数据拷贝到所述共享内存,以使得所述分布式文件系统客户端能够利用进程间通信方式从所述共享内存中读取所述待读数据。
第六方面,本申请实施例提供一种CDN网元容器实例化配置装置,所述CDN网元容器部署在宿主机上,所述宿主机上安装有宿主机内核平台,所述宿主机内核平台包括分布式文件系统服务端,所述装置包括:初始化配置模块,用于初始化配置一个或多个CDN网元容器;配置信息获取模块,用于获取所述CDN网元容器的配置信息,所述配置信息包括:进程间通信配置信息和分布式文件系统能力信息;进程间通信配置模块,用于根据所述进程间通信配置信息对进程间通信配置参数进行配置,使得所述CDN网元容器与宿主机内核平台实现进程间通信;分布式文件系统服务端配置模块,用于根据所述分布式文件系统能力信息进行所述分布式文件系统服务端的配置,以完成所述CDN网元容器实例化配置。
第七方面,本申请实施例提供一种CDN网元容器写数据装置,应用于与CDN网元容器通信连接的宿主机内核平台,所述宿主机内核平台包括分布式文件系统服务端和共享内存,所述CDN网元容器包括分布式文件系统客户端,所述分布式文件系统客户端和所述分布式文件系统服务端访问所述共享内存;所述装置包括:第一获取逻辑存储路径模块,用于获取逻辑存储路径和数据写请求信息,所述逻辑存储路径为所述CDN网元容器根据文件存储标识和对应容器路径生成;获取待写数据模块,用于所述分布式文件系统服务端根据所述数据写请求信息,从所述共享内存中获取待写数据;写磁盘空间模块,用于根据所述逻辑存储路径将所述待写数据写入对应磁盘空间。
第八方面,本申请实施例提供一种CDN网元容器读数据装置,应用于宿主机,所述CDN网元容器位于宿主机上,所述宿主机上安装有宿主机内核平台,所述CDN网元容器与所述宿主机内核平台通信连接,所述宿主机内核平台包括分布式文件系统服务端和共享内存,所述CDN网元容器包括分布式文件系统客户端,所述分布式文件系统客户端和所述分布式文件系统服务端访问所述共享内存;所述装置包括:第二获取逻辑存储路径模块,用于获取逻辑存储路径和数据读请求信息,所述逻辑存储路径为所述CDN网元容器根据文件存储标识和对应容器路径生成;获取位置标识模块,用于所述分布式文件系统服务端根据所述数据读请求信息,利用所述逻辑存储路径获取待读数据的位置标识;读取待读数据模块,用于根据所述位置标识将所述待读数据拷贝到所述共享内存,以使得所述分布式文件系统客户端能够利用进程间通信方式从所述共享内存中读取所述待读数据。
第九方面,本申请实施例提供一种计算机设备,包括处理器以及存储器;所述存储器用于存储程序;所述处理器用于根据所述程序执行如第一方面至第五方面中任一项所述的待诊图像处理方法。
第十方面,本申请实施例提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行第一方面至第五方面中任意一项所述的待诊图像处理方法。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请实施例的一些实施例,对于本领域普通技术人员来说,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一个实施例提供的CDN网元容器存储架构的示意图;
图2是本申请一个实施例提供的CDN网元容器实例化配置方法的流程图;
图3是本申请一个实施例提供的CDN网元容器实例化配置方法的又一流程图;
图4是本申请一个实施例提供的CDN网元容器实例化配置方法的又一流程图;
图5是本申请一个实施例提供的CDN网元容器存储架构的又一示意图
图6是本申请一个实施例提供的CDN网元容器实例化配置方法的又一流程图;
图7是本申请一个实施例提供的CDN网元容器写数据方法的流程图;
图8是本申请一个实施例提供的CDN网元容器写数据方法的又一流程图;
图9是本申请一个实施例提供的CDN网元容器写数据方法的流程图;
图10是本申请一个实施例提供的CDN网元容器写数据方法的又一流程图;
图11是本申请一个实施例提供的CDN网元容器写数据方法的又一流程图;
图12是本申请一个实施例提供的CDN网元容器读数据方法的流程图;
图13是本申请一个实施例提供的CDN网元容器读数据方法的又一流程图;
图14是本申请一个实施例提供的CDN网元容器读数据方法;
图15是本申请一个实施例提供的CDN网元容器读数据方法的又一流程图;
图16是本申请一个实施例提供的CDN网元容器读数据方法的又一流程图;
图17是本申请一个实施例提供的CDN网元容器实例化配置装置的结构框图;
图18是本申请一个实施例提供的CDN网元容器写数据装置的结构框图;
图19是本申请一个实施例提供的CDN网元容器读数据装置的结构框图。
具体实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请实施例。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请实施例的描述。
需要说明的是,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于流程图中的顺序执行所示出或描述的步骤。说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
还应当理解,在本申请实施例说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请实施例的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
内容分发网络(virtual Content Delivery Network,CDN)是相关技术中将内容推送到离用户最近的服务节点上,使得用户就近访问内容的一种技术。使用CDN进行内容传输能够极大的提高用户对于内容获取的相应速度,也极大的减少了内容在骨干网络上传输的带宽压力。
随着第五代移动通信技术(5th Generation Mobile Networks,5G)商用以及4K/8K高清视频、虚拟现实(Virtual Reality,VR)和增强现实(Augmented Reality,AR)等大流量低时延业务的引入,运营商将CDN边缘节点下沉到移动边缘计算平台,例如与人脸识别和边缘转码等计算型应用共享边缘计算平台底层硬件。从基于物理机的部署模式切换到边缘计算平台虚拟化部署模式,实现CDN的解耦,即应用、云平台和硬件设备三者不存在厂家或技术上绑定关系,扩大CDN的适用范围。
由于云平台可以为业务提供丰富的平台能力,快速地进行业务部署,因此基于边缘云架构的虚拟化内容分发网络(virtual Content Delivery Network,VCDN)方案逐渐成为各大运营商的选择。虚拟化后的CDN边缘节点可以释放中央处理器、内存和磁盘大部分资源,与边缘计算实现资源共享。但是相比容器而言,虚拟机基于硬件资源的虚拟化技术有较大的性能损耗,因此容器方式通常作为边缘云平台CDN部署的最佳选择。
CDN作为在音视频相关业务中提供流服务的节点,同时基于运营商专有的网络用户,以及基于互联网的视频用户越来越多,服务类别的复杂性和任务的规模越来越庞大,由此,会带来任务执行时间过长的问题,极大的影响用户的体验。特别是对于容器化CDN场景下,如果仅仅通过提高CDN节点设备性能会导致CDN成本较高,对于CDN运营商来说难以接受。如何在当前CDN网络中利用有限的设备资源来在系统层面上提升vCDN用户的服务质量成为目前需要解决的问题。
相关技术中,容器方式部署CDN的存储方式主要采取以下方案:(1)为容器指定特权模式,将特定的主机磁盘挂载到容器上,缓存软件通过容器直写裸磁盘;(2)通过创建数据卷并挂载到对应容器中来实现容器内进程与宿主机文件系统建立关联关系,实现数据的读写。上述两种容器存储方案作为当前容器化应用数据持久化的通用存储方案,使用可移植操作系统接口(Portable Operating System Interface of UNIX,POSIX)标准来实现,虽然能够满足许多应用场景下的用户需求,但由于传统的POSIX标准接口方案,在文件读写中需要在用户内存和内核内存互相拷贝,当面对大量文件读写时,严重影响文件读写的性能,因此对于CDN这样的I/O密集型业务来说,已经难以满足当前网络用户量增加及移动终端普及背景下的用户需求。
因此,本申请实施例提供了一种CDN网元容器实例化配置方法,与相关技术相比,通过初始化配置一个或多个CDN网元容器,然后获取进程间通信配置信息和分布式文件系统能力信息,根据进程间通信配置信息对进程间通信配置参数进行配置,使得CDN网元容器与宿主机内核平台实现进程间通信,根据分布式文件系统能力信息,建立CDN网元容器与分布式文件系统的数据交互通道,以完成CDN网元容器 实例化配置。本申请实施例通过CDN网元容器与宿主机平台进程间通信的方式,使CDN网元容器的存储相关业务在服务过程中,直接从内核态进行操作,避免相关技术中存储相关业务需要在用户内存和内核内存之间互相拷贝,影响文件读写的性能的问题,通过减少CDN网元容器服务数据处理流程,从而实现CDN网元容器服务的优化处理,能够有效降低CDN相关业务的时延,提升服务性能,例如存储性能或读写性能。
下面结合附图,对本申请实施例作进一步阐述。
图1示出了可以应用本申请实施例的技术方案的示例性CDN网元容器存储架构的示意图。
如图1所示,该实施例中CDN容器存储架构部署在宿主机上,宿主机包括:边缘云平台110、宿主机硬件模块200和宿主机内核平台300。
其中,边缘云平台100是用于提供容器化部署CDN网元的平台,即CDN网元容器部署在边缘云平台100上,边缘云平台100包括:编排组件110和与编排组件110通信连接的容器集合120,编排组件110用于实现CDN网元的容器化部署,容器集合120中包含一个或多个容器,每个容器中还可以包括一个或多个CDN网元容器130,CDN网元容器130中包括分布式文件系统客户端131。
宿主机硬件模块200包括:一个或多个存储器210。在一实施例中,存储器210可以是硬盘,例如机械硬盘(Hard Disk Drive,HDD)和固态硬盘(Solid State Disk,SDD)共同构成,也可以全部由固态硬盘构成。
宿主机内核平台300运行于宿主机中,其包括:磁盘管理模块310、分布式文件系统服务端320和共享内存330,分布式文件系统客户端131和分布式文件系统服务端320均可以进程间通信方式访问共享内存330。
其中,磁盘管理模块310用于整合一个或多个存储器210,例如整合HDD硬盘和SSD硬盘,分布式文件系统服务端320用于提高存储器210的I/O性能,共同实现CDN网元容器存储架构。
在一实施例中,边缘云平台100是以kubernetes作为容器编排系统实现CDN网元的容器化部署方案,容器集合120可以是kubernetes容器系统中的pod单元,CDN网元容器130可以是Server容器。
kubernetes,简称K8s。是一个用于管理云平台中多个主机上的容器化的开源应用,Kubernetes提供了针对容器的应用部署、规划、更新和维护机制。部署容器方式中每个容器之间互相隔离,每个容器有自己的文件系统,容器之间进程不会相互影响,能区分计算资源。Kubernetes是一个开源的容器编排引擎,支持自动化部署、大规模可伸缩、应用容器化管理。在生产环境中部署一个应用程序时,通常要部署该应用的多个实例以便对应用请求进行负载均衡。在Kubernetes中,可以创建多个容器,每个容器里面运行一个应用实例,然后通过内置的负载均衡策略,实现对这一组应用实例的管理、发现、访问。
应该理解,图1中的CDN网元容器和存储器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的CDN网元容器和存储器。
在本申请的一个实施例中,为了实现上述CDN网元容器存储架构,编排组件110可以对CDN网元容器进行实例化配置,例如通过初始化配置一个或多个CDN网元容器,然后获取进程间通信配置信息和分布式文件系统能力信息,根据进程间通信配置信息对进程间通信配置参数进行配置,使得CDN网元容器与宿主机内核平台实现进程间通信,根据分布式文件系统能力信息,建立CDN网元容器与分布式文件系统的数据交互通道,以完成CDN网元容器实例化配置。通过CDN网元容器与宿主机平台进程间通信的方式,使CDN网元容器的存储相关业务在服务过程中,直接从内核态进行操作,避免相关技术中存储相关业务需要在用户内存和内核内存之间互相拷贝,影响文件读写的性能的问题,通过减少CDN网元容器服务数据处理流程,从而实现CDN网元容器的存储性能最大化处理,能够有效降低CDN相关存储业务的时延,提升服务性能。
本申请实施例描述的系统架构以及应用场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域技术人员可知,随着系统架构的演变和新应用场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。本领域技术人员可以理解的是,图1中示出的系统架构并不构成对本申请实施例的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
基于上述系统架构,提出本申请一实施例的CDN网元容器实例化配置方法的各个实施例,在一实施例中,编排组件可以执行该实施例的CDN网元容器实例化配置方法。
如图2所示,图2是本申请一个实施例提供的CDN网元容器实例化配置方法的流程图,包括但不限于有步骤S1110和步骤S1140。
步骤S1110,初始化配置一个或多个CDN网元容器。
在一实施例中,参照图3,初始化配置一个或多个CDN网元容器的过程包括但不限于以下步骤:
步骤S1111,获取一个或多个CDN网元容器的初始化配置信息。
在一实施例中,初始化配置信息包括:基本信息、资源信息和业务信息,其中,基础信息可以是网元 信息,资源信息可以是CPU信息或存储需求信息等,业务信息可以是服务类型或IP端口信息等,利用该初始化配置信息实现对CDN网元容器实例化之前的初始化工作。可以理解的是,本申请实施例中初始化配置信息的分类只是一种示意,并不代表对其进行限定,凡是完成CDN网元初始化需要的信息都可以是该初始化配置信息。
步骤S1112,根据初始化配置信息生成资源创建信息。
步骤S1113,根据资源创建信息初始化配置一个或多个CDN网元容器。
在一实施例中,通过边缘云平台中能够与k8s的API server接口通信的接口,向k8s的API server请求生成资源创建信息,然后k8s的API server生成资源创建信息后,根据资源创建信息初始化配置一个或多个CDN网元容器。
在一实施例中,资源创建信息可以是json格式的字符串,下面是资源创建信息的一种示例:
Figure PCTCN2022114284-appb-000001
上述仅作示例展示,并非该资源创建信息的全部内容,其具体值以"*"表示。
步骤S1120,获取CDN网元容器的配置信息。
在一实施例中,根据上述资源创建请求获取CDN网元容器的配置信息,该配置信息包括:进程间通信配置信息和分布式文件系统能力信息。例如分布式文件系统能力信息从上述("ifdfs":"1")可以得到。
步骤S1130,根据进程间通信配置信息对进程间通信配置参数进行配置,使得CDN网元容器与宿主机内核平台实现进程间通信。
在一实施例中,由于容器的隔离机制,CDN网元容器是无法直接在宿主机的内核态进行操作,因此需要根据进程间通信配置信息对进程间通信配置参数进行配置,以实现CDN网元容器与宿主机内核平台实现进程间通信。
相关技术中,CDN网元容器由于隔离机制,其与宿主机进行存储相关操作时,多采用POSIX标准接口,网元容器中数据读写需要从宿主机的内核缓冲区,到存储器的用户缓冲区,然后再到CDN的内核socket缓冲区之间根据读写需求进行相互拷贝,当有大量数据交互或者数据较大时,这种存储拷贝流程效率太低,降低CDN网元容器的存储性能。
在一实施例中,进程间通信配置参数为hostIPC参数。步骤S130根据进程间通信配置信息对进程间通信配置参数进行配置,具体包括:将hostIPC参数配置为true。当k8s中hostIPC参数被设置为true时,则CDN网元容器可以与宿主机内核平台在内核态实现进程间通信。进程间通信方式使得CDN网元容器在存储业务服务过程中,在内核态直接进行,数据的发送无需在用户内存(如用户缓冲区)和内核内存(如内 核缓冲区和内核socket缓冲区)之间互相拷贝,其中内核socket缓冲区即内核与socket相关的缓冲区。本申请实施例能够在不需要提高CDN网元节点设备性能导致CDN成本较高的情况下,在当前CDN网络中利用有限的设备资源在系统层面上实现了容器化存储的高性能,保证边缘云场景下的CDN业务的高性能服务。
步骤S1140,根据分布式文件系统能力信息建立CDN网元容器与分布式文件系统的数据交互通道,以完成CDN网元容器实例化配置。
在一实施例中,分布式文件系统能力信息为:判断是否支持分布式文件系统,例如使用ifdfs参数来表示,可设定当ifdfs=1时,表示为支持分布式文件系统,可以理解的是,参数表示和参数值均可根据实际需求设定。
若分布式文件系统能力信息获知,该宿主机支持分布式文件系统,则在宿主机内核平台中安装分布式文件系统服务端,在CDN网元容器中安装相应的分布式文件系统客户端,并且在宿主机内核平台中创建共享内存,以建立数据交互通道,以使得分布式文件系统客户端和分布式文件系统服务端均可利用数据交互通道访问共享内存。
在一实施例中,通过进程间通信和共享内存的方式,实现宿主机容器分布式文件系统客户端和分布式文件系统服务端通信,在CDN网元容器存储相关业务服务过程中,数据读写在内核缓存之间执行拷贝操作,直接走内核态操作,不需要在用户内存和内核态内存之间进行切换,也不需要数据在用户内存和内核内存之间相互拷贝,即可实现CDN网元容器性能最大化处理。
在一实施例中,参照图4,步骤S1140包括但不限于有以下步骤:
步骤S1141:为分布式文件系统服务端的存储目录配置对应数据卷。
在一实施例中,如果宿主机支持分布式文件系统,则在宿主机内核平台中安装分布式文件系统服务端,需要进行分布式文件目录编排,为分布式文件系统服务端的存储目录配置对应数据卷,实现容器目录与物理存储之间的映射。
步骤S1142:将数据卷挂载到对应容器路径中,以使得CDN网元容器能够通过容器路径与分布式文件系统服务端对应的数据卷进行数据交互。
在一实施例中,数据卷包括:第一数据卷和第二数据卷,其中,第一数据卷用于存储符合第一性能约束条件的第一类型数据,第二数据卷用于存储不符合第一性能约束条件的第二类型数据。在一实施例中,第一性能约束条件包括但不限于:使用频率小于第一预设使用频率、数据大小小于第一预设数据大小、数据类型为第一预设数据类型或时延要求大于第一预设时延大小等。
在一实施例中,第一类型数据可以是:配置文件、数据文件和日志文件等,该类型数据较小,对时延性能要求不高,主要是配置应用场景等。第二类型数据可以是视频、音频等流媒体数据等,该类型数据的大小较大,对时延性能要求高。
步骤S1142中将数据卷挂载到对应容器路径中,包括但不限于以下步骤:
步骤S1143:将第一数据卷挂载到第一容器路径中,以使得可利用hostpath调用方式对第一数据卷进行调用。
在一实施例中,HostPath调用方式将宿主机上的文件或目录挂载到Pod中的CDN网元容器上,支持以下4种挂载模式:1)DirectoryOrCreate,该模式表示:如果在给定路径上什么都不存在,将根据需要创建空目录,权限设置为0755,与Kubelet有相同的组和属主信息。2)Directory,该模式表示:在给定路径上必须存在目录。3)FileOrCreate,该模式表示:如果在给定路径上什么都不存在,那么将在给定路径根据需要创建空文件,权限设置为0644,具有与Kubelet相同的组和所有权。4)File,该模式表示:在给定路径上必须存在文件。通过相应的挂载配置,可以在Pod运行时,在Pod所在CDN网元容器上的相应路径挂载宿主机的第一数据卷,从而将第一数据卷映射到Pod内部,在CDN网元容器动态挂载第一数据卷。
步骤S1144:将第二数据卷挂载到第二容器路径中,以使得可利用sendfile读写方式对第二数据卷进行读写。
相关技术中,读写方式需要进行socket传输,例如当需要对一个文件进行传输的时候,具体流程细节如下:
1)调用read函数,将文件数据拷贝到内核缓冲区;
2)read函数返回,文件数据从内核缓冲区拷贝到用户缓冲区;
3)write函数调用,将文件数据从用户缓冲区拷贝到内核socket缓冲区;
4)数据从内核socket缓冲区拷贝到用户设备,完成相应的存储业务。
可见在这个过程中发生了四次拷贝操作,分别是硬盘内存->内核内存->用户内存->内核socket缓冲区(内核内存的一种)->用户设备。
在一实施例中,sendfile调用方式为调用sendfile函数实现调用,sendfile函数是一种I/O函数,用于存储相关业务,能够在两个文件描述符之间传递数据,其操作完全在内核中,从而避免了内核缓冲区和用户 缓冲区之间的数据拷贝,提高拷贝效率。下面是sendfile函数的一种调用方式:sendfile(int out_fd,int in_fd,off_t*offset,size_t count),其中,in_fd参数是待读出内容的文件描述符,out_fd参数是待写入内容的文件描述符,offset参数指定从读入文件流的哪个位置开始读,如果为空,则使用读入文件流默认的起始位置,count参数指定文件描述符in_fd和out_fd之间传输的字节数。并且in_fd必须是一个支持类似mmap函数的文件描述符,即必须指向真实的文件,不能是socket和管道,而out_fd必须是一个socket。
上述实施例采用sendfile调用方式,宿主机内核平台调用sendfile(),通过直接存储器访问(Direct Memory Access,DMAP),将硬盘数据拷贝到内核缓冲区,然后数据在内核态被内核直接拷贝到另外一个内核socket缓冲区,直接走内核态操作,在内核中直接完成了从一个内核缓冲区到另一个内核缓冲区的拷贝,不需要数据在用户内存和内核内存之间相互拷贝。并且直接存储器访问把数据从内核缓冲区直接拷贝给用户的协议栈,不需要在用户内存和内核态内存之间进行切换。由于这种调用方式能够提高CDN网元容器的存储性能,因此将第二数据卷中对时延性能要求高的数据利用sendfile读写方式在第二容器路径中对第二数据卷进行读写操作。
在一实施例中,参考图5,为本申请实施例中CDN网元容器存储架构的又一示意图。
图5在图1的基础上,增加了第一数据卷和第二数据卷的相关目录,其中,第一数据卷目录可以是Linux OS目录,第一数据卷用于存储符合第一性能约束条件的第一类型数据,该目录表示将第二数据卷挂载宿主机内核平台的相关容器路径中。第二数据卷的目录可以是DFS目录,第二数据卷用于存储不符合第一性能约束条件的第二类型数据。该目录表示将第二数据卷挂载在宿主机内核平台的分布式文件系统服务端的相关容器路径中。图5中可见,第一数据卷利用hostpath调用方式挂载对应容器路径中,第二数据卷利用sendfile读写方式在第二容器路径中对第二数据卷进行读写操作。
在一实施例中,第一数据卷也可以挂载在宿主机内核平台的分布式文件系统服务端的相关容器路径中,即第一类型数据也采用sendfile调用方式进行读取操作。
参照图6,为本申请一实施例的CDN网元容器实例化配置方法流程图,包括但不限于以下步骤。
步骤S110:初始化配置一个或多个CDN网元容器。
步骤S120:获取CDN网元容器的配置信息,进行进程间通信配置。
该步骤中,通过将hostIPC参数配置为true,实现进程间通信配置,使得CDN网元容器可以与宿主机内核平台在内核态实现进程间通信。
步骤S130:根据分布式文件系统能力信息,判断宿主机是否支持分布式文件系统,例如通过ifdfs参数判断,若支持分布式文件系统,则进入步骤S140,否则进入步骤S160。
步骤S140:进行分布式文件系统服务端的配置,为分布式文件系统服务端的存储目录配置对应数据卷。
步骤S150:将数据卷挂载到对应容器路径中。
该步骤包括将第一数据卷利用hostpath调用方式挂载对应容器路径中,将第二数据卷利用sendfile读写方式在第二容器路径中对第二数据卷进行读写操作,以使得CDN网元容器能够通过容器路径与分布式文件系统服务端对应的数据卷进行数据交互。
步骤S160:完成CDN网元容器实例化配置。
该步骤中,实例化可以根据实际部署情况确定,本申请实施例不做明确限定。
本申请实施例的CDN网元容器实例化配置方法,通过CDN网元容器与宿主机平台进程间通信的方式,使CDN网元容器的存储相关业务在服务过程中,直接从内核态进行操作,避免相关技术中存储相关业务需要在用户内存和内核内存之间互相拷贝,影响文件读写的性能的问题,通过减少CDN网元容器服务数据处理流程,从而实现CDN网元容器的存储性能最大化处理,能够有效降低CDN相关存储业务的时延,提升服务性能。
另外,在一实施例中,还提供一种CDN网元容器写数据方法,参照图1的CDN网元容器存储架构,该方法应用于与宿主机内核平台通信连接的CDN网元容器,宿主机内核平台包括分布式文件系统服务端和共享内存,CDN网元容器包括分布式文件系统客户端,分布式文件系统客户端和分布式文件系统服务端均可访问共享内存。
如图7所示,图7是本申请一个实施例提供的CDN网元容器写数据方法的流程图,包括但不限于有步骤S2110和步骤S2140。
步骤S2110,获取逻辑存储路径。
在一实施例中,参照图8,步骤S2110包括但不限于以下步骤。
步骤S2111,获取文件存储标识。
在一实施例中,可以通过以下两种方式获取文件存储标识。1)根据用户请求信息中的url获取请求业务资源类型,根据预设提取规则从用户请求信息中提取处文件存储标识,预设提取规则可以是提前和运营商等业务参与方协商确定好的。例如可以是预先指定不同业务资源种类对应的提取规则,也可以是相关技术中通用的url资源分类规则,根据不同的业务资源类型,分别获取文件存储标识,在此不对预设提取规 则进行限定。2)根据业务特征获取文件存储标识,此处,业务特性可以是提前和运营商等业务参与方协商确定好的。
在一实施例中,文件存储标识可以是预设前缀标识+url路径组成,每个文件存储标识对应一个唯一编码,后续读写过程中,将该文件存储标识作为唯一的资源文件索引。
步骤S2112,根据文件存储标识和对应容器路径生成逻辑存储路径。
在一实施例中,将上述文件存储标识预配置的对应容器挂载目录中容器路径组合为逻辑存储路径。
步骤S2120,利用分布式文件系统客户端,将待写数据写入共享内存中。
在一实施例中,CDN网元容器的分布式文件系统客户端利用进程间通信方式访问共享内存,将待写数据写入共享内存中。
步骤S2130,利用分布式文件系统客户端,将逻辑存储路径和数据写请求信息通过进程间通信发送至分布式文件系统服务端,以使得分布式文件系统服务端根据数据写请求信息,在共享内存中获取待写数据进行数据写操作。
在一实施例中,CDN网元容器的分布式文件系统客户端将上述生成的逻辑存储路径和数据写请求信息通过进程间通信方式发送至宿主机内核平台的分布式文件系统服务端,后续读写时,分布式文件系统服务端可以根据接收到的数据写请求信息,在共享内存中获取分布式文件系统客户端写入的待写数据进行数据写操作。
本申请实施例的CDN网元容器写数据方法,CDN网元容器利用进程间通信方式访问共享内存,将待写数据写入共享内存中,然后将生成的逻辑存储路径和数据写请求信息发送至分布式文件系统服务端,以使得分布式文件系统服务端根据数据写请求信息,在共享内存中获取待写数据进行数据写操作。由于直接从内核态进行操作,减少CDN网元容器服务数据处理流程,实现CDN网元容器的存储性能最大化处理,能够有效降低CDN相关存储业务的时延,提升数据写入效率。
另外,在一实施例中,还提供一种CDN网元容器写数据方法,参照图1的CDN网元容器存储架构,该方法应用于与CDN网元容器通信连接的宿主机内核平台,宿主机内核平台包括分布式文件系统服务端和共享内存,CDN网元容器包括分布式文件系统客户端,分布式文件系统客户端和分布式文件系统服务端均可访问共享内存。
如图9所示,图9是本申请一个实施例提供的CDN网元容器写数据方法的流程图,包括但不限于有步骤S3110和步骤S3130。
步骤S3110,获取逻辑存储路径和数据写请求信息,逻辑存储路径为CDN网元容器根据文件存储标识和对应容器路径生成,逻辑存储路径能够被转换为宿主机上存储器的物理存储路径。
在一实施例中,分布式文件系统服务端接收CDN网元容器的分布式文件系统客户端通过进程间通信方式发送的逻辑存储路径和数据写请求信息。
步骤S3120,分布式文件系统服务端根据数据写请求信息,从共享内存中获取待写数据。
在一实施例中,待写数据是CDN网元容器的分布式文件系统客户端利用进程间通信方式访问共享内存写入的。
步骤S3130,根据逻辑存储路径将待写数据写入对应磁盘空间。
在一实施例中,参照图10,步骤S3130包括但不限于有以下步骤。
步骤S3131,分布式文件系统服务端根据数据写请求信息,将待写数据写入内核缓存中,并生成内存占用标识。
在一实施例中,分布式文件系统服务端的客户端代理模块利用进程间通信方式,从共享内存中获取待写数据,根据数据写请求信息,将待写数据写入内核缓存中,同时生成内存占用标识。例如,将一页待写数据从共享内存中拷贝到内核缓存(可以是预先开辟的内核内存区域,在此不做限定)中,然后在内核缓存中对相关区域进行置脏操作,标识该区域内存空间已经被占用。
步骤S3132,根据逻辑存储路径和内存占用标识,将内核缓存中待写数据写入对应磁盘空间。
在一实施例中,分布式文件系统服务端的后台服务器根据内存占用标识,将上述脏页取处后,根据逻辑存储路径写入对应的文件访问服务器中,即利用进程间通信方式向分布式文件系统客户端返回写入成功信息,并释放共享内存相关页。
在一实施例中,为了提高写入效率,分布式文件系统服务端的文件访问服务器磁盘线程执行异步写入操作,将待写数据异步写入对应磁盘中,这种异步写入操作能够保证一个磁盘并行服务多个用户提高写入效率。
在一实施例中,参考图11,是本申请一个实施例提供的CDN网元容器写数据方法的流程图,包括但不限于以下步骤。
步骤S210,获取逻辑存储路径和数据写请求信息。
其中,逻辑存储路径为CDN网元容器根据文件存储标识和对应容器路径生成,逻辑存储路径能够被 转换为宿主机上存储器的物理存储路径。
步骤S220,分布式文件系统服务端判断是否存在逻辑存储路径,如果存在则进入步骤S230,否则进入步骤S250。
步骤S230,分布式文件系统服务端根据数据写请求信息从共享内存中获取待写数据。
步骤S240,根据逻辑存储路径将待写数据写入对应磁盘空间。
步骤S250,若逻辑存储路径不存在,创建逻辑存储路径,创建逻辑存储路径后,进入步骤S230进行写数据操作。
本申请实施例的CDN网元容器写数据方法,分布式文件系统服务端获取到逻辑存储路径和数据写请求信息后,根据数据写请求信息,利用进程间通信方式从共享内存中获取待写数据,然后根据逻辑存储路径将待写数据写入对应磁盘空间。由于直接从内核态进行操作,减少CDN网元容器服务数据处理流程,实现CDN网元容器的存储性能最大化处理,能够有效降低CDN相关存储业务的时延,提升数据写入效率。
另外,在一实施例中,还提供一种CDN网元容器读数据方法,参照图1的CDN网元容器存储架构,该方法应用于与宿主机内核平台通信连接的CDN网元容器,宿主机内核平台包括分布式文件系统服务端和共享内存,CDN网元容器包括分布式文件系统客户端,分布式文件系统客户端和分布式文件系统服务端均可访问共享内存。
如图12所示,图12是本申请一个实施例提供的CDN网元容器读数据方法的流程图,包括但不限于有步骤S4110和步骤S4140。
步骤S4110,获取逻辑存储路径。
在一实施例中,参照图13,步骤S4110包括但不限于以下步骤。
步骤S4111,获取文件存储标识。
在一实施例中,可以通过以下两种方式获取文件存储标识。1)根据用户请求信息中的url获取请求业务资源类型,根据预设提取规则从用户请求信息中提取处文件存储标识,预设提取规则可以是提前和运营商等业务参与方协商确定好的。例如可以是预先指定不同业务资源种类对应的提取规则,也可以是相关技术中通用的url资源分类规则,根据不同的业务资源类型,分别获取文件存储标识,在此不对预设提取规则进行限定。2)根据业务特征获取文件存储标识,此处,业务特性可以是提前和运营商等业务参与方协商确定好的。
在一实施例中,文件存储标识可以是预设前缀标识+url路径组成,每个文件存储标识对应一个唯一编码,后续读写过程中,将该文件存储标识作为唯一的资源文件索引。
步骤S4112,根据文件存储标识和对应容器路径生成逻辑存储路径。
在一实施例中,将上述文件存储标识预配置的对应容器挂载目录中容器路径组合为逻辑存储路径。
步骤S4120,将逻辑存储路径和数据读请求信息通过进程间通信发送至分布式文件系统服务端,以使得分布式文件系统服务端根据数据读请求信息,在共享内存中获取待读数据进行数据读操作。
在一实施例中,CDN网元容器的分布式文件系统客户端将上述生成的逻辑存储路径和数据读请求信息通过进程间通信方式,发送至宿主机内核平台的分布式文件系统服务端,后续读数据时,分布式文件系统服务端可以根据接收到的数据读请求信息,在共享内存中获取待读数据进行数据读操作。
本申请实施例的CDN网元容器读数据方法,CDN网元容器利用进程间通信方式将生成的逻辑存储路径和数据读请求信息发送至分布式文件系统服务端,以使得分布式文件系统服务端根据数据读请求信息,在共享内存中获取待读数据进行数据读操作。由于直接从内核态进行操作,减少CDN网元容器服务数据处理流程,实现CDN网元容器的存储性能最大化处理,能够有效降低CDN相关存储业务的时延,提升数据读取效率。
本申请实施例的CDN网元容器读数据方法,CDN网元容器利用进程间通信方式将生成的逻辑存储路径和数据读请求信息发送至分布式文件系统服务端,以使得分布式文件系统服务端可以根据接收到的数据读请求信息,将待读数据写入共享内存中,进行后续数据读操作。由于直接从内核态进行操作,减少CDN网元容器服务数据处理流程,实现CDN网元容器的存储性能最大化处理,能够有效降低CDN相关存储业务的时延,提升数据写入效率。
另外,在一实施例中,还提供一种CDN网元容器读数据方法,参照图1的CDN网元容器存储架构,该方法应用于与CDN网元容器通信连接的宿主机内核平台,宿主机内核平台包括分布式文件系统服务端和共享内存,CDN网元容器包括分布式文件系统客户端,分布式文件系统客户端和分布式文件系统服务端均可访问共享内存。
如图14所示,图14是本申请一个实施例提供的CDN网元容器读数据方法的流程图,包括但不限于有步骤S5110和步骤S5130。
步骤S5110,获取逻辑存储路径和数据读请求信息,逻辑存储路径为CDN网元容器根据文件存储标识和对应容器路径生成,逻辑存储路径能够被转换为宿主机上存储器的物理存储路径。
在一实施例中,分布式文件系统服务端接收CDN网元容器的分布式文件系统客户端通过进程间通信方式发送的逻辑存储路径和数据读请求信息。
步骤S5120,分布式文件系统服务端根据数据读请求信息,利用逻辑存储路径获取待读数据的位置标识。
在一实施例中,分布式文件系统服务端根据数据读请求信息利用客户端代理模块,访问逻辑存储路径对应的分布式文件系统的文件位置寄存器,从文件位置寄存器中获取位置标识。例如,通过文件位置寄存器获取待读文件的chunkid得到位置标识,其中chunk表示一个文件,chunkId就是给每个文件一个唯一标识id,因此根据待读文件的chunkid可以定位到待读文件的具体存储位置。
步骤S5130,根据位置标识将待读数据拷贝到共享内存,以使得分布式文件系统客户端能够利用进程间通信方式从共享内存中读取待读数据。
在一实施例中,参照图15,步骤S5130包括但不限于有以下步骤。
步骤S5131,根据位置标识获取当前待读数据。
步骤S5132,获取当前待读数据的访问频率值:
1)若访问频率值大于等于预设访问频率,则将待读数据拷贝到共享内存。
在一实施例中,当前待读数据的访问频率值大于等于预设访问频率,则认为该待读数据属于高频访问文件,根据预先设定的访问规则,将高频访问文件存储在共享内存中,因此可以在共享内存中可以直接获取该待读文件。
2)若访问频率值小于预设访问频率,则将待读数据写入内核缓存,并增加访问频率值,然后将待读数据拷贝到共享内存。
在一实施例中,当前待读数据的访问频率值小于预设访问频率,则认为该待读数据属于低频访问文件,根据预先设定的访问规则,分布式文件系统服务端的文件访问服务器会申请一块内核缓存,将该待读数据写入内核缓存中,磁盘线程将该待读数据从内核缓存中拷贝到共享内存中,同时对应的访问频率值增加1,内核缓存中的数据可以按照预设清理规则进行释放。
在一实施例中,分布式文件系统服务端根据逻辑存储路径查找待读数据,如果该文件不存在,则发送错误信息以及对应的错误码,如果该文件存在,则按照上述方式将待读数据写入共享内存中,以便分布式文件系统客户端进行读取。
在一实施例中,参考图16,是本申请一个实施例提供的CDN网元容器读数据方法的流程图,包括但不限于以下步骤。
步骤S310,获取逻辑存储路径和数据读请求信息。
其中,逻辑存储路径为CDN网元容器根据文件存储标识和对应容器路径生成,逻辑存储路径能够被转换为宿主机上存储器的物理存储路径。
步骤S320,分布式文件系统服务端根据数据读请求信息从共享内存中获取待写数据。
步骤S330,分布式文件系统服务端判断待读数据是否是高频访问数据,如果是则进入步骤S340,否则进入步骤S350。
步骤S340,将属于高频访问数据的待读数据拷贝到共享内存。
步骤S350,将待读数据写入内核缓存,并增加访问频率值,然后进入步骤S340,将待读数据拷贝到共享内存。
本申请实施例的CDN网元容器读数据方法,分布式文件系统服务端获取到逻辑存储路径和数据读请求信息后,利用进程间通信方式将待读数据写入共享内存中,使得CDN网元容器的分布式文件系统客户端能够利用进程间通信方式从共享内存中读取待读数据。由于直接从内核态进行操作,减少CDN网元容器服务数据处理流程,实现CDN网元容器的存储性能最大化处理,能够有效降低CDN相关存储业务的时延,提升数据写入效率。
另外,在一实施例中,参照图17,提供一种CDN网元容器实例化配置装置,CDN网元容器部署在宿主机上,宿主机上安装有宿主机内核平台,宿主机内核平台包括分布式文件系统服务端,装置包括:
初始化配置模块410,用于初始化配置一个或多个CDN网元容器;
配置信息获取模块420,用于获取进程间通信配置信息和分布式文件系统能力信息;
进程间通信配置模块430,用于根据分布式文件系统能力信息,建立CDN网元容器与分布式文件系统的数据交互通道,以完成CDN网元容器实例化配置;
分布式文件系统服务端配置模块440,用于根据分布式文件系统能力信息进行分布式文件系统服务端的配置,以完成CDN网元容器实例化配置。
另外,在一实施例中,参照图18,一种CDN网元容器写数据装置,应用于与CDN网元容器通信连接的宿主机内核平台,宿主机内核平台包括分布式文件系统服务端和共享内存,CDN网元容器包括分布式文件系统客户端,分布式文件系统客户端和分布式文件系统服务端访问共享内存;装置包括:
第一获取逻辑存储路径模块510,用于获取逻辑存储路径和数据写请求信息,逻辑存储路径为CDN网元容器根据文件存储标识和对应容器路径生成;
获取待写数据模块520,用于分布式文件系统服务端根据数据写请求信息,从共享内存中获取待写数据;
写磁盘空间模块530,用于根据逻辑存储路径将待写数据写入对应磁盘空间。
另外,在一实施例中,参照图19,一种CDN网元容器读数据装置,应用于宿主机,CDN网元容器位于宿主机上,宿主机上安装有宿主机内核平台,CDN网元容器与宿主机内核平台通信连接,宿主机内核平台包括分布式文件系统服务端和共享内存,CDN网元容器包括分布式文件系统客户端,分布式文件系统客户端和分布式文件系统服务端访问共享内存;
装置包括:
第二获取逻辑存储路径模块610,用于获取逻辑存储路径和数据读请求信息,逻辑存储路径为CDN网元容器根据文件存储标识和对应容器路径生成;
获取位置标识模块620,用于分布式文件系统服务端根据数据读请求信息,利用逻辑存储路径获取待读数据的位置标识;
读取待读数据模块630,用于根据位置标识将待读数据拷贝到共享内存,以使得分布式文件系统客户端能够利用进程间通信方式从共享内存中读取待读数据。
以上所描述的CDN网元容器实例化配置装置、CDN网元容器写数据装置和CDN网元容器读数据装置的实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本申请实施例方案的目的。
需要说明的是,本申请实施例中的CDN网元容器实例化配置装置,可以执行如图2所示实施例中的CDN网元容器实例化配置方法。即,本申请实施例中的CDN网元容器实例化配置装置和如图2所示实施例中的CDN网元容器实例化配置方法,均属于相同的发明构思,因此这些实施例具有相同的实现原理以及技术效果,此处不再详述。
需要说明的是,本申请实施例中的CDN网元容器写数据装置,可以执行如图9所示实施例中的CDN网元容器写数据方法。即,本申请实施例中的CDN网元容器写数据装置和如图9所示实施例中的CDN网元容器写数据方法,均属于相同的发明构思,因此这些实施例具有相同的实现原理以及技术效果,此处不再详述。
需要说明的是,本申请实施例中的CDN网元容器读数据装置,可以执行如图13所示实施例中的CDN网元容器读数据方法。即,本申请实施例中的CDN网元容器读数据装置和如图13所示实施例中的CDN网元容器读数据方法,均属于相同的发明构思,因此这些实施例具有相同的实现原理以及技术效果,此处不再详述。
另外,本申请实施例的一个实施例还提供了计算机设备,计算机设备包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序。
处理器和存储器可以通过总线或者其他方式连接。
存储器作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序以及非暂态性计算机可执行程序。此外,存储器可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施方式中,存储器可选包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至该处理器。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
实现上述实施例的CDN网元容器实例化配置方法、CDN网元容器写数据方法或CDN网元容器读数据方法所需的非暂态软件程序以及指令存储在存储器中,当被处理器执行时,执行上述实施例中的CDN网元容器实例化配置方法、CDN网元容器写数据方法或CDN网元容器读数据方法。
此外,本申请实施例的一个实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机可执行指令,该计算机可执行指令被一个处理器或控制器执行,例如,被上述计算机设备实施例中的一个处理器执行,可使得上述处理器执行上述实施例中的CDN网元容器实例化配置方法、CDN网元容器写数据方法或CDN网元容器读数据方法。
又如,被上述计算机设备实施例中的一个处理器执行,可使得上述处理器执行上述实施例中的CDN网元容器实例化配置方法、CDN网元容器写数据方法或CDN网元容器读数据方法。
本申请实施例第一方面提供的一种CDN网元容器实例化配置方法,与相关技术相比,通过初始化配置一个或多个CDN网元容器,然后获取进程间通信配置信息和分布式文件系统能力信息,根据进程间通信配置信息对进程间通信配置参数进行配置,使得CDN网元容器与宿主机内核平台实现进程间通信,根据分布式文件系统能力信息,建立CDN网元容器与分布式文件系统的数据交互通道,以完成CDN网元容 器实例化配置。本申请实施例通过CDN网元容器与宿主机平台进程间通信的方式,使CDN网元容器的存储相关业务在服务过程中,直接从内核态进行操作,避免相关技术中存储相关业务需要在用户内存和内核内存之间互相拷贝,影响文件读写的性能的问题,通过减少CDN网元容器服务数据处理流程,从而实现CDN网元容器服务的优化处理,能够有效降低CDN相关业务的时延,提升服务性能。
可以理解的是,上述第二方面至第十方面与相关技术相比存在的有益效果与上述第一方面与相关技术相比存在的有益效果相同,可以参见上述第一方面中的相关描述,在此不再赘述。
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统可以被实施为软件、固件、硬件及其适当的组合。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。
以上是对本申请实施例的一些实施进行了具体说明,但本申请实施例并不局限于上述实施方式,熟悉本领域的技术人员在不违背本申请实施例精神的前提下还可做出种种的等同变形或替换,这些等同的变形或替换均包含在本申请实施例权利要求所限定的范围内。

Claims (23)

  1. 一种CDN网元容器实例化配置方法,所述CDN网元容器部署在宿主机上,所述宿主机上安装有宿主机内核平台,所述方法包括:
    初始化配置一个或多个CDN网元容器;
    获取进程间通信配置信息和分布式文件系统能力信息;
    根据所述进程间通信配置信息对进程间通信配置参数进行配置,使得所述CDN网元容器与宿主机内核平台实现进程间通信;
    根据所述分布式文件系统能力信息,建立CDN网元容器与分布式文件系统的数据交互通道,以完成所述CDN网元容器实例化配置。
  2. 根据权利要求1所述的CDN网元容器实例化配置方法,其中,所述进程间通信配置参数为hostIPC参数;
    所述根据所述进程间通信配置信息对进程间通信配置参数进行配置,包括:
    将所述hostIPC参数配置为true。
  3. 根据权利要求1所述的CDN网元容器实例化配置方法,其中,所述宿主机内核平台包括分布式文件系统服务端,所述CDN网元容器包括分布式文件系统客户端,所述分布式文件系统服务端和所述分布式文件系统客户端通信连接;
    所述根据所述分布式文件系统能力信息,建立CDN网元容器与分布式文件系统服务端的数据交互通道,包括:
    根据所述分布式文件系统能力信息,判断所述宿主机内核平台是否支持分布式文件系统;
    若支持分布式文件系统,则在所述宿主机内核平台中创建共享内存,以建立所述数据交互通道,以使得所述分布式文件系统客户端和所述分布式文件系统服务端均可利用所述数据交互通道访问所述共享内存。
  4. 根据权利要求3所述的CDN网元容器实例化配置方法,其中,所述根据所述分布式文件系统能力信息进行所述分布式文件系统服务端的配置,包括:
    为所述分布式文件系统服务端的存储目录配置对应数据卷;
    将所述数据卷挂载到对应容器路径中,以使得所述CDN网元容器能够通过所述容器路径与所述分布式文件系统服务端对应的数据卷进行数据交互。
  5. 根据权利要求4所述的CDN网元容器实例化配置方法,其中,所述数据卷包括:第一数据卷和第二数据卷;
    所述将所述数据卷挂载到对应容器路径中,包括:
    将所述第一数据卷挂载到第一容器路径中,以使得可利用hostpath调用方式对所述第一数据卷进行调用;
    将所述第二数据卷挂载到第二容器路径中,以使得可利用sendfile读写方式对所述第二数据卷进行读写。
  6. 根据权利要求5所述的CDN网元容器实例化配置方法,其中,所述第一数据卷用于存储第一类型数据,所述第二数据卷用于存储第二类型数据;
    所述第一类型数据为符合第一性能约束条件的内容数据;
    所述第二类型数据为不符合第一性能约束条件的内容数据。
  7. 根据权利要求1所述的CDN网元容器实例化配置方法,其中,所述初始化配置一个或多个CDN网元容器,包括:
    获取所述一个或多个CDN网元容器的初始化配置信息;
    根据所述初始化配置信息生成资源创建信息;
    根据所述资源创建信息初始化配置一个或多个所述CDN网元容器。
  8. 一种CDN网元容器写数据方法,应用于与宿主机内核平台通信连接的CDN网元容器,所述宿主机内核平台包括分布式文件系统服务端和共享内存,所述CDN网元容器包括分布式文件系统客户端,所述分布式文件系统客户端和所述分布式文件系统服务端均可访问所述共享内存;
    所述方法包括:
    获取逻辑存储路径;
    利用分布式文件系统客户端,将待写数据写入所述共享内存中;
    利用分布式文件系统客户端,将所述逻辑存储路径和数据写请求信息通过进程间通信发送至所述分布式文件系统服务端,以使得所述分布式文件系统服务端根据所述数据写请求信息,在所述共享内存中获取 所述待写数据进行数据写操作。
  9. 根据权利要求8所述的CDN网元容器写数据方法,其中,所述获取逻辑存储路径,包括:
    获取文件存储标识;
    根据所述文件存储标识和对应容器路径生成所述逻辑存储路径。
  10. 一种CDN网元容器写数据方法,应用于与CDN网元容器通信连接的宿主机内核平台,所述宿主机内核平台包括分布式文件系统服务端和共享内存,所述CDN网元容器包括分布式文件系统客户端,所述分布式文件系统客户端和所述分布式文件系统服务端访问所述共享内存;
    所述方法包括:
    获取逻辑存储路径和数据写请求信息,所述逻辑存储路径为所述CDN网元容器根据文件存储标识和对应容器路径生成;
    所述分布式文件系统服务端根据所述数据写请求信息,从所述共享内存中获取待写数据;
    根据所述逻辑存储路径将所述待写数据写入对应磁盘空间。
  11. 根据权利要求10所述的CDN网元容器写数据方法,其中,所述根据所述逻辑存储路径将所述待写数据写入对应磁盘空间,包括:
    所述分布式文件系统服务端根据所述数据写请求信息,将所述待写数据写入内核缓存中,并生成内存占用标识;
    根据所述逻辑存储路径和所述内存占用标识,将所述内核缓存中所述待写数据写入对应磁盘空间。
  12. 根据权利要求11所述的CDN网元容器写数据方法,其中,所述分布式文件系统服务端根据所述数据写请求信息,将所述待写数据写入内核缓存中,包括:
    所述分布式文件系统服务端的客户端代理模块利用进程间通信方式,根据所述数据写请求信息,将所述待写数据写入内核缓存中。
  13. 根据权利要求10所述的CDN网元容器写数据方法,其中,还包括:若所述逻辑存储路径不存在,创建所述逻辑存储路径。
  14. 一种CDN网元容器读数据方法,应用于CDN网元容器,所述CDN网元容器位于宿主机上,所述宿主机上安装有宿主机内核平台,所述CDN网元容器与所述宿主机内核平台通信连接,所述宿主机内核平台包括分布式文件系统服务端和共享内存,所述CDN网元容器包括分布式文件系统客户端,所述分布式文件系统客户端和所述分布式文件系统服务端访问所述共享内存;
    所述方法包括:
    获取逻辑存储路径;
    将所述逻辑存储路径和数据读请求信息通过进程间通信发送至所述分布式文件系统服务端,以使得所述分布式文件系统服务端根据所述数据读请求信息,在所述共享内存中获取所述待读数据进行数据读操作。
  15. 根据权利要求14所述的CDN网元容器写数据方法,其中,所述获取逻辑存储路径,包括:
    获取文件存储标识;
    根据所述文件存储标识和对应容器路径生成所述逻辑存储路径。
  16. 一种CDN网元容器读数据方法,应用于宿主机,所述CDN网元容器位于宿主机上,所述宿主机上安装有宿主机内核平台,所述CDN网元容器与所述宿主机内核平台通信连接,所述宿主机内核平台包括分布式文件系统服务端和共享内存,所述CDN网元容器包括分布式文件系统客户端,所述分布式文件系统客户端和所述分布式文件系统服务端访问所述共享内存;
    所述方法包括:
    获取逻辑存储路径和数据读请求信息,所述逻辑存储路径为所述CDN网元容器根据文件存储标识和对应容器路径生成;
    所述分布式文件系统服务端根据所述数据读请求信息,利用所述逻辑存储路径获取待读数据的位置标识;
    根据所述位置标识将所述待读数据拷贝到所述共享内存,以使得所述分布式文件系统客户端能够利用进程间通信方式从所述共享内存中读取所述待读数据。
  17. 根据权利要求16所述的CDN网元容器读数据方法,其中:所述分布式文件系统服务端根据所述数据读请求信息,利用所述逻辑存储路径获取待读数据的位置标识,包括:
    所述分布式文件系统服务端根据所述数据读请求信息利用客户端代理模块,访问所述逻辑存储路径对应的所述分布式文件系统的文件位置寄存器;
    获取所述位置标识。
  18. 根据权利要求16所述的CDN网元容器读数据方法,其中:所述根据所述位置标识将所述待读数据拷贝到所述共享内存,还包括:
    根据所述位置标识获取当前待读数据;
    获取所述当前待读数据的访问频率值:
    若访问频率值大于等于预设访问频率,则将所述待读数据拷贝到所述共享内存;
    若访问频率值小于所述预设访问频率,则将所述待读数据写入内核缓存,并增加所述访问频率值,然后将所述待读数据拷贝到所述共享内存。
  19. 一种CDN网元容器实例化配置装置,所述CDN网元容器部署在宿主机上,所述宿主机上安装有宿主机内核平台,所述装置包括:
    初始化配置模块,用于初始化配置一个或多个CDN网元容器;
    配置信息获取模块,用于获取进程间通信配置信息和分布式文件系统能力信息;
    进程间通信配置模块,用于根据所述进程间通信配置信息对进程间通信配置参数进行配置,使得所述CDN网元容器与宿主机内核平台实现进程间通信;
    分布式文件系统服务端配置模块,用于根据所述分布式文件系统能力信息,建立CDN网元容器与分布式文件系统的数据交互通道,以完成所述CDN网元容器实例化配置。
  20. 一种CDN网元容器写数据装置,应用于与CDN网元容器通信连接的宿主机内核平台,所述宿主机内核平台包括分布式文件系统服务端和共享内存,所述CDN网元容器包括分布式文件系统客户端,所述分布式文件系统客户端和所述分布式文件系统服务端访问所述共享内存;
    所述装置包括:
    第一获取逻辑存储路径模块,用于获取逻辑存储路径和数据写请求信息,所述逻辑存储路径为所述CDN网元容器根据文件存储标识和对应容器路径生成;
    获取待写数据模块,用于所述分布式文件系统服务端根据所述数据写请求信息,从所述共享内存中获取待写数据;
    写磁盘空间模块,用于根据所述逻辑存储路径将所述待写数据写入对应磁盘空间。
  21. 一种CDN网元容器读数据装置,应用于宿主机,所述CDN网元容器位于宿主机上,所述宿主机上安装有宿主机内核平台,所述CDN网元容器与所述宿主机内核平台通信连接,所述宿主机内核平台包括分布式文件系统服务端和共享内存,所述CDN网元容器包括分布式文件系统客户端,所述分布式文件系统客户端和所述分布式文件系统服务端访问所述共享内存;
    所述装置包括:
    第二获取逻辑存储路径模块,用于获取逻辑存储路径和数据读请求信息,所述逻辑存储路径为所述CDN网元容器根据文件存储标识和对应容器路径生成;
    获取位置标识模块,用于所述分布式文件系统服务端根据所述数据读请求信息,利用所述逻辑存储路径获取待读数据的位置标识;
    读取待读数据模块,用于根据所述位置标识将所述待读数据拷贝到所述共享内存,以使得所述分布式文件系统客户端能够利用进程间通信方式从所述共享内存中读取所述待读数据。
  22. 一种计算机设备,其中,包括处理器以及存储器;
    所述存储器用于存储程序;
    所述处理器用于根据所述程序执行如权利要求1至7中任一项所述的方法;或者,权利要求8至9中任一项所述的方法;或者,权利要求10至13中任一项所述的方法;或者,权利要求14至15中任一项所述的方法;或者,权利要求16至18中任一项所述的方法。
  23. 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行如权利要求1至7中任一项所述的方法;或者,权利要求8至9中任一项所述的方法;或者,权利要求10至13中任一项所述的方法;或者,权利要求14至15中任一项所述的方法;或者,权利要求16至18中任一项所述的方法。
PCT/CN2022/114284 2021-10-21 2022-08-23 Cdn网元容器配置方法、读写方法、装置、设备及存储介质 WO2023065809A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111228686.6 2021-10-21
CN202111228686.6A CN116016498A (zh) 2021-10-21 2021-10-21 Cdn网元容器配置方法、读写方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2023065809A1 true WO2023065809A1 (zh) 2023-04-27

Family

ID=86025300

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/114284 WO2023065809A1 (zh) 2021-10-21 2022-08-23 Cdn网元容器配置方法、读写方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN116016498A (zh)
WO (1) WO2023065809A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116233520B (zh) * 2023-05-06 2023-07-25 海马云(天津)信息技术有限公司 传递和获取视频数据的方法及装置、服务器设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107135103A (zh) * 2017-05-08 2017-09-05 网宿科技股份有限公司 在异构资源上构建内容分发网络平台的方法和系统
CN107590033A (zh) * 2017-09-07 2018-01-16 网宿科技股份有限公司 一种创建docker容器的方法、装置和系统
CN108304269A (zh) * 2017-01-13 2018-07-20 阿里巴巴集团控股有限公司 一种数据的发送、接收方法、装置及通信框架
CN109525413A (zh) * 2017-09-20 2019-03-26 中兴通讯股份有限公司 Cdn网络功能虚拟化的管理方法、装置及系统
US20200351327A1 (en) * 2019-04-30 2020-11-05 Verizon Digital Media Services Inc. Function manager for an edge compute network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108304269A (zh) * 2017-01-13 2018-07-20 阿里巴巴集团控股有限公司 一种数据的发送、接收方法、装置及通信框架
CN107135103A (zh) * 2017-05-08 2017-09-05 网宿科技股份有限公司 在异构资源上构建内容分发网络平台的方法和系统
CN107590033A (zh) * 2017-09-07 2018-01-16 网宿科技股份有限公司 一种创建docker容器的方法、装置和系统
CN109525413A (zh) * 2017-09-20 2019-03-26 中兴通讯股份有限公司 Cdn网络功能虚拟化的管理方法、装置及系统
US20200351327A1 (en) * 2019-04-30 2020-11-05 Verizon Digital Media Services Inc. Function manager for an edge compute network

Also Published As

Publication number Publication date
CN116016498A (zh) 2023-04-25

Similar Documents

Publication Publication Date Title
US11934341B2 (en) Virtual RDMA switching for containerized
US9588807B2 (en) Live logical partition migration with stateful offload connections using context extraction and insertion
US8830870B2 (en) Network adapter hardware state migration discovery in a stateful environment
US7552298B2 (en) Method and system for deferred pinning of host memory for stateful network interfaces
US10452296B1 (en) Accelerated volumes
US8937940B2 (en) Optimized virtual function translation entry memory caching
US9864717B2 (en) Input/output processing
US8819242B2 (en) Method and system to transfer data utilizing cut-through sockets
WO2016119469A1 (zh) 业务上下文管理方法、物理主机、pcie设备及迁移管理设备
WO2019100266A1 (zh) 移动边缘主机服务通知方法和装置
US8185633B1 (en) Method and apparatus for offloading network processes in a computer storage system
WO2021139264A1 (zh) 对象存储控制方法、装置、计算机设备及存储介质
CN109857545B (zh) 一种数据传输方法及装置
US20210326270A1 (en) Address translation at a target network interface device
WO2023065809A1 (zh) Cdn网元容器配置方法、读写方法、装置、设备及存储介质
CN114371811A (zh) 用于存储管理的方法、电子设备和计算机程序产品
CN114756388A (zh) 一种基于rdma的集群系统节点间按需共享内存的方法
US11283723B2 (en) Technologies for managing single-producer and single consumer rings
CN115129625A (zh) 外围设备中的增强的存储协议仿真
US20140025859A1 (en) Input/output processing
CN110471627B (zh) 一种共享存储的方法、系统及装置
CN108063737B (zh) 一种FCoE存储区域网读请求处理方法及系统
CN116418848A (zh) 网络节点的配置和访问请求的处理方法、装置
WO2023134392A1 (zh) 云存储设备的数据读取和写入方法及系统
US20240103897A1 (en) Diversified virtual memory

Legal Events

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

Ref document number: 22882428

Country of ref document: EP

Kind code of ref document: A1