Container time slice adjusting method and device, equipment and storage medium

By predetermining the time slice allocation rules and modifying the container management interface, the problem of manual intervention required for running container time slice updates is solved, automated updates are realized, efficiency is improved and costs are reduced.

CN119336441APending Publication Date: 2025-01-21CHINA MOBILE COMM GRP TERMINAL +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411262894.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

In the prior art, the running container needs to manually update the time slice, and the container needs to be restarted after the update to take effect, resulting in high labor costs and low update efficiency.

Method used

By pre -determining the time film allocation rules, determine the expected time film of the container, and modify the container management interface based on these rules, increase the time film update method, thereby automatically adjust the time film of the container.

Benefits of technology

It enables container time slices to be updated without manual intervention, avoiding container downtime, improving update efficiency and reducing labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336441A_ABST
    Figure CN119336441A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a container time slice adjusting method and device, equipment and a storage medium, and the method comprises the steps: determining an expected time slice corresponding to a container according to a predetermined time slice distribution rule; wherein the time slice distribution rule comprises a total time slice for distribution and a time slice distribution mode; according to a time slice distribution rule, modifying a first container management interface of the container to obtain a modified second container management interface; wherein the second container management interface comprises a time slice updating method based on a time slice distribution rule; and according to the second container management interface, adjusting the time slice of the container to an expected time slice corresponding to the container.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a method, device, equipment and storage medium for adjusting a container time slice. Background Art

[0002] In the related art, the native interface of docker is usually used to update the time slice of the container. Specifically, when creating a container, the time slice parameter of the container can be directly specified to update the container time slice. However, when the container is running, the time slice update cannot be achieved by directly specifying the container time slice parameter. Instead, the docker command needs to be used to manually update the container time slice, and the update will take effect only after the container is restarted. This method requires manual intervention and will cause container downtime when updating the time slice. Therefore, there are problems of high labor costs and low update efficiency. Summary of the invention

[0003] The embodiments of the present disclosure provide a method, apparatus, device and storage medium for adjusting a container time slice to solve the problems in the related art of manually updating the time slice of a running container and restarting the container to make the update effective, which leads to high labor costs and low update efficiency.

[0004] In a first aspect, an embodiment of the present disclosure provides a method for adjusting a container time slice, the method comprising:

[0005] Determine the expected time slice corresponding to the container according to a predetermined time slice allocation rule; wherein the time slice allocation rule includes the total time slice available for allocation and the time slice allocation method;

[0006] According to the time slice allocation rule, modify the first container management interface of the container to obtain a modified second container management interface; wherein the second container management interface includes a time slice update method based on the time slice allocation rule;

[0007] According to the second container management interface, the time slice of the container is adjusted to an expected time slice corresponding to the container.

[0008] In a second aspect, an embodiment of the present disclosure provides a device for adjusting a container time slice, the device comprising:

[0009] A determination module, used to determine the expected time slice corresponding to the container according to a predetermined time slice allocation rule; wherein the time slice allocation rule includes a total time slice available for allocation and a time slice allocation method;

[0010] A modification module, used to modify the first container management interface of the container according to the time slice allocation rule to obtain a modified second container management interface; wherein the second container management interface includes a time slice update method based on the time slice allocation rule;

[0011] An adjustment module is used to adjust the time slice of the container to an expected time slice corresponding to the container according to the second container management interface.

[0012] In a third aspect, an embodiment of the present disclosure provides a container time slice adjustment device, comprising: a processor; and a memory configured to store computer executable instructions, wherein the computer executable instructions, when executed, enable the processor to implement the steps of the method described in the first aspect above.

[0013] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and the computer-executable instructions implement the steps of the method described in the first aspect when executed by a processor.

[0014] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0015] At least one of the above technical solutions provided by the embodiments of the present invention can achieve the following technical effects:

[0016] In an embodiment of the present invention, a time slice allocation rule may be predetermined, and the time slice rule may include a total time slice available for allocation and a time slice allocation method. After the time slice allocation rule is determined, an expected time slice corresponding to the container may be determined according to the predetermined time slice allocation rule. Then, the first container management interface of the container may be modified according to the time slice allocation rule, a time slice update method based on the time slice allocation rule may be added, and a modified second container management interface may be obtained. Finally, the time slice of the container may be adjusted to the expected time slice corresponding to the container according to the modified second container management interface.

