Container scheduling method, device and storage medium

By cleaning container data and disassociating users in cloud set-top box applications, the resource waste problem caused by container restart is solved, and more efficient container scheduling and user experience is achieved.

CN116661972BActive Publication Date: 2025-08-26HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310754250.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-25
Publication Date
2025-08-26
Estimated Expiration
2043-06-25

AI Technical Summary

Technical Problem

In cloud set-top box applications, due to the large number of users and the fast in and out of user behavior, a large number of containers are required to restart during container scheduling, resulting in excessive resource overhead.

Method used

After the user exits the container, the preset cleaning instructions are executed to clean the container data and unlink the user relationship, and the restored container is obtained for subsequent scheduling to avoid container restart.

Benefits of technology

It effectively reduces resource overhead during container scheduling, reduces the startup delay and system load of cloud applications, and improves the system's response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116661972B_ABST
    Figure CN116661972B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a container scheduling method, device, and storage medium. In an embodiment of the present application, during the container scheduling process, for the first container where the target cloud application that the first user requests to exit is located, a cleanup operation can be performed on the first container according to a preset cleanup instruction to clean up the container data generated by the first user using the first container, and the association between the first container and the first user can be released to obtain a restored first container. On this basis, the restored first container can be used for subsequent container scheduling. Accordingly, in an embodiment of the present application, during the container scheduling process, the container data left after the user uses the container is cleaned up and the association between the container and the user is released through a preset cleanup instruction, which can achieve pre-preparation of container resources and no restart after use, thereby effectively reducing resource overhead in the container scheduling process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a container scheduling method, device, and storage medium. Background Art

[0002] At present, the industry has proposed an implementation plan for cloud set-top boxes: the desktop launcher adapted to the set-top box is implemented as a cloud application, and the cloud desktop launcher is carried by a container. Based on this, the data stream provided by the cloud desktop launcher can be pushed to the user's set-top box for display via the broadcast and television network link.

[0003] However, due to the large number of set-top box users, the cloud desktop launcher has the characteristics of a large number of users, high instantaneous requests, and fast in and out of user behavior. This results in a large number of container restarts during the container scheduling process, consuming too many resources. Summary of the Invention

[0004] Various aspects of the present application provide a container scheduling method, device, and storage medium to reduce resource overhead during container scheduling.

[0005] This embodiment of the present application provides a container scheduling method, including:

[0006] performing a cleanup operation on a first container of a target cloud application requested to be exited by a first user according to a preset cleanup instruction, so as to clean up container data generated by the first user using the first container;

[0007] Disassociation between the first container and the first user to obtain a restored first container;

[0008] Container scheduling is performed according to the restored first container.

[0009] The embodiment of the present application further provides a control device, including a memory and a processor;

[0010] The memory is used to store one or more computer instructions;

[0011] The processor is coupled to the memory and is configured to execute the one or more computer instructions to perform the aforementioned container scheduling method.

[0012] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the aforementioned container scheduling method.

[0013] In an embodiment of the present application, during the container scheduling process, for the first container where the target cloud application that the first user requested to exit is located, a cleanup operation can be performed on the first container according to a preset cleanup instruction to clean up the container data generated by the first user using the first container, and the association between the first container and the first user can be released to obtain a restored first container. On this basis, the restored first container can be used for subsequent container scheduling. Accordingly, in an embodiment of the present application, during the container scheduling process, the container data left after the user uses the container is cleaned up and the association between the container and the user is released through a preset cleanup instruction, which can achieve pre-preparation of container resources and no restart after use, thereby effectively reducing resource overhead in the container scheduling process. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0015] Figure 1 A flowchart of a container scheduling method provided by an exemplary embodiment of the present application;

[0016] Figure 2 A logical diagram of a container scheduling method provided by an exemplary embodiment of the present application;

[0017] Figure 3 A schematic diagram of a queue of containers to be cleaned provided in an exemplary embodiment of the present application;

[0018] Figure 4 A schematic diagram of an application scenario provided by an exemplary embodiment of the present application;

[0019] Figure 5 A structural diagram of a control device provided as another exemplary embodiment of the present application. DETAILED DESCRIPTION

[0020] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0021] At present, the resource overhead is too large due to the need to perform a large number of container restarts during the container scheduling process. To this end, in some embodiments of the present application: during the container scheduling process, for the first container where the target cloud application that the first user requests to exit is located, a cleanup operation can be performed on the first container in accordance with a preset cleanup instruction to clean up the container data generated by the first user using the first container, and the association between the first container and the first user can be released to obtain a restored first container. On this basis, the restored first container can be used for subsequent container scheduling. Accordingly, in an embodiment of the present application, during the container scheduling process, the container data left after the user uses the container is cleaned up and the association between the container and the user is released through preset cleanup instructions, so as to achieve pre-preparation of container resources and no restart after use, thereby effectively reducing the resource overhead in the container scheduling process.

