Containerized data synchronization method, device, equipment, medium and product

Through the containerized data synchronization method, container instances are dynamically managed to meet task requirements, solving the problem of low resource utilization of traditional data synchronization tools, and achieving efficient and flexible resource allocation and task execution.

CN118897717BActive Publication Date: 2024-12-13SHENZHEN SMARTCITY TECH DEV GRP CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411398717.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2024-12-13
Estimated Expiration
2044-10-09

AI Technical Summary

Technical Problem

Traditional data synchronization tools run on fixed physical or virtual machines, and resource allocation and management are static, resulting in low resource utilization and cannot be dynamically adjusted according to task requirements.

Method used

The containerized data synchronization method is adopted to package the data synchronization tool into a mirror through the container platform, and the container orchestration platform is used to dynamically manage container instances, automatically expand or shrink according to performance indicators, and achieve flexible allocation of resources.

Benefits of technology

Improve resource utilization, ensure efficient execution and response speed of data synchronization tasks, reduce operational costs, and provide flexible and efficient data synchronization solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118897717B_ABST
    Figure CN118897717B_ABST
Patent Text Reader

Abstract

The present application discloses a containerized data synchronization method, device, equipment, medium and product, which relates to the field of data processing and cloud computing technology. The method includes: packaging a data synchronization tool into an image on a container platform, creating a container instance corresponding to the image in a container orchestration platform cluster; if an externally inputted business requirement is obtained, a description file corresponding to the business requirement is generated, the description information in the description file is stored in a mapping file of the container orchestration platform, a target mapping file is obtained, a configuration file is generated, and a data synchronization task corresponding to the configuration file is run in the container instance; when the data synchronization task is running, the performance index of the container instance is obtained, and compared with a first preset threshold and a second preset threshold respectively; if the performance index is greater than the first preset threshold, the container instance is expanded; if the performance index is less than the second preset threshold, the container instance is reduced. The present application improves resource utilization when the task is running.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to containerized data synchronization methods, devices, equipment, media and products. Background Art

[0002] In recent years, with the rapid development of big data technology and the growing demand for data processing, data synchronization and governance have become key technical fields. In this context, data synchronization tools have become a widely used solution in the industry due to their high efficiency, flexibility, and wide support for heterogeneous data sources. However, there are obvious defects in their operation mode. For example, traditional data synchronization tools usually run on fixed physical machines or virtual machines, and resource allocation and management are often static. This means that once a task starts running, the resources it requires (such as memory and storage) have been fixedly allocated and cannot be dynamically adjusted according to the actual needs of the task, which may lead to low resource utilization. Summary of the invention

[0003] The main purpose of this application is to provide a containerized data synchronization method, apparatus, equipment, medium and product, that is, a containerized data synchronization method, apparatus, equipment, computer-readable storage medium and computer program product, which aims to solve the technical problem of low resource utilization when tasks are running.

[0004] To achieve the above object, the present application proposes a containerized data synchronization method, which is applied to a containerized data synchronization system. The containerized data synchronization system includes a container platform and a container orchestration platform cluster. The container orchestration platform cluster includes at least one container orchestration platform. The containerized data synchronization method includes:

[0005] The preset data synchronization tool is packaged into an image through the container platform, and the container instance corresponding to the image is created through the container orchestration platform cluster. The container instance is the smallest deployment computing unit in the container orchestration platform.

[0006] If the actual business requirements input from the outside are obtained, a description file corresponding to the actual business requirements is generated, and the description information in the description file is stored in the mapping file of the container orchestration platform to obtain a target mapping file;

[0007] Generate a configuration file based on the target mapping file, and run the data synchronization task corresponding to the configuration file in the container instance;

[0008] When the data synchronization task is running, obtaining a performance indicator of the container instance, and comparing the performance indicator with a first preset threshold and a second preset threshold respectively, wherein the first preset threshold is greater than the second preset threshold;

[0009] If the performance indicator is greater than the first preset threshold, the container instance is expanded;

[0010] If the performance indicator is less than the second preset threshold, the container instance is scaled down.

[0011] In one embodiment, the steps of packaging a preset data synchronization tool into an image through a container platform, and creating a container instance corresponding to the image in a container orchestration platform cluster include:

[0012] Obtain the image configuration file of the data synchronization tool through the container platform;

[0013] Build an image based on the image configuration file and push the image to the image repository;

[0014] The container orchestration platform determines the deployment file containing the address of the image repository and creates a container instance based on the deployment file.

[0015] In one embodiment, the step of expanding the capacity of a container instance includes:

[0016] The number of first container instances required to execute the data synchronization task is calculated according to the performance indicator, the first preset threshold, and the number of running container instances of the container instance currently running;

[0017] Determine whether the difference between the number of first container instances and the number of running container instances is greater than a preset expansion adjustment value;

[0018] If the difference between the first number of container instances and the number of running container instances is greater than the preset expansion adjustment value, the number of running container instances is increased by the number of container instances equal to the preset expansion adjustment value, and the step of determining whether the difference between the first number of container instances and the increased number of running container instances is greater than the preset expansion adjustment value is continued;

[0019] If the difference between the number of first container instances and the number of running container instances is less than or equal to the preset expansion adjustment value, the number of running container instances is increased to be consistent with the number of first container instances.

[0020] In one embodiment, the step of scaling down the container instance includes:

[0021] The number of second container instances required to perform the data synchronization task is calculated based on the performance indicator, the second preset threshold, and the actual number of container instances of the container instance currently running;

[0022] Determine whether the difference between the actual number of container instances and the second number of container instances is greater than a preset shrinking adjustment value;

[0023] If the difference between the actual number of container instances and the second number of container instances is greater than the preset shrinkage adjustment value, the actual number of container instances is reduced by the number of container instances equal to the preset shrinkage adjustment value, and the step of determining whether the difference between the actual number of container instances and the second number of container instances is greater than the preset shrinkage adjustment value is continued;

[0024] If the difference between the actual number of container instances and the second number of container instances is less than or equal to the preset shrink adjustment value, the actual number of container instances is reduced to be consistent with the second number of container instances.

[0025] In one embodiment, the step of obtaining the performance indicator of the container instance includes:

