Container migration optimization method, system and storage medium

By identifying and simplifying the amount of image information, and optimizing the image according to the resource allocation of the target computing environment, the problem of data storage pressure in image migration from a high-performance environment to a low-performance environment is solved, and the effective use of images in a low-performance environment is achieved. show.

CN118585290BActive Publication Date: 2024-10-18LANYUN NET
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411067440.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-10-18
Estimated Expiration
2044-08-06

AI Technical Summary

Technical Problem

During the container migration process, when processed images are transferred from a high-performance computing environment to a low-performance computing environment, they cannot be effectively optimized, resulting in increased data storage pressure and the low-performance environment being unable to display image details.

Method used

By identifying the amount of information in the image, the image is simplified according to the resource allocation of the target computing environment, eliminating unnecessary pixels, generating a simplified image suitable for low-performance environments, and recording the simplification process in the cache library for subsequent reading. Match when requested.

Benefits of technology

It reduces the amount of data, optimizes the migration process of image containers, reduces data storage pressure, and ensures that images can be displayed in low-performance environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118585290B_ABST
    Figure CN118585290B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of task migration, and specifically discloses a container migration optimization method, system and storage medium. The method comprises the following steps: obtaining a processed image of a backup of a container to be migrated, identifying the processed image, determining the information amount of each data in the processed image, and obtaining an information amount array corresponding to the processed image after the information amount of all data in the processed image is calculated; when a migration request pointing to a certain migration environment is received, obtaining the container resource allocation amount of the migration environment; simplifying the data of the processed image according to the container resource allocation amount and the information amount array; the present invention identifies the processed image, determines the information amount of the processed image, simplifies the data of the processed image based on the information amount and the difference between the environment after migration and the environment before migration, thereby reducing the data amount and optimizing the migration process of the container of the processed image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of task migration, and in particular to a container migration optimization method, system and storage medium. Background Art

[0002] Container migration usually refers to moving containerized applications between different computing environments. This is a common concept in cloud computing and modern software development, especially in environments using container technologies such as Docker and Kubernetes. Container migration can help achieve optimal resource allocation, improve application availability and flexibility, and also support operations such as fault recovery and load balancing.

[0003] During the container migration process, the processed data also needs to be migrated. For text data, due to the similar complexity, a simple migration is sufficient. However, for image data, different computing environments have different computing capabilities. When transferring the container for processing images from a high-performance computing environment to a low-performance computing environment, it is actually meaningless to retain the original processed image, because the low-performance computing environment cannot display the details. If such processed images can be optimized, the data storage pressure can be greatly reduced. How to optimize the processed images is the technical problem that the technical solution of the present invention wants to solve. Summary of the invention

[0004] The purpose of the present invention is to provide a container migration optimization method, system and storage medium to solve the problems raised in the above background technology.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] A container migration optimization method, the method comprising:

[0007] Obtain the processed image of the backup of the container to be migrated, identify the processed image, determine the information amount of each data in the processed image, and after the information amount of all data in the processed image is calculated, obtain an information amount array corresponding to the processed image;

[0008] When receiving a migration request directed to a migration environment, obtaining the container resource allocation amount of the migration environment;

[0009] Performing data simplification on the processed image according to the container resource allocation amount and information amount array;

[0010] The data simplification process of each container to be migrated is recorded in real time based on a preset cache library. When recording, a label of the recorded content is determined according to the migration environment corresponding to the data simplification process.

[0011] When the cache library receives a data read request sent by a container to be migrated, it matches the recorded data according to the label of the container to be migrated.

[0012] As a further solution of the present invention: the steps of obtaining the processed image of the backup of the container to be migrated, identifying the processed image, determining the information amount of each data in the processed image, and obtaining the information amount array corresponding to the processed image after the information amount of all data in the processed image is calculated include:

[0013] Obtaining a processed image of a backup of the container to be migrated, and splitting the processed image into multiple frame data groups;

[0014] Identify each frame of data and determine the data complexity;

[0015] Determine the information amount of each data according to the data complexity of each frame data and the data complexity of other frame data within a preset range;

[0016] The order of the multi-frame data groups is retained, and the amount of information of each data is counted to obtain an information amount array.

[0017] As a further solution of the present invention: the calculation process of the data complexity is:

[0018] ; In the formula, For the The data complexity of the frame data, For the The number of pixels corresponding to the pixel mean in the histogram under each channel, For the In the histogram under the channel The number of pixels corresponding to the pixel value; For the The preset weights corresponding to the channels, the sum of the weights of all channels is one;

[0019] The calculation process of the information volume is:

[0020] ; In the formula, For the The amount of information in the frame data, is the radius of the preset range; For the The difference in data complexity of frame data, ; For the The data complexity of the frame data, For the Data complexity of frame data.

[0021] As a further solution of the present invention: the step of simplifying the data of the processed image according to the container resource allocation amount and the information amount array comprises:

[0022] Query the current amount of resources of the container, compare it with the container resource allocation of the migration environment, and calculate the scaling ratio;

[0023] Reading an information amount array of a processed image, and correcting the scaling ratio according to the information amount array;

[0024] For any processed image, the number of culling is determined based on the corrected scaling ratio and the total number of pixels in the processed image;

[0025] Pixels are randomly removed from the processed image, and when the number of removed pixels reaches the removal number, the image after the pixels are removed is output as the image after data simplification.

[0026] As a further solution of the present invention: the step of randomly removing pixels from the processed image and outputting the image after the pixels are removed as the image after data simplification when the number of removed pixels reaches the removal number comprises:

[0027] Calculate the selection probability of each pixel;

[0028] Randomly select pixels in the processed image based on the selection probability;

[0029] Recording the number of selected pixels, and when the number of eliminated pixels reaches the elimination number, outputting an image after the pixels are eliminated as an image after data simplification;

[0030] The calculation process of the selection probability is:

[0031] ; ; In the formula, The midpoint of the image The probability of selection, For point The characteristic value of For point The pixel value of

[0032] The process of determining the number of eliminations is as follows:

[0033] ; In the formula, For the The number of frame data to be culled, Indicates the container resource allocation for the migration environment. Indicates the current amount of resources; For the The amount of information in the frame data, is the maximum amount of information, is a preset constant.

[0034] As a further solution of the present invention: the step of recording the data simplification process of each container to be migrated in real time based on a preset cache library, and determining a label of the recorded content according to the migration environment corresponding to the data simplification process during recording includes:

[0035] Monitor the progress of each container to be migrated in real time. When a container to be migrated is undergoing data simplification, select a storage unit from the preset cache library.

[0036] Based on the selected storage unit, the pixels to be eliminated in each image during the elimination process are obtained to obtain a elimination array for each image; during the obtaining process, the elimination order, position and pixel value of the pixels are retained;

[0037] Query the migration environment corresponding to the container to be migrated for data simplification, and use the name of the migration environment as a label to insert into the elimination array.

[0038] As a further solution of the present invention: when the cache library receives a data read request sent by a container to be migrated, the step of matching the recorded data according to the label of the container to be migrated includes:

[0039] When the cache library receives a data read request sent by a migration environment, it queries the name of the migration environment;

[0040] Traverse the cache library according to the name and match all the elimination arrays;

[0041] The elimination array is sorted according to the image corresponding to the elimination array, and the sorted elimination array is used as the data of the matched record.

[0042] The technical solution of the present invention also provides a container migration optimization system, the system comprising:

[0043] An information volume calculation module is used to obtain the processed image of the backup of the container to be migrated, identify the processed image, and determine the information volume of each data in the processed image. After the information volume of all data in the processed image is calculated, an information volume array corresponding to the processed image is obtained;

[0044] An allocation amount acquisition module, configured to acquire the container resource allocation amount of a migration environment upon receiving a migration request directed to the migration environment;

[0045] A data reduction module, used for performing data simplification on the processed image according to the container resource allocation amount and information amount array;

[0046] The simplification process recording module is used to record the data simplification process of each container to be migrated in real time based on a preset cache library. When recording, the label of the recorded content is determined according to the migration environment corresponding to the data simplification process;

[0047] The data decoding module is used to match the recorded data according to the label of a container to be migrated when the cache library receives a data read request sent by the container to be migrated.

[0048] As a further solution of the present invention: the information volume calculation module includes:

[0049] An image splitting unit, used for obtaining a processed image of a backup of the container to be migrated, and splitting the processed image into a plurality of frame data groups;