[0022] The following describes in detail the technical solutions provided by various embodiments of the present application in conjunction with the accompanying drawings.

[0023] Figure 1 A flowchart of a container scheduling method provided by an exemplary embodiment of the present application is shown below. Figure 2 This is a logical diagram of a container scheduling method provided by an exemplary embodiment of the present application. The method can be executed by a container scheduling device, which can be implemented as software, hardware, or a combination of software and hardware. The container scheduling device can be integrated into a control device. Figure 1 , the method may include:

[0024] Step 100: Perform a cleanup operation on a first container of a target cloud application that a first user requests to exit according to a preset cleanup instruction, so as to clean up container data generated by the first user's use of the first container.

[0025] Step 102: Disassociate the first container from the first user to obtain a restored first container.

[0026] Step 103: Perform container scheduling according to the restored first container.

[0027] The container scheduling method provided in this embodiment can be applied to a variety of scenarios requiring container scheduling, and this embodiment does not limit the application scenario. Regardless of the application scenario, the container scheduling method provided in this embodiment can reduce resource overhead during the container scheduling process, especially in scenarios with a large number of users and users entering and exiting cloud applications quickly, achieving more significant improvements.

[0028] This embodiment does not limit the system architecture used in the application scenario, and this embodiment can be adapted to various system architectures in different application scenarios. Figure 2In practical applications, regardless of the application scenario, a control device for container scheduling is typically deployed. Of course, the name of the control device may vary in different application scenarios. For example, in a cloud-based set-top box application scenario, the control device in this embodiment may be referred to as a cloud control device. The container scheduling method provided in this embodiment can be implemented by the control device. This embodiment does not limit the deployment location or physical implementation form of the control device in the application scenario.

[0029] The following briefly describes several concepts involved in this embodiment:

[0030] Cloud applications transform the traditional "local installation and local computing" model of software into a "ready-to-use" service. These applications connect to and control remote cloud application servers via the internet or local area network to complete logical or computational tasks. Cloud applications are primarily powered by internet technology and are presented as thin clients or smart clients.

[0031] A cloud application server may refer to a cloud server used to support the operation of cloud applications. The processing logic and computing tasks of cloud applications are all completed in the cloud application server.

[0032] Containers are a technology used to bundle an application and all its necessary files into a runtime environment. As a unit, a container can be easily run on any operating system in any environment.

[0033] Traditional cloud application startup and shutdown are typically achieved through container restarts. Specifically, when a user requests to stop a cloud application, the container containing the cloud application is released. When a user requests to start a cloud application, the container for that cloud application is restarted. During the restart process, the operating system must be started in the container, and then the cloud application is started. The operating system startup process is typically quite lengthy. Therefore, the delay caused by a single container restart is already quite long. For cloud applications with large user volumes and frequent user in and out, the number of container restarts caused by their startup and shutdown will be significant. This not only results in excessive startup delays for such cloud applications, but also in significant resource overhead. Therefore, this embodiment proposes a container scheduling method to achieve a more lightweight way to start and stop cloud applications.

[0034] refer to Figure 2 In this embodiment, a cloud application server can deploy multiple containers, which can be used to host cloud applications. In other words, cloud applications can run in containers. Furthermore, in this embodiment, a specific type of cloud application is described as a target cloud application. In an exemplary application scenario, the target cloud application can be a desktop launcher for implementing a cloud-based set-top box.

[0035] For ease of description, the container scheduling method provided by this embodiment will be described below using the first container as an example. The first container can be any container in the application scenario. In this embodiment, the user who last used the first container is described as the first user. It should be understood that the first user can be any user in the application scenario.

[0036] refer to Figure 1 In step 100, a cleanup operation is performed on the first container of the target cloud application requested to be exited by the first user according to preset cleanup instructions, thereby clearing the container data generated by the first user's use of the first container. In actual applications, upon receiving a request to exit the target cloud application corresponding to the first user's request, the corresponding first container may be marked as pending cleanup. It should be understood that containers in the pending cleanup state will not be used for container scheduling.

[0037] Preferably, in this embodiment, the preset cleanup instructions may include application cache cleanup instructions and custom cleanup instructions.

[0038] The application cache clearing instruction can be a system instruction that can clear the cloud application cache data generated during the operation of the cloud application. Typically, the operating system has a system instruction with this function, but the name of the system instruction with this function may vary for different operating systems. For example, in the Android system, the PM clear instruction (PackageManager clear) can be used as the application cache clearing instruction in this embodiment. Based on this, in step 100, the cloud application cache data in the first container can be cleared according to the application cache clearing instruction. In actual applications, the application cache clearing instruction can be issued to the cloud application server where the first container is located to control the cloud application server to clear the cloud application cache data in the first container. An exemplary cloud application cache clearing solution can be: in response to the application cache clearing instruction, query the package names of each running package under the cloud application running in the first container; search for the relevant cache data according to the package name and clear it. It should be understood that the application cache clearing instruction (such as the PM clear instruction) has the function of searching and clearing cache data based on the package name.