[0026] Convert performance metrics into visualizations and present the visualizations.

[0027] In one embodiment, after the step of performing capacity expansion processing on the container instance, the following steps are included:

[0028] If the data synchronization task has been completed, delete the container instance after the expansion process;

[0029] The steps for scaling down the container instance include:

[0030] If the data synchronization task has been completed, delete the container instance after the reduction process.

[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes a containerized data synchronization device, which is arranged in a containerized data synchronization system. The containerized data synchronization system includes a container platform and a container orchestration platform cluster. The container orchestration platform cluster includes at least one container orchestration platform. The containerized data synchronization device includes:

[0032] A creation module is used to package the preset data synchronization tool into an image through the container platform, and create a container instance corresponding to the image through the container orchestration platform cluster, where the container instance is the smallest deployment computing unit in the container orchestration platform;

[0033] The file module is used to generate a description file of the data synchronization task corresponding to the actual business demand if the actual business demand input from the outside is obtained, and store the description information in the description file in the mapping file of the container orchestration platform to obtain the target mapping file;

[0034] The running module generates a configuration file based on the target mapping file, and runs the data synchronization task corresponding to the configuration file in the container instance;

[0035] A comparison module, which obtains a performance indicator of the container instance when the data synchronization task is running, and compares the performance indicator with a first preset threshold and a second preset threshold respectively, wherein the first preset threshold is greater than the second preset threshold;

[0036] A capacity expansion module, configured to expand the capacity of the container instance if the performance indicator is greater than a first preset threshold;

[0037] The capacity reduction module is used to reduce the capacity of the container instance if the performance indicator is less than a second preset threshold.

[0038] In addition, to achieve the above-mentioned purpose, the present application also proposes a containerized data synchronization device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the containerized data synchronization method as described above.

[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the containerized data synchronization method as described above are implemented.

[0040] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the containerized data synchronization method as described above are implemented.

[0041] One or more technical solutions proposed in this application have at least the following technical effects:

[0042] The present application is applied to a containerized data synchronization system, which integrates a container platform and a container orchestration platform cluster, wherein each container orchestration platform in the container orchestration platform cluster serves as a core component for dynamically managing resources and optimizing application deployment. The container platform packages the preset data synchronization tool into an image, which not only integrates the data synchronization tool itself, but also includes its complete and independent operating environment, forming a standardized software package. This greatly simplifies the deployment process of the data synchronization task, not only improves the deployment efficiency, but also ensures the consistency of each deployment, and effectively avoids compatibility issues caused by environmental differences. In the container orchestration platform cluster, the image is converted into a container instance. As the most basic and highly deployable computing unit in the system, the container instance can flexibly allocate resources dynamically according to actual needs, realizing efficient use of resources. When the system receives the actual business needs input from the outside, a description file corresponding to it is generated, and the description information of the description file is stored in the mapping file of the container orchestration platform to form a target mapping file, and then a configuration file is generated based on the target mapping file, and the data synchronization task corresponding to the configuration file is run in the container instance. This process further improves the matching degree between data synchronization tasks and business needs through refined configuration management, ensuring the accuracy and timeliness of data flow. More importantly, during the execution of data synchronization tasks, the system monitors the performance indicators of container instances in real time and compares them with the first preset threshold and the second preset threshold. When the performance indicator exceeds the first preset threshold, the system will automatically trigger the expansion process, disperse the load pressure by increasing the number of container instances, and ensure the smooth execution and efficient completion of data synchronization tasks. On the contrary, when the performance indicator is lower than the second preset threshold, indicating that there is an excess of resources, the system will automatically perform a reduction operation to reduce unnecessary resource occupation and achieve optimal resource configuration. This intelligent automatic expansion and reduction strategy not only improves the response speed and stability of the system, but also significantly reduces operating costs, providing users with a more flexible and efficient data synchronization solution and improving resource utilization during task runtime. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0045] Figure 1A flowchart of the first embodiment of the containerized data synchronization method of the present application is provided;

[0046] Figure 2 A schematic diagram of a scenario provided for the first embodiment of the containerized data synchronization method of the present application;

[0047] Figure 3 A schematic diagram of a data synchronization method for the containerized data synchronization method of the present application, which is based on a container orchestration platform running a data synchronization tool;

[0048] Figure 4 This is a schematic diagram of the module structure of the containerized data synchronization device according to an embodiment of the present application;

[0049] Figure 5 Schematic diagram of the device structure of the hardware operating environment involved in the containerized data synchronization method in the embodiment of the present application.

[0050] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0051] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0052] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0053] At present, the deployment and operation of data synchronization tools mainly rely on two technical solutions: one is the data synchronization method based on static resource management, which allocates resources on fixed physical machines or virtual machines and avoids resource exhaustion by strictly controlling task parallelism; the other is the task scheduling method that relies on manual or third-party scheduling platforms, such as xxl-job (a distributed task scheduling platform), which provides flexible scheduling methods but increases the complexity of system integration and labor costs. However, these two technical solutions have obvious limitations in dealing with modern big data processing needs. Static resource management leads to low resource utilization, makes it difficult to adapt to the dynamic changes in task resource requirements, and lacks elastic expansion capabilities, which may lead to low resource utilization and reduced task processing speed, and may even lead to large-scale task failures; while the task management method of manual or third-party scheduling lacks automation and flexibility, affecting the efficiency and accuracy of data processing. At the same time, this task management method lacks a unified resource management platform, which makes it impossible to monitor, manage and optimize resources, and it is impossible to effectively control and optimize the overall resource usage.

[0054] The containerized data synchronization method provided in this application can optimize the deployment and scheduling of data synchronization tools in a containerized environment, realize dynamic management of resources, elastic expansion and automated task scheduling, thereby improving the efficiency and reliability of data synchronization. Using the container orchestration platform, data synchronization tasks can be deployed in containers to realize dynamic resource management, elastic expansion and automated task scheduling. This means that task resources are dynamically adjusted on demand, such as CPU (Central Processing Unit, the computing core and control core of the computer), and memory increase and decrease to automatically match demand and improve utilization. At the same time, the container orchestration platform can automatically increase and decrease container instances to adapt to changes in data volume and processing requirements, achieving efficient expansion and resource conservation. The task life cycle is automatically managed through the container orchestration platform to reduce manual operations. In addition, as a unified platform, the container orchestration platform centrally manages monitoring platform resources, and uses API (Application Programming Interface) and dashboard tools to easily grasp resource status and optimize management.