[0017] It can be seen from the above-mentioned embodiments of the invention that the present solution can determine the expected time slice corresponding to each container according to the predetermined time slice allocation rule, and can modify the container management interface according to the time slice allocation rule, so that the modified container management interface can include a time slice update method based on the time slice allocation rule, and then, the dynamic adjustment of the container time slice can be automatically realized according to the modified container management interface. Since the container time slice can be updated without manual intervention and without restarting the container, it can effectively solve the problems of high labor cost and low update efficiency of related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate one or more embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor.

[0019] Figure 1 One of the flowcharts of a method for adjusting a container time slice provided by an embodiment of the present invention;

[0020] Figure 2 A second flow chart of a method for adjusting a container time slice provided by an embodiment of the present invention;

[0021] Figure 3 A third flowchart of a method for adjusting a container time slice provided by an embodiment of the present invention;

[0022] Figure 4 A schematic diagram of the module composition of a container time slice adjustment device 400 provided in one embodiment of the present invention;

[0023] Figure 5 A schematic diagram of the hardware structure of a container time slice adjustment device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to make the technical parties in this technical field better understand the technical aspects of one or more embodiments of the present disclosure, and to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in combination with the specific embodiments of the present invention and the corresponding drawings. 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 ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0025] The technical solutions provided by various embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.

[0026] See also Figure 1 , Figure 1 One of the flowcharts of the method for adjusting the container time slice provided by an embodiment of the present invention is as follows: Figure 1 As shown, the method comprises the following steps:

[0027] Step 102: Determine the expected time slice corresponding to the container according to a predetermined time slice allocation rule; wherein the time slice allocation rule includes the total time slice available for allocation and the time slice allocation method.

[0028] Step 104: modify the first container management interface of the container according to the time slice allocation rule to obtain a modified second container management interface; wherein the second container management interface includes a time slice update method based on the time slice allocation rule.

[0029] Step 106: According to the second container management interface, adjust the time slice of the container to the expected time slice corresponding to the container.

[0030] In the embodiment of the present invention, a time slice allocation rule may be predetermined, wherein the time slice allocation rule may include a total time slice available for allocation and a time slice allocation method.

[0031] In one embodiment of the invention, the total time slices that can be allocated to all containers can be predefined, and the time slice allocation method can be defined, for example, all containers are evenly allocated time slices, or containers are sequentially allocated time slices of specified sizes, etc. Based on the predefined total time slices that can be allocated, and the time slice allocation method, the time slices that can be allocated to each container can be calculated respectively.

[0032] After the time slice allocation rule is predetermined, the expected time slice corresponding to the container may be determined according to the determined time slice allocation rule.

[0033] In one embodiment of the invention, the time slice that can be allocated to each container can be calculated based on the total time slices available for allocation and the time slice allocation method, and determined as the expected time slice corresponding to each container.

[0034] In the embodiment of the present invention, the first container management interface of the container can be modified according to the predetermined time slice allocation rule to obtain a modified second container management interface, wherein the second container management interface can include a time slice update method based on the time slice allocation rule.

[0035] In one embodiment of the invention, the container management interface may be an interface for creating, starting, stopping or deleting a container. In an embodiment of the present invention, in order to realize automatic adjustment of the container time slice, the container management interface of the container may be modified. Specifically, the first container management interface of the container may be modified according to the time slice allocation rule. When modifying, a time slice update method based on the time slice allocation rule may be added to the first container management interface, so that when the modified second container management interface executes a command, it may realize the update of the container time slice based on the added time slice update method, and realize the update based on the time slice allocation rule when updating, that is, the time slice of the corresponding container may be adjusted to the time slice determined by the time slice allocation rule.

[0036] It should be noted that this scheme does not restrict the specific time slice update method added in this modification, as long as the added time slice update method can meet the corresponding settings according to the time slice allocation rules, and after the settings are completed, the container time slice can be updated according to the time slice allocation rules when the command is executed in the second container management interface.

[0037] After obtaining the modified second container management interface, the time slice of the container can be adjusted to the expected time slice corresponding to the container determined above according to the second container management interface.