[0039] A custom cleanup instruction can be an instruction that can clean up specified data generated in the first container. The custom cleanup instruction can indicate the storage location of the specified data and the system function to be called. Here, the system function indicated in the custom cleanup instruction can be one or more system functions in the operating system used in the application scenario. In actual applications, the function name of the system function can be indicated as needed, and the function name of the system function is not provided as an example here. The specified data can be other data generated by the first user using the first container but not covered by the cleanup scope of the application cache cleanup instruction. For example, some data that is specially customized for the target cloud application for various reasons in the application scenario is generally not stored in the standard data directory of the target cloud application, but may be stored in a storage location customized by the application scenario. To this end, in this embodiment, the storage location of the relevant specified data in the application scenario can be pre-obtained, and appropriate system functions for implementing data cleanup can be selected for each of these specified data. Thus, a custom cleanup instruction can be constructed based on the storage location of the specified data and the required system function. Based on this, in step 100, the specified data generated in the first container can be cleaned according to the custom cleanup instruction. In practical applications, a custom cleanup instruction can be sent to the cloud application server where the first container resides, instructing the cloud application server to clean up the specified data generated in the first container. Furthermore, appropriate custom cleanup instructions can be constructed as needed for different application scenarios to more comprehensively clean up various data generated by specialized customizations in different application scenarios.

[0040] Thus, in step 100, by extracting the relevant cleanup instructions required for container cleanup, the container data left behind by the user after using the container can be comprehensively and accurately cleaned. As mentioned above, the container data here includes the aforementioned cloud application cache data as well as various specified data specifically customized for the application scenario. By executing step 100 in this embodiment, the first container can be restored to its initial state at the data level. The initial state can be understood as the container having no trace of user use.

[0041] Continue to refer Figure 1, in step 101, the association relationship between the first container and the first user can also be released. In an optional implementation scheme: the user information of the first user recorded in the system attribute information of the first container can be cleared. In actual applications, the container usually maintains system attribute information. For the first container used by the first user, the user information of the first user is recorded in its system attribute information to characterize the association relationship between the first container and the first user. Based on this, in this optional implementation scheme, a system attribute information modification instruction can be initiated to the cloud application server where the first container is located to control the cloud application server to delete the user information of the first user recorded in the system attribute information of the first container. Thereby, the association relationship between the first container and the first user can be released. It should be understood that in this embodiment, other implementation schemes can also be used to release the association relationship between the first container and the first user, and it is not limited to this.

[0042] Based on this, by executing step 101 in this embodiment, the first container can be restored to its initial state from the system property level.

[0043] In this way, in this embodiment, the first container can be restored at the data and system attribute levels to obtain a restored first container. It should be understood that during the entire process of restoring the first container, user usage traces in the first container can be cleared without restarting the container, achieving the same effect as a restart.

[0044] Continue to refer Figure 1 In step 102, the restored first container can be used for subsequent container scheduling. In practical applications, after completing the restoration process for the first container in both steps 100 and 101, the restored first container can be marked as being in a pending scheduling state. This way, the restored first container will be used as a pending container for subsequent container scheduling, thereby enabling pre-preparation of container resources. During the subsequent container scheduling process, the restored first container can be directly called to start the cloud application, eliminating the need to restart the container. This avoids the delay caused by container restarts and effectively reduces the startup time of the cloud application.

[0045] In summary, in this embodiment, during the container scheduling process, for the first container where the target cloud application that the first user requested to exit is located, a cleanup operation can be performed on the first container according to a preset cleanup instruction to clean up the container data generated by the first user using the first container, and the association between the first container and the first user can be released to obtain a restored first container. On this basis, the restored first container can be used for subsequent container scheduling. Accordingly, in this embodiment of the present application, during the container scheduling process, the container data left after the user uses the container is cleaned up and the association between the container and the user is released through a preset cleanup instruction, which can achieve pre-preparation of container resources and no restart after use, thereby effectively reducing resource overhead in the container scheduling process.

[0046] In the above or following embodiments, in step 102, an optional implementation method for subsequent container scheduling may be: in response to a target cloud application entry request corresponding to a second user, determining a to-be-executed container instruction required for starting the target cloud application for the second user; selecting a target container for the target cloud application entry request corresponding to the second user from the to-be-scheduled containers, where the to-be-scheduled containers include the first container; if the first container is selected as the target container, providing the to-be-executed container instruction to the first container, so that the first container starts the target cloud application for the second user according to the to-be-executed container instruction.

[0047] In this optional implementation, various approaches can be used to determine the container instructions to be executed when launching the target cloud application for the second user. In one exemplary approach, user request parameters can be parsed from the target cloud application entry request corresponding to the second user; the user request parameters can be translated into container instructions according to a preset translation template, and used as the container instructions to be executed.