[0055] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a terminal, etc. capable of realizing the above functions. The following takes the terminal as an example to illustrate this embodiment and the following embodiments.

[0056] Based on this, the present application embodiment provides a containerized data synchronization method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the containerized data synchronization method of the present application.

[0057] In this embodiment, the containerized data synchronization system is applied. The containerized data synchronization system includes a container platform and a container orchestration platform cluster. The container orchestration platform cluster includes at least one container orchestration platform. Figure 2 , Figure 2 This is a scenario diagram of the first embodiment of the containerized data synchronization method of the present application.

[0058] The containerized data synchronization method includes steps S10 to S60:

[0059] It should be noted that container platforms such as Docker (an application container engine) will package the application and its dependencies in a file. When the file is run, a virtual container will be generated. The program runs in this virtual container just like running on a real physical machine. Container orchestration platforms such as Kubernetes (a containerized application for managing multiple hosts in a cloud platform) are platforms for automating the deployment, expansion, and management of containerized applications.

[0060] Step S10, packaging the preset data synchronization tool into an image through the container platform, and creating a container instance corresponding to the image through the container orchestration platform cluster, wherein the container instance is the smallest deployment computing unit in the container orchestration platform;

[0061] It should be noted that data synchronization tools refer to software tools used to synchronize data between different data sources, such as DataX (an offline data synchronization tool / platform). An image is the basic template for containers in a container platform. It is a lightweight, executable, independent software package that contains all the content required for software to run (including code, runtime, libraries, environment variables, configuration files, etc.). A container instance is the smallest deployment unit in a container orchestration platform and can contain one or more containers, as well as some shared resources of these containers.

[0062] First, prepare the environment and ensure that the container platform environment is available. Then create an image configuration file for the container platform, specify the base image, install the dependencies required for the data synchronization tool, copy the data synchronization tool to the image, set environment variables (if necessary), specify the command to be executed when the container is started, etc. Use the command to build the container to generate the image file according to the instructions in the image configuration file and upload it to the image repository. Define the deployment configuration in the container orchestration platform, specify the image file to be used, the specifications of the container instance (such as CPU, memory limit), network configuration, etc., submit the deployment configuration to the container orchestration platform, and the container orchestration platform will create a container instance based on the deployment configuration.

[0063] Step S20: if the actual business requirements input from the outside are obtained, a description file corresponding to the actual business requirements is generated, and the description information in the description file is stored in a mapping file of the container orchestration platform to obtain a target mapping file;

[0064] It should be noted that the actual business requirements of external input refer to the data synchronization requirements provided by the outside of the system (which may be users, other systems or services, etc.). These requirements may include specific information such as the data source to be synchronized, the target location, the synchronization frequency, and the synchronization rules. Data synchronization tasks refer to the process of automatically extracting data from one or more data sources (such as databases, files, cloud services, applications, etc.) according to the predetermined configuration (if extracting data from the database, the predetermined configuration may be setting query statements, if extracting data from the file system, the predetermined configuration may be specifying the file path and format), and finally synchronizing the data to the target data source after necessary conversion and cleaning using data synchronization tools or technologies. The description file usually contains all the necessary information required to perform the data synchronization task, such as the URL (Uniform Resource Locator) of the data source, the path of the target storage, the table or field to be synchronized, the triggering conditions for synchronization (such as scheduled tasks or real-time triggers), etc. The mapping file is a resource object used by the container orchestration platform to store configuration data, which can be stored in the form of key-value pairs.

[0065] Based on the specific contents of these requirements, such as data type, synchronization frequency, source data location, and target data location, the system compiles all the detailed steps and configuration information required to perform the data synchronization task, thereby generating a complete data synchronization task description file. This file records in detail how to convert business requirements into specific synchronization operations, providing clear guidance for subsequent task execution. If the description file is small and does not need to be changed frequently, its content can be embedded directly into the mapping file. If the description file is large, store the description file as an external file in a location accessible to the container (such as a persistent storage volume), and then configure the mount point in the mapping file so that the container can access the file.

[0066] Step S30, generating a configuration file based on the target mapping file, and running a data synchronization task corresponding to the configuration file in the container instance;

[0067] It should be noted that the configuration file includes commands such as reading configuration information in the target mapping file and generating task configuration.

[0068] First, a configuration file is generated by parsing the target mapping file and the actual business data processing requirements. This configuration file is required to perform the data synchronization task. It defines the synchronization rules, parameters, and target location in detail. Subsequently, this configuration file is loaded into a container instance. After the configuration file is obtained inside the container, the content of the configuration file is read and parsed into an internal data structure or object for subsequent use. If there are addresses of other files in the configuration file, the location of other files in the container file system is found according to the recorded addresses. In this process, the container instance extracts all the parameters and configuration information required to perform the data synchronization task. Before applying the configuration to the data synchronization task, the application may perform configuration validation to ensure that all necessary parameters are set correctly and meet the expected format and range. Once the configuration file is successfully read and parsed, the container instance uses the configuration information to initialize and start the data synchronization task. This includes establishing a database connection, setting synchronization rules, defining synchronization frequency, etc. During the task execution, the application reads data from the source database and synchronizes the data to the target database according to the guidance of the configuration file.

[0069] Step S40, when the data synchronization task is running, obtaining the performance index of the container instance, and comparing the performance index with the first preset threshold and the second preset threshold respectively, wherein the first preset threshold is greater than the second preset threshold;

[0070] It should be noted that the performance indicator refers to the performance data generated by the container instance during operation, such as CPU usage, memory occupancy, etc. The first preset threshold and the second preset threshold together form an interval range, which is a series of interval ranges preset for monitoring and managing system performance. The first preset threshold is the maximum value of this interval range, and the second preset threshold is the minimum value of this interval range. When the performance indicator does not belong to this interval range, it may indicate that the system needs to be adjusted or optimized.