[0050] A data identification unit, used to identify each frame of data and determine the data complexity;

[0051] A calculation unit, used to determine the information amount of each data according to the data complexity of each frame data and the data complexity of other frame data within a preset range;

[0052] The statistical unit is used to retain the order of multiple frame data groups, count the amount of information of each data, and obtain an information amount array.

[0053] The technical solution of the present invention also provides a storage medium, in which at least one program code is stored. When the program code is loaded and executed by a processor, the container migration optimization method is implemented.

[0054] Compared with the prior art, the beneficial effects of the present invention are: the present invention identifies the processed image, determines the amount of information of the processed image, simplifies the data of the processed image based on the amount of information and the difference between the environment after migration and the environment before migration, thereby reducing the amount of data and optimizing the migration process of the container for processing the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention.

[0056] Figure 1 A flowchart of the overall process of optimizing the method for container migration.

[0057] Figure 2 Block diagram of a system optimized for container migration. DETAILED DESCRIPTION

[0058] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0059] Figure 1 The following is a general flow chart of a container migration optimization method. In an embodiment of the present invention, a container migration optimization method is provided, and the method includes:

[0060] Step S100: obtaining a processed image of the backup of the container to be migrated, identifying the processed image, determining the information amount of each data in the processed image, and after the information amount of all data in the processed image is calculated, obtaining an information amount array corresponding to the processed image;

[0061] Step S200: upon receiving a migration request directed to a certain migration environment, obtaining the container resource allocation amount of the migration environment;

[0062] Step S300: simplifying the processed image data according to the container resource allocation amount and the information amount array;

[0063] Step S400: Recording the data simplification process of each container to be migrated in real time based on a preset cache library, and determining a label of the recorded content according to the migration environment corresponding to the data simplification process when recording;

[0064] Step S500: When the cache library receives a data read request sent by a container to be migrated, it matches the recorded data according to the tag of the container to be migrated.

[0065] The technical solution of the present invention is applied to the container migration scenario. The container involved in this application is mainly a container for processing images, which is similar to a virtualized GPU. There are many computing environments. Each time a migration occurs, some optimization processing needs to be performed on the processed images synchronously to make them compatible with different computing environments. The optimization process of this application is mainly aimed at computing environments with different resource amounts, especially when a computing environment with sufficient resources migrates to a computing environment with insufficient resources. When processing new images, the performance will be reduced. If the processed images are still processed with high performance, there will be some incoordination. Therefore, this application is a solution for simplifying the processed images when the container changes from high performance to low performance.

[0066] Furthermore, for a container that needs to be migrated, a processed image of the backup of the container to be migrated is obtained, the processed image is identified, and the amount of information of each data (image) in the processed image is determined. After the amount of information of all data in the processed image is calculated, an information amount array corresponding to the processed image is obtained, and the order of elements in the information amount array is the same as the image order of the processed image.

[0067] Specifically, when a migration request pointing to a certain migration environment is received, the container resource allocation amount of the migration environment is obtained. If the container resource allocation amount of the migration environment is larger than that of the current migration environment, it remains unchanged. If the container resource allocation amount of the migration environment is smaller than that of the current migration environment, it is necessary to simplify the data of the processed image according to the container resource allocation amount and the information amount array. The processed image is an image set. The container resource allocation amount determines the simplification amplitude, and the information amount array determines the simplification difference between different images in the image set.

[0068] In addition, the execution subject of this method also constructs an upper-level cache table to count the data simplification process of all containers to be migrated during migration and cache it; it should be noted that in the statistical stage, the label is determined by the target computing environment of migration. The purpose of this solution is that the party that queries the data subsequently is the computing environment. If the computing environment requires more refined data, it will upload a query request. At this time, the cached data can be matched according to the name of the computing environment and sent to the computing environment.

[0069] As a preferred embodiment of the technical solution of the present invention, the steps of obtaining the processed image of the backup of the container to be migrated, identifying the processed image, determining the information amount of each data in the processed image, and obtaining the information amount array corresponding to the processed image after the information amount of all data in the processed image is calculated include:

[0070] Obtaining a processed image of a backup of the container to be migrated, and splitting the processed image into multiple frame data groups;

[0071] Identify each frame of data and determine the data complexity;