[0048] Among them, in different application scenarios, the initiator of the target cloud application entry request may not be exactly the same. For example, in the cloud set-top box scenario, the initiator of the target cloud application entry request may be the set-top box server. In this exemplary application scenario, the second user may first initiate a standard desktop access request to the set-top box server through the broadcast and television network protocol, and the request may carry information such as the user ID; thereafter, the set-top box server may construct a target cloud application entry request for the second user based on operational requirements and / or the second user's customized requirements, and carry user request parameters used to reflect the aforementioned operational requirements and / or the second user's customized requirements in the target cloud application entry request; based on this, the set-top box server may send the target cloud application entry request corresponding to the second user to the control device in accordance with the relevant protocol agreed upon with the control device in this embodiment, so that the control device can parse the user request parameters corresponding to the second user therefrom.

[0049] In addition, in this exemplary solution, the mapping relationship between user request parameters and container instructions can also be maintained in the preset translation template. Based on this mapping relationship, the parsed user request parameters can be translated into container instructions, thereby determining the container instructions to be executed when the target cloud application is started for the second user.

[0050] It should be understood that in this embodiment, the pending container instructions are operational instructions that the container understands and is required to execute when launching a cloud application for a user. These pending container instructions instruct the container to perform a personalized launch configuration for the cloud application requested by the user. In this embodiment, the pending container instructions determined for the same cloud application may be different for different users. By launching the cloud application for the user according to the pending container instructions, the container ensures that the user's interface status, network status, and other related states of the launched cloud application meet the user's personalized needs.

[0051] Of course, other exemplary solutions can also be used to determine the container instructions to be executed required for starting the target cloud application for the second user, for example, directly carrying the container instructions to be executed in the target cloud application entry request, etc., which are not limited here.

[0052] As mentioned above, the restored first container will be marked as a container to be scheduled for subsequent container scheduling, and other restored containers and / or newly created containers may also be stored in the application scenario, all of which may be used as containers to be scheduled. The container to be scheduled in this embodiment refers to any container that can be used to start the target cloud application for the user. Therefore, in the above optional implementation provided by this embodiment, in addition to determining the aforementioned container instructions to be executed, it is also possible to select a target container for the target cloud application entry request corresponding to the second user from the existing containers to be scheduled in the application scenario. Here, optionally, the target container selection operation may be performed according to strategies such as distance priority or load balancing, which is not limited in this embodiment. After this selection operation, the first container may be selected as the target container, and of course other containers to be scheduled may also be selected as the target container.

[0053] For ease of description, it is assumed here that the first container is selected as the target container. In this optional implementation:

[0054] On the one hand, an association relationship can be established between the first container and the second user. In one exemplary solution, the second user's user information can be written to the system attribute information of the first container to establish the association relationship between the first container and the second user. In actual applications, the connection information corresponding to the first container can also be provided to the user terminal of the second user. In this way, the association relationship between the first container and the second user can be activated twice. The second user can further use the first container according to the received connection information. The connection information may include the IP address and port information of the first container, etc., which are not limited here.

[0055] Alternatively, the previously determined container instructions to be executed can be provided to the first container, which can then launch the target cloud application for the second user according to the instructions to be executed. After launching the target cloud application, the first container can also be marked as in a working state. It should be understood that containers in a working state will not be used for container scheduling.

[0056] Through the above two operations, the target cloud application can be started for the second user in the first container.

[0057] This embodiment also provides a further improved solution: the user data corresponding to the second user is mounted to the first container, so that the first container can personalize the target cloud application according to the user data corresponding to the second user. The user data corresponding to the second user is generated during the second user's use of the previous container and is used to record the second user's personalized configuration information under the target cloud application; and, during the process of cleaning the previous container used by the second user, the user data corresponding to the second user has been transferred to a designated storage location. In addition, mounting in this improved solution means associating the storage location of the user data with the first container. In actual applications, the designated storage location for transferring the user data corresponding to the second user can be a host directory or a host file. Based on this, the corresponding host directory or host file can be used as a data volume of the first container to achieve mounting. Of course, this is merely exemplary, and this embodiment is not limited to this. Based on the aforementioned mounting operation, the first container can read the user data corresponding to the second user without any obstacles, so that the target cloud application can be personalized according to the user data corresponding to the second user. In actual applications, the first container can personalize the target cloud application according to the user data corresponding to the second user after starting the target cloud application for the second user. Of course, it can also be completely personalized during the startup process of the target cloud application, which is not limited here.

[0058] Among them, in this improved solution, user data may include but is not limited to user operation preference records for the target cloud application, user call records for other applications in the target cloud application, login information or user avatars entered by the user for other applications in the target cloud application and other cached information.

[0059] Returning to the aforementioned container cleanup step, before executing the cleanup operation on the first container according to the preset cleanup instructions, the user data contained in the container data corresponding to the first container can be transferred to a designated storage location. It should be understood that during the aforementioned container cleanup step, the container data of the first container contains the user data corresponding to the first user. This allows the user data in the container to be transferred before the container is cleaned. This ensures that when each user re-enters the target cloud application, their personalized configuration information for the target cloud application can be restored, effectively improving the user experience.