[0071] When a data synchronization task is running, in order to monitor and ensure efficient execution of the task, the system will obtain the performance indicators of the container instance running the task in real time or periodically. These performance indicators may include but are not limited to CPU usage, memory usage, network bandwidth utilization, etc., which reflect the resource consumption and efficiency of the container instance when processing data synchronization tasks. After obtaining these performance indicators, the system will compare these indicators with two preset thresholds: the first preset threshold and the second preset threshold. If the performance indicator is between the second preset threshold and the first preset threshold, this usually means that the performance of the container instance is within an acceptable range and the data synchronization task can proceed normally, but the system will also remain vigilant and continuously monitor changes in performance indicators.

[0072] Step S50: If the performance indicator is greater than a first preset threshold, the container instance is expanded;

[0073] It should be noted that capacity expansion processing means that when the performance indicator of a container instance exceeds the first preset threshold, the system responds to the resource shortage by increasing the number of container instances or increasing the resource quota of a single instance (such as CPU, memory) to ensure that the task can be executed smoothly.

[0074] If the performance index of the container instance when executing the data synchronization task is monitored to be greater than the first preset threshold, it is determined that capacity expansion is required. The capacity expansion process may include increasing the number of container instances, increasing the resource requests and limits of the container instances, etc., so as to cope with higher loads, improve task processing efficiency, and prevent task failures.

[0075] Step S60: If the performance indicator is less than the second preset threshold, the container instance is scaled down.

[0076] It should be noted that when the performance index of a container instance is lower than the second preset threshold, the system reclaims excess resources by reducing the number of container instances or lowering the resource quota of a single instance to improve overall resource utilization and reduce costs.

[0077] If the performance index of the container instance when executing the data synchronization task is monitored to be less than the second preset threshold, it is determined that the capacity needs to be reduced. The capacity reduction process may include reducing the number of container instances, reducing the resource requests and restrictions of the container instances, etc., to release redundant resources and prevent resource waste.

[0078] In this embodiment, the containerized data synchronization system integrates the container platform and the container orchestration platform cluster, wherein each container orchestration platform in the container orchestration platform cluster serves as a core component for dynamically managing resources and optimizing application deployment. The container platform packages the preset data synchronization tool into an image, which not only integrates the data synchronization tool itself, but also includes its complete and independent operating environment, forming a standardized software package. This greatly simplifies the deployment process of the data synchronization task, not only improves the deployment efficiency, but also ensures the consistency of each deployment, and effectively avoids compatibility issues caused by environmental differences. In the container orchestration platform cluster, the image is converted into a container instance. As the most basic and highly deployable computing unit in the system, the container instance can flexibly dynamically allocate resources according to actual needs, realizing efficient use of resources. When the system receives the actual business needs input from the outside, it generates a corresponding description file, and stores the description information of the description file in the mapping file of the container orchestration platform to form a target mapping file, and then generates a configuration file based on the target mapping file, and reads the configuration file, and runs the data synchronization task in the configuration file in the container instance. This process further improves the matching degree between data synchronization tasks and business needs through refined configuration management, ensuring the accuracy and timeliness of data flow. More importantly, during the execution of data synchronization tasks, the system monitors the performance indicators of container instances in real time and intelligently compares them with the preset first and second thresholds. When the performance indicators exceed the first preset threshold, the system will automatically trigger the expansion process, disperse the load pressure by increasing the number of container instances, and ensure the smooth execution and efficient completion of data synchronization tasks. On the contrary, when the performance indicators are lower than the second preset threshold, indicating that there is an excess of resources, the system will automatically perform a reduction operation to reduce unnecessary resource occupation and achieve optimal resource configuration. This intelligent automatic expansion and reduction strategy not only improves the response speed and stability of the system, but also significantly reduces operating costs, providing users with a more flexible and efficient data synchronization solution and improving resource utilization during task runtime.

[0079] In a feasible implementation manner, after the step of obtaining the performance indicator of the container instance in step S40, step R10 is further included:

[0080] Step R10, converting the performance indicator into a visualization view and displaying the visualization view.

[0081] It should be noted that the visual view refers to the display of the above performance indicators in the form of charts, graphs or other easy-to-understand forms, so that operation and maintenance personnel can intuitively understand the running status of the container instance. The visual performance indicators can be presented to users through dashboards, monitoring interfaces, etc.

[0082] The collected performance indicator data is sorted, filtered, calculated, and appropriate chart types (such as line charts, bar charts, pie charts, etc.) are selected to display the data. After the conversion is completed, the visual view is displayed through a user interface (such as a web page, dashboard, or software interface), allowing users to understand the trends, changes, and possible problems of performance indicators at a glance.

[0083] For example, if you want to display trend graphs of CPU usage and memory usage, you can set different colors to represent different performance levels, such as green for usage within a normal range, yellow for usage close to a warning threshold, and red for usage exceeding a warning threshold.

[0084] In this embodiment, by obtaining the running status of the container instance, a unified visual view is formed, which facilitates timely discovery and processing of resource bottlenecks based on the running status information of the data synchronization task, thereby ensuring the stability and reliability of data processing.

[0085] In a feasible implementation manner, after the step of expanding the capacity of the container instance in step S50, step T10 is further included:

[0086] Step T10: If the data synchronization task has been completed, the container instance after the expansion is deleted;

[0087] After the step of reducing the capacity of the container instance in step S60, step T20 is further included:

[0088] Step T20: If the data synchronization task has been completed, the container instance after the shrinking process is deleted.

[0089] It should be noted that the data synchronization task has been completed, which means that the data synchronization task has been executed according to the predetermined rules and processes and achieved the expected results. This usually means that all data has been successfully synchronized from the source system to the target system without errors or abnormalities.

[0090] If the data synchronization task is completed, the deletion operation is performed through the API or command line tool of the container orchestration platform to delete the container instance associated with the data synchronization task, including the container instance after the expansion process and the container instance after the reduction process, terminate all containers in the container instance, and release the computing resources occupied by it. However, since there is an anti-accidental deletion mechanism in the container orchestration platform such as Kubernetes, if the container instance is managed by controllers such as Deployment (the most commonly used resource object in Kubernetes, which provides a declarative definition method for the creation of ReplicaSet and container instances) and ReplicaSet (used to manage the number and health status of container instances), these controllers will notice that the container instance has been deleted and can recreate the container instance according to its policy. Therefore, after deleting the container instance, the controller related to the container instance must also be deleted.

