Configuration migration method and apparatus, computer device, and storage medium
Patent Information
- Application Number
- CN202311560879.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-22
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-11-22
Smart Images

Figure CN117459389B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a configuration migration method, apparatus, computer device, and storage medium. Background Technology
[0002] Currently, internet finance companies rely on decision engines for risk management, credit services, and other functions. When there is a need to replace the decision engine, the old decision engine already has a large number of decisions running and carries the company's core business. Most existing migration solutions for new and old systems involve dual write → comparison → gray-scale → verification → switching. However, random functions, date functions, and remote calls in the decision-making process can affect the results. Existing migration solutions for new and old systems only compare whether the data on both sides is consistent during the verification phase, which cannot meet the requirements for migrating the decision engine. Summary of the Invention
[0003] Based on this, in order to solve the above problems, the present invention proposes a configuration migration method, apparatus, computer equipment and storage medium, which takes into account the influence of random functions, dates, remote calls, floating-point numbers and other factors on migration comparison results to ensure the accuracy of migration.
[0004] According to a first aspect of the present invention, a configuration migration method is provided, comprising the following steps:
[0005] The message conversion process involves converting messages from the legacy decision-making system.
[0006] The migration step involves creating a new decision version of the decision system based on the content of the converted message.
[0007] The comparison step involves using the input of the old decision system as the input of the new decision system to obtain the execution result of the new decision system, and then comparing the execution result of the new decision system with the execution result of the old decision system.
[0008] The verification step involves conducting business-free testing and gray-scale verification on the new decision-making system that passed the comparison step, and then launching the new decision-making system that passed the business-free testing and gray-scale verification.
[0009] In some embodiments, when random numbers are involved in the comparison step, a shadow old decision system is established for the old decision system and a shadow new decision system is established for the new decision system. The random function calls in the shadow old decision system and the shadow new decision system are replaced with number retrieval to ensure that the random numbers obtained by the shadow old decision system and the shadow new decision system are consistent. The execution results of the shadow old decision system are compared with the execution results of the shadow new decision system. If the comparison is successful, it is determined that the comparison between the execution results of the new decision system and the execution results of the old decision system is successful.
[0010] In some embodiments, when time is involved in the comparison step, a mock function is added so that the comparison of the execution results of the new decision system and the old decision system is not affected by the execution time.
[0011] In some embodiments, the comparison step includes an added configuration item to compare the execution results of the new decision system with those of the old decision system within a set accuracy range.
[0012] In some embodiments, the business run-through and grayscale verification are implemented through a migration state machine, which breaks down the migration process into multiple stages and multiple processes.
[0013] In some embodiments, the verification step includes: starting a no-load run, verifying whether the no-load run is successful, if the no-load run is successful, proceeding to the no-load run comparison, if the no-load run fails, displaying "to be migrated";
[0014] After entering the empty run comparison, you can choose to end the empty run and take the old decision system offline, or enter the judgment of whether the empty run comparison passes by writing back the offline status.
[0015] If the empty run comparison passes, choose to end the empty run and take the old decision system offline, or enter the gray-scale verification; if the empty run comparison fails, choose to end the empty run and take the old decision system offline, or choose to force the empty run comparison to pass and enter the gray-scale verification.
[0016] If the grayscale verification passes, it indicates that the migration has been completed and the new decision-making system is now officially operational.
[0017] In some embodiments, a feedback step is also included, which provides feedback on the metrics during the configuration migration process and displays the metrics through a visualization panel; the metrics include: configuration migration success rate and new decision system runtime.
[0018] According to a second aspect of the present invention, a configuration migration device is provided, comprising:
[0019] The message conversion module is used to convert messages from legacy decision-making systems.
[0020] The migration module is used to create a new decision version of the decision system based on the content of the converted message.
[0021] The comparison module is used to obtain the execution result of the new decision system by using the input of the old decision system as the input of the new decision system, and compare the execution result of the new decision system with the execution result of the old decision system.
[0022] The verification module is used to perform business-free testing and gray-scale verification on the new decision-making system that has passed the comparison in the comparison module, and to launch the new decision-making system that has passed the business-free testing and gray-scale verification.
[0023] According to a third aspect of the present invention, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the steps of any of the methods described above.
[0024] According to a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the methods of any of the above embodiments.
[0025] By implementing the above-described solution of the present invention, the following beneficial effects can be obtained:
[0026] 1. Verify the correctness of the configuration by comparing the results of configuration conversion and execution decision replay. The process is divided into steps and phases for migration, and the migration state machine design ensures that no problems are missed in the production environment, resulting in high accuracy in configuration migration. The design of migration states and operations during the decision migration process avoids accidents caused by human error.
[0027] 2. The comparison process provides configuration interventions such as specified precision and field exclusion for comparison results, and the configuration migration is highly adaptable.
[0028] 3. Consider various factors that hinder configuration migration, such as random functions and dates, and provide corresponding solutions to transform uncertain results into deterministic and comparable results. This is achieved by using mock time and centering the values of random functions to eliminate the influence of uncertain process variables on the results.
[0029] 4. The migration process is visualized. The migration process is designed with multi-dimensional indicators and formed into a visual dashboard to display the migration progress and comparison results, ensuring the efficiency and security of configuration migration. Attached Figure Description
[0030] Figure 1 This is a flowchart of some embodiments of the configuration migration method of the present invention;
[0031] Figure 2 This is a schematic diagram of the random function processing method in the configuration migration method of the present invention;
[0032] Figure 3 These are schematic diagrams illustrating the structure of some other embodiments of the configuration migration method of the present invention;
[0033] Figure 4 is from Figure 4A and Figure 4B The flowcharts illustrate some other embodiments of the configuration migration method of the present invention;
[0034] Figure 5 This is a migration state diagram of the configuration migration method in some embodiments of the present invention;
[0035] Figure 6 These are schematic diagrams illustrating the structure of some embodiments of the configuration migration device of the present invention;
[0036] Figure 7 This is an internal structural diagram of a computer device used to implement some embodiments of the present invention. Detailed Implementation
[0037] Embodiments of the invention will now be described more fully with reference to the accompanying drawings, in which embodiments of the invention are illustrated. However, the invention may be practiced in many different forms, and should not be construed as limited to the embodiments set forth herein.
[0038] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. As used herein, the singular forms “a” and “this” 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 stated features, integrals, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof.
[0039] Unless otherwise defined, the terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains. Terms used herein shall be interpreted as having the same meaning as they have in the context of this specification and in the relevant field, and shall not be interpreted in an idealized or overly formal sense, unless specifically defined herein.
[0040] ADB: AnalyticDB, Alibaba Cloud's enterprise-grade cloud-native data warehouse;
[0041] Hengine: The name of the new decision-making system;
[0042] Kafka: A high-throughput distributed publish-subscribe messaging system;
[0043] mock: mock refers to creating an object to simulate a real object;
[0044] Topic: Every message published to the Kafka cluster has a category, which is called a Topic.
[0045] Figure 1 Flowcharts of some embodiments of the configuration migration method of the present invention are shown.
[0046] like Figure 1 As shown, the method includes:
[0047] Message conversion step S102: Perform message conversion for the old decision-making system;
[0048] Migration step S104: Create a new decision version of the decision system using the converted message;
[0049] In comparison step S106, the input of the old decision system is used as the input of the new decision system to obtain the execution result of the new decision system, and the execution result of the new decision system is compared with the execution result of the old decision system.
[0050] In verification step S108, the new decision-making system that passed the comparison in the comparison step is subjected to business idle run and gray-scale verification, and the new decision-making system that passes the business idle run and gray-scale verification is put online.
[0051] In some embodiments, when random numbers are involved in the comparison step, a shadow old decision system is created for the old decision system, and a shadow new decision system is created for the new decision system. Random function calls in both the shadow old and shadow new decision systems are replaced with number retrieval, ensuring that the random numbers obtained by the shadow old and shadow new decision systems are consistent. The execution results of the shadow old decision system are compared with the execution results of the shadow new decision system. If the comparison passes, the comparison between the execution results of the new and old decision systems is considered successful. Figure 2 As shown, the old decision version A is modified into a random function to obtain the old decision version A'. Based on A and A', the corresponding HEngine version a and HEngine version a' are obtained respectively. The comparison result of A' and a' is used as the comparison result of A and a.
[0052] In some embodiments, since the results of decision execution may differ depending on the execution time, there is a time difference when consuming the execution log of the old decision to execute the new decision. By adding a mock function (mocking the now() related functions to the execution time of the old decision), the difference in results caused by the time difference can be avoided.
[0053] In some embodiments, the comparison results may fail due to insignificant precision issues, such as inconsistencies in the 15th decimal place (these inconsistencies do not affect business operations). Therefore, a special configuration item is added during the comparison process to ensure that the comparison results are considered consistent when they are consistent at a specified precision.
[0054] In some embodiments, the business run-through and grayscale verification are implemented through a migration state machine, which breaks down the migration process into multiple stages and multiple processes.
[0055] In some embodiments, the verification step includes: starting a no-load run, verifying whether the no-load run is successful, if the no-load run is successful, proceeding to the no-load run comparison, if the no-load run fails, displaying "to be migrated";
[0056] After entering the dry-run comparison, whether to end the dry run and take the old decision system offline, or whether the dry-run comparison is passed is determined through offline status backhaul;
[0057] If the dry-run comparison is passed, end the dry run and take the old decision system offline, or enter grayscale verification; if the dry-run comparison fails, end the dry run and take the old decision system offline, or forcibly pass the dry-run comparison and enter grayscale verification;
[0058] If the grayscale verification is passed, it is displayed that the migration is completed and the new decision system is officially put into operation.
[0059] In some embodiments, a feedback step is further included, which feeds back indicators in the configuration migration process, and the indicators include: configuration migration success rate and running time of the new decision system.
[0060] Figure 3 It shows a flowchart of some other embodiments of the configuration migration method of the present invention.
[0061] As Figure 3 shown, the method includes:
[0062] Step 1: offline message conversion, converting messages of the old decision system;
[0063] Step 2: start migration, create a version of the new decision system based on the content after message conversion in step 1; and perform preparation operations for decision operation (e.g., management relationship between the old and new decision versions, data preparation required during the operation period)
[0064] Step 3: double reading comparison, consume the execution logs of the old decision system (including input, intermediate variables and output of the decision); use the input of the old decision system as the input of the new decision system to execute the decision; compare the execution result of the new decision system with that of the old decision system; store the execution results with differences in the comparison into the database.
[0065] Step 4: grayscale / official operation, perform service dry run and grayscale verification on the decision versions that have passed the comparison, and officially launch the new decision system version that has passed the verification.
[0066] In step 3, the execution result is in JSON format, and comparison is performed one by one after flattening the JSON.
[0067] For example: {
[0068] “user”:{“name”:”Xiao Ming”,“age”:12},
[0069] }
[0070] After flattening:
[0071] user.name=Xiao Ming
[0072] user.age = 12.
[0073] Figure 4 shows flowcharts of some other embodiments of the configuration migration method of the present invention.
[0074] As shown in Figure 4, HEngineService receives the execution logs (inputs, intermediate variables, and outputs) of the old decision engine. Based on the mapping between the old and new decision versions, it executes the corresponding HEngine decision version to obtain the execution results, comparing them with those of the old decision engine. The comparison result logs are then sent via Kafka. The log platform consumes these logs and records logs of failed comparisons. The recorded execution results are sent to ADB, where offline tasks calculate relevant metrics (including configuration migration success rate and new decision system runtime) based on the data. The migration status is then written back to the decision database. The calculated metrics are stored in ADB, and by querying these metrics in ADB, the migration metrics are displayed on a visual dashboard for easy monitoring and operation.
[0075] Figure 5 The diagram illustrates the migration state of the configuration migration method according to some embodiments of the present invention.
[0076] like Figure 5 As shown, in the migration state machine, all new decision versions go through several states from creation to official operation: Pending Migration, In-process Drilling Comparison, Drilling Comparison Passed, Drilling Comparison Failed, Drilling Comparison Forced Passed, In Grayscale, Migrated, and Operation Completed. These states control actions (e.g., only after passing the drilling comparison or forcibly passing can the next stage be entered). This ensures that no failures occur due to human error during the migration process. In the diagram, except for offline status write-back which represents offline actions, other actions such as starting drilling, starting grayscale, ending drilling, and going offline are all manual actions. The content within "<>" represents the current state.
[0077] Figure 6 A schematic diagram of the configuration migration device of the present invention is shown.
[0078] like Figure 6 As shown, the configuration migration device in this embodiment includes:
[0079] The message conversion module 100 is used to convert messages from the legacy decision-making system.
[0080] Migration module 200 is used to create a decision version of the new decision system based on the content after message conversion;
[0081] The comparison module 300 is used to obtain the execution result of the new decision system by using the input of the old decision system as the input of the new decision system, and compare the execution result of the new decision system with the execution result of the old decision system.
[0082] The verification module 400 is used to perform business-free testing and gray-scale verification on the new decision-making system that has passed the comparison in the comparison module, and to put the new decision-making system that has passed the business-free testing and gray-scale verification online.
[0083] For specific limitations regarding a configuration migration device, please refer to the limitations regarding a configuration migration method described above, which will not be repeated here. Each module in the aforementioned configuration migration device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0084] The present invention also provides a computer device, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements the configuration migration method described above. The display screen can be a liquid crystal display (LCD) or an electronic ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse. Those skilled in the art will understand that… Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the computer device to which the present invention is applied. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0085] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described configuration migration method.
[0086] Those skilled in the art will understand that implementing all or part of the processes in the above method embodiments can be accomplished by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), memory bus (RAMbus), direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0087] The embodiments of the present invention have now been described in detail. To avoid obscuring the concept of the invention, some details known in the art have not been described. Those skilled in the art will fully understand how to implement the technical solutions disclosed herein based on the above description.
[0088] While specific embodiments of the present invention have been described in detail by way of examples, those skilled in the art should understand that the above examples are for illustrative purposes only and are not intended to limit the scope of the invention. Those skilled in the art should understand that modifications can be made to the above embodiments or equivalent substitutions can be made to some technical features without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.
Claims
1. A configuration migration method, characterized in that, Includes the following steps: The message conversion process involves converting messages from the legacy decision-making system. The migration step involves creating a new decision version of the decision system based on the content of the converted message. The comparison step involves using the input of the old decision system as the input of the new decision system to obtain the execution result of the new decision system, and then comparing the execution result of the new decision system with the execution result of the old decision system. The verification step involves conducting business-wide testing and gray-scale verification on the new decision-making system that passed the comparison step, and then launching the new decision-making system that passes the business-wide testing and gray-scale verification. In the comparison step, when random numbers are involved, a shadow old decision system is created for the old decision system, and a shadow new decision system is created for the new decision system. The random function calls in both the shadow old and shadow new decision systems are replaced with number retrieval to ensure that the random numbers obtained by the shadow old and shadow new decision systems are consistent. The execution results of the shadow old decision system are compared with the execution results of the shadow new decision system. If the comparison passes, the comparison between the execution results of the new and old decision systems is considered successful. In the comparison step, when time is involved, a mock function is added to ensure that the comparison of the execution results of the new decision system and the old decision system is not affected by the execution time.
2. The configuration migration method according to claim 1, characterized in that, In the comparison step, a configuration option is added to compare the execution results of the new decision system and the old decision system within a set accuracy range.
3. The configuration migration method according to claim 1, characterized in that, The business process runs and gray-scale verification are implemented through a migration state machine, which breaks down the migration process into multiple stages and multiple processes.
4. The configuration migration method according to claim 1, characterized in that, The verification steps include: starting a no-load run, verifying whether the no-load run is successful, if the no-load run is successful, proceeding to the no-load run comparison, if the no-load run fails, displaying "to be migrated"; After entering the empty run comparison, you can choose to end the empty run and take the old decision system offline, or enter the judgment of whether the empty run comparison passes by writing back the offline status. If the empty run comparison passes, choose to end the empty run and take the old decision system offline, or enter the gray-scale verification; if the empty run comparison fails, choose to end the empty run and take the old decision system offline, or choose to force the empty run comparison to pass and enter the gray-scale verification. If the grayscale verification passes, it indicates that the migration has been completed and the new decision-making system is now officially operational.
5. The configuration migration method according to claim 1, characterized in that, It also includes a feedback step, which provides feedback on the metrics during the configuration migration process and displays the metrics through a visualization panel; The metrics include: configuration migration success rate and new decision system uptime.
6. A configuration migration device, characterized in that, include: The message conversion module is used to convert messages from legacy decision-making systems. The migration module is used to create a new decision version of the decision system based on the content of the converted message. The comparison module is used to obtain the execution result of the new decision system by using the input of the old decision system as the input of the new decision system, and compare the execution result of the new decision system with the execution result of the old decision system. The verification module is used to perform business-level and canary-scale verification on the new decision-making system that has passed the comparison in the comparison module, and to launch the new decision-making system that has passed the business-level and canary-scale verification. In the comparison module, when random numbers are involved, a shadow old decision system is created for the old decision system, and a shadow new decision system is created for the new decision system. Random function calls in both the shadow old and shadow new decision systems are replaced with number retrieval to ensure that the random numbers obtained by the shadow old and shadow new decision systems are consistent. The execution results of the shadow old decision system are compared with the execution results of the shadow new decision system. If the comparison passes, the comparison between the execution results of the new and old decision systems is considered successful. In the comparison module, when time is involved, a mock function is added so that the comparison of the execution results of the new decision system and the old decision system is not affected by the execution time.
7. 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, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Tangible (upstream vertical chain) new technologies based on new designs and new compositions that increase people's quality of life relevant to my companies 'lines' of business
CA2642458A1
Migration method based on VMEC service network selection
CN113055487A