[0060] In summary, in this embodiment, when a target cloud application entry request corresponding to a user is received, based on the technical concept of pre-preparing container resources and not restarting after use in this embodiment, a suitable target container can be quickly selected from the containers to be scheduled, and the determined container instructions to be executed can be quickly sent to the target container, and the relevant user data can also be mounted to the target container, which enables the target container to efficiently start the target cloud application for the user and complete the personalized configuration required by the user.

[0061] In the above or following embodiments, a design concept of managing container cleaning work based on a queue is also proposed. Figure 3 A schematic diagram of a queue of containers to be cleaned is provided as an exemplary embodiment of the present application.

[0062] refer to Figure 3 In this design concept, in response to a target cloud application exit request corresponding to a first user, the description information of the first container can be added to a queue of containers to be cleaned. The queue of containers to be cleaned also includes description information of containers of target cloud applications requested to be exited by other users. Based on the queue of containers to be cleaned, the cleaning trigger timing of each container to be cleaned is determined. When the first container reaches the cleaning trigger timing, the cleaning operation and subsequent operations are performed on the first container according to the preset cleaning instructions.

[0063] In this design concept, when receiving the target cloud application exit request corresponding to each user, the container pointed to by each target cloud application exit request can be determined. As mentioned above, such containers can be marked as being in a to-be-cleaned state. Moreover, the description information of the container in the to-be-cleaned state can be added to the to-be-cleaned container queue. It can be understood that the containers recorded in the to-be-cleaned container queue in this embodiment are dynamically changing. Through the to-be-cleaned container queue, the target cloud application exit request can be discretized, so that the triggering timing of the container cleanup operation caused by each target cloud application exit request can be flexibly managed according to the resource load situation.

[0064] An exemplary method for determining the cleaning trigger timing for each uncleaned container may include: in response to a cleaning operation trigger event, determining a threshold M for the number of containers supported by this round of cleaning operations; selecting N containers from a queue of uncleaned containers as containers to be cleaned in this round, where N ≤ M, and both N and M are positive integers; and determining when the N containers to be cleaned have reached a cleaning trigger timing. In this exemplary method, the cleaning operation trigger event may be the completion time of a round of cleaning operations. Of course, it may also be a periodic trigger event, etc., which is not limited here.

[0065] In this exemplary solution, a variety of technical means can be used to determine the threshold value M of the number of containers supported by this round of cleaning operations. An exemplary technical means may be: calculating the current available resource amount for container cleaning; segmenting the available resource amount according to the specified segmentation unit to determine the number of segments corresponding to the available resource amount; calculating the product between the number of segments and the number of containers supported by the predefined single-segment resource as the threshold value M of the number of containers supported by this round of cleaning operations. Optionally, the current resource load n2 can be monitored; a predefined resource load threshold n1 (this value is usually an empirical value) can also be defined; if n1>n2, the difference between n1 and n2 is calculated as the available resource amount for container cleaning. In addition, in this exemplary technical means, the number of segments k corresponding to the resource load threshold n1 (this value is usually also an empirical value) and the number of containers p supported by the single-segment resource (this value is usually also an empirical value) can be predefined. Based on this, the aforementioned process of calculating the container number threshold M can be expressed as:

[0066] M=[(n1-n2) / (n1 / k)]*p

[0067] Among them, n1 / k can be used as a designated segment unit, and [(n1-n2) / (n1 / k)] can represent the number of segments corresponding to the aforementioned available resource amount.

[0068] In addition, in this exemplary technical means, in order to avoid the problem of excessive resource load, if n2≤n1, it is determined that there are no available resources for container cleaning, and the current round of cleaning operation is no longer performed, and the current resource load n2 is continued to be monitored until it is determined that there are available resources for container cleaning based on n2, and then the next round of cleaning operation is started.

[0069] In this exemplary solution, N containers to be cleaned in this round can be removed from the queue of containers to be cleaned according to a first-in, first-out (FIFO) mechanism. Furthermore, in this exemplary solution, the aforementioned data-level and system-attribute-level cleaning operations can be performed on the N removed containers in this round in a serial or parallel manner.

[0070] It is worth noting that, in this embodiment, other exemplary solutions may be used to determine the cleaning triggering timing of each container to be cleaned in the queue of containers to be cleaned, and the present invention is not limited thereto.

[0071] In summary, in the design concept proposed in this embodiment, the target cloud application exit requests corresponding to each user can be discretized based on the queue of containers to be cleaned, and the cleaning triggering timing of the containers to be cleaned can be dynamically controlled by monitoring the amount of available resources. On the one hand, it can solve the problem of instantaneous pressure on resource load caused by a large number of exit requests during peak hours. On the other hand, it can make full use of the available resources and reasonably calculate the data threshold of the containers that can be cleaned in each round, thereby avoiding a large number of containers to be cleaned from being congested in the queue and circumventing the problem of insufficient number of containers to be scheduled.