[0091] Furthermore, when the task is completed, the container instance can notify the container orchestration platform that the data synchronization task has been completed. In this way, the time for querying the execution status of the data synchronization task container instance can be saved, thereby improving efficiency.

[0092] By monitoring the execution status of the data synchronization task in real time, this embodiment can accurately determine whether the task is completed. Once the task is confirmed to be completed, the container instance and its associated controller that are no longer needed are automatically deleted. This mechanism effectively avoids idleness and waste of resources and ensures the maximum utilization of resources. At the same time, deleting the controller related to the container instance ensures the complete deletion of the container instance.

[0093] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction, and will not be repeated later. On this basis, step S10, the containerized data synchronization method also includes steps A10~A30:

[0094] Step A10, obtaining the image configuration file of the data synchronization tool through the container platform;

[0095] It should be noted that the image configuration file is a text file that contains a series of commands and parameters for building an image. It defines how to start from a base image, gradually install and configure the application and its dependencies, and finally generate a new image.

[0096] For example, in this embodiment, DataX is used as a data synchronization tool, Docker is used as a container platform, and Kubernetes is used as a container orchestration platform. Correspondingly, the image configuration file is Dockerfile. Figure 3 , Figure 3This is a diagram of the data synchronization method based on the container orchestration platform to run the data synchronization tool. To deploy the DataX (data synchronization tool) framework in Kubernetes (container orchestration platform), you first need to create a new Dockerfile in the environment, specify how to start from the base image, add DataX binary files, configuration files, etc., and set the necessary environment variables and startup commands. Then Docker builds the Docker image according to the Dockerfile.

[0097] Step A20, building an image based on the image configuration file, and pushing the image to the image warehouse;

[0098] It should be noted that an image repository is a place for storing and managing container images. It allows users to easily upload, download and share images, and is usually used in software development and deployment. Common image repositories include Docker Hub (Docker repository) and private repositories.

[0099] For example, use a command to build an image, such as docker build (build image), and push the built image to an image repository, such as Docker Hub or a private image repository, so that Kubernetes can pull it.

[0100] Step A30: Determine the deployment file containing the address of the image repository through the container orchestration platform, and create a container instance according to the deployment file.

[0101] It should be noted that the deployment file specifies which image to use to create the container instance, as well as other configuration information of the container instance (such as the number of replicas, resource limits, etc.).

[0102] For example, a user can write a Kubernetes deployment file (usually a YAML file) that describes how to deploy your DataX service. This file can specify the name and version of the deployment, the source of the container image (that is, the DataX image you pushed to the image repository before), the number of replicas to be created (such as 3 replicas to ensure high availability and load balancing), and the configuration of the container runtime (such as CPU, memory, and port mapping, etc.). When the deployment file is ready, you can use the kubectl command-line tool to apply it to Kubernetes. This command tells Kubernetes to create and manage container instances of the DataX service according to the deployment file. In this embodiment, the container instance refers to the Pod, which is the smallest control unit in Kubernetes. There must be at least one container in the Pod. Subsequently, according to business needs, configure the DataX (data synchronization tool) task and generate a description file describing the DataX task. This file contains all the key information required to perform data integration tasks, including but not limited to: source and target information of data integration, such as the URL, username, password of the source database, the URL of the target storage, access keys, etc.; related resource configuration parameters for DataX task execution, such as the number of concurrent threads, memory limit, CPU request, etc., to ensure that the task can be executed efficiently in a resource-constrained environment. In the Kubernetes environment, ConfigMap is a resource object for storing configuration data, which allows the configuration information to be separated from the application code, so as to manage the configuration more flexibly. In this embodiment, the mapping file refers to ConfigMap. By calling the Kubernetes interface (or the Kubernetes command line tool), the previously generated DataX task description file (or the key configuration information therein) is converted into a ConfigMap resource and stored in the ConfigMap. Then, the JSON configuration file of the DataX task can be dynamically generated through the business system or by writing a program, including steps such as reading the configuration information in the ConfigMap and generating the task configuration. Then call the Kubernetes API to run the DataX task on the previously created Pod. When the DataX task is executed, the platform will monitor the running status of the DataX task to facilitate the unified operation and maintenance and monitoring management of the DataX task. After the DataX task is executed, you can delete the Pod by writing a program or using the Kubectl command to call the Kubernetes API.

[0103] In this embodiment, by receiving the image configuration file of the data synchronization tool, the automation and customization of the image construction are realized. The image built based on the configuration file not only includes a complete data synchronization tool and its operating environment, but also ensures the consistency and reusability of the image. The image is pushed to the image warehouse for easy version management and distribution deployment. Subsequently, by writing and executing the deployment file, a container instance is quickly created based on the image warehouse address. This process simplifies the deployment process and improves deployment efficiency. In general, this application provides users with a flexible and efficient data synchronization solution through automated construction, push and deployment, reduces operation and maintenance costs, and improves the response speed and reliability of data processing.

[0104] Based on the first or second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first or second embodiment can be referred to the above description, and will not be repeated hereafter. The step of expanding the capacity of the container instance in step S50 also includes steps B10 to B40:

[0105] Step B10, calculating the number of first container instances required to execute the data synchronization task according to the performance indicator, the first preset threshold and the number of running container instances of the container instance currently running;

[0106] For example, assuming that the calculation formula for the number of first container instances required to perform the data synchronization task is Number of running container instances* (performance index / expected performance index) ( Indicates rounding up), the meaning of the above formula is to calculate how many container instances should be running to achieve optimal resource utilization and availability by quantifying the gap between the performance index of the current container instance and the expected performance index value (that is, the first preset threshold or the second preset threshold). If the current container instance is 10, the performance index of CPU utilization is 95%, and the first preset threshold of CPU utilization is 80%, then according to the above formula, there should be 10 * (0.95 / 0.8) = 11.875 = 12 container instances are running, so the container orchestration platform automatically increases the number of container instances to 12 to achieve optimal resource utilization and availability.