[0038] Among them, when adjusting, the value of the expected time slice corresponding to the above-mentioned determined container can be written into the designated node of the corresponding container through the second container management interface, such as writing the value of the expected time slice into the node / dev / cpu / docker / container_id / cpu.rt_runtime_us, so as to adjust the time slice of the container to the expected time slice corresponding to the above-mentioned determined container.

[0039] In one embodiment of the invention, after the first container management interface is modified to obtain the second container management interface, when the second container management interface manages the container, the time slice of the container can be adjusted according to the time slice update method based on the time slice allocation rule in the second container management interface, and the time slice of the container can be adjusted to the expected time slice corresponding to the container. The embodiment of the present invention can adjust the time slice of the container in real time according to the time slice allocation rule to better meet the demand. In addition, by adjusting the time slice during the container management process, it can respond to the changes in system demand in a more timely manner, realize real-time resource optimization configuration, and improve the performance and efficiency of the system.

[0040] The second container management interface managing the container may include at least one of the following: the second container management interface creating a container; the second container management interface starting a container; the second container management interface stopping a container; and the second container management interface deleting a container.

[0041] In one embodiment of the invention, after adjusting the time slice of a container to the expected time slice corresponding to the container, when a specific docker command is received, the first container management interface is called to adjust the time slices of all running containers. The size of the container time slice adjusted here is consistent with the size of the time slice that can be allocated to each container determined in the predetermined time slice allocation rule, in order to ensure that when the container is stopped, restarted, or restarted unexpectedly, the time slice of the container after restart remains unchanged compared to before the restart. The embodiment of the present invention can complete the time slice adjustment of all running containers before the execution of a specific docker command is completed, ensuring the timely update of the time slice and improving the response speed of the system.

[0042] In an embodiment of the present invention, the time slice adjustment of all running containers is completed before the execution of a specific docker command is completed. The specific docker command is a docker command that needs to be executed by the container management interface.

[0043] In an example, the specific docker command may include instructions related to container creation, starting, stopping, and deletion, such as docker run, docker start, docker stop, and docker rm.

[0044] It should be noted that when a specific docker command is a command to start a container, the first container management interface can be called to adjust the time slices of all running containers and containers to be started, so as to dynamically adjust the time slice resources to all containers that are running or to be run, so as to maximize the use of time slice resources. When starting a new container, adjusting the time slices of all running containers and containers to be started can ensure that after the new container is started, each container in the system can reasonably share CPU resources, avoid the situation where some containers have excess resources while others have insufficient resources, and improve the overall utilization of resources.

[0045] When the specific docker command is a command to stop the container, the first container management interface may be called to adjust only the time slices of all running containers.

[0046] In one embodiment of the invention, Figure 2As shown, it is a second flow chart of a method for adjusting the container time slice provided by an embodiment of the present invention. In an embodiment of the present invention, the modified container management interface, that is, the above-mentioned second container management interface, can be used to manage containers, such as creating, starting, stopping, and deleting containers. Then, the interface can update the time slice of the running or running container according to the predefined time slice allocation rules. Before the execution of the corresponding specific docker command ends, the docker native interface, that is, the first container management interface before the modification, can be mobilized to update the time slices of all running containers, so as to realize the update of the time slices of all running containers before the execution of the specific docker command ends.

[0047] In an embodiment of the present invention, before the execution of a specific docker command ends, it is necessary to complete the time slice adjustment of all running containers to ensure that the time slice resources of the started containers have been updated in real time before the command execution ends. In one example, thread concurrency restrictions, locking, hook interfaces, or docker command truncation can be used to ensure that the time slice adjustment of all running containers is completed before the execution of a specific docker command ends. Completing the time slice adjustment before the execution of a specific docker command ends can ensure that the container can obtain appropriate time slice resources in a timely manner during operation. If the adjustment is made after the command execution ends, the container may run under an unreasonable time slice configuration for a period of time, affecting performance and response speed. By adjusting the time slice during the command execution process, these changes can be adapted more quickly to ensure that the system always runs in the optimal state.