[0072] Figure 4 A schematic diagram of an application scenario provided by an exemplary embodiment of the present application. Figure 4 In this application scenario, the target cloud application uses a desktop launcher adapted for a set-top box. The system architecture in this application scenario includes a set-top box, a set-top box server, a cloud application server, and a cloud control server. The container scheduling method provided in this embodiment can be implemented by the cloud control server. A container is deployed in the cloud application server, and the desktop launcher can run in the container. The desktop launchers accessed by different users run in different containers.

[0073] refer to Figure 4 , the container scheduling process is roughly as follows:

[0074] 1. User A enters Cloud Launcher:

[0075] A. Receive the cloud launcher entry request corresponding to user A, translate the request, and determine the container instructions to be executed.

[0076] In actual applications, user A can turn on the set-top box through the remote control, which can trigger the set-top box to initiate a power-on request to the set-top box server. The power-on request can carry the ID of user A. The set-top box server can determine the user request parameters corresponding to user A based on operational needs and / or customized needs recorded for user A, and construct a desktop launcher entry request based on the user request parameters. For example, the user request parameters can be: id: A, app: youku, activity: play. The user request parameters represent that user A expects to start the youku application and perform automatic playback after turning on the computer. The set-top box server can send the desktop launcher entry request constructed for user A to the cloud control server. The cloud control server can translate the user request parameters in the desktop launcher entry request based on a preset translation template to obtain the container instructions to be executed.

[0077] B. Select a target container for user A from the containers to be scheduled.

[0078] The selection can be based on distance priority or load balancing mechanism.

[0079] C. Write user A's user information into the system property information of the target container.

[0080] D. Get the user data directory transferred for user A and mount it.

[0081] E. Start the Launcher in the target container according to the container instructions to be executed and the user data directory;

[0082] F. Mark the target container after launching the Launcher as working and assign it to user A for streaming service.

[0083] In actual applications, the Launcher started in the target container can generate a data stream and provide it to the set-top box server. The set-top box server can then push the data stream to the set-top box for screen display.

[0084] 2. User A exits Cloud Launcher:

[0085] A. Receive the Cloud Launcher entry request from user A. The system translates the request and determines the container to be cleaned.

[0086] B. Mark the container as pending cleanup and place it in the queue of containers to be cleaned.

[0087] 3. Container cleaning process:

[0088] A. Calculate the resource load threshold that the cloud application server can provide, denoted as n1. This value is generally obtained through testing and verification.

[0089] B. Real-time monitor the current resource load of the cloud application server, denoted as n2;

[0090] C. Calculate the threshold of the number of containers that can be cleaned simultaneously currently according to n1 and n2, denoted as m. There are multiple ways to calculate m. An exemplary calculation method is as follows:

[0091] When n2 >= n1, it is determined that the current load of the cloud application server is too high, and no cleaning action is performed;

[0092] When n2 < n1, take t = n1 - n2. Segment n1, and each segment can carry p containers to be cleaned. Assume the number of segments that n1 can be divided into is k, then m = t / (n1 / k) * p.

[0093] D. Pull m containers from the container queue to be cleaned in the FIFO order, and the steps are as follows:

[0094] Transfer the user data in each container and store it on an external disk;

[0095] According to the preset cleaning instructions, clean the container data in each container. The method adopted in this solution is the instruction cleaning method, rather than directly restarting the container. The specific steps are as follows:

[0096] Obtain the applications currently running in the container and the running package names;

[0097] Execute the pm clear instruction;

[0098] Execute other custom cleaning instructions to ensure the successful comprehensive cleaning of the container data;

[0099] E. Clear the user information recorded in the system attributes of the container, and mark the status of the container as the to-be-allocated status;

[0100] F. Put the container into the list of allocatable containers for subsequent container scheduling.

[0101] It can be seen that in the scenario where a large number of users quickly enter and exit the desktop launcher during peak hours, the container scheduling method provided in this embodiment can reduce system pressure and effectively alleviate the problem of insufficient resources caused by too many users. By refining the system instructions that the container exit depends on, cleaning up the data left after the user's use, and restoring the properties, the problem of relying on the container restart to restore to the initial state in the traditional scheduling scheme is solved, and the container can be allocated to the next user in a more lightweight way. This measure effectively reduces the system load and greatly reduces the unavailability period of the system. At the same time, a mechanism for discretizing and controlling cloud application exit requests is introduced. By reasonably calculating the threshold value of the number of containers that can be cleaned up by the current cloud application server, the problem of excessive instantaneous pressure on the cloud application server during peak hours is effectively solved without affecting the system throughput.

[0102] In this way, based on the container scheduling method provided in this embodiment, Figure 4 The application scenario shown can produce at least the following technical effects:

[0103] 1. Compared with the common method of cleaning data by restarting the container, this solution uses preset cleanup instructions to clean up container usage data, reducing application downtime and system load;