[0107] It should be noted that this embodiment can automatically adjust according to multiple indicators, such as CPU utilization, memory utilization, network throughput, etc., to ensure that the resource utilization and availability of the container instance are in the optimal state. At the same time, the number of running container instances can also be adjusted according to the scaling ratio limit and the maximum number of container instances, the minimum number of container instances and other rules defined in the container orchestration platform to ensure the stability and reliability of the platform and task execution.

[0108] Step B20, determining whether the difference between the number of first container instances and the number of running container instances is greater than a preset expansion adjustment value;

[0109] It should be noted that sometimes the difference between the number of first container instances and the number of running container instances is too large. Directly adjusting the number of running container instances to be consistent with the number of first container instances will cause resources to change too quickly, affecting the stability of task execution. Therefore, a preset expansion adjustment value can be introduced. Only the number of container instances with the preset expansion adjustment value can be changed each time, thereby avoiding overly drastic expansion operations and increasing the stability of the system.

[0110] Furthermore, a cooling and delay mechanism can be introduced. Specifically, a cooling time can be set for the expansion operation. During the cooling time, even if the indicator exceeds the threshold again, a new expansion operation will not be triggered immediately. This can prevent frequent expansion due to short-term fluctuations in indicators. Similarly, a shrinking delay time can be set for the shrinking operation to ensure that the system has stabilized in a low-load state before shrinking. The difference is that setting the shrinking delay time should be more cautious because shrinking will directly affect the availability of the service.

[0111] Step B30: if the difference between the number of first container instances and the number of running container instances is greater than the preset expansion adjustment value, the number of running container instances is increased by the number of container instances equal to the preset expansion adjustment value, and the step of determining whether the difference between the number of first container instances and the increased number of running container instances is greater than the preset expansion adjustment value is continued;

[0112] For example, assume that the current performance indicator of a container instance shows that in order to maintain optimal performance, the required number of container instances is 10 container instances. The current number of running container instances is 7, and the preset adjustment value is 2. The difference between the required number of container instances (10) and the number of running container instances (7) is 3, which is greater than the preset adjustment value (2). Because the difference is greater than the preset adjustment value, 2 container instances are added. At this time, the number of running container instances becomes 9. Then, it is re-determined whether the difference between the required number of container instances and the number of running container instances is greater than the preset adjustment value, and the difference is calculated again. Now the difference between the required number of container instances (10) and the number of running container instances (9) is 1, which is not greater than the preset adjustment value (2). Because the difference is not greater than the preset adjustment value, the number of running container instances is directly adjusted to be consistent with the required number of container instances, that is, increased to 10.

[0113] Step B40: If the difference between the number of first container instances and the number of running container instances is less than or equal to the preset expansion adjustment value, the number of running container instances is increased to be consistent with the number of first container instances.

[0114] In this embodiment, the required number of container instances is accurately calculated for accurate capacity expansion, and this mechanism ensures balanced load distribution. By increasing the number of running container instances in real time to accurately match the required number, performance bottlenecks caused by insufficient resources are effectively prevented. By carefully judging the difference between the required number of container instances and the number of running container instances, and introducing a preset capacity expansion adjustment value as a basis for decision-making, intelligent capacity expansion of the number of container instances is achieved. When the difference exceeds the preset capacity expansion adjustment value, the number of running instances is gradually increased to ensure a smooth and orderly adjustment process and avoid system shocks that may be caused by one-time large-scale adjustments. When the difference is reduced to within the preset range, it is accurately adjusted to the required number of instances, ensuring the accuracy and efficiency of resource allocation.

[0115] In a feasible implementation manner, the step of scaling down the container instance in step S60 further includes steps C10 to C40:

[0116] Step C10, calculating the number of second container instances required to execute the data synchronization task according to the performance indicator, the second preset threshold and the actual number of container instances currently running;

[0117] It should be noted that this step is one of the core of the scaling-in strategy, which relies on accurate monitoring and analysis of current performance indicators (such as CPU usage, memory usage, network bandwidth, etc.). Performance indicators reflect the load of the container instance when performing data synchronization tasks. By comparing these performance indicators with the second preset threshold, and combining with prediction algorithms (such as time series analysis, machine learning models, etc.), the optimal or appropriate number of container instances required to perform the data synchronization task in theory, that is, the second number of container instances, can be calculated.

[0118] Furthermore, a more accurate prediction algorithm, such as a load prediction model based on machine learning, can be used to improve the accuracy of the calculation of the number of second container instances, and the prediction model can be trained and verified regularly to ensure that it adapts to changes in the system load.

[0119] Step C20, determining whether the difference between the actual number of container instances and the second number of container instances is greater than a preset shrinkage adjustment value;

[0120] It should be noted that a preset shrinking adjustment value is introduced in this embodiment. The reason is the same as that in the third embodiment, which will not be repeated here. By introducing the preset shrinking adjustment value, frequent expansion operations are avoided, thereby increasing the stability of the system.

[0121] After calculating the number of second container instances, the system needs to determine the difference between the number of actual container instances currently running and the number of second container instances. If the difference is greater than the preset shrink adjustment value, it means that there are too many container instances and a shrink operation is required to reclaim resources. The shrink operation will gradually reduce the number of actual container instances according to the step size of the preset shrink adjustment value until the difference is no greater than the preset shrink adjustment value.

[0122] Similarly, a cooling and delay mechanism can be introduced to increase system stability. Specifically, a scaling delay time can be set for scaling operations to ensure that the system is stable at a low load before scaling. The difference is that the scaling delay time should be set more cautiously because scaling directly affects service availability.

[0123] Step C30: if the difference between the actual number of container instances and the second number of container instances is greater than the preset shrinkage adjustment value, the actual number of container instances is reduced by the number of container instances equal to the preset shrinkage adjustment value, and the step of determining whether the difference between the actual number of container instances and the second number of container instances is greater than the preset shrinkage adjustment value is continued;

[0124] When it is determined that a reduction operation is required, the system will gradually reduce the number of container instances according to the preset reduction adjustment value. After each reduction in the number of container instances, the system will recalculate the difference and determine whether to continue reducing the capacity. If the difference is not greater than the preset reduction adjustment value, the actual number of container instances will be directly adjusted to be consistent with the number of second container instances.