[0048] In one embodiment of the present invention, the predetermined time slice allocation rule may include a time slice adjustment period. When adjusting the time slice of the container to the expected time slice corresponding to the container, a time slice update service may be first created according to the time slice allocation rule. Then, the started container in the container may be detected according to the time slice update service. The time slices of the started container and the newly created container may be adjusted according to the time slice allocation rule, and the time slices of the started container and the newly created container may be adjusted to the expected time slices corresponding to the started container and the newly created container.

[0049] In one example, the time slice allocation rule can also reserve a portion of time slice resources for the host and the newly started container. In addition, the default value of the time slice parameter when the container is started can be set, where this value must be smaller than the reserved time slice value. It should be noted that when the container is started, the value of the parameter corresponding to the time slice set should be as small as possible, so that the newly created container can be started at the first startup.

[0050] After creating a time slice update service corresponding to the time slice allocation rule, the service can first automatically detect the started container, and then, according to the time slice allocation rule, automatically write the determined expected time slice value to the designated node of the corresponding container, wherein the corresponding container may include the started container and the newly created container. Then, the first container management interface can be called to adjust the time slices of all containers according to the time slice update service. Among them, the size of the container time slice adjusted here is consistent with the size of the time slice that can be allocated to each container determined in the predetermined time slice allocation rule, in order to ensure that the time slice of the container after restart remains unchanged compared with before restart when the container is stopped, restarted, or restarted unexpectedly. By creating a time slice update service, automatic detection and adjustment of container time slices are realized without manual intervention, which greatly improves management efficiency. Reduces cumbersome manual operations, reduces management costs and the possibility of errors. In addition, the time slice update service can detect started containers and newly created containers in real time, and adjust them according to the time slice allocation rule. This can quickly adapt to changes in the system, ensure that the container always runs under reasonable time slice resources, and improve the response speed and performance of the system.

[0051] In one embodiment of the invention, Figure 3 FIG3 is a flowchart of a method for adjusting container time slices provided by an embodiment of the present invention. After creating a time slice update service corresponding to a time slice allocation rule, the time slice update service can continuously update the time slice of the started container according to the custom time slice allocation rule.

[0052] In an embodiment of the present invention, a time slice allocation rule may be predetermined, and the time slice rule may include a total time slice available for allocation and a time slice allocation method. After the time slice allocation rule is determined, an expected time slice corresponding to the container may be determined according to the predetermined time slice allocation rule. Then, the first container management of the container may be modified according to the time slice allocation rule, a time slice update method based on the time slice allocation rule may be added, and a modified second container management interface may be obtained. Finally, the time slice of the container may be adjusted to the expected time slice corresponding to the container according to the modified second container management interface.

[0053] It can be seen from the above-mentioned embodiments of the invention that the present solution can determine the expected time slice corresponding to each container according to the predetermined time slice allocation rule, and can modify the container management interface according to the time slice allocation rule, so that the modified container management interface can include a time slice update method based on the time slice allocation rule, and then, the dynamic adjustment of the container time slice can be automatically realized according to the modified container management interface. Since the container time slice can be updated without manual intervention and without restarting the container, it can effectively solve the problems of high labor cost and low update efficiency of related technologies.

[0054] Corresponding to the above container time slice adjustment method, the embodiment of the present invention further provides a container time slice adjustment device. Figure 4 A schematic diagram of the module composition of the container time slice adjustment device 400 provided in an embodiment of the present invention is shown in FIG. Figure 4 As shown, the container time slice adjustment device 400 includes:

[0055] The determination module 401 is used to determine the expected time slice corresponding to the container according to a predetermined time slice allocation rule; wherein the time slice allocation rule includes the total time slice available for allocation and the time slice allocation method;

[0056] A modification module 402, configured to modify the first container management interface of the container according to the time slice allocation rule to obtain a modified second container management interface; wherein the second container management interface includes a time slice update method based on the time slice allocation rule;

[0057] The adjustment module 403 is configured to adjust the time slice of the container to an expected time slice corresponding to the container according to the second container management interface.

[0058] Optionally, the adjustment module 403 is used to:

[0059] When the second container management interface manages the container, the time slice of the container is adjusted according to the time slice updating method based on the time slice allocation rule in the second container management interface, so as to adjust the time slice of the container to the expected time slice corresponding to the container.