[0072] Determine the information amount of each data according to the data complexity of each frame data and the data complexity of other frame data within a preset range;

[0073] The order of the multi-frame data groups is retained, and the amount of information of each data is counted to obtain an information amount array.

[0074] The processed images of the container backup to be migrated are converted into a multi-frame data group, wherein the multi-frame data group is an image set, and the order is kept unchanged during the splitting process.

[0075] By identifying each frame of data (image), the data complexity (complexity of the image) can be determined. Furthermore, the relationship between each frame of data and the adjacent frame of data can be calculated to obtain the time domain relationship. Combining the time domain relationship and data complexity, the amount of information in each frame of data can be obtained. The order of the multi-frame data group is retained, and the amount of information of each data is counted to obtain the information amount array.

[0076] Specifically, the calculation process of the data complexity is:

[0077] ; In the formula, For the The data complexity of the frame data, For the The number of pixels corresponding to the pixel mean in the histogram under each channel, For the In the histogram under the channel The number of pixels corresponding to the pixel value; For the The preset weights corresponding to the channels, the sum of the weights of all channels is one;

[0078] The calculation process of the information volume is:

[0079] ; In the formula, For the The amount of information in the frame data, is the radius of the preset range; For the The difference in data complexity of frame data, ; For the The data complexity of the frame data, For the The data complexity of frame data is determined based on the pixel histogram under each channel. The number of pixels corresponding to the mean pixel value is determined, and then the standard deviation of the number of pixels corresponding to each pixel value relative to the number of pixels corresponding to the mean pixel value is calculated. The pixel distribution of different channels can be obtained, and the pixel distribution of all channels is accumulated to obtain the data complexity. In general, the number of channels is 3.

[0080] The amount of information introduces the time domain judgment process, which judges the sum of the differences in the complexity of all data within a time range. The difference in the complexity of each data is essentially ; The larger the difference sum is, the greater the image difference within the time range is, and the more information there is.

[0081] As a preferred embodiment of the technical solution of the present invention, the step of simplifying the data of the processed image according to the container resource allocation amount and the information amount array includes:

[0082] Query the current amount of resources of the container, compare it with the container resource allocation of the migration environment, and calculate the scaling ratio;

[0083] Reading an information amount array of a processed image, and correcting the scaling ratio according to the information amount array;

[0084] For any processed image, the number of culling is determined based on the corrected scaling ratio and the total number of pixels in the processed image;

[0085] Pixels are randomly removed from the processed image, and when the number of removed pixels reaches the removal number, the image after the pixels are removed is output as the image after data simplification.

[0086] The above content provides a specific data simplification solution, which is actually an image simplification solution. It queries the current resource amount of the container, compares it with the container resource allocation amount of the migration environment, reads the information amount array of the processed image, and corrects the scaling ratio according to the information amount array. The correction logic is that the larger the amount of information, the smaller the scaling ratio, and the less simplified data; wherein the scaling ratio is a percentage.

[0087] Then, for any processed image, the number of pixels to be eliminated is determined based on the corrected scaling ratio and the total number of pixels in the processed image. The number of pixels to be eliminated represents the number of pixels that need to be eliminated. Pixels are randomly eliminated from the processed image. When the number of pixels to be eliminated reaches the number of pixels to be eliminated, the image after the pixels are eliminated is output as the image after data simplification.

[0088] Specifically, the step of randomly removing pixels from the processed image and, when the number of removed pixels reaches the removal number, outputting the image after the pixels are removed as the image after data simplification includes:

[0089] Calculate the selection probability of each pixel;

[0090] Randomly select pixels in the processed image based on the selection probability;

[0091] Recording the number of selected pixels, and when the number of eliminated pixels reaches the elimination number, outputting an image after the pixels are eliminated as an image after data simplification;

[0092] The calculation process of the selection probability is:

[0093] ; ; In the formula, The midpoint of the image The probability of selection, For point The characteristic value of For point The pixel value of

[0094] The process of determining the number of eliminations is as follows:

[0095] ; In the formula, For the The number of frame data to be culled, Indicates the container resource allocation for the migration environment. Indicates the current amount of resources; For the The amount of information in the frame data, is the maximum amount of information, is a preset constant.