[0125] Step C40: if the difference between the actual number of container instances and the second number of container instances is less than or equal to the preset shrinkage adjustment value, the actual number of container instances is reduced to be consistent with the second number of container instances.

[0126] Furthermore, detailed logs and performance indicator data can be recorded during the scaling process for subsequent analysis and optimization; monitoring and alarm mechanisms can be introduced to respond and handle abnormal situations in a timely manner during the scaling process; and scaling strategies can be evaluated and adjusted regularly to adapt to changes in system load and business needs. For example, parameters such as the preset scaling adjustment value and the second preset threshold can be adjusted based on historical data and business trends.

[0127] In this embodiment, the required number of container instances is accurately calculated so as to accurately scale down. This mechanism ensures efficient use of resources and effectively avoids waste caused by excess resources. By carefully judging the difference between the required number of container instances and the actual number of container instances, and introducing a preset scaling adjustment value as a basis for decision-making, intelligent scaling down of the number of container instances is achieved. When the difference exceeds the preset scaling adjustment value, the number of running instances is gradually reduced to ensure a smooth and orderly adjustment process and avoid the system impact that may be caused by a one-time large-scale adjustment. When the difference is reduced to within the preset range, it is accurately adjusted to the required number of instances, ensuring the accuracy and efficiency of resource allocation.

[0128] It should be noted that, under the condition that the technology is feasible and the logic is clear, the above embodiments can be combined in pairs or in multiple combinations.

[0129] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the containerized data synchronization method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0130] This application also provides a containerized data synchronization device, please refer to Figure 4 , applied to a containerized data synchronization system, the containerized data synchronization system includes a container platform and a container orchestration platform cluster, the container orchestration platform cluster includes at least one container orchestration platform, and the containerized data synchronization device includes:

[0131] A creation module 10 is used to package the preset data synchronization tool into an image on the container platform, and create a container instance corresponding to the image in the container orchestration platform cluster, wherein the container instance is the smallest deployment computing unit in the container orchestration platform;

[0132] The file module 20 is used to generate a description file of the data synchronization task corresponding to the actual business demand if the actual business demand input from the outside is obtained, and store the description information in the description file in the mapping file of the container orchestration platform to obtain a target mapping file;

[0133] An operating module 30 is used to generate a configuration file of a data synchronization task based on the target mapping file, and execute the configuration file to run the data synchronization task in the container instance;

[0134] A comparison module 40 is used to obtain a performance indicator of the container instance when the data synchronization task is executed, and compare the performance indicator with a first preset threshold and a second preset threshold respectively, wherein the first preset threshold is greater than the second preset threshold;

[0135] An expansion module 50, configured to expand the capacity of the container instance if the performance indicator is greater than a first preset threshold;

[0136] The capacity reduction module 60 is configured to reduce the capacity of the container instance if the performance indicator is less than a second preset threshold.

[0137] The containerized data synchronization device provided by the present application adopts the containerized data synchronization method in the above embodiment, which can solve the technical problem of low resource utilization when the task is running. Compared with the prior art, the beneficial effects of the containerized data synchronization device provided by the present application are the same as the beneficial effects of the containerized data synchronization method provided by the above embodiment, and the other technical features in the containerized data synchronization device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0138] The present application provides a containerized data synchronization device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the containerized data synchronization method in the above-mentioned embodiment one.

[0139] Reference below Figure 5, which shows a schematic diagram of the structure of a containerized data synchronization device suitable for implementing the embodiment of the present application. The containerized data synchronization device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The containerized data synchronization device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0140] like Figure 5 As shown, the containerized data synchronization device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the containerized data synchronization device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the containerized data synchronization device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a containerized data synchronization device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.

[0141] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0142] The containerized data synchronization device provided by the present application adopts the containerized data synchronization method in the above embodiment, which can solve the technical problem of low resource utilization when the task is running. Compared with the prior art, the beneficial effects of the containerized data synchronization device provided by the present application are the same as the beneficial effects of the containerized data synchronization method provided by the above embodiment, and the other technical features in the containerized data synchronization device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0143] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0144] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0145] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, the computer-readable program instructions being used to execute the containerized data synchronization method in the above-mentioned embodiment.

[0146] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0147] The computer-readable storage medium may be included in the containerized data synchronization device; or may exist independently without being assembled into the containerized data synchronization device.

[0148] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the containerized data synchronization device, the containerized data synchronization device:

[0149] The preset data synchronization tool is packaged into an image through the container platform, and the container instance corresponding to the image is created through the container orchestration platform cluster. The container instance is the smallest deployment computing unit in the container orchestration platform.

[0150] If the actual business requirements input from the outside are obtained, a description file corresponding to the actual business requirements is generated, and the description information in the description file is stored in the mapping file of the container orchestration platform to obtain a target mapping file;

[0151] Generate a configuration file based on the target mapping file, and run the data synchronization task corresponding to the configuration file in the container instance;

[0152] When the data synchronization task is running, obtaining a performance indicator of the container instance, and comparing the performance indicator with a first preset threshold and a second preset threshold respectively, wherein the first preset threshold is greater than the second preset threshold;

[0153] If the performance indicator is greater than the first preset threshold, the container instance is expanded;

[0154] If the performance indicator is less than the second preset threshold, the container instance is scaled down.

[0155] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0156] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0157] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0158] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned containerized data synchronization method, and can solve the technical problem of low resource utilization when tasks are running. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the containerized data synchronization method provided in the above-mentioned embodiment, and will not be elaborated here.

[0159] The present application also provides a computer program product, including a computer program, which implements the steps of the containerized data synchronization method as described above when the computer program is executed by a processor.

[0160] The computer program product provided by this application can solve the technical problem of low resource utilization when tasks are running. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the containerized data synchronization method provided by the above embodiment, which will not be repeated here.

