Seamless configuration migration method and device, equipment and medium
Through the steps of configuration collection, mapping, policy formulation and migration, and using technical means such as data structure flattening, migration mark bits and callback functions, seamless configuration migration is achieved, solving the problem of low degree of configuration migration automation in the existing technology, and achieving smooth switching and configuration monitoring of system iteration, ensuring the efficiency and reliability of the migration process.
Patent Information
- Application Number
- CN202411858516.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-05-09
AI Technical Summary
In the existing technology, the degree of automation of configuration migration is low, and it is impossible to effectively respond to configuration changes and migration needs in complex environments, which affects the normal operation of the system, and it is difficult to monitor the differences in new and old configurations during the migration process, increasing the risk of system errors.
Through configuration collection, configuration mapping, migration strategy formulation and configuration migration, seamless configuration migration, and other steps, the configuration and migration can be achieved. Technical means such as data structure flattening, migration mark bits and callback functions are used to ensure the reliability and flexibility of the migration process.
It realizes smooth switching of system iteration without additional system downtime and has no perception between users and third parties, ensuring the efficiency and reliability of configuration migration, and timely monitoring and alarming configuration differences, reducing the risk of system errors.
Smart Images

Figure CN119961243A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a configuration seamless migration method, device, equipment and medium. Background Art
[0002] In modern software systems, configuration management is the key to ensuring the normal operation of the system. Configurations are becoming more and more complex. Different configurations control different service processes, and the configurations of different services may also be interdependent. However, as the system is updated or migrated, configuration data needs to be seamlessly migrated from one environment to another. This migration process usually involves manual adjustments and a large amount of manual intervention, which can easily lead to configuration errors, thus affecting the normal operation of the system. In the prior art, the degree of automation of configuration migration is low, and it is impossible to effectively cope with configuration changes and migration requirements in complex environments. For the service dependencies provided to the downstream, once the data structure changes, it is very likely to affect the operation of downstream services. Existing migration methods include: 1. Manual migration: The administrator manually copies configuration files and settings and migrates them from the source system to the target system. 2. Scripted migration: Automated configuration migration by writing scripts, copying and adjusting the configuration files of the source system through scripts and applying them to the target system. 3. Migration based on configuration management tools: Use configuration management tools (such as Ansible, Puppet, Chef, etc.) to manage the migration of configuration files. These tools can automatically synchronize configurations between the source system and the target system. 4. Containerized migration: Use container technology (such as Docker) to package applications and configurations into a container, and then migrate the container to the new environment. There are many problems in the existing migration methods, including: 1. For manual migration, its operation is prone to errors, especially when facing complex configuration files, some configuration items may be missed; at the same time, the migration process requires a lot of manual operations, which is inefficient, especially in large systems; operations by different administrators may lead to inconsistent configurations, increasing the risk of system errors. 2. For scripted migration, scripts are usually written for specific environments, and require a lot of adjustments when migrating to different environments, which is not flexible; as the complexity of the system increases, scripts need to be frequently updated and maintained, which increases the difficulty of management; and when the script fails, it may take a long time to troubleshoot and fix the problem. 3. For migration based on configuration management tools, configuration management tools usually require special learning and training, and the initial setup and configuration may be complex. For small projects, introducing configuration management tools may add unnecessary complexity. These tools usually require specific environment configuration and dependencies, which may limit their use in certain environments. 4. For containerized migration, although containerization reduces environmental dependence, it still depends on the underlying container platform. If the platform differences are large, migration may encounter problems. For teams that are not familiar with container technology, setting up and managing containers may add additional complexity. In some cases, the performance overhead brought by containerization is also a problem.As far as current technology is concerned, in the process of configuration migration, not enough is done to reduce downtime and user-perceived interruptions. The downtime is often very long, and users cannot use the application due to migration downtime, which affects the user experience. In addition, various vulnerabilities may appear, causing the original functions to be unable to be used normally. In addition, there is no good monitoring between the new configuration after migration and the original old configuration. When there is a difference in configuration, there is no timely alarm. As a result, because the wrong configuration cannot be discovered in time, some errors in program operation will occur, causing some unpredictable losses.
[0003] To address the above problems, no effective solution has been proposed yet. Summary of the invention
[0004] Based on this, it is necessary to provide a configuration seamless migration method, device, equipment and medium for the above technical problems. The configuration seamless migration method of the present invention does not require additional system downtime, can achieve smooth switching of system iterations, and does not perceive users and third parties.
[0005] According to a first aspect of the present invention, there is provided a method for seamless configuration migration, comprising:
[0006] Configuration collection step: collect configuration data from the source system and the target system, convert the collected configuration data into the smallest granularity configuration data through data structure flattening, and generate a configuration list;
[0007] A configuration mapping step, comparing the configuration lists of the source system and the target system to identify configuration differences between the source system and the target system, and generating a difference report;
[0008] A migration strategy formulation step, determining the configuration mapping rules of the source system and the target system according to the difference report, and formulating a corresponding migration strategy;
[0009] The configuration migration step migrates the configuration of the source system to the target system according to the migration strategy.
[0010] In some embodiments, the method further includes a configuration synchronization step of synchronizing the configuration of the target system to the configuration of the source system according to the mapping rule, and performing dual writing of the configuration of the target system and the configuration of the source system.
[0011] In some embodiments, it also includes an anti-corrosion layer construction step, which prevents the architecture of the source system from affecting the architecture of the target system, and performs mapping compatibility to ensure that third-party application requests that call the source system application are not affected.
[0012] In some embodiments, it also includes a configuration monitoring step, which regularly monitors the configuration of the source system and the configuration of the target system, and notifies the relevant person in charge when differences are found.
[0013] In some embodiments, the step of migrating data in the database is also included.
[0014] In some embodiments, the steps of data migration include:
[0015] 1) Upgrading the first database and upgrading the node from the first version to the second version;
[0016] 2) After a node is upgraded to the second version, a second database is created; nodes in the first version read and write through the first database;
[0017] For the read request of the node in the second version, read from the first database and the second database at the same time, check whether the result from the second database contains the migration mark bit, if not, directly return the result of the second database; if yes, or the corresponding result cannot be read from the second database, then perform the following processing: perform data migration through the callback function to convert the data of the first database into the format of the second database and migrate it to the second database, and return the data in the second database to the read request;
[0018] For the write request of the node in the second version, the following processing is performed: the migration mark bit is set for the data in the second database, and if there is no migration mark bit, empty data with the migration mark bit is created; the data is written in the format of the first database in the first database; the data is read from the first database and converted into data in the data format of the second database by means of a callback function; the converted data is used to update the data in the second database, and the migration mark bit is cleared;
[0019] 3) After all nodes are upgraded to the second version, the nodes in the second version continue to perform read and write operations in the manner of step 2); data migration is performed through the callback function, and all data in the first database is converted into the format of the second database and migrated to the second database;
[0020] The data migration through the callback function includes: setting a migration mark in the second database, reading the data in the first database, converting it into data in the data format of the second database through the callback function, using the converted data to update the data in the second database, and clearing the migration mark.
[0021] According to a second aspect of the present invention, there is provided a configuration seamless migration device, comprising:
[0022] The configuration collection module is used to collect configuration data from the source system and the target system, convert the collected configuration data into the smallest granularity configuration data through data structure flattening, and generate a configuration list;
[0023] A configuration mapping module, used to compare the configuration lists of the source system and the target system to identify configuration differences between the source system and the target system, and generate a difference report;
[0024] A migration strategy formulation module, used to determine the configuration mapping rules of the source system and the target system according to the difference report, and formulate a corresponding migration strategy;
[0025] The configuration migration module is used to migrate the configuration of the source system to the target system according to the migration strategy.
[0026] According to a third aspect of the present invention, there is provided a computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-mentioned method embodiments when executing the computer program.
[0027] According to a fourth aspect of the present invention, there is provided 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 method of any of the above embodiments are implemented.
[0028] The beneficial effects achieved by the present invention are as follows:
[0029] 1. The configuration migration solution can be embedded and used with low learning cost. The whole process does not require additional system downtime, and normal iterative releases can be smoothly switched, so that users and third parties using it are not aware of it. For the migrated configuration, it can be run in grayscale, and the new and old configurations can be compared and monitored to inform the person in charge in time, and the specific configuration of the fault can be accurately located. The new and old configurations can be synchronized in both directions, and no additional rollback operation is required when problems occur.
[0030] 2. By setting migration markers and callback functions, ensure that data is gradually converted to the new format during the migration process to maintain the integrity and consistency of the target database. The combination of the double-write mechanism, callback functions, and markers ensures a smooth transition of the system while maximizing the reliability and flexibility of the data migration process. In a distributed environment, a data migration solution is provided that can provide external services while performing system upgrades. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 is a flow chart of some embodiments of the method for seamless configuration migration of the present invention;
[0032] Figure 2 It is a schematic diagram of the structure of some embodiments of the configuration seamless migration device of the present invention;
[0033] Figure 3 It is a diagram of the internal structure of a computer device used to implement some embodiments of the present invention. DETAILED DESCRIPTION
[0034] Embodiments of the present invention will be described more fully below with reference to the accompanying drawings, in which embodiments of the present invention are shown. However, the present invention can be embodied in many different forms and should not be construed as limited to the embodiments set forth herein.
[0035] The terms used herein are used only for the purpose of describing specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a", "an", "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that when used herein, the term "comprising" specifies the presence of the claimed features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof.
[0036] Unless otherwise defined, the terms (including technical and scientific terms) used herein have the same meanings as commonly understood by those of ordinary skill in the art to which the present disclosure belongs. The terms used herein should be interpreted as having the meanings consistent with their meanings in the context of this specification and in the relevant field, and should not be interpreted in an idealized or overly formal sense, unless specifically defined as such herein.
[0037] Migration mark: Set the migration mark to indicate whether the data has been migrated, thereby avoiding repeated data migration.
[0038] Callback function: A callback function is a function that is passed as a parameter. In C language, callback functions can only be implemented using function pointers. In more modern programming languages such as C++, Python, and ECMAScript, functors or anonymous functions can also be used. In the present invention, functions such as data format conversion, data migration, and clearing of migration flags can be implemented.
[0039] Figure 1 The flowcharts of some embodiments of the method for seamless configuration migration of the present invention are shown.
[0040] like Figure 1 As shown, the method includes:
[0041] Configuration collection step S102, collecting configuration data from the source system and the target system, converting the collected configuration data into configuration data of minimum granularity through data structure flattening, and generating a configuration list;
[0042] Configuration mapping step S104, comparing the configuration lists of the source system and the target system to identify configuration differences between the source system and the target system, and generating a difference report;
[0043] Migration strategy formulation step S106, determining the configuration mapping rules of the source system and the target system according to the difference report, and formulating a corresponding migration strategy;
[0044] Configuration migration step S108, migrating the configuration of the source system to the target system according to the migration strategy.
[0045] In some embodiments, it also includes a configuration synchronization step, synchronizing the configuration of the target system to the configuration of the source system according to the mapping rule, and the configuration of the target system is double-written with the configuration of the source system. An anti-corrosion layer construction step, constructing an anti-corrosion layer to prevent the architecture of the source system from affecting the architecture of the target system, and performing mapping compatibility to ensure that third-party application requests that call the source system application are not affected. A configuration monitoring step, regularly monitoring the configuration of the source system and the configuration of the target system, and notifying the relevant person in charge when differences are found.
[0046] Existing data is often implemented in a distributed storage manner. When providing services, these different machines are often scattered in different data centers. There are many problems in system upgrades and data migration. In particular, during the data migration process, since the system is still in service, there will be new write requirements, which are prone to conflicts and lead to partial data loss. Based on this situation, the present invention also proposes a data migration solution, the steps are as follows:
[0047] 1) Upgrading the first database and upgrading the node from the first version to the second version;
[0048] 2) After a node is upgraded to the second version, a second database is created; nodes in the first version read and write through the first database;
[0049] For the read request of the node in the second version, read from the first database and the second database at the same time, check whether the result from the second database contains the migration mark bit, if not, directly return the result of the second database; if yes, or the corresponding result cannot be read from the second database, then perform the following processing: perform data migration through the callback function to convert the data of the first database into the format of the second database and migrate it to the second database, and return the data in the second database to the read request;
[0050] For the write request of the node in the second version, the following processing is performed: the migration mark bit is set for the data in the second database, and if there is no migration mark bit, empty data with the migration mark bit is created; the data is written in the format of the first database in the first database; the data is read from the first database and converted into data in the data format of the second database by means of a callback function; the converted data is used to update the data in the second database, and the migration mark bit is cleared;
[0051] 3) After all nodes are upgraded to the second version, the nodes in the second version continue to perform read and write operations in the manner of step 2); data migration is performed through the callback function, and all data in the first database is converted into the format of the second database and migrated to the second database;
[0052] Among them, data migration is performed through a callback function, including: setting a migration mark in the second database, reading data in the first database, converting it into data in the data format of the second database through a callback function, using the converted data to update the data in the second database, and clearing the migration mark.
[0053] This solution ensures that data is gradually converted to a new format during the migration process by setting migration markers and callback functions, maintaining the integrity and consistency of the target database. The combination of the double-write mechanism, callback functions, and markers ensures a smooth transition of the system while maximizing the reliability and flexibility of the data migration process. In a distributed environment, a data migration solution is provided that can provide external services while performing system upgrades.
[0054] Figure 2 The schematic diagram shows the structure of some embodiments of the configuration seamless migration device of the present invention.
[0055] like Figure 2 As shown, the configuration seamless migration device in the embodiment includes:
[0056] The configuration collection module 100 is used to collect configuration data from the source system and the target system, convert the collected configuration data into the configuration data of the smallest granularity by flattening the data structure, and generate a configuration list;
[0057] The configuration mapping module 200 is used to compare the configuration lists of the source system and the target system to identify the configuration differences between the source system and the target system, and generate a difference report;
[0058] A migration strategy formulation module 300, for determining the configuration mapping rules of the source system and the target system according to the difference report, and formulating a corresponding migration strategy;
[0059] The configuration migration module 400 is used to migrate the configuration of the source system to the target system according to the migration strategy.
[0060] For the specific definition of a configuration seamless migration device, please refer to the definition of a configuration seamless migration method above, which will not be repeated here. Each module in the above-mentioned configuration seamless migration device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0061] The present invention also provides a computer device, which may be a terminal, and its internal structure diagram may be as shown in Figure 3 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the above-mentioned configuration seamless migration method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc. Those skilled in the art can understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0062] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned configuration seamless migration method is implemented.
[0063] Those of ordinary skill in the art can understand that all or part of the processes in the above method embodiments can be implemented by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RRAM) or external cache memory. By way of illustration and not limitation, RXM is available in a variety of forms, such as static RXM (SRXM), dynamic RXM (DRXM), synchronous DRXM (SDRXM), double data rate SDRXM (DDRSDRXM), enhanced SDRXM (ESDRXM), synchronous link (Synchlink) DRXM (SLDRXM), memory bus (RXmYus), direct RXM (RDRXM), direct memory bus dynamic RXM (DRDRXM), and memory bus dynamic RXM (RDRXM), etc.
[0064] So far, the embodiments of the present invention have been described in detail. In order to avoid obscuring the concept of the present invention, some details known in the art are not described. Based on the above description, those skilled in the art can fully understand how to implement the technical solutions disclosed herein.
[0065] Although some specific embodiments of the present invention have been described in detail by way of examples, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It should be understood by those skilled in the art that the above embodiments may be modified or some technical features may be replaced by equivalents without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.
Claims
1. A configuration seamless migration method, characterized in that: include: Configuration collection step: collect configuration data from the source system and the target system, convert the collected configuration data into the smallest granularity configuration data through data structure flattening, and generate a configuration list; A configuration mapping step, comparing the configuration lists of the source system and the target system to identify configuration differences between the source system and the target system, and generating a difference report; A migration strategy formulation step, determining the configuration mapping rules of the source system and the target system according to the difference report, and formulating a corresponding migration strategy; The configuration migration step migrates the configuration of the source system to the target system according to the migration strategy.
2. The method for seamless configuration migration according to claim 1, characterized in that: Also includes, The configuration synchronization step synchronizes the configuration of the target system with the configuration of the source system according to the mapping rule, and the configuration of the target system is synchronized with the configuration of the source system for dual writing.
3. The configuration seamless migration method according to claim 1, characterized in that: Also includes, The anti-corrosion layer construction step is to build an anti-corrosion layer to prevent the architecture of the source system from affecting the architecture of the target system, and to perform mapping compatibility to ensure that third-party application requests that call the source system application are not affected.
4. The method for seamless configuration migration according to claim 1, characterized in that: Also includes, Configure monitoring steps to regularly monitor the configuration of the source system and the target system, and notify the relevant person in charge when differences are found.
5. The method for seamless configuration migration according to claim 1, characterized in that: Also includes, Migration step: migrate the data in the database.
6. The method for seamless configuration migration according to claim 5, characterized in that: The steps of data migration include: 1) Upgrading the first database and upgrading the node from the first version to the second version; 2) After a node is upgraded to the second version, a second database is created; nodes in the first version read and write through the first database; For the read request of the node in the second version, read from the first database and the second database at the same time, check whether the result from the second database contains the migration mark bit, if not, directly return the result of the second database; if yes, or the corresponding result cannot be read from the second database, then perform the following processing: perform data migration through the callback function to convert the data of the first database into the format of the second database and migrate it to the second database, and return the data in the second database to the read request; For the write request of the node in the second version, the following processing is performed: the migration mark bit is set for the data in the second database, and if there is no migration mark bit, empty data with the migration mark bit is created; the data is written in the format of the first database in the first database; the data is read from the first database and converted into data in the data format of the second database by means of a callback function; the converted data is used to update the data in the second database, and the migration mark bit is cleared; 3) After all nodes are upgraded to the second version, the nodes in the second version continue to perform read and write operations in the manner of step 2); data migration is performed through the callback function, and all data in the first database is converted into the format of the second database and migrated to the second database; The data migration through the callback function includes: setting a migration mark in the second database, reading the data in the first database, converting it into data in the data format of the second database through the callback function, using the converted data to update the data in the second database, and clearing the migration mark.
7. A configuration seamless migration device, characterized in that: include: The configuration collection module is used to collect configuration data from the source system and the target system, convert the collected configuration data into the smallest granularity configuration data through data structure flattening, and generate a configuration list; A configuration mapping module, used to compare the configuration lists of the source system and the target system to identify configuration differences between the source system and the target system, and generate a difference report; A migration strategy formulation module, used to determine the configuration mapping rules of the source system and the target system according to the difference report, and formulate a corresponding migration strategy; The configuration migration module is used to migrate the configuration of the source system to the target system according to the migration strategy.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.