[0096] The process of data simplification is to identify each pixel point for each image and determine the selection probability of each pixel point based on the characteristic value of the pixel point color value. The characteristic value is used to characterize the difference between the pixel point and the surrounding pixels. The greater the difference, the higher the selection probability.

[0097] Furthermore, regarding the number of culling, a ratio is first determined based on the container resource allocation of the migration environment and the current resource amount. If the ratio is greater than 1, no culling is required and the culling number is zero. If the ratio is less than 1, the ratio is subtracted from 1 and then multiplied by the maximum amount of information and the first The ratio of the amount of information in the frame data. The larger the amount of information, the greater the maximum amount of information. The smaller the ratio of the information volume of the frame data, the more it is multiplied by a coefficient and rounded up (not shown in the formula, it can be determined in the actual elimination process, for example, if 100.3 pixels are eliminated, it is considered as 101), which can be used as the elimination number. From the above content, it can be seen that the larger the amount of information, the smaller the elimination number, and the smaller the resource allocation in the content, the more elimination number.

[0098] As a preferred embodiment of the technical solution of the present invention, the step of recording the data simplification process of each container to be migrated in real time based on a preset cache library, and determining the label of the recorded content according to the migration environment corresponding to the data simplification process during recording includes:

[0099] Monitor the progress of each container to be migrated in real time. When a container to be migrated is undergoing data simplification, select a storage unit from the preset cache library.

[0100] Based on the selected storage unit, the pixels to be eliminated in each image during the elimination process are obtained to obtain a elimination array for each image; during the obtaining process, the elimination order, position and pixel value of the pixels are retained;

[0101] Query the migration environment corresponding to the container to be migrated for data simplification, and use the name of the migration environment as a label to insert into the elimination array.

[0102] The progress of each container to be migrated is monitored in real time to determine whether migration occurs. If migration occurs, data simplification will be performed. When a container to be migrated performs data simplification, a storage unit is selected in the preset cache library to obtain a culling array and store it in the storage unit. Each culling array obtained corresponds to an image in the processed image. When obtaining the culling array, the culling order, position and pixel value of the culled pixels need to be retained. The name of the culling array is the corresponding image name, the culling order is the order of the selected pixels, the position is the position of the selected pixels, and the pixel value is the position of the selected pixels.

[0103] Then, the migration environment corresponding to the container to be migrated for data simplification is queried, and the name of the migration environment is used as a label to insert into the elimination array. The elimination arrays corresponding to all processed images in the same container to be migrated all use the name of the migration environment as a label.

[0104] Furthermore, when the cache library receives a data read request sent by a container to be migrated, the step of matching the recorded data according to the tag of the container to be migrated includes:

[0105] When the cache library receives a data read request sent by a migration environment, it queries the name of the migration environment;

[0106] Traverse the cache library according to the name and match all the elimination arrays;

[0107] The elimination array is sorted according to the image corresponding to the elimination array, and the sorted elimination array is used as the data of the matched record.

[0108] The above content provides a data restoration service for the computing environment. When the cache library receives a data read request sent by a migration environment, the name of the migration environment is queried. Since the name of the migration environment has been inserted into the elimination array when the elimination array is retained, the cache library is traversed according to the name to match all elimination arrays. These elimination arrays correspond to the elimination process of the processed image. The elimination arrays are sorted so that they correspond one-to-one with the processed image, and then the elimination array is used to restore the image data to obtain the unsimplified data.

[0109] Figure 2: is a structural block diagram of a container migration optimization system. In a preferred embodiment of the technical solution of the present invention, a container migration optimization system is also provided. The system 10 includes:

[0110] The information volume calculation module 11 is used to obtain the processed image of the container backup to be migrated, identify the processed image, determine the information volume of each data in the processed image, and obtain the information volume array corresponding to the processed image after the information volume of all data in the processed image is calculated;

[0111] The allocation amount acquisition module 12 is used to acquire the container resource allocation amount of a migration environment when receiving a migration request directed to the migration environment;

[0112] A data reduction module 13, used for performing data simplification on the processed image according to the container resource allocation amount and information amount array;

[0113] The simplification process recording module 14 is used to record the data simplification process of each container to be migrated in real time based on a preset cache library, and when recording, determine the label of the recorded content according to the migration environment corresponding to the data simplification process;