[0060] Optionally, the device further includes a receiving module 404 ( Figure 4 Not shown):

[0061] The receiving module 404 is used to call the first container management interface to adjust the time slices of all running containers after adjusting the time slice of the container to the expected time slice corresponding to the container when a specific docker command is received, and complete the time slice adjustment of all running containers before the execution of the specific docker command is completed; wherein, the specific docker command is a docker command that needs to be executed by the container management interface.

[0062] Optionally, the receiving module 404 is further used for:

[0063] When the specific docker command is a command for starting a container, the first container management interface is called to adjust the time slices of all running containers and containers to be started.

[0064] Optionally, the receiving module 404 is further used for:

[0065] By means of thread concurrency limitation, locking, hook interface or docker command truncation, the time slice adjustment of all running containers is completed before the execution of the specific docker command ends.

[0066] Optionally, the time slice allocation rule includes a time slice adjustment period, and the adjustment module 403 is used to:

[0067] Creating a time slice update service according to the time slice allocation rule;

[0068] The started container in the container is detected according to the time slice update service, and the time slices of the started container and the newly created container are adjusted according to the time slice allocation rule, so that the time slices of the started container and the newly created container are adjusted to the expected time slices corresponding to the started container and the newly created container.

[0069] In an embodiment of the present invention, a time slice allocation rule may be predetermined, and the time slice rule may include a total time slice available for allocation and a time slice allocation method. After the time slice allocation rule is determined, an expected time slice corresponding to the container may be determined according to the predetermined time slice allocation rule. Then, the first container management of the container may be modified according to the time slice allocation rule, a time slice update method based on the time slice allocation rule may be added, and a modified second container management interface may be obtained. Finally, the time slice of the container may be adjusted to the expected time slice corresponding to the container according to the modified second container management interface.

[0070] It can be seen from the above-mentioned embodiments of the invention that the present solution can determine the expected time slice corresponding to each container according to the predetermined time slice allocation rule, and can modify the container management interface according to the time slice allocation rule, so that the modified container management interface can include a time slice update method based on the time slice allocation rule, and then, the dynamic adjustment of the container time slice can be automatically realized according to the modified container management interface. Since the container time slice can be updated without manual intervention and without restarting the container, it can effectively solve the problems of high labor cost and low update efficiency of related technologies.

[0071] Corresponding to the above container time slice adjustment method, an embodiment of the present invention further provides a container time slice adjustment device. Figure 5 A schematic diagram of the hardware structure of a container time slice adjustment device provided by an embodiment of the present invention.

[0072] The device for adjusting the container time slice may be the terminal device or server for adjusting the container time slice provided in the above embodiment.

[0073] The container time slice adjustment device may have relatively large differences due to different configurations or performances, and may include one or more processors 501 and memory 502, and the memory 502 may store one or more storage applications or data. Among them, the memory 502 may be a short-term storage or a persistent storage. The application stored in the memory 502 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the container time slice adjustment device. Furthermore, the processor 501 may be configured to communicate with the memory 502, and execute a series of computer executable instructions in the memory 502 on the container time slice adjustment device. The container time slice adjustment device may also include one or more power supplies 503, one or more wired or wireless network interfaces 504, one or more input and output interfaces 505, and one or more keyboards 506.

[0074] Specifically in this embodiment, the container time slice adjustment device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions in the container time slice adjustment device, and is configured to be executed by one or more processors.

[0075] In an embodiment of the present invention, a time slice allocation rule may be predetermined, and the time slice rule may include a total time slice available for allocation and a time slice allocation method. After the time slice allocation rule is determined, an expected time slice corresponding to the container may be determined according to the predetermined time slice allocation rule. Then, the first container management of the container may be modified according to the time slice allocation rule, a time slice update method based on the time slice allocation rule may be added, and a modified second container management interface may be obtained. Finally, the time slice of the container may be adjusted to the expected time slice corresponding to the container according to the modified second container management interface.

[0076] It can be seen from the above-mentioned embodiments of the invention that the present solution can determine the expected time slice corresponding to each container according to the predetermined time slice allocation rule, and can modify the container management interface according to the time slice allocation rule, so that the modified container management interface can include a time slice update method based on the time slice allocation rule, and then, the dynamic adjustment of the container time slice can be automatically realized according to the modified container management interface. Since the container time slice can be updated without manual intervention and without restarting the container, it can effectively solve the problems of high labor cost and low update efficiency of related technologies.

[0077] Another embodiment of the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and the computer-executable instructions implement the above process when executed by a processor.

[0078] The storage medium in the embodiment of the present disclosure can implement each process of the above-mentioned container time slice adjustment method embodiment and achieve the same effect and function, which will not be repeated here.

[0079] Another embodiment of the present disclosure further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above process is implemented.

[0080] The computer program product in the embodiment of the present disclosure can implement each process of the above-mentioned container time slice adjustment method embodiment and achieve the same effect and function, which will not be repeated here.

[0081] In various embodiments of the present disclosure, the computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0082] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0083] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0084] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0085] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing the embodiments of the present disclosure, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0086] Those skilled in the art will appreciate that one or more embodiments of the present disclosure may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0087] The present disclosure 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 disclosure. 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 generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. 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.

[0088] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate 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 A function specified in one or more boxes.

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

[0090] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0091] One or more embodiments of the present disclosure may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present disclosure may also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0092] Each embodiment in the present disclosure is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0093] The above description is only an embodiment of the present disclosure and is not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the scope of the claims of the present disclosure.

Claims

1. A method for adjusting a container time slice, characterized in that: The method comprises: Determine the expected time slice corresponding to the container according to a predetermined time slice allocation rule; wherein the time slice allocation rule includes the total time slice available for allocation and the time slice allocation method; According to the time slice allocation rule, modify the first container management interface of the container to obtain a modified second container management interface; wherein the second container management interface includes a time slice update method based on the time slice allocation rule; According to the second container management interface, the time slice of the container is adjusted to an expected time slice corresponding to the container.

2. The method according to claim 1, characterized in that The step of adjusting the time slice of the container to an expected time slice corresponding to the container according to the second container management interface includes: When the second container management interface manages the container, the time slice of the container is adjusted according to the time slice updating method based on the time slice allocation rule in the second container management interface, so as to adjust the time slice of the container to the expected time slice corresponding to the container.

3. The method according to claim 2, characterized in that After adjusting the time slice of the container to an expected time slice corresponding to the container, the method further includes: When a specific docker command is received, the first container management interface is called to adjust the time slices of all running containers, and the time slice adjustment of all running containers is completed before the execution of the specific docker command is completed; wherein the specific docker command is a docker command that needs to be executed by the container management interface.

4. The method according to claim 3, characterized in that When receiving a specific docker command executed by the container management interface, calling the first container management interface to adjust the time slices of all running containers includes: When the specific docker command is a command for starting a container, the first container management interface is called to adjust the time slices of all running containers and containers to be started.

5. The method according to claim 3, characterized in that: Before the execution of the specific docker command ends, the time slice adjustment of all running containers is completed, including: By means of thread concurrency limitation, locking, hook interface or docker command truncation, the time slice adjustment of all running containers is completed before the execution of the specific docker command ends.

6. The method according to claim 1, characterized in that The time slice allocation rule includes a time slice adjustment period, and the step of adjusting the time slice of the container to an expected time slice corresponding to the container includes: Creating a time slice update service according to the time slice allocation rule; The started container in the container is detected according to the time slice update service, and the time slices of the started container and the newly created container are adjusted according to the time slice allocation rule, so that the time slices of the started container and the newly created container are adjusted to the expected time slices corresponding to the started container and the newly created container.

7. A device for adjusting a container time slice, characterized in that: The device comprises: A determination module, used to determine the expected time slice corresponding to the container according to a predetermined time slice allocation rule; wherein the time slice allocation rule includes a total time slice available for allocation and a time slice allocation method; A modification module, used to modify the first container management interface of the container according to the time slice allocation rule to obtain a modified second container management interface; wherein the second container management interface includes a time slice update method based on the time slice allocation rule; An adjustment module is used to adjust the time slice of the container to an expected time slice corresponding to the container according to the second container management interface.

8. A container time slice adjustment device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the method according to any one of claims 1 to 6 when executed by the processor.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.