[0104] 2. By pre-preparing container resources and not restarting them after use, they are placed in a pending state in advance, reducing application startup time and the system load caused by a large number of startup requests;

[0105] 3. In scenarios where the set-top box's cloud launcher experiences high start-stop frequency, user requests to exit the launcher are discretized and the threshold for the number of containers that can be cleaned is calculated. This prevents the impact of a large number of simultaneous exit requests on the cloud application server's host load.

[0106] It should be noted that some of the processes described in the above embodiments and accompanying drawings include multiple operations that appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order in which they appear in this document, or may be executed in parallel. Operation serial numbers, such as 101, 102, etc., are merely used to distinguish between 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 sequentially or in parallel. It should be noted that descriptions such as "first" and "second" in this document are used to distinguish different containers, users, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.

[0107] Figure 5 This is a structural diagram of a control device provided by another exemplary embodiment of the present application. Figure 5As shown, the computing device includes a memory 50 and a processor 51 .

[0108] The processor 51 is coupled to the memory 50 and is configured to execute the computer program in the memory 50 to:

[0109] performing a cleanup operation on a first container of a target cloud application requested to be exited by a first user according to a preset cleanup instruction, so as to clean up container data generated by the first user using the first container;

[0110] Disassociation between the first container and the first user to obtain a restored first container;

[0111] Container scheduling is performed according to the restored first container.

[0112] In an optional embodiment, when the processor 51 performs container scheduling according to the restored first container, it may be specifically configured to:

[0113] In response to a target cloud application entry request corresponding to a second user, determining a container instruction to be executed required for the second user to start the target cloud application;

[0114] Selecting a target container for the target cloud application entry request corresponding to the second user from the containers to be scheduled, where the containers to be scheduled include the first container;

[0115] If the first container is selected as the target container, an association relationship is established between the first container and the second user;

[0116] The to-be-executed container instruction is provided to the first container, so that the first container starts the target cloud application for the second user according to the to-be-executed container instruction.

[0117] In an optional embodiment, before performing a cleanup operation on the first container according to a preset cleanup instruction, the processor 51 may further be configured to: transfer user data contained in the container data to a designated storage location, wherein the user data is used to record personalized configuration information of the user under the target cloud application;

[0118] After the processor 51 selects a target container from the containers to be scheduled for the target cloud application entry request corresponding to the second user, it can also be used to: if the first container is selected as the target container, mount the user data corresponding to the second user to the first container, so that the first container can personalize the target cloud application according to the user data corresponding to the second user.

[0119] In an optional embodiment, when determining the container instructions to be executed required for starting the target cloud application for the second user, the processor 51 may specifically be configured to:

[0120] Parsing user request parameters from the target cloud application entry request corresponding to the second user;

[0121] According to a preset translation template, the user request parameters are translated into container instructions as the container instructions to be executed.

[0122] In an optional embodiment, when the processor 51 performs the cleaning operation on the first container according to the preset cleaning instruction, it can be specifically configured to:

[0123] Cleaning up the cloud application cache data in the first container according to the application cache cleanup instruction;

[0124] Cleaning up the specified data generated in the first container according to the custom cleaning instruction;

[0125] The custom cleanup instruction indicates the storage location of the specified data and the system function to be called.

[0126] In an optional embodiment, when disassociating the first container from the first user, the processor 51 may specifically be configured to:

[0127] The user information of the first user recorded in the system attribute information of the first container is cleared.

[0128] In an optional embodiment, before performing the cleaning operation on the first container according to the preset cleaning instruction, the processor 51 may further be configured to:

[0129] In response to the target cloud application exit request corresponding to the first user, adding the description information of the first container to a queue of containers to be cleaned up, the queue of containers to be cleaned up also including description information of containers of the target cloud application that other users have requested to exit;

[0130] Determining a cleaning triggering time for each container to be cleaned based on the queue of containers to be cleaned;

[0131] When the cleaning trigger timing of the first container is reached, the cleaning operation and subsequent operations are performed on the first container according to the preset cleaning instruction.

[0132] In an optional embodiment, when the processor 51 determines the cleaning triggering timing of each container to be cleaned based on the queue of containers to be cleaned, it may be specifically configured to:

[0133] In response to a cleaning operation triggering event, determining a threshold M of the number of containers supported by this round of cleaning operations;

[0134] Select N containers from the queue of containers to be cleaned as containers to be cleaned in this round, where N≤M, and both N and M are positive integers;

[0135] Determine whether the N containers to be cleaned have reached a cleaning triggering time.

[0136] In an optional embodiment, when determining the threshold value M of the number of containers supported by the current round of cleaning operations, the processor 51 may specifically be configured to:

[0137] Calculate the amount of resources currently available for container cleanup;

[0138] Segmenting the available resource amount according to a specified segmentation unit to determine the number of segments corresponding to the available resource amount;

[0139] The product of the number of segments and the number of containers supported by the predefined single-segment resource is calculated as a threshold M of the number of containers supported by this round of cleaning operations.