[0114] The data decoding module 15 is used to match the recorded data according to the tag of a container to be migrated when the cache library receives a data read request sent by the container to be migrated.

[0115] Furthermore, the information volume calculation module 11 includes:

[0116] An image splitting unit, used for obtaining a processed image of a backup of the container to be migrated, and splitting the processed image into a plurality of frame data groups;

[0117] A data identification unit, used to identify each frame of data and determine the data complexity;

[0118] A calculation unit, used to determine the information amount of each data according to the data complexity of each frame data and the data complexity of other frame data within a preset range;

[0119] The statistical unit is used to retain the order of multiple frame data groups, count the amount of information of each data, and obtain an information amount array.

[0120] The functions that can be achieved by the container migration optimization method are all completed by a computer device, and the computer device includes one or more processors and one or more memories, and at least one program code is stored in the one or more memories. The program code is loaded and executed by the one or more processors to implement the container migration optimization method.

[0121] The processor takes out instructions from the memory one by one, analyzes the instructions, and then completes the corresponding operations according to the instruction requirements, generating a series of control commands, so that the various parts of the computer can automatically, continuously and coordinately move to become an organic whole, realize the input of programs, the input of data, and the calculation and output of results. The arithmetic operations or logical operations generated in this process are all completed by the operator; the memory includes a read-only memory (ROM), which is used to store computer programs, and a protection system is provided outside the memory.

[0122] Exemplarily, the computer program may be divided into one or more modules, one or more modules are stored in a memory and executed by a processor to implement the present invention. One or more modules may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program in a terminal device.

[0123] Those skilled in the art will understand that the description of the above service equipment is merely an example and does not constitute a limitation on the terminal equipment. It may include more or fewer components than described above, or a combination of certain components, or different components, for example, it may include input and output devices, network access devices, buses, etc.

[0124] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire staff terminal.

[0125] The above-mentioned memory can be used to store computer programs and / or modules. The above-mentioned processor realizes various functions of the above-mentioned terminal device by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as an information collection template display function, a product information release function, etc.), etc.; the data storage area can store data created according to the use of the berth status display system (such as product information collection templates corresponding to different product types, product information that different product providers need to release, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0126] If the module / unit integrated in the terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable medium. Based on this understanding, the present invention implements all or part of the modules / units in the above-mentioned embodiment system, and can also be completed by instructing the relevant hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable medium, and the computer program can realize the functions of the above-mentioned various system embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or system that can carry computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.

[0127] It should be noted that, in this article, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0128] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A container migration optimization method, characterized in that: The method comprises: Obtain the processed image of the backup of the container to be migrated, identify the processed image, determine the information amount of each data in the processed image, and after the information amount of all data in the processed image is calculated, obtain an information amount array corresponding to the processed image; When receiving a migration request directed to a migration environment, obtaining the container resource allocation amount of the migration environment; Performing data simplification on the processed image according to the container resource allocation amount and information amount array; The data simplification process of each container to be migrated is recorded in real time based on a preset cache library. When recording, a label of the recorded content is determined according to the migration environment corresponding to the data simplification process. When the cache library receives a data read request sent by a container to be migrated, it matches the recorded data according to the label of the container to be migrated; The step of simplifying the processed image data according to the container resource allocation amount and the information amount array comprises: Query the current amount of resources of the container, compare it with the container resource allocation of the migration environment, and calculate the scaling ratio; Reading an information amount array of a processed image, and correcting the scaling ratio according to the information amount array; For any processed image, the number of culling is determined based on the corrected scaling ratio and the total number of pixels in the processed image; randomly removing pixels from the processed image, and when the number of removed pixels reaches the removal number, outputting the image after the pixels are removed as the image after data simplification; The step of randomly removing pixels from the processed image and outputting the image after the pixels are removed as the image after data simplification when the number of removed pixels reaches the removal number comprises: Calculate the selection probability of each pixel; Randomly select pixels in the processed image based on the selection probability; Recording the number of selected pixels, and when the number of eliminated pixels reaches the elimination number, outputting an image after the pixels are eliminated as an image after data simplification; The calculation process of the selection probability is: Where P(x,y) is the probability of selecting point (x,y) in the image, R(x,y) is the feature value of point (x,y), and I(x,y) is the pixel value of point (x,y); The process of determining the number of eliminations is as follows: Where N(t) is the number of data to be removed from the tth frame, Z1 represents the container resource allocation of the migration environment, and Z2 represents the current resource amount; t is the information amount of the t-th frame data, I max is the maximum amount of information, and C is a preset constant.

