Container adaptive adjustment method, device and equipment and storage medium
By using traffic prediction models in cloud computing architecture to dynamically adjust the number of container instances and data transmission volume, the problem that static rules cannot adapt to business needs is solved, and adaptive adjustment and resource optimization of containers are achieved.
Patent Information
- Application Number
- CN202510767223.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-09-05
AI Technical Summary
In existing cloud computing architectures, load balancing and scaling methods rely on static rules or timed monitoring, which cannot reflect immediate changes in container status and cluster performance in real time, resulting in resource waste or insufficient performance and a lack of adaptive capabilities.
A traffic prediction model is used to build a model through historical transmission data and container status data to predict future data transmission volume. The number of container instances and data transmission volume are adjusted according to the predicted data and container performance to achieve container adaptive adjustment.
It improves the adaptability of containers, realizes intelligent adjustment of resource allocation, reduces resource waste and performance deficiencies, and improves the flexibility and efficiency of the system.
Smart Images

Figure CN120602435A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology and can be used in the field of financial technology, especially in the field of cloud computing. Specifically, they relate to a container adaptive adjustment method, apparatus, device, and storage medium. Background Art
[0002] In the current cloud computing architecture, common load balancing and scaling methods mainly rely on static rules or scheduled monitoring for resource allocation and load balancing.
[0003] Specifically, when business volume increases, the number of service instances needs to be manually increased; when business volume decreases, application support personnel need to manually reduce the number of service instances; or the number of service instances can be automatically adjusted based on preset load thresholds. Although adaptive container adjustment is implemented, static adjustment strategies cannot reflect real-time changes in container status and cluster performance, which can lead to resource waste or insufficient performance. In addition, fixed threshold settings cannot adapt to changing business needs and lack adaptive capabilities. Summary of the Invention
[0004] The present application provides a container adaptive adjustment method, apparatus, device and storage medium to improve the adaptability of the container while achieving intelligent adjustment of resource configuration.
[0005] According to one aspect of the present application, a method for adaptively adjusting a container is provided, the method comprising:
[0006] Based on the traffic prediction model, the data transmission volume of the candidate container in a preset time period is predicted according to the current transmission data of the candidate container to obtain the predicted data transmission volume of the candidate container; wherein the traffic prediction model is constructed and determined based on the historical transmission data sequence and container status data sequence of the candidate container;
[0007] Adjusting the number of container instances of the candidate container according to the predicted data transmission volume and the candidate container performance of the candidate container to obtain a target container; wherein the candidate container performance includes the container instance processable volume and the single instance throughput;
[0008] The data transmission volume of the target container is adjusted according to the current data transmission volume of the currently transmitted data and the target container performance of the target container, so as to complete the container adaptive adjustment.
[0009] According to another aspect of the present application, a container adaptive adjustment device is provided, the device comprising:
[0010] a transmission volume prediction module, configured to predict the data transmission volume of a candidate container in a preset time period based on the current transmission data of the candidate container and a traffic prediction model, thereby obtaining a predicted data transmission volume of the candidate container; wherein the traffic prediction model is constructed and determined based on the historical transmission data sequence and container status data sequence of the candidate container;
[0011] an instance quantity adjustment module, configured to adjust the container instance quantity of the candidate container according to the predicted data transmission volume and the candidate container performance of the candidate container to obtain a target container; wherein the candidate container performance includes the container instance processable capacity and the single instance throughput;
[0012] The transmission volume adjustment module is configured to adjust the data transmission volume of the target container according to the current data transmission volume of the currently transmitted data and the target container performance of the target container, so as to complete container adaptive adjustment.
[0013] According to another aspect of the present application, an electronic device is provided, comprising:
[0014] one or more processors;
[0015] a memory for storing one or more programs;
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement any one of the container adaptive adjustment methods provided in the embodiments of the present application.
[0017] According to another aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, any one of the container adaptive adjustment methods provided in the embodiments of the present application is implemented.
[0018] According to another aspect of the present application, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the computer program implements any one of the container adaptive adjustment methods provided in the embodiments of the present application.
[0019] This application predicts the data transmission volume of a candidate container in a preset time period based on the current transmission data of the candidate container based on a traffic prediction model, and obtains the predicted data transmission volume of the candidate container; wherein, the traffic prediction model is constructed and determined based on the historical transmission data sequence and the container status data sequence of the candidate container; according to the predicted data transmission volume and the candidate container performance of the candidate container, the container instance quantity of the candidate container is adjusted to obtain the target container; wherein, the candidate container performance includes the container instance processable capacity and the single instance throughput; according to the current data transmission volume of the current transmission data and the target container performance of the target container, the data transmission volume of the target container is adjusted to complete the container adaptive adjustment. The above technical solution, through the hierarchical adjustment method of first performing coarse-grained adjustment of the container instance quantity and then performing fine-grained adjustment of the data transmission volume, helps to improve the adaptability of the container while realizing intelligent adjustment of resource allocation. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 This is a flow chart of a container adaptive adjustment method provided in accordance with the first embodiment of the present application;
[0021] Figure 2 This is a flow chart of a container adaptive adjustment method provided in accordance with the second embodiment of the present application;
[0022] Figure 3 This is a structural diagram of a container adaptive adjustment device provided according to Example 3 of the present application;
[0023] Figure 4 It is a structural diagram of an electronic device for implementing the container adaptive adjustment method of Example 4 of the present application. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] In addition, it should be noted that the collection, storage, use, processing, transmission, provision and disclosure of relevant data such as current transmission data and data transmission volume involved in the technical solution of this application comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0027] Example 1
[0028] Figure 1 This is a flowchart of a container adaptive adjustment method provided according to Example 1 of the present application. This embodiment is applicable to situations where a container is adaptively adjusted based on real-time data transmission conditions. It can be performed by a container adaptive adjustment device. The container adaptive adjustment device can be implemented in the form of hardware and / or software. The container adaptive adjustment device can be configured in a computer device, such as a server.
[0029] like Figure 1 As shown, the method includes:
[0030] S110. Based on a traffic prediction model and according to the current transmission data of the candidate container, predict the data transmission volume of the candidate container in a preset time period to obtain a predicted data transmission volume of the candidate container; wherein the traffic prediction model is constructed and determined based on a historical transmission data sequence and a container status data sequence of the candidate container.
[0031] In this embodiment, the traffic prediction model uses historical transmission data and container status data to predict the data transmission volume of a candidate container within a future time period. A candidate container is a container currently in normal use during data transmission. Current transmission data refers to the ongoing data transmission of the container during real-time operation; it typically includes the amount of data received by the container from the system and the amount of data sent elsewhere. The preset time period is manually set based on actual conditions or empirical values and is not specifically limited in this embodiment of the application. Data transmission volume refers to the amount of data transmitted by a container within a specified time period and is generally used to measure the container's load or processing capacity. The predicted data transmission volume is an estimate of the data transmission volume of the candidate container within a preset future time period based on the traffic prediction model; this predicted value can provide advance information on the container's future load. The historical transmission data series refers to the record of all transmission data of the container over the past period; analyzing this data can help predict future traffic patterns. The container status data series refers to the container's status information over the past period, such as CPU (Central Processing Unit) utilization, memory usage, network latency, etc., which reflects the container's operating status.
[0032] For example, the traffic prediction model is called, and real-time mobile phone data is input to generate a traffic forecast for a period of time in the future (such as the next 5 minutes, 1 hour, etc.), and the predicted data transmission volume of the candidate container is obtained. The sliding window method is used to update the forecast, and the latest data is continuously provided to the model as feedback to ensure that it adapts to changing business needs.
[0033] Optionally, the traffic prediction model includes at least an input layer, a feature fusion module, a spatiotemporal feature extraction layer, a multi-scale prediction head and an output layer; the output end of the input layer includes two parallel output ports; the input end of the feature fusion module includes two parallel input ports; the output end of the input layer is connected to the input end of the feature fusion module through tensor copy or shared memory transmission; the output end of the feature fusion module is connected to the input end of the spatiotemporal feature extraction layer; the output end of the spatiotemporal feature extraction layer is connected to the input end of the multi-scale prediction head; the input end of the multi-scale prediction head is connected to the input end of the output layer; the output end of the output layer is connected to the input end of the spatiotemporal feature extraction layer to update the parameters of the spatiotemporal feature extraction layer.
[0034] In this embodiment, the input layer is the first layer in the neural network, responsible for receiving external input data. In the traffic prediction model, the input layer receives historical network traffic data, container status, and other information, providing basic data for calculations in subsequent layers. The feature fusion module integrates data features from different sources or types to provide richer feature information for processing in subsequent layers. The spatiotemporal feature extraction layer extracts spatiotemporal features from the input multidimensional feature data. Spatiotemporal features typically involve the time series and spatial distribution of the data. In traffic prediction, spatiotemporal features help more accurately predict future traffic changes. The multiscale prediction head is a module in the traffic prediction model that is responsible for making predictions at different time scales (e.g., short-term, medium-term, and long-term). Through multiscale prediction, the model can more comprehensively capture traffic changes across different time dimensions. The output layer is the last layer of the neural network and is responsible for outputting the model's prediction results. In the traffic prediction model, the output of the output layer is the predicted value for future traffic. The output of the output layer can also be used to update the parameters of the spatiotemporal feature extraction layer through a feedback mechanism (such as backpropagation) to continuously optimize the feature extraction capability and improve the model's prediction accuracy. Tensor copy or shared memory are two methods used to transfer data between different modules. In the case of tensor copy, the data will be copied to the target module; shared memory allows multiple modules to directly access the same memory area and quickly share data.
[0035] Optionally, the traffic prediction model of the present application can also be based on a deep learning framework, using long short-term memory networks or neural network structures in the fields of natural language processing and deep learning for prediction; cross-validation and hyperparameter tuning are used to improve model performance.
[0036] S120. Adjust the number of container instances of the candidate container according to the predicted data transmission volume and the candidate container performance of the candidate container to obtain a target container; wherein the candidate container performance includes the container instance processable volume and single instance throughput.
[0037] In this embodiment, the number of container instances refers to the number of container instances created and running. Container instances can be increased or decreased based on actual load requirements to achieve container scaling. The container instance throughput refers to the amount of data each container instance can process per unit time. This metric is often used to measure a container's processing power. Single-instance throughput refers to the amount of data a single container instance can transmit per unit time. Higher throughput indicates a greater ability of the container to process requests. The target container refers to a scaled container whose performance has been adjusted to accommodate the projected load requirements.
[0038] For example, when the predicted traffic is higher than the processing capacity of the current container (which can be based on the historical peak or target threshold as a reference standard), the container instance of the container is increased; when the predicted traffic is far lower than the processing capacity of the current container or there is a load drop, the container instance of the container is reduced.
[0039] It should be noted that when reducing the number of container instances, an elegant termination method can be used to ensure that all requests are processed before scaling down.
[0040] Among them, the graceful termination method refers to taking appropriate steps and measures to ensure that resources are correctly released, data is properly saved, and connections are closed in an orderly manner when the program or service is closed, thereby avoiding data loss, damage or service interruption.
[0041] S130 : Adjust the data transmission volume of the target container according to the current data transmission volume of the currently transmitted data and the target container performance of the target container to complete container adaptive adjustment.
[0042] In this embodiment, the current data transfer volume refers to the actual amount of data processed by the system, indicating the traffic being processed by the container at a specific point in time. The target container performance refers to the capabilities and performance of the target container, typically including metrics such as container throughput, processing power, and latency.
[0043] Illustratively, a load balancing algorithm may be used to adjust the data transmission volume of the target container according to the current data transmission volume of the currently transmitted data and the target container performance of the target container.
[0044] Among them, the load balancing algorithm refers to the reasonable distribution of tasks or requests to multiple servers, nodes or resources in a distributed system, thereby ensuring load balancing of each server, high availability and high performance of the system; load balancing can avoid overloading of certain servers, while improving the system's processing power, fault tolerance and response speed.
[0045] In an optional implementation, the effectiveness of container instance volume adjustment and data transmission volume adjustment is regularly evaluated, such as monitoring service response time, processing error rate, system throughput and other indicators, and a feedback loop is established to feed the monitoring results into the traffic prediction model in real time, so that the system has the ability of continuous learning and self-optimization; based on the monitoring results, reports are automatically generated, and the system business performance and resource utilization efficiency are displayed through data visualization to facilitate daily analysis by operation and maintenance personnel.
[0046] The embodiment of the present application predicts the data transmission volume of the candidate container in a preset time period based on the current transmission data of the candidate container based on a traffic prediction model, thereby obtaining the predicted data transmission volume of the candidate container; wherein, the traffic prediction model is constructed and determined based on the historical transmission data sequence and the container status data sequence of the candidate container; according to the predicted data transmission volume and the candidate container performance of the candidate container, the container instance quantity of the candidate container is adjusted to obtain the target container; wherein, the candidate container performance includes the container instance processable capacity and the single instance throughput; according to the current data transmission volume of the current transmission data and the target container performance of the target container, the data transmission volume of the target container is adjusted to complete the container adaptive adjustment. The above technical solution, through the hierarchical adjustment method of first performing coarse-grained adjustment of the container instance quantity and then performing fine-grained adjustment of the data transmission volume, helps to improve the adaptability of the container while realizing intelligent adjustment of resource configuration.
[0047] Example 2
[0048] Figure 2 It is a flowchart of a container adaptive adjustment method provided in accordance with the second embodiment of the present application. Based on the technical solutions of the above embodiments, this embodiment refines "according to the predicted data transmission volume and the candidate container performance of the candidate container, the container instance quantity of the candidate container is adjusted to obtain the target container" into "numeric comparison of the predicted data transmission volume with the container instance processable capacity to obtain a numerical comparison result; based on the correspondence between the numerical comparison result and the candidate adjustment method, the target adjustment method of the container instance quantity of the candidate container is determined according to the numerical comparison result; the candidate adjustment method includes expansion adjustment and contraction adjustment; according to the target adjustment method, the predicted data transmission volume, the container instance processable capacity and the single instance throughput, the container instance quantity of the candidate container is adjusted to obtain the target container". It should be noted that for the parts not described in detail in the embodiments of the present application, please refer to the relevant statements of other embodiments. Figure 2 As shown, the method includes:
[0049] S210 : Based on the traffic prediction model and according to the current transmission data of the candidate container, predict the data transmission volume of the candidate container in a preset time period to obtain the predicted data transmission volume of the candidate container.
[0050] S220: Compare the predicted data transmission volume with the processable volume of the container instance to obtain a numerical comparison result.
[0051] In this embodiment, the numerical comparison result refers to the comparison result obtained when comparing the predicted data transmission volume and the processable capacity of the container instance. For example, when the predicted data transmission volume is greater than the processable capacity of the container instance, an expansion strategy may be adopted; otherwise, a reduction strategy may be adopted.
[0052] Exemplarily, the container instance processable capacity can be based on the peak value of the candidate container's historical data processing capacity or a preset processable capacity threshold, and the predicted data transmission capacity is numerically compared with the container instance processable capacity to obtain a numerical comparison result.
[0053] S230 : Based on the correspondence between the numerical comparison result and the candidate adjustment methods, determine a target adjustment method for the number of container instances of the candidate container according to the numerical comparison result; the candidate adjustment methods include expansion adjustment and contraction adjustment.
[0054] In this embodiment, candidate adjustment methods refer to selectable resource adjustment methods. Expansion adjustment refers to increasing the number of container instances to handle more data traffic. Scaling adjustment refers to reducing the number of container instances to conserve computing and storage resources. The target adjustment method is the final adjustment method determined based on the correspondence between the numerical comparison results and the candidate adjustment methods, which determines whether to expand or shrink capacity.
[0055] For example, if the predicted data transmission volume is greater than the processing capacity of the current container instance, the system will perform capacity expansion adjustment, that is, increase the number of container instances to handle more data traffic; if the predicted data transmission volume is less than the processing capacity of the current container instance, the system will perform capacity reduction adjustment, that is, reduce the number of container instances, thereby saving computing and storage resources.
[0056] S240: Adjust the container instance quantity of the candidate container according to the target adjustment mode, the predicted data transmission volume, the container instance processable capacity, and the single instance throughput to obtain a target container.
[0057] Optionally, the absolute difference between the predicted data transmission volume and the container instance's processable volume is calculated to obtain the data volume to be adjusted; based on the data volume to be adjusted and the single-instance throughput, the instance volume to be adjusted of the candidate container is determined; based on the target adjustment method and the instance volume to be adjusted, the container instance volume of the candidate container is adjusted to obtain the target container.
[0058] In this embodiment, the data volume to be adjusted is calculated by the absolute difference between the predicted data transfer volume and the container instance's capacity, representing the specific amount of data requiring resource allocation adjustment. The instance volume to be adjusted refers to the number of container instances that need to be adjusted; this number determines the number of container instances to be expanded or reduced.
[0059] In an optional implementation, if the amount of data to be adjusted does not meet the instance amount adjustment condition, the container instance amount of the candidate container is not adjusted; if the amount of data to be adjusted meets the instance amount adjustment condition, the container instance amount of the candidate container is adjusted.
[0060] Among them, the instance quantity adjustment condition is artificially pre-set based on actual conditions or experience values, and the embodiment of the present application does not make specific limitations on this; for example, the adjustment condition may be that the amount of data to be adjusted is less than the adjustment data amount threshold.
[0061] Exemplarily, if the amount of data to be adjusted is less than the adjustment data amount threshold, the container instance quantity of the candidate container is not adjusted; if the amount of data to be adjusted is greater than or equal to the adjustment data amount threshold, the container instance quantity of the candidate container is adjusted.
[0062] S250: Adjust the data transmission volume of the target container according to the current data transmission volume of the currently transmitted data and the target container performance of the target container to complete container adaptive adjustment.
[0063] Optionally, the current load state of the target container is determined based on the current data transmission volume of the currently transmitted data and the target container performance of the target container; wherein the current load state is a relaxed state, a normal state, and a loaded state; if the current load state is a loaded state or a relaxed state, the data transmission volume of the target container is adjusted according to the current load state.
[0064] In this embodiment, the current load status describes the current workload of the container instance, reflecting the workload of the container when processing data transfers. A "relaxed" status indicates that the container load is low, and the amount of data processed by the container is far below its maximum processing capacity. A "normal" status indicates that the container load is within its design capacity, and the amount of data transferred is roughly balanced with the container's processing capacity. A "loaded" status indicates that the container load is excessive, and the current amount of data transferred is approaching or exceeding the container's maximum processing capacity, potentially resulting in performance degradation.
[0065] Furthermore, the current resource utilization of the target container is determined based on the current data transmission volume of the currently transmitted data and the target container performance of the target container; and based on the corresponding relationship between the resource utilization and the candidate load status, the current load status of the target container is determined according to the current resource utilization.
[0066] In this embodiment, the current resource utilization refers to the ratio between the system resources used by the container at a certain moment and the available resources of the container; resource utilization is a key indicator for evaluating the load status of the container; the current resource utilization may include at least one of CPU utilization, memory utilization, and network bandwidth utilization.
[0067] Exemplarily, if the CPU utilization is lower than a certain threshold (such as lower than 30%), the memory utilization is lower than a certain threshold (such as 40%), and the network bandwidth utilization is lower than a certain threshold (such as lower than 45%), then the target container is determined to be in a relaxed state; if the CPU utilization is in a medium range (such as 30%-80%), the memory utilization is in a medium range (such as 40%-70%), and the network bandwidth utilization is in a medium range (such as 45%-90%), then the target container is determined to be in a normal state; if the CPU utilization is close to or higher than a certain threshold (such as greater than 80%), the memory utilization is close to or higher than the threshold (such as greater than 70%), and the network bandwidth utilization reaches a high value (such as greater than 90%), then the target container is determined to be in a loaded state.
[0068] The embodiment of the present application predicts the data transmission volume of the candidate container in a preset time period based on the current transmission data of the candidate container based on the traffic prediction model, and obtains the predicted data transmission volume of the candidate container; compares the predicted data transmission volume with the container instance processable volume to obtain a numerical comparison result; based on the correspondence between the numerical comparison result and the candidate adjustment method, determines the target adjustment method of the container instance quantity of the candidate container according to the numerical comparison result; the candidate adjustment method includes expansion adjustment and contraction adjustment; according to the target adjustment method, the predicted data transmission volume, the container instance processable volume and the single instance throughput, the container instance quantity of the candidate container is adjusted to obtain the target container; according to the current data transmission volume of the current transmission data and the target container performance of the target container, the data transmission volume of the target container is adjusted to complete the container adaptive adjustment. The above technical solution, by first performing coarse-grained adjustment of the container instance quantity and then performing fine-grained adjustment of the data transmission volume in a hierarchical adjustment method, helps to improve the adaptability of the container while realizing intelligent adjustment of resource configuration.
[0069] Example 3
[0070] Figure 3 This is a schematic diagram of the structure of a container adaptive adjustment device provided in accordance with the third embodiment of the present application, which can be applied to the case where the container is adaptively adjusted according to the real-time transmission data situation. The container adaptive adjustment device can be implemented in the form of hardware and / or software. The container adaptive adjustment device can be configured in a computer device, such as a server. Figure 3 As shown, the device includes:
[0071] The transmission volume prediction module 310 is configured to predict the data transmission volume of a candidate container in a preset time period based on the current transmission data of the candidate container using a traffic prediction model, thereby obtaining the predicted data transmission volume of the candidate container. The traffic prediction model is constructed and determined based on the historical transmission data sequence and container status data sequence of the candidate container.
[0072] An instance quantity adjustment module 320 is configured to adjust the container instance quantity of a candidate container based on the predicted data transmission volume and the candidate container performance of the candidate container to obtain a target container; wherein the candidate container performance includes the container instance processing capacity and the single instance throughput;
[0073] The transmission volume adjustment module 330 is configured to adjust the data transmission volume of the target container according to the current data transmission volume of the currently transmitted data and the target container performance of the target container, so as to achieve container adaptive adjustment.
[0074] The embodiment of the present application predicts the data transmission volume of the candidate container in a preset time period based on the current transmission data of the candidate container based on a traffic prediction model, thereby obtaining the predicted data transmission volume of the candidate container; wherein, the traffic prediction model is constructed and determined based on the historical transmission data sequence and the container status data sequence of the candidate container; according to the predicted data transmission volume and the candidate container performance of the candidate container, the container instance quantity of the candidate container is adjusted to obtain the target container; wherein, the candidate container performance includes the container instance processable capacity and the single instance throughput; according to the current data transmission volume of the current transmission data and the target container performance of the target container, the data transmission volume of the target container is adjusted to complete the container adaptive adjustment. The above technical solution, through the hierarchical adjustment method of first performing coarse-grained adjustment of the container instance quantity and then performing fine-grained adjustment of the data transmission volume, helps to improve the adaptability of the container while realizing intelligent adjustment of resource configuration.
[0075] Optionally, the instance quantity adjustment module 320 includes:
[0076] A data comparison unit, configured to compare the predicted data transmission volume with the processable volume of the container instance to obtain a numerical comparison result;
[0077] An adjustment mode determining unit is configured to determine a target adjustment mode for the number of container instances of the candidate container based on a correspondence between the numerical comparison result and the candidate adjustment modes; the candidate adjustment modes include expansion adjustment and contraction adjustment;
[0078] The instance quantity adjustment unit is used to adjust the container instance quantity of the candidate container according to the target adjustment mode, the predicted data transmission volume, the container instance processing capacity and the single instance throughput to obtain the target container.
[0079] Optional instance quantity adjustment unit, specifically used to:
[0080] Calculate the absolute difference between the predicted data transfer volume and the container instance's processable volume to obtain the data volume to be adjusted.
[0081] Determine the number of candidate container instances to be adjusted based on the amount of data to be adjusted and the throughput of a single instance.
[0082] According to the target adjustment mode and the number of instances to be adjusted, the number of container instances of the candidate container is adjusted to obtain the target container.
[0083] Optionally, the transmission volume adjustment module 330 includes:
[0084] a load state determining unit, configured to determine a current load state of the target container according to a current data transmission volume of the currently transmitted data and a target container performance of the target container; wherein the current load state includes a relaxed state, a normal state, and a loaded state;
[0085] The transmission volume adjustment unit is used to adjust the data transmission volume of the target container according to the current load state if the current load state is a loaded state or a relaxed state.
[0086] Optionally, the load state determination unit is specifically configured to:
[0087] determining a current resource utilization rate of the target container based on a current data transfer volume of the currently transmitted data and a target container performance of the target container;
[0088] Based on the correspondence between resource utilization and candidate load states, the current load state of the target container is determined according to the current resource utilization.
[0089] Optionally, the traffic prediction model includes at least an input layer, a feature fusion module, a spatiotemporal feature extraction layer, a multi-scale prediction head, and an output layer; the output end of the input layer includes two parallel output ports; the input end of the feature fusion module includes two parallel input ports;
[0090] The output end of the input layer is connected to the input end of the feature fusion module through tensor copy or shared memory transmission; the output end of the feature fusion module is connected to the input end of the spatiotemporal feature extraction layer; the output end of the spatiotemporal feature extraction layer is connected to the input end of the multi-scale prediction head; the input end of the multi-scale prediction head is connected to the input end of the output layer; the output end of the output layer is connected to the input end of the spatiotemporal feature extraction layer to update the parameters of the spatiotemporal feature extraction layer.
[0091] The container adaptive adjustment device provided in the embodiment of the present application can execute the container adaptive adjustment method provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects for executing each container adaptive adjustment method.
[0092] According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.
[0093] Example 4
[0094] Figure 44 is a schematic diagram of the structure of an electronic device 410 that implements the container adaptive adjustment method of an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0095] like Figure 4 As shown, the electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. Various programs and data required for the operation of the electronic device 410 can also be stored in the RAM 413. The processor 411, ROM 412 and RAM 413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.
[0096] Multiple components in electronic device 410 are connected to I / O interface 415, including an input unit 416, such as a keyboard, mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a magnetic disk, optical disk, etc.; and a communication unit 419, such as a network card, modem, wireless communication transceiver, etc. The communication unit 419 allows electronic device 410 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0097] Processor 411 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 411 executes the various methods and processes described above, such as the container adaptive adjustment method.
[0098] In some embodiments, the container adaptive adjustment method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the container adaptive adjustment method described above can be performed. Alternatively, in other embodiments, the processor 411 can be configured as the container adaptive adjustment method by any other appropriate means (e.g., by means of firmware).
[0099] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0100] Computer programs for implementing the methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable container adaptive regulation device, so that when executed by the processor, the computer programs implement the functions / operations specified in the flowcharts and / or block diagrams. The computer programs can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0101] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0102] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0103] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0104] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0105] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this application can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of this application can be achieved. This is not limited herein.
[0106] The above specific embodiments do not constitute a limitation on the scope of protection of this application. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application shall be included within the scope of protection of this application.
Claims
1. A container adaptive adjustment method, characterized in that: include: Based on the traffic prediction model, the data transmission volume of the candidate container in a preset time period is predicted according to the current transmission data of the candidate container to obtain the predicted data transmission volume of the candidate container; wherein the traffic prediction model is constructed and determined based on the historical transmission data sequence and container status data sequence of the candidate container; Adjusting the number of container instances of the candidate container according to the predicted data transmission volume and the candidate container performance of the candidate container to obtain a target container; wherein the candidate container performance includes the container instance processable volume and the single instance throughput; The data transmission volume of the target container is adjusted according to the current data transmission volume of the currently transmitted data and the target container performance of the target container, so as to complete the container adaptive adjustment.
2. The method according to claim 1, characterized in that The step of adjusting the number of container instances of the candidate container according to the predicted data transmission volume and the candidate container performance of the candidate container to obtain a target container includes: Comparing the predicted data transmission volume with the processable volume of the container instance to obtain a numerical comparison result; Based on the correspondence between the numerical comparison result and the candidate adjustment method, determining a target adjustment method for the container instance quantity of the candidate container according to the numerical comparison result; the candidate adjustment method includes expansion adjustment and contraction adjustment; According to the target adjustment mode, the predicted data transmission volume, the processable capacity of the container instance, and the single instance throughput, the container instance quantity of the candidate container is adjusted to obtain a target container.
3. The method according to claim 2, characterized in that The step of adjusting the number of container instances of the candidate container according to the target adjustment mode, the predicted data transmission volume, the processable volume of the container instance, and the single-instance throughput to obtain a target container includes: Calculating the absolute difference between the predicted data transmission volume and the processable volume of the container instance to obtain the data volume to be adjusted; Determining the number of instances to be adjusted for the candidate container according to the amount of data to be adjusted and the single instance throughput; According to the target adjustment mode and the number of instances to be adjusted, the number of container instances of the candidate container is adjusted to obtain a target container.
4. The method according to claim 1, wherein Adjusting the data transmission volume of the target container according to the current data transmission volume of the currently transmitted data and the target container performance of the target container includes: determining a current load state of the target container according to a current data transmission volume of the currently transmitted data and a target container performance of the target container; wherein the current load state is a relaxed state, a normal state, and a loaded state; If the current load state is a loaded state or a light state, the data transmission volume of the target container is adjusted according to the current load state.
5. The method according to claim 4, characterized in that Determining a current load state of the target container according to a current data transmission volume of the currently transmitted data and a target container performance of the target container includes: determining a current resource utilization rate of the target container according to a current data transmission volume of the currently transmitted data and a target container performance of the target container; Based on the correspondence between resource utilization and candidate load states, the current load state of the target container is determined according to the current resource utilization.
6. The method according to claim 1, characterized in that The traffic prediction model includes at least an input layer, a feature fusion module, a spatiotemporal feature extraction layer, a multi-scale prediction head, and an output layer; the output end of the input layer includes two parallel output ports; the input end of the feature fusion module includes two parallel input ports; The output end of the input layer is connected to the input end of the feature fusion module through tensor copy or shared memory transmission; the output end of the feature fusion module is connected to the input end of the spatiotemporal feature extraction layer; the output end of the spatiotemporal feature extraction layer is connected to the input end of the multi-scale prediction head; the input end of the multi-scale prediction head is connected to the input end of the output layer; the output end of the output layer is connected to the input end of the spatiotemporal feature extraction layer to update the parameters of the spatiotemporal feature extraction layer.
7. A container adaptive adjustment device, characterized in that: include: a transmission volume prediction module, configured to predict the data transmission volume of a candidate container in a preset time period based on the current transmission data of the candidate container and a traffic prediction model, thereby obtaining a predicted data transmission volume of the candidate container; wherein the traffic prediction model is constructed and determined based on the historical transmission data sequence and container status data sequence of the candidate container; an instance quantity adjustment module, configured to adjust the container instance quantity of the candidate container according to the predicted data transmission volume and the candidate container performance of the candidate container to obtain a target container; wherein the candidate container performance includes the container instance processable capacity and the single instance throughput; The transmission volume adjustment module is configured to adjust the data transmission volume of the target container according to the current data transmission volume of the currently transmitted data and the target container performance of the target container, so as to complete container adaptive adjustment.
8. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the container adaptive adjustment method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the container adaptive adjustment method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the container adaptive adjustment method according to any one of claims 1 to 6.