[0161] The above are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A containerized data synchronization method, characterized in that: Applied to a containerized data synchronization system, the containerized data synchronization system includes a container platform and a container orchestration platform cluster, the container orchestration platform cluster includes at least one container orchestration platform, and the containerized data synchronization method includes: Obtaining a preset image configuration file of a data synchronization tool through the container platform, building an image based on the image configuration file, and pushing the image to an image repository, determining a deployment file containing the address of the image repository through the container orchestration platform, and creating a container instance according to the deployment file, wherein the container instance is the smallest deployment computing unit in the container orchestration platform; If an actual business requirement input from the outside is obtained, a description file corresponding to the actual business requirement is generated, and the description information in the description file is stored in a mapping file of the container orchestration platform to obtain a target mapping file; Generate a configuration file based on the target mapping file, and run a data synchronization task corresponding to the configuration file in the container instance; When the data synchronization task is running, obtaining a performance indicator of the container instance, and comparing the performance indicator with a first preset threshold and a second preset threshold respectively, wherein the first preset threshold is greater than the second preset threshold; If the performance indicator is greater than a first preset threshold, the container instance is expanded, wherein the step of expanding the container instance includes: calculating the number of first container instances required to execute the data synchronization task according to the performance indicator, the first preset threshold and the number of running container instances of the container instance currently running; judging whether the difference between the first number of container instances and the number of running container instances is greater than a preset expansion adjustment value; if the difference between the first number of container instances and the number of running container instances is greater than the preset expansion adjustment value, increasing the number of running container instances by the number of container instances equal to the preset expansion adjustment value, and continuing to perform the step of judging whether the difference between the first number of container instances and the increased number of running container instances is greater than the preset expansion adjustment value; if the difference between the first number of container instances and the number of running container instances is less than or equal to the preset expansion adjustment value, increasing the number of running container instances to be consistent with the first number of container instances; If the performance indicator is less than a second preset threshold, the container instance is scaled down, wherein the step of scaling down the container instance includes: calculating the number of second container instances required to execute the data synchronization task according to the performance indicator, the second preset threshold, and the actual number of container instances of the container instance currently running, and determining whether a difference between the actual number of container instances and the second number of container instances is greater than a preset shrinkage adjustment value; if the difference between the actual number of container instances and the second number of container instances is greater than the preset shrinkage adjustment value, reducing the actual number of container instances by the number of container instances equal to the preset shrinkage adjustment value, and continuing to execute the step of determining whether the difference between the actual number of container instances and the second number of container instances is greater than the preset shrinkage adjustment value; if the difference between the actual number of container instances and the second number of container instances is less than or equal to the preset shrinkage adjustment value, reducing the actual number of container instances to be consistent with the second number of container instances.

2. The containerized data synchronization method according to claim 1, characterized in that: The step of obtaining the performance indicator of the container instance includes: The performance indicator is converted into a visual view, and the visual view is displayed.

3. The containerized data synchronization method according to claim 1, characterized in that: After the step of expanding the capacity of the container instance, the method further includes: If the data synchronization task has been completed, deleting the container instance after the expansion process; After the step of reducing the capacity of the container instance, the method further includes: If the data synchronization task has been completed, the container instance after the shrinking process is deleted.

4. A containerized data synchronization device, characterized in that: Set in a containerized data synchronization system, the containerized data synchronization system includes a container platform and a container orchestration platform cluster, the container orchestration platform cluster includes at least one container orchestration platform, and the containerized data synchronization device includes: A creation module, which obtains an image configuration file of a preset data synchronization tool through the container platform, builds an image based on the image configuration file, pushes the image to an image repository, determines a deployment file containing the address of the image repository through the container orchestration platform, and creates a container instance according to the deployment file, wherein the container instance is the smallest deployment computing unit in the container orchestration platform; The file module generates a description file corresponding to the actual business demand if the actual business demand input from the outside is obtained, and stores the description information in the description file in the mapping file of the container orchestration platform to obtain a target mapping file; An operation module generates a configuration file based on the target mapping file, and runs a data synchronization task corresponding to the configuration file in the container instance; A comparison module, when the data synchronization task is running, obtains the performance indicator of the container instance, and compares the performance indicator with a first preset threshold and a second preset threshold respectively, wherein the first preset threshold is greater than the second preset threshold; The capacity expansion module performs capacity expansion processing on the container instance if the performance indicator is greater than a first preset threshold, wherein the capacity expansion processing on the container instance includes: calculating the first container instance number required to execute the data synchronization task according to the performance indicator, the first preset threshold and the number of running container instances of the container instance currently running; judging whether the difference between the first container instance number and the number of running container instances is greater than a preset capacity expansion adjustment value; if the difference between the first container instance number and the number of running container instances is greater than the preset capacity expansion adjustment value, increasing the number of running container instances by the number of container instances equal to the preset capacity expansion adjustment value, and continuing to perform the step of judging whether the difference between the first container instance number and the increased number of running container instances is greater than the preset capacity expansion adjustment value; if the difference between the first container instance number and the number of running container instances is less than or equal to the preset capacity expansion adjustment value, increasing the number of running container instances to be consistent with the first container instance number; A shrinking module, if the performance indicator is less than a second preset threshold, shrinking the container instance, wherein shrinking the container instance includes: calculating the number of second container instances required to execute the data synchronization task according to the performance indicator, the second preset threshold and the actual number of container instances of the container instance currently running, judging whether the difference between the actual number of container instances and the second number of container instances is greater than a preset shrinking adjustment value, if the difference between the actual number of container instances and the second number of container instances is greater than the preset shrinking adjustment value, reducing the actual number of container instances by the number of container instances equal to the preset shrinking adjustment value, and continuing to perform the step of judging whether the difference between the actual number of container instances and the second number of container instances is greater than the preset shrinking adjustment value, if the difference between the actual number of container instances and the second number of container instances is less than or equal to the preset shrinking adjustment value, reducing the actual number of container instances to be consistent with the second number of container instances.

5. A containerized data synchronization device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the containerized data synchronization method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the containerized data synchronization method according to any one of claims 1 to 3 are implemented.

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

Citation Information

Patent Citations

  • System capacity expansion method and equipment of cluster and medium

    CN113064696A

  • Server capacity expansion and contraction method and device, equipment and storage medium

    CN115292048A

  • Automatic operation and maintenance method based on container and big data

    CN117971384A