Application deployment method, application fluidization method, computing device and computer storage medium
By storing application files to the storage directory of the target physical machine and mapping the application installation directory of the container to the storage directory, efficient application deployment is achieved, solving the problems of low deployment efficiency and high storage space consumption in the prior art.
Patent Information
- Application Number
- CN202311041274.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-17
- Publication Date
- 2025-02-25
AI Technical Summary
When deploying applications to a large number of containers, the prior art requires repeated deployment operations, which is inefficient, and each container needs to obtain installation packages, consuming a large amount of storage space.
By storing the application files of the target application to the target storage directory of the target physical machine and mapping the container's application installation directory to the storage directory, a deployment instruction is sent to the container, so that the container can read the application files through the mapping directory for deployment.
Improve application deployment efficiency, reduce storage space consumption, and avoid the need to store application files separately for each container.
Smart Images

Figure CN119512570A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to an application deployment method, an application streaming method, a computing device, and a computer storage medium. Background Art
[0002] The development of container technology has led to major changes in the way applications are deployed. By deploying applications in containers, differences in the external environment can be shielded. For example, for local devices with low performance that require application operation, applications can be deployed and run in containers, and then application data can be streamed to local devices to meet the application operation requirements of local devices.
[0003] In actual application scenarios, there is a need to deploy applications to a large number of containers, for example, deploying a video playback application to thousands or even tens of thousands of containers. To meet this need, the relevant technology usually deploys the application installation package to each container separately, and then each container decompresses the installation package to obtain the application file, and then installs the application into the container.
[0004] In the process of implementing the concept of the present invention, the inventors found that the application deployment solution, on the one hand, requires repeated application deployment operations, which is inefficient, and on the other hand, each container needs to obtain an installation package, which consumes a large amount of storage space. Summary of the invention
[0005] Embodiments of the present invention provide an application deployment method, an application streaming method, a computing device, and a computer storage medium.
[0006] In a first aspect, an embodiment of the present invention provides an application deployment method, including:
[0007] Storing the application files of the target application in the target storage directory in the target physical machine;
[0008] Determine at least one container running in the target physical machine;
[0009] Mapping the application installation directory of the at least one container to the target storage directory;
[0010] An application deployment instruction is sent to the at least one container, so that the at least one container reads the target storage directory through the application installation directory in response to the application installation instruction to deploy the target application based on the application file.
[0011] In a second aspect, an embodiment of the present invention provides an application deployment method, including:
[0012] Receive a directory mapping operation, where the directory mapping operation is used to map an application installation directory of the container to a target storage directory of a target physical machine, where application files of a target application are stored in the target storage directory;
[0013] Receive application deployment instructions;
[0014] In response to the application deployment instruction, the target storage directory is read through the application installation directory to deploy the target application based on the application file.
[0015] In a third aspect, an embodiment of the present invention provides an application streaming method, including:
[0016] Receive a directory mapping operation, where the directory mapping operation is used to map an application installation directory of the container to a target storage directory of a target physical machine, where application files of a video application are stored in the target storage directory;
[0017] Receive application deployment instructions;
[0018] In response to the application deployment instruction, reading the target storage directory through the application installation directory to deploy the video application based on the application file;
[0019] In response to the video application being deployed successfully, running the video application to generate video stream data;
[0020] The video stream data is sent to a target set-top box so that the target set-top box parses the video stream data to obtain a video picture and displays the video picture.
[0021] In a fourth aspect, an embodiment of the present invention provides an application deployment device, including:
[0022] A storage module, used for storing application files of a target application in a target storage directory in a target physical machine;
[0023] A container determination module, used to determine at least one container running in the target physical machine;
[0024] A mapping module, configured to map the application installation directory of the at least one container to the target storage directory;
[0025] A deployment module is used to send an application deployment instruction to the at least one container, so that the at least one container reads the target storage directory through the application installation directory in response to the application installation instruction to deploy the target application based on the application file.
[0026] In a fifth aspect, an embodiment of the present invention provides an application deployment device, including:
[0027] A first operation receiving module is used to receive a directory mapping operation, wherein the directory mapping operation is used to map the application installation directory of the container to a target storage directory of the target physical machine, wherein the target storage directory stores application files of the target application;
[0028] A first instruction receiving module, used to receive an application deployment instruction;
[0029] The first reading module is used to respond to the application deployment instruction and read the target storage directory through the application installation directory to deploy the target application based on the application file.
[0030] In a sixth aspect, an embodiment of the present invention provides an application fluidization device, comprising:
[0031] A second operation receiving module is used to receive a directory mapping operation, wherein the directory mapping operation is used to map the application installation directory of the container to a target storage directory of the target physical machine, wherein the application files of the video application are stored in the target storage directory;
[0032] A second instruction receiving module, used to receive an application deployment instruction;
[0033] a second reading module, configured to respond to the application deployment instruction and read the target storage directory through the application installation directory to deploy the video application based on the application file;
[0034] An operation module, configured to operate the video application and generate video stream data in response to successful deployment of the video application;
[0035] The data sending module is used to send the video stream data to a target set-top box so that the target set-top box can parse the video stream data to obtain a video picture and display the video picture.
[0036] In a seventh aspect, an embodiment of the present invention provides a computing device, including a processing component and a storage component;
[0037] The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the application deployment method provided by the embodiment of the present invention, or to implement the application streaming method provided by the embodiment of the present invention.
[0038] In an eighth aspect, a computer storage medium is provided in an embodiment of the present invention, storing a computer program, and when the computer program is executed by a computer, it implements the application deployment method provided in an embodiment of the present invention, or implements the application streaming method provided in an embodiment of the present invention.
[0039] An embodiment of the present invention provides an application deployment method, which adopts: storing application files of a target application in a target storage directory in a target physical machine; determining at least one container running in the target physical machine; mapping the application installation directory of at least one container to the target storage directory; sending an application deployment instruction to at least one container, so that at least one container reads the target storage directory through the application installation directory in response to the application installation instruction, so as to achieve a technical solution for deploying the target application based on the application file, and only needs to store the application files of the target application in the target storage directory on the target physical machine, and multiple containers running on the target physical machine can access the target storage directory through the created directory mapping relationship, so as to realize the deployment of the target application in the container, without storing the application files for each container, thereby improving the deployment efficiency of the application and reducing the consumption of storage space.
[0040] These and other aspects of the present invention will become more apparent from the following description of the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 The general architecture diagram of the container orchestration system Kubernetes is schematically shown;
[0043] Figure 2 A flowchart of an application deployment method provided by an embodiment of the present invention is schematically shown;
[0044] Figure 3 A schematic diagram schematically shows an application deployment method provided by an embodiment of the present invention;
[0045] Figure 4 A schematic diagram schematically shows an application deployment method provided by an embodiment of the present invention;
[0046] Figure 5 A flowchart of an application deployment method provided by another embodiment of the present invention is schematically shown;
[0047] Figure 6 A flowchart of an application streaming method provided by an embodiment of the present invention is schematically shown;
[0048] Figure 7 A block diagram of an application deployment device provided by an embodiment of the present invention is schematically shown;
[0049] Figure 8 A block diagram of an application deployment device provided by another embodiment of the present invention is schematically shown;
[0050] Fig. 9 A block diagram of an application fluidization device provided by an embodiment of the present invention is schematically shown;
[0051] Fig.10 A block diagram of a computing device provided by an embodiment of the present invention is schematically shown. DETAILED DESCRIPTION
[0052] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0053] In some of the processes described in the specification and claims of the present invention and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.
[0054] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0055] Figure 1 The general architecture diagram of the container orchestration system Kubernetes is schematically shown.
[0056] like Figure 1As shown, kubernetes divides the nodes in the cluster into a master node (Master) and at least one worker node (Node). Master and Node can be physical machines or virtual machines in a cloud environment. The cloud environment is specifically a computing cluster including at least one cloud computing device (such as a central server). In some implementations, Master and Node can also be physical machines or virtual machines in an edge environment. The edge environment is specifically a computing cluster including at least one edge computing device (such as an edge server). In other implementations, Master and Node can also be end devices or virtual machines on end devices. It should be noted that Master and Node can be physical machines or virtual machines in the same environment, or physical machines or virtual machines in different environments. For example, Master can be a physical machine in a cloud environment, and Node can be a physical machine in an edge environment.
[0057] Among them, the Master runs a group of processes related to cluster management, such as the interface server (kube-apiserver), kube controller manager (kube-controller-manager), scheduler (kube-scheduler), and storage (etcd). The kube-apiserver relies on etcd to store data. Through these processes, the Master can achieve management capabilities such as resource management, pod scheduling, elastic scaling, security control, and error correction for the entire cluster.
[0058] The Node runs the application process to provide the application process with the resources it needs to run. The application process runs in the pod container. The Node also runs service processes, such as the proxy (kubelet) and network proxy (kube-proxy). The Node uses these service processes to create, start, restart, destroy, and load balance Pods.
[0059] Figure 1 The example below shows that a kubernetes cluster includes a Master and a Node. In some implementations, a kubernetes cluster can include multiple Nodes, so that applications can be deployed in multiple nodes in a distributed manner. Furthermore, a kubernetes cluster can also include multiple Masters. When a Master fails, another Master can be enabled, so that high availability can be guaranteed.
[0060] By deploying applications into containers and running them in containers, the differences in the external environment can be shielded. For example, for local devices with low performance that have application running requirements, applications can be deployed and run in containers, and then application data can be streamed to local devices to meet the application running requirements of local devices.
[0061] In actual application scenarios, there is a need to deploy applications to a large number of containers, for example, deploying a video playback application to thousands or even tens of thousands of containers. To meet this need, the relevant technology usually deploys the application installation package to each container separately, and then each container decompresses the installation package to obtain the application file, and then installs the application into the container.
[0062] In the process of implementing the concept of the present invention, the inventors found that the application deployment solution, on the one hand, requires repeated application deployment operations, which is inefficient, and on the other hand, each container needs to obtain an installation package, which consumes a large amount of storage space.
[0063] In order to solve the problems existing in the related art, an embodiment of the present invention provides an application deployment method, which adopts: storing application files of a target application in a target storage directory in a target physical machine; determining at least one container running in the target physical machine; mapping the application installation directory of at least one container to the target storage directory; sending an application deployment instruction to at least one container, so that at least one container reads the target storage directory through the application installation directory in response to the application installation instruction. In order to deploy the target application based on the application file, it is only necessary to store the application files of the target application in the target storage directory on the target physical machine. Multiple containers running on the target physical machine can access the target storage directory through the created directory mapping relationship, thereby realizing the deployment of the target application in the container. There is no need to store application files for each container, thereby improving the deployment efficiency of the application and reducing the consumption of storage space.
[0064] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0065] Figure 2 A flowchart of an application deployment method provided by an embodiment of the present invention is schematically shown. Figure 2 As shown, the application deployment method may specifically include the following steps:
[0066] 201, storing the application files of the target application in the target storage directory in the target physical machine;
[0067] 202, determining at least one container running in the target physical machine;
[0068] 203, mapping the application installation directory of at least one container to the target storage directory;
[0069] 204 , sending an application deployment instruction to at least one container, so that the at least one container reads the target storage directory through the application installation directory in response to the application installation instruction to deploy the target application based on the application file.
[0070] According to an embodiment of the present invention, an application file may be a file obtained by decompressing the installation package of a target application, and the application file may include all resources, codes and configuration information of the target application. Specifically, the application file may include the manifest information of the target application, such as the package name, application permissions, component declarations, etc., and may also include the compiled bytecode file, resource files, dependent local libraries (.so files), original binary files, etc. of the target application.
[0071] According to an embodiment of the present invention, the application file can be stored in the target storage directory pointed to by the application directory path through the pre-specified application directory path.
[0072] According to an embodiment of the present invention, the target storage directory may be a pre-created shared directory accessible to the container, or may be a directory on the target physical machine for storing application data and application files.
[0073] In the embodiment of the present invention, the container is a short-lived and easily replaceable entity. When the container is started, a read-only file system is created based on the used basic image and operated inside the container. Once the container is stopped and deleted, all data inside the container will also be lost, that is, the container itself does not have persistent storage capabilities.
[0074] According to an embodiment of the present invention, in order to achieve persistent storage of container data, a container volume can be used. The container volume is a mechanism for sharing data between the container and the physical machine. Specifically, in the related art, for each container, a container volume is usually created on the physical machine, and then when the container is started, the container volume is mounted to the container directory, so that the container can access the container volume created on the physical machine like accessing a normal directory.
[0075] According to an embodiment of the present invention, since in the related technology, each container has a corresponding container volume on the target physical machine, when deploying the application, the application files need to be stored in the container volume corresponding to each container respectively, so that the container can read the application files stored in the container volume to realize the deployment of the application.
[0076] In an embodiment of the present invention, the container volume of one or more containers running on the target physical machine, that is, the application installation directory, can be mapped to the target storage directory pre-created in the target physical machine, so that the target storage directory on the target physical machine can provide storage capacity for the one or more containers. Furthermore, after the application files of the target application are stored in the target storage directory, the one or more containers can read the application files by accessing the target storage directory, so that the resources, code and configuration information of the application files can be used to realize the deployment of the application in the container.
[0077] Therefore, when the target application needs to be deployed to a large number of containers, through the application deployment method provided by the embodiment of the present invention, it is only necessary to store the application files of the target application in the target storage directory on the target physical machine, and the containers running on the target physical machine can access the application files stored in the target storage directory, thereby realizing the deployment of the target application, without the need to store the application files separately for the container volume corresponding to each container, thereby improving the application deployment efficiency and reducing the occupancy of the target physical machine storage space by the application files.
[0078] Figure 3 A schematic diagram schematically shows an application deployment method provided by an embodiment of the present invention.
[0079] like Figure 3 As shown, 301 may represent a physical machine, and 302 may represent multiple containers running on the physical machine 301.
[0080] First, the application files of the target application may be stored in the target storage directory 3011 on the physical machine 301 , and then the application installation directories 3021 of the multiple containers 302 may be mapped to the target storage directory 3011 .
[0081] After the directory mapping is implemented, the container 301 can read the application files stored in the target storage directory 3011 based on the application installation directory 3021, so as to deploy and run the target application based on the application files.
[0082] According to an embodiment of the present invention, mapping the application installation directory of at least one container to the target storage directory may be specifically implemented as follows:
[0083] A soft link is established between the application installation directory and the target storage directory, so that the container can access the target storage directory using the application installation directory.
[0084] According to an embodiment of the present invention, the application installation directory can be first determined in the container through the directory path of the application installation directory, and then a soft link can be created in the application installation directory. The soft link can be a special type of file that can point to another file or directory and provide indirect access to the file and directory.
[0085] According to an embodiment of the present invention, after a soft link is created, the soft link may be pointed to a target storage directory on a physical machine.
[0086] According to an embodiment of the present invention, before storing the application file of the target application in the target storage directory in the target physical machine, the application deployment method further includes:
[0087] Get application update request;
[0088] In response to the application update request, obtaining a compressed package of the target application;
[0089] Decompress the compressed package to obtain the application file.
[0090] In one embodiment of the present invention, a first version of a target application may be running in the container, and the application update request may be used to update the target application from the first version to a second version.
[0091] According to an embodiment of the present invention, in response to an application update request, a compressed package of a second version of a target application may be obtained.
[0092] According to an embodiment of the present invention, the application files stored in the target storage directory of the target physical machine may be application files obtained by decompressing the compressed package.
[0093] In one embodiment of the present invention, the compressed package may be an APK (Android Package Kit) file.
[0094] According to an embodiment of the present invention, the container may be a stateful container. A stateful container may be used by only one user at a time. When the user does not use the container, the container is in an idle state. When the user uses the container, the container may be in a used state.
[0095] According to an embodiment of the present invention, for a container in an idle state, an application file may be directly used to update the application.
[0096] According to an embodiment of the present invention, for a container in use, if an application in the container is to be updated, it is necessary to wait until the user has finished using the container, and then use the application file to update the target application. Specifically, before the update, the container can be destroyed, and then a new container can be generated, and the application storage directory of the new container can be mapped to the target storage directory, so that after the new container is started, the deployment of the new version of the application has been completed.
[0097] According to an embodiment of the present invention, decompressing the compressed package to obtain the application file can be specifically implemented as follows:
[0098] determining architecture information for at least one container;
[0099] Determine the decompression tool corresponding to the architecture information;
[0100] Use a decompression tool to decompress the compressed package to obtain the application file.
[0101] According to an embodiment of the present invention, the architecture information may include chip architecture information, and the chip architecture may include, for example, an x86 architecture or an ARM architecture.
[0102] According to an embodiment of the present invention, different chip architectures will generate different APK files when generating an application program, and different APK files need to rely on specific library files to run.
[0103] The APK file may include a lib / directory, which contains dependent library files required by different architectures, corresponding to different chip architectures and instruction sets. For example, the lib / armeabi-v7a / directory may contain library files for the ARMv7 architecture, and the lib / x86 / directory may contain library files for the x86 architecture.
[0104] To ensure that the target application can run correctly on the container, the architecture information of the container can be determined before decompressing the APK file, and then the decompression tool corresponding to the architecture information can be used to decompress the APK file to obtain the application file.
[0105] According to an embodiment of the present invention, in order to avoid abnormality of the target application after the target application is deployed into the container based on the application file due to damage of the application file, the integrity of the application file can be checked after the application file is decompressed.
[0106] Specifically, the application file can be read in blocks, and then a check value can be calculated for each block of the application file. After the check value is calculated for each block of the application file, the calculated check value can be compared with a standard check value. If the check value is equal to the standard check value, it indicates that the application file has not been tampered with; if the check value is not equal to the standard check value, it indicates that the application file may have been modified or damaged.
[0107] According to an embodiment of the present invention, a verification algorithm such as a CRC32 algorithm or a hash algorithm may be used to perform integrity verification on the application file.
[0108] According to an embodiment of the present invention, sending an application installation instruction to at least one container may be specifically implemented as follows:
[0109] A first access instruction is sent to at least one container, where the first access instruction is used to instruct the at least one container to start access threads respectively, and use the access threads to access the first file system, so that the first file system creates a number of file copies of application files corresponding to the number of access threads based on the number of access threads, and each access thread accesses the corresponding file copy.
[0110] According to an embodiment of the present invention, the first file system can be a stacked file system, which depends on and is built on other file systems, such as ext4fs and xfs, and does not directly divide the disk space. It only merges different directories in the underlying file system, such as the container volumes corresponding to each container on the physical machine. Therefore, multiple containers running on the physical machine can access the target storage directory in a shared directory manner.
[0111] According to an embodiment of the present invention, since multiple containers running on a physical machine can access the target storage directory on the physical machine, due to the access lock mechanism, if two or more containers access the target storage directory at the same time, the access request that first reaches the target storage directory will exclusively access the target storage directory, resulting in other containers being unable to access application files, thereby reducing application deployment efficiency.
[0112] According to an embodiment of the present invention, in order to improve application deployment efficiency, when the first file system receives access threads from multiple containers, it can first count the number of access threads, then create multiple file copies corresponding to the number of access threads, and schedule the access threads to the corresponding file copies.
[0113] According to an embodiment of the present invention, after the access thread completes accessing the file copy, the first file system may delete the file copy to release storage space.
[0114] According to an embodiment of the present invention, the application deployment method further includes:
[0115] Receive an application uninstall request;
[0116] In response to the application uninstallation request, sending a service termination instruction to at least one container, where the service termination instruction is used to instruct the at least one container to stop providing services using the target application;
[0117] An application uninstallation instruction is sent to the target physical machine, where the application uninstallation instruction is used to instruct the target physical machine to delete the application file from the target storage directory.
[0118] According to an embodiment of the present invention, when it is necessary to carry the target application from multiple containers, it is also not necessary to perform an application uninstallation operation for each container. It is only necessary to delete the application file from the target storage directory when terminating the container from providing services using the target application, and the target application can be uninstalled from the multiple containers.
[0119] According to an embodiment of the present invention, the application deployment method further includes:
[0120] Receive container expansion instructions;
[0121] In response to the container expansion instruction, create at least one expansion container on the target physical machine;
[0122] In response to at least one expansion container being generated, an application installation directory of the at least one expansion container is mapped to a target storage directory, so that the at least one expansion container reads the target storage directory through the application installation directory to deploy a target application based on the application file.
[0123] According to an embodiment of the present invention, after at least one new capacity expansion container is created on the target physical machine, it is usually necessary to deploy the target application in the newly created capacity expansion container.
[0124] In an embodiment of the present invention, after the expansion container is created, the application installation directory of the expansion container can be mapped to the target storage directory on the physical machine, so as to deploy the target application in the expansion container without re-performing the application deployment operation for the expansion container.
[0125] According to an embodiment of the present invention, at least one container reading the target storage directory through the application installation directory in response to the application installation instruction may be specifically implemented as follows:
[0126] Read the target storage directory through the application installation directory to obtain application information stored in the application file;
[0127] According to an embodiment of the present invention, the application deployment method further includes:
[0128] At least one container stores application information in an application registry;
[0129] Start the access thread;
[0130] Based on the application information stored in the registry, the application file is accessed using an access thread.
[0131] According to an embodiment of the present invention, the application information may include, for example, metadata and configuration information.
[0132] According to an embodiment of the present invention, an application registry (Application Registry) may be a centralized repository for storing metadata and configuration information of an application program so as to dynamically discover, register and manage the application program at runtime.
[0133] According to an embodiment of the present invention, after configuring the application information to the registry, the container can start an access thread and access the application file according to the application information recorded in the registry, thereby executing the code of the application file and running the target application.
[0134] Figure 4 A schematic diagram schematically shows an application deployment method provided by an embodiment of the present invention.
[0135] like Figure 4 As shown, 401 may represent a physical machine, and 402 may represent a container running on the physical machine 401 .
[0136] The container 402 may include an application installation directory 4021 and an application data directory 4022 , wherein the application installation directory 4021 is used to store resources required for application operation, and the application data directory 4022 is used to store data generated by application operation.
[0137] The physical machine 401 includes a target storage directory 4011 and a first deployment controller 4012 .
[0138] After mapping the application installation directory 401 to the target storage directory 4011, if the first deployment controller 4012 detects that application files are stored in the target storage directory 4011, it will notify the second deployment controller 4023 in the container 401, and the second deployment controller 4023 will access the target storage directory 4011 through the application storage directory 4021 through a pre-created mapping relationship to read the application files.
[0139] When reading the target storage directory 4011 through the application installation directory 4021 , the first storage system 403 may be accessed first, and the target storage directory may be accessed through the first storage system 403 .
[0140] After the application is deployed to the container 402 and runs for a period of time, the application will generate running data, and the application running data can be stored on the storage server 404 through the application data directory 4022.
[0141] Figure 5 A flowchart of an application deployment method provided by another embodiment of the present invention is schematically shown. Figure 5 As shown, the application deployment method may specifically include the following steps:
[0142] 501, receiving a directory mapping operation, where the directory mapping operation is used to map an application installation directory of a container to a target storage directory of a target physical machine, where application files of a target application are stored in the target storage directory;
[0143] 502, receiving an application deployment instruction;
[0144] 503 , in response to the application deployment instruction, read the target storage directory through the application installation directory to deploy the target application based on the application file.
[0145] Figure 6 A flowchart of an application streaming method provided by an embodiment of the present invention is schematically shown. Figure 6 As shown, the application fluidization method may specifically include the following steps:
[0146] 601, receiving a directory mapping operation, where the directory mapping operation is used to map an application installation directory of a container to a target storage directory of a target physical machine, where application files of a video application are stored in the target storage directory;
[0147] 602, receiving an application deployment instruction;
[0148] 603, in response to the application deployment instruction, reading the target storage directory through the application installation directory to deploy the video application based on the application file;
[0149] 604, in response to the video application being deployed successfully, running the video application and generating video stream data;
[0150] 605, sending the video stream data to the target set-top box, so that the target set-top box parses the video stream data to obtain video images and displays the video images.
[0151] Figure 7 A block diagram of an application deployment device provided by an embodiment of the present invention is schematically shown. Figure 7 As shown, the application deployment device 700 may specifically include:
[0152] The storage module 701 is used to store the application files of the target application in the target storage directory in the target physical machine;
[0153] A container determination module 702 is used to determine at least one container running in a target physical machine;
[0154] A mapping module 703, configured to map an application installation directory of at least one container to a target storage directory;
[0155] The deployment module 704 is used to send an application deployment instruction to at least one container, so that the at least one container reads the target storage directory through the application installation directory in response to the application installation instruction to deploy the target application based on the application file.
[0156] According to an embodiment of the present invention, the mapping module 703 includes:
[0157] The soft link establishment unit is used to establish a soft link between the application installation directory and the target storage directory, so that the container uses the application installation directory to access the target storage directory.
[0158] According to an embodiment of the present invention, the application deployment apparatus 700 further includes:
[0159] A request acquisition module is used to obtain application update requests;
[0160] A compressed package acquisition module, used to obtain a compressed package of a target application in response to an application update request;
[0161] The decompression module is used to decompress the compressed package to obtain the application file.
[0162] According to an embodiment of the present invention, the decompression module includes:
[0163] an information determination unit, configured to determine architecture information of at least one container;
[0164] A tool determination unit, used for determining a decompression tool corresponding to the architecture information;
[0165] The decompression unit is used to decompress the compressed package using a decompression tool to obtain the application file.
[0166] According to an embodiment of the present invention, the deployment module 704 includes:
[0167] A first access instruction sending unit is used to send a first access instruction to at least one container, where the first access instruction is used to instruct the at least one container to start access threads respectively, and use the access threads to access the first file system, so that the first file system creates a number of file copies of application files corresponding to the number of access threads based on the number of access threads, and each access thread accesses the corresponding file copy.
[0168] According to an embodiment of the present invention, the application deployment apparatus 700 further includes:
[0169] An uninstall request receiving module, used for receiving an application uninstall request;
[0170] a termination instruction sending module, configured to send a service termination instruction to at least one container in response to an application uninstallation request, wherein the service termination instruction is used to instruct the at least one container to stop providing services using the target application;
[0171] The uninstall module is used to send an application uninstall instruction to the target physical machine, and the application uninstall instruction is used to instruct the target physical machine to delete the application file from the target storage directory.
[0172] According to an embodiment of the present invention, the application deployment apparatus 700 further includes:
[0173] A capacity expansion instruction receiving module, used to receive a container capacity expansion instruction;
[0174] An expansion module, configured to create at least one expansion container on a target physical machine in response to a container expansion instruction;
[0175] The mapping module is further used to map the application installation directory of the at least one expansion container to the target storage directory in response to the generation of the at least one expansion container, so that the at least one expansion container reads the target storage directory through the application installation directory to deploy the target application based on the application file.
[0176] According to an embodiment of the present invention, the deployment module 704 includes:
[0177] A reading unit, used to read a target storage directory through an application installation directory to obtain application information stored in application files;
[0178] According to an embodiment of the present invention, the application deployment apparatus 700 further includes:
[0179] An information storage module, used for at least one container to store application information in an application registration table;
[0180] Thread startup module, used to start the access thread;
[0181] The file access module is used to access application files using access threads based on application information stored in the registry.
[0182] Figure 7 The application deployment device can execute Figure 2 The implementation principle and technical effect of the application deployment method of the embodiment shown are not repeated here. The specific way in which each module and unit performs operations in the application deployment device in the above embodiment has been described in detail in the embodiment of the method, and will not be elaborated here.
[0183] Figure 8 A block diagram of an application deployment device provided by another embodiment of the present invention is schematically shown. Figure 8 As shown, the application deployment device 800 may specifically include:
[0184] A first operation receiving module 801 is used to receive a directory mapping operation, where the directory mapping operation is used to map the application installation directory of the container to a target storage directory of the target physical machine, where the application files of the target application are stored in the target storage directory;
[0185] The first instruction receiving module 802 is used to receive an application deployment instruction;
[0186] The first reading module 803 is used to respond to the application deployment instruction and read the target storage directory through the application installation directory to deploy the target application based on the application file.
[0187] Figure 8 The application deployment device can execute Figure 5 The implementation principle and technical effect of the application deployment method of the embodiment shown are not repeated here. The specific way in which each module and unit performs operations in the application deployment device in the above embodiment has been described in detail in the embodiment of the method, and will not be elaborated here.
[0188] Fig. 9 A block diagram of an application streaming device provided by an embodiment of the present invention is schematically shown. Fig. 9As shown, the application fluidization device 900 may include:
[0189] A second operation receiving module 901 is used to receive a directory mapping operation, where the directory mapping operation is used to map the application installation directory of the container to a target storage directory of the target physical machine, where the application files of the video application are stored in the target storage directory;
[0190] A second instruction receiving module 902, used to receive an application deployment instruction;
[0191] A second reading module 903 is used to respond to the application deployment instruction and read the target storage directory through the application installation directory to deploy the video application based on the application file;
[0192] An operation module 904 is used to operate the video application and generate video stream data in response to the video application being deployed successfully;
[0193] The data sending module 905 is used to send the video stream data to the target set-top box, so that the target set-top box can parse the video stream data to obtain the video picture and display the video picture.
[0194] Fig. 9 The application fluidization device can perform Figure 6 The implementation principle and technical effect of the application fluidization method described in the illustrated embodiment will not be described in detail. The specific manner in which each module and unit performs operations in the application fluidization device in the above embodiment has been described in detail in the embodiment of the method, and will not be described in detail here.
[0195] In a possible design, the application deployment device and application streaming device provided by the embodiment of the present invention can be implemented as a computing device, such as Fig.10 As shown, the computing device may include a storage component 1001 and a processing component 1002;
[0196] The storage component 801 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 1002 to implement the application deployment method and application streaming method provided in the embodiments of the present invention.
[0197] Of course, the computing device may also include other components, such as input / output interfaces, communication components, etc. The input / output interface provides an interface between the processing component and the peripheral interface module, which may be an output device, an input device, etc. The communication component is configured to facilitate wired or wireless communication between the computing device and other devices.
[0198] Among them, the computing device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. In this case, the computing device can refer to a cloud server, and the above-mentioned processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform.
[0199] When the computing device is a physical device, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or a single terminal device.
[0200] The embodiment of the present invention further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a computer, the application deployment method and the application streaming method provided by the embodiment of the present invention can be implemented.
[0201] The embodiment of the present invention further provides a computer program product, including a computer program. When the computer program is executed by a computer, the application deployment method and the application streaming method provided by the embodiment of the present invention can be implemented.
[0202] The processing components in the above corresponding embodiments may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing components may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0203] The storage component is configured to store various types of data to support operations in the device. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0204] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0205] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0206] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0207] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An application deployment method, characterized in that: include: Storing the application files of the target application in the target storage directory in the target physical machine; Determine at least one container running in the target physical machine; Mapping the application installation directory of the at least one container to the target storage directory; An application deployment instruction is sent to the at least one container, so that the at least one container reads the target storage directory through the application installation directory in response to the application installation instruction to deploy the target application based on the application file.
2. The method according to claim 1, characterized in that Mapping the application installation directory of the at least one container to the target storage directory comprises: A soft link between the application installation directory and the target storage directory is established, so that the container uses the application installation directory to access the target storage directory.
3. The method according to claim 1, characterized in that Before storing the application file of the target application in the target storage directory in the target physical machine, the method further includes: Get application update request; In response to the application update request, obtaining a compressed package of the target application; Decompress the compressed package to obtain the application file.
4. The method according to claim 3, characterized in that Decompressing the compressed package to obtain the application file includes: determining architecture information of the at least one container; Determine a decompression tool corresponding to the architecture information; The compressed package is decompressed using the decompression tool to obtain the application file.
5. The method according to claim 1, characterized in that The sending the application installation instruction to the at least one container includes: A first access instruction is sent to the at least one container, where the first access instruction is used to instruct the at least one container to start access threads respectively, and use the access threads to access the first file system, so that the first file system creates, based on the number of the access threads, a number of file copies of the application files corresponding to the number, and enables each of the access threads to access the corresponding file copy.
6. The method according to claim 1, characterized in that The method further comprises: Receive an application uninstall request; In response to the application uninstallation request, sending a service termination instruction to the at least one container, wherein the service termination instruction is used to instruct the at least one container to stop providing services using the target application; An application uninstallation instruction is sent to the target physical machine, where the application uninstallation instruction is used to instruct the target physical machine to delete the application file from the target storage directory.
7. The method according to claim 1, characterized in that The method further comprises: Receive container expansion instructions; In response to the container expansion instruction, creating at least one expansion container on the target physical machine; In response to the generation of the at least one expansion container, the application installation directory of the at least one expansion container is mapped to the target storage directory, so that the at least one expansion container reads the target storage directory through the application installation directory to deploy the target application based on the application file.
8. The method according to claim 1, characterized in that The at least one container reading the target storage directory through the application installation directory in response to the application installation instruction includes: Read the target storage directory through the application installation directory to obtain application information stored in the application file; The method further comprises: At least one container stores the application information in an application registration table; Start the access thread; Based on the application information stored in the registration table, the application file is accessed using the access thread.
9. An application deployment method, characterized in that: include: Receive a directory mapping operation, where the directory mapping operation is used to map an application installation directory of the container to a target storage directory of a target physical machine, where application files of a target application are stored in the target storage directory; Receive application deployment instructions; In response to the application deployment instruction, the target storage directory is read through the application installation directory to deploy the target application based on the application file.
10. An application fluidization method, characterized in that: include: Receive a directory mapping operation, where the directory mapping operation is used to map an application installation directory of the container to a target storage directory of a target physical machine, where application files of a video application are stored in the target storage directory; Receive application deployment instructions; In response to the application deployment instruction, reading the target storage directory through the application installation directory to deploy the video application based on the application file; In response to the video application being deployed successfully, running the video application to generate video stream data; The video stream data is sent to a target set-top box so that the target set-top box parses the video stream data to obtain a video picture and displays the video picture.
11. A computing device, characterized in that: including a processing component and a storage component; The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the application deployment method as described in any one of claims 1 to 8, or, to implement the application deployment method as described in claim 9, or, to implement the application streaming method as described in claim 10.
12. A computer storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a computer, the application deployment method according to any one of claims 1 to 8 is implemented, or the application deployment method according to claim 9 is implemented, or the application streaming method according to claim 10 is implemented.