2. The container migration optimization method according to claim 1, characterized in that: The steps of obtaining the processed image of the backup of the container to be migrated, identifying the processed image, determining the information amount of each data in the processed image, and obtaining the information amount array corresponding to the processed image after the information amount of all data in the processed image is calculated include: Obtaining a processed image of a backup of the container to be migrated, and splitting the processed image into multiple frame data groups; Identify each frame of data and determine the data complexity; Determine the information amount of each data according to the data complexity of each frame data and the data complexity of other frame data within a preset range; The order of the multi-frame data groups is retained, and the amount of information of each data is counted to obtain an information amount array.

3. The container migration optimization method according to claim 2, characterized in that: The calculation process of the data complexity is: In the formula, F t is the data complexity of the t-th frame data, E i is the number of pixels corresponding to the pixel mean in the histogram under the i-th channel, x j is the number of pixels corresponding to the jth pixel value in the histogram under the i-th channel; α i is the preset weight corresponding to the i-th channel, and the sum of the weights of all channels is one; The calculation process of the information volume is: In the formula, I t is the information content of the t-th frame data, σ is the radius of the preset range; ΔF t is the difference in data complexity of the t-th frame data, ΔF t =(F t+1 -F t-1 ) / 2; F t+1 is the data complexity of the t+1th frame data, F t-1 is the data complexity of the t-1th frame data.

4. The container migration optimization method according to claim 1, characterized in that: The step of recording the data simplification process of each container to be migrated in real time based on a preset cache library, and determining a label of the recorded content according to the migration environment corresponding to the data simplification process during recording includes: Monitor the progress of each container to be migrated in real time. When a container to be migrated is undergoing data simplification, select a storage unit from the preset cache library. Based on the selected storage unit, the pixels to be eliminated in each image during the elimination process are obtained to obtain a elimination array for each image; during the obtaining process, the elimination order, position and pixel value of the pixels are retained; Query the migration environment corresponding to the container to be migrated for data simplification, and use the name of the migration environment as a label to insert into the elimination array.

5. The container migration optimization method according to claim 4, characterized in that: When the cache library receives a data read request sent by a container to be migrated, the step of matching the recorded data according to the tag of the container to be migrated includes: When the cache library receives a data read request sent by a migration environment, it queries the name of the migration environment; Traverse the cache library according to the name and match all the elimination arrays; The elimination array is sorted according to the image corresponding to the elimination array, and the sorted elimination array is used as the data of the matched record.

6. A container migration optimization system, characterized in that: The system comprises: An information volume calculation module is used to obtain the processed image of the backup of the container to be migrated, identify the processed image, and determine the information volume of each data in the processed image. After the information volume of all data in the processed image is calculated, an information volume array corresponding to the processed image is obtained; An allocation amount acquisition module, configured to acquire the container resource allocation amount of a migration environment upon receiving a migration request directed to the migration environment; A data reduction module, used for performing data simplification on the processed image according to the container resource allocation amount and information amount array; The simplification process recording module is used to record the data simplification process of each container to be migrated in real time based on a preset cache library. When recording, the label of the recorded content is determined according to the migration environment corresponding to the data simplification process; The data decoding module is used to match the recorded data according to the label of a container to be migrated when the cache library receives a data read request sent by the container to be migrated.

7. A container migration optimization system according to claim 6, characterized in that: The information volume calculation module includes: An image splitting unit, used for obtaining a processed image of a backup of the container to be migrated, and splitting the processed image into a plurality of frame data groups; A data identification unit, used to identify each frame of data and determine the data complexity; A calculation unit, used to determine the information amount of each data according to the data complexity of each frame data and the data complexity of other frame data within a preset range; The statistical unit is used to retain the order of multiple frame data groups, count the amount of information of each data, and obtain an information amount array.

8. A storage medium, characterized in that: At least one program code is stored in the storage medium. When the program code is loaded and executed by the processor, the container migration optimization method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Database migration method, server and computer storage medium

    CN110659259A

  • Data migration method and system

    CN110958297A