[0140] In an optional embodiment, the target cloud application is a desktop launcher of a set-top box. The desktop launchers entered by different users run in different containers. The container carrying the cloud desktop launcher is deployed in a cloud application server, and the number of the cloud application servers is one or more.

[0141] Further, if Figure 5 As shown, the control device also includes: a communication component 52, a power supply component 53 and other components. Figure 5 Only some components are shown schematically, which does not mean that the control device only includes Figure 5 Components shown.

[0142] It is worth noting that the technical details in the above-mentioned embodiments of the control device can be referred to the relevant description in the aforementioned method embodiment. In order to save space, they will not be repeated here, but this should not cause any loss of the protection scope of this application.

[0143] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which can implement the steps in the above method embodiment when the computer program is executed.

[0144] above Figure 5The memory in the computing platform is used to store computer programs and can be configured to store various other data to support operations on the computing platform. Examples of such data include instructions for any application or method operating on the computing platform, contact data, phone book data, messages, pictures, videos, etc. The memory can be implemented by any type of volatile or non-volatile storage device or a combination of them, 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.

[0145] above Figure 5 The communication component in is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0146] above Figure 5 The power supply component in a device provides power to various components of the device in which the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply component is located.

[0147] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0148] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0149] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0150] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

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

[0152] 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 this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0153] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included in the protection scope of the present application.

Claims

1. A container scheduling method, comprising: In response to a target cloud application exit request corresponding to a first user, adding description information of a first container where the target cloud application is located to a queue of containers to be cleaned up, where the queue of containers to be cleaned up also includes description information of containers where the target cloud application is located that has been requested to be exited by other users; In response to a cleaning operation triggering event, calculating a current available resource amount for container cleaning, and segmenting the available resource amount according to a specified segmentation unit to determine a number of segments corresponding to the available resource amount; Calculate the product of the number of segments and the number of containers supported by the predefined single-segment resource as the threshold M of the number of containers supported by this round of cleaning operations; Select N containers from the queue of containers to be cleaned as containers to be cleaned in this round, where N≤M, and both N and M are positive integers; Determining whether a cleaning trigger timing has been reached for the N containers to be cleaned, and when the cleaning trigger timing has been reached for the first container, performing a cleaning operation on the first container according to a preset cleaning instruction to clean container data generated by the first user using the first container; Disassociation between the first container and the first user to obtain a restored first container; Container scheduling is performed according to the restored first container.

2. The method according to claim 1, wherein the step of performing container scheduling based on the restored first container comprises: In response to a target cloud application entry request corresponding to a second user, determining a container instruction to be executed required for the second user to start the target cloud application; Selecting a target container for the target cloud application entry request corresponding to the second user from the containers to be scheduled, where the containers to be scheduled include the first container; If the first container is selected as the target container, an association relationship is established between the first container and the second user; The to-be-executed container instruction is provided to the first container, so that the first container starts the target cloud application for the second user according to the to-be-executed container instruction.

3. The method according to claim 2, before performing a cleaning operation on the first container according to a preset cleaning instruction, the method further comprises: Transferring the user data contained in the container data to a designated storage location, wherein the user data is used to record the user's personalized configuration information under the target cloud application; After selecting a target container from the containers to be scheduled for the target cloud application entry request corresponding to the second user, the method further includes: if the first container is selected as the target container, mounting user data corresponding to the second user to the first container, so that the first container can personalize the target cloud application according to the user data corresponding to the second user.

4. The method according to claim 2, wherein determining the container instructions to be executed required for the second user to start the target cloud application comprises: Parsing user request parameters from the target cloud application entry request corresponding to the second user; According to a preset translation template, the user request parameters are translated into container instructions as the container instructions to be executed.

5. The method according to claim 1, wherein performing a cleaning operation on the first container according to a preset cleaning instruction comprises: Cleaning up the cloud application cache data in the first container according to the application cache cleanup instruction; Cleaning up the specified data generated in the first container according to the custom cleaning instruction; The custom cleanup instruction indicates the storage location of the specified data and the system function to be called.

6. The method according to claim 1, wherein disassociating the first container from the first user comprises: The user information of the first user recorded in the system attribute information of the first container is cleared.

7. According to the method according to claim 1, the target cloud application is the desktop launcher of the set-top box, the desktop launchers entered by different users run in different containers, and the container carrying the cloud desktop launcher is deployed in the cloud application server, and the number of the cloud application servers is one or more.

8. A control device comprising a memory and a processor; The memory is used to store one or more computer instructions; The processor is coupled to the memory and is configured to execute the one or more computer instructions to execute the container scheduling method according to any one of claims 1 to 7.

9. A computer-readable storage medium storing computer instructions, which, when executed by one or more processors, causes the one or more processors to execute the container scheduling method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Container scheduling method and system, equipment and storage medium

    CN113760452A

  • Container scheduling method and device, equipment and storage medium

    CN114564281A