Method, device, equipment, storage medium and product for realizing quota lossless control in system migration
Patent Information
- Application Number
- CN202611422543.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-14
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]然而,上述现有方案均存在明显缺陷
[0015]本申请提出的一个或多个技术方案,至少具有以下技术效果:通过构建新限额处理应用并部署于新数据库,所述新数据库上独立创建有第一数据表,用于记录所述新限额处理应用受理的全部限额交易累计值,旧限额处理应用的旧数据库中配置有第二数据表和第三数据表,所述第一数据表的累计数据准实时同步至旧数据库中的第二数据表,旧限额处理应用在限额检查时合并旧数据库中的第三数据表与第二数据表;响应于客户的限额交易请求,将交易流量由所述旧限额处理应用切换至所述新限额处理应用,所述新限额处理应用在限额检查时合并所述第三数据表与所述第一数据表的数据进行汇总计算,并将所述第一数据表的最新值持续同步至所述第二数据表;在完成全部流量切换后,停止所述旧限额处理应用的交易处理,使所述旧数据库中的第三数据表进入静态数据状态;将处于静态数据状态的所述第三数据表整体迁移至所述新数据库,存储为第四数据表,将所述新限额处理应用的限额检查逻辑由合并所述第三数据表与所述第一数据表,切换为合并所述第四数据表与所述第一数据表,并断开所述第一数据表向所述第二数据表的同步链路。
Smart Images

Figure CN123012055A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, equipment, storage medium and product for achieving limit-based lossless control during system migration. Background Technology
[0002] In banking transaction systems, customer payment authorization processing requires strict checks on various transaction limits, including limits set by the customer and cumulative periodic limits (daily, monthly, quarterly, annual, etc.) preset by banks and regulatory authorities to control risks. During system migration, ensuring the accuracy of cumulative limit values and the correctness of limit checks during forward migration and reverse rollback are crucial for ensuring business continuity and fund security. Currently, the industry commonly uses solutions such as full data migration, dual-write dual-control, or periodic alignment migration to address limit control issues during system migration.
[0003] However, all of the above-mentioned existing solutions have significant drawbacks. The full data migration solution requires halting all transactions during the migration window, importing the accumulated limit values from the old system into the new system, and completing consistency checks before the data can be switched. This not only interrupts business services but also requires data to be migrated back to the old system to restore service should the new system malfunction, impacting business continuity. While the dual-write, dual-controller solution supports parallel operation and real-time comparison between the old and new systems, it requires waiting for the switch to the next cycle's new system to fully support long-term limit accumulation. Furthermore, the exception handling logic, such as limit rollback in case of transaction failure, is complex, especially in distributed deployments where data consistency issues between multiple databases must be addressed. The cycle-aligned migration solution requires switching at the end of the cycle for different types of cycles, but it's difficult to find a unified alignment point for various cycle limits, and exception rollbacks must also be performed at cycle boundaries, lacking flexibility. Summary of the Invention
[0004] The main objective of this application is to provide a method, apparatus, device, storage medium, and product for achieving limit-based lossless control during system migration, aiming to improve the flexibility and reliability of system migration.
[0005] To achieve the above objectives, this application proposes a method for implementing lossless limit control during system migration, the method comprising: A new limit processing application is built and deployed on a new database. A first data table is independently created on the new database to record the cumulative value of all limit transactions accepted by the new limit processing application. A second data table and a third data table are configured in the old database of the old limit processing application. The cumulative data of the first data table is synchronized to the second data table in the old database in near real-time. When the old limit processing application checks the limit, it merges the third data table and the second data table in the old database. In response to a customer's transaction limit request, the transaction flow is switched from the old limit processing application to the new limit processing application. When checking the limit, the new limit processing application merges the data from the third data table and the first data table for summary calculation, and continuously synchronizes the latest value of the first data table to the second data table. After the complete traffic switch is completed, the transaction processing of the old quota processing application is stopped, and the third data table in the old database enters a static data state. The entire third data table, which is in a static data state, is migrated to the new database and stored as the fourth data table. The limit check logic of the new limit processing application is switched from merging the third data table and the first data table to merging the fourth data table and the first data table, and the synchronization link from the first data table to the second data table is disconnected.
[0006] In one embodiment, the method further includes: During the transaction flow switching process, the old limit processing application retains the ability to merge the third data table and the second data table in case of a rollback.
[0007] In one embodiment, the method further includes: During the transaction flow switching process, the transaction flow is switched according to the customer dimension to ensure that the limit processing for the same customer at any given time is executed by only one of the new limit processing application or the old limit processing application.
[0008] In one embodiment, the method further includes: If the near real-time synchronization fails when the cumulative data in the first data table is synchronized to the second data table in the old database, an asynchronous compensation mechanism will be initiated in the background to ensure that the final data in the first data table and the second data table are consistent.
[0009] In one embodiment, the method further includes: When the new quota processing application encounters an anomaly and needs to be switched back, the transaction traffic is switched back to the old quota processing application, which then performs the summary check logic to merge the third data table and the second data table.
[0010] In one embodiment, before migrating the entire third data table, which is in a static data state, to the new database and storing it as the fourth data table, the method further includes: Confirm whether the third data table in the old database has been updated; After confirming that the third data table in the old database will no longer be updated, the subsequent quota data migration operation is performed.
[0011] Furthermore, to achieve the above objectives, this application also proposes an apparatus for implementing lossless limit control during system migration, the apparatus comprising: The building module is used to build a new quota processing application and deploy it on a new database. A first data table is independently created on the new database to record the cumulative value of all quota transactions accepted by the new quota processing application. The old database of the old quota processing application is configured with a second data table and a third data table. The cumulative data of the first data table is synchronized to the second data table in the old database in near real-time. When the old quota processing application checks the quota, it merges the third data table and the second data table in the old database. The switching module is used to switch the transaction traffic from the old limit processing application to the new limit processing application in response to the customer's limit transaction request. The new limit processing application merges the data of the third data table and the first data table for summary calculation during limit checks, and continuously synchronizes the latest value of the first data table to the second data table. The static management module is used to stop the transaction processing of the old quota processing application after the completion of all traffic switching, so that the third data table in the old database enters the static data state. The migration module is used to migrate the third data table, which is in a static data state, to the new database and store it as the fourth data table. The limit check logic of the new limit processing application is switched from merging the third data table and the first data table to merging the fourth data table and the first data table, and the synchronization link from the first data table to the second data table is disconnected.
[0012] Furthermore, to achieve the above objectives, this application also proposes an apparatus for implementing limit-based lossless control during system migration, the apparatus comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the method for implementing limit-based lossless control during system migration as described above.
[0013] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the method for implementing limit-based lossless control in system migration as described above.
[0014] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the method for implementing limit-based lossless control in system migration as described above.
[0015] One or more technical solutions proposed in this application have at least the following technical effects: A new limit processing application is constructed and deployed on a new database. A first data table is independently created on the new database to record the cumulative value of all limit transactions processed by the new limit processing application. A second data table and a third data table are configured in the old database of the old limit processing application. The cumulative data in the first data table is synchronized to the second data table in the old database in near real-time. During limit checks, the old limit processing application merges the third data table and the second data table in the old database. In response to a customer's limit transaction request, the transaction flow is switched from the old limit processing application to the new limit processing application. During the limit check, the application merges the data from the third data table and the first data table for summary calculation, and continuously synchronizes the latest value from the first data table to the second data table. After completing the full traffic switch, the transaction processing of the old limit processing application is stopped, causing the third data table in the old database to enter a static data state. The third data table in the static data state is migrated to the new database and stored as a fourth data table. The limit check logic of the new limit processing application is switched from merging the third data table and the first data table to merging the fourth data table and the first data table, and the synchronization link from the first data table to the second data table is disconnected.
[0016] The technical solution presented in this application ensures that business services do not need to be interrupted and customer transactions remain unaffected throughout the migration process. The cumulative limit values of the old and new systems are stored and updated independently, avoiding data overwriting and concurrency conflicts. Migration and rollback do not require waiting for specific period boundaries (such as the beginning of the month, quarter, or year) and can be executed at any time. Old data is statically rendered during data migration, making the migration logic simple and reliable. This achieves a seamless business switchover, eliminating the need to pause services or impact business operations during the switchover window. Simultaneously, it reduces the complexity of limit control, avoiding the challenges of handling exceptions such as rollbacks due to transaction failures in traditional dual-write, dual-control systems, and eliminates the limitation of switchover time points. Limits for various cumulative periods, such as daily, monthly, and yearly, can be switched and rolled back at any time without waiting for specific period boundaries, thereby improving the flexibility and reliability of system migration. The method presented in this application is not only applicable to limit migration in bank transaction systems but can also be used for lossless migration scenarios in all systems involving cumulative resource control, such as API traffic quota management and resource acquisition. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A flowchart is provided for the first embodiment of the method for implementing lossless limit control during system migration in this application; Figure 2 This is a schematic diagram of the overall architecture of the quota migration scheme in this application; Figure 3 A new limit service process diagram is constructed for this application; Figure 4 This is a schematic diagram illustrating the interaction relationship during the parallel phase of traffic limit switching in this application; Figure 5 This is a diagram illustrating the completed status of the traffic limit switch for this application; Figure 6 This is a diagram illustrating the completion status of the quota migration for this application; Figure 7 This is a schematic diagram of the module structure of the device for implementing lossless limit control during system migration in an embodiment of this application. Figure 8 This is a schematic diagram of the hardware operating environment involved in the method for implementing limit-based lossless control during system migration in the embodiments of this application.
[0020] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0021] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0022] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0023] The main solution of this application embodiment is as follows: A new limit processing application is constructed and deployed on a new database. A first data table is independently created on the new database to record the cumulative value of all limit transactions processed by the new limit processing application. The old database of the old limit processing application is configured with a second data table and a third data table. The cumulative data in the first data table is synchronized to the second data table in the old database in near real-time. During limit checks, the old limit processing application merges the third data table and the second data table in the old database. In response to a customer's limit transaction request, the transaction flow is switched from the old limit processing application to the new limit processing application. During limit checks, the new limit processing application... During the query, the data from the third data table and the first data table are merged and summarized for calculation, and the latest value from the first data table is continuously synchronized to the second data table. After all traffic switching is completed, the transaction processing of the old quota processing application is stopped, and the third data table in the old database enters a static data state. The third data table in the static data state is migrated to the new database and stored as a fourth data table. The quota checking logic of the new quota processing application is switched from merging the third data table and the first data table to merging the fourth data table and the first data table, and the synchronization link from the first data table to the second data table is disconnected.
[0024] The technical solution presented in this application ensures that business services do not need to be interrupted and customer transactions remain unaffected throughout the migration process. The cumulative limit values of the old and new systems are stored and updated independently, avoiding data overwriting and concurrency conflicts. Migration and rollback do not require waiting for specific period boundaries (such as the beginning of the month, quarter, or year) and can be executed at any time. Old data is statically rendered during data migration, making the migration logic simple and reliable. This achieves a seamless business switchover, eliminating the need to pause services or impact business operations during the switchover window. Simultaneously, it reduces the complexity of limit control, avoiding the challenges of handling exceptions such as rollbacks due to transaction failures in traditional dual-write, dual-control systems, and eliminates the limitation of switchover time points. Limits for various cumulative periods, such as daily, monthly, and yearly, can be switched and rolled back at any time without waiting for specific period boundaries, thereby improving the flexibility and reliability of system migration. The method presented in this application is not only applicable to limit migration in bank transaction systems but can also be used for lossless migration scenarios in all systems involving cumulative resource control, such as API traffic quota management and resource acquisition.
[0025] This application's embodiments take into account that in banking transaction systems, customer payment authorization processing requires strict checks on various transaction limits, including limits set by the customer and cumulative periodic limits (daily, monthly, quarterly, annual, etc.) preset by banks and regulatory authorities to control risks. During system migration, ensuring the accuracy of cumulative limit values and the correctness of limit checks during forward migration and reverse rollback are crucial for ensuring business continuity and fund security. Currently, the industry commonly uses solutions such as full data migration, dual-write dual-control, or periodic alignment migration to address limit control issues during system migration.
[0026] However, all of the above-mentioned existing solutions have significant drawbacks. The full data migration solution requires halting all transactions during the migration window, importing the accumulated limit values from the old system into the new system, and completing consistency checks before the data can be switched. This not only interrupts business services but also requires data to be migrated back to the old system to restore service should the new system malfunction, impacting business continuity. While the dual-write, dual-controller solution supports parallel operation and real-time comparison between the old and new systems, it requires waiting for the switch to the next cycle's new system to fully support long-term limit accumulation. Furthermore, the exception handling logic, such as limit rollback in case of transaction failure, is complex, especially in distributed deployments where data consistency issues between multiple databases must be addressed. The cycle-aligned migration solution requires switching at the end of the cycle for different types of cycles, but it's difficult to find a unified alignment point for various cycle limits, and exception rollbacks must also be performed at cycle boundaries, lacking flexibility.
[0027] To address the aforementioned issues, this invention proposes a solution for lossless quota control during system migration. This solution aims to achieve seamless business switching, ensuring that the switching window does not require service interruption or affect business operations. Simultaneously, it reduces the complexity of quota control, avoids the challenges of handling exceptions such as rollbacks due to transaction failures in traditional dual-write, dual-control systems, and eliminates the limitation on switching time points. This allows quotas for various cumulative periods, such as daily, monthly, and yearly, to be switched and rolled back at any time without waiting for specific period boundaries, thereby improving the flexibility and reliability of system migration.
[0028] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device, device, or system capable of implementing the above functions for limit-based lossless control during system migration. The following description uses a system for limit-based lossless control during system migration as an example to illustrate this embodiment and the subsequent embodiments.
[0029] Based on this, embodiments of this application provide a method for implementing lossless limit control during system migration, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the method for implementing lossless limit control during system migration in this application.
[0030] In this embodiment, the method for implementing lossless control of limits during system migration includes steps S10 to S40. The following provides a detailed explanation of each step.
[0031] like Figure 1 As shown, the first embodiment of this application proposes a method for implementing lossless limit control during system migration, the method comprising: Step S10: Build a new quota processing application and deploy it on a new database. A first data table is independently created on the new database to record the cumulative value of all quota transactions accepted by the new quota processing application. A second data table and a third data table are configured in the old database of the old quota processing application. The cumulative data of the first data table is synchronized to the second data table in the old database in near real-time. When the old quota processing application checks the quota, it merges the third data table and the second data table in the old database. First, a new limit processing application is built and deployed on the new database. Specifically, the new limit processing application (which can be denoted as App_New) is relative to the old limit processing application (which can be denoted as App_Old), and both are server-side applications used to process limit transactions.
[0032] The aforementioned limit transactions refer to payment authorization transactions that require verification of various transaction limits set by the customer or preset by banks and regulatory authorities to control transaction risks.
[0033] The new database is a data storage system that is physically independent of the old database and can be deployed on different servers or different storage clusters.
[0034] A first data table (which can be denoted as Table B) is independently created on the new database to record the cumulative value of all limit transactions processed by the new limit processing application. "Independently created" means that the first data table is not coupled with any data table in the old database; its table structure, storage location, and read / write logic are all independent of the old system.
[0035] The total cumulative value of all limit transactions refers to the value accumulated by the new limit processing application for each limit transaction after passing the limit check, according to different accumulation periods such as daily, monthly, weekly, quarterly, and annually. For example, for daily cumulative limits, whenever a transaction passes the limit check, the "Daily Cumulative Transaction Amount" field for the corresponding customer in the first data table is increased by the amount of that transaction; for monthly cumulative limits, the "Monthly Cumulative Transaction Amount" field is updated accordingly. The first data table can be indexed by customer identifier (such as customer number) and limit type (such as daily limit, monthly limit, and annual limit) for quick querying and updating.
[0036] The old database of the legacy quota processing application contains a second data table (referred to as table B') and a third data table (referred to as table A). The third data table was originally used by the legacy quota processing application to store the cumulative value of the quota transactions it processed. The second data table is a newly constructed table used to receive synchronization data from the first data table. Its table structure is the same as or compatible with the first data table to ensure accurate reception of synchronization data. In the initial state (i.e., before any traffic switching has been performed), the second data table is empty and does not contain any cumulative data.
[0037] The cumulative data in the first data table is synchronized to the second data table in the old database in near real-time. Near real-time synchronization means that after data is updated in the first data table, the updated content is synchronized to the second data table within the shortest possible time (usually milliseconds or seconds), rather than through scheduled batch synchronization. Near real-time synchronization can be achieved through message queues (such as Kafka, RabbitMQ), database log parsing (such as Canal), or application dual-write mechanisms. The purpose of near real-time synchronization is to ensure that the cumulative data of the new quota processing application can be obtained in a timely manner when the old quota processing application performs quota checks, thereby ensuring that the cumulative data used for quota checks is complete and accurate regardless of which application processes the transaction traffic.
[0038] The old limit processing application merges the third and second data tables in the old database during limit checks. Merging means that when performing limit threshold checks, the cumulative value recorded in the third data table (old system) is added to the cumulative value recorded in the second data table (new system synchronized), resulting in a total cumulative value. This total cumulative value is then compared to a preset limit threshold. For example, if a customer's daily cumulative limit is 10,000 yuan, and the third data table records that the customer has accumulated 5,000 yuan in transactions in the old system that day, while the second data table records that the customer has accumulated 3,000 yuan in transactions in the new system that day, the merged total cumulative value is 8,000 yuan, leaving 2,000 yuan of available credit. The old limit processing application performs limit checks based on this total value of 8,000 yuan. If the current transaction amount does not exceed 2,000 yuan, the check passes; otherwise, the transaction is rejected.
[0039] Through the above steps, a new quota processing application was built and a data synchronization channel was established between the old and new systems, laying the data foundation for subsequent traffic switching. The cumulative quota values of the old and new systems are stored separately (in the first and third data tables respectively), without affecting each other. They are only merged during quota checks, avoiding data overwrite issues during data migration and concurrent online transactions.
[0040] As one implementation method, the overall architecture of the quota migration scheme in this embodiment can be referred to Figure 1 As shown, where: Gateway_App is a transaction access gateway with a limit, responsible for receiving transaction requests from business systems and forwarding them according to routing rules. Hereinafter referred to as the gateway.
[0041] App_Old is an old limit processing application that supports maintenance checks and cumulative limits on a daily, monthly, weekly, quarterly, and yearly basis.
[0042] App_New is the new limit processing application, and the functions that App_Old was responsible for checking and accumulating limits need to be gradually migrated to App_New.
[0043] During the quota migration process, quota control is implemented between App_Old and App_New applications: App_Old stores the cumulative value of the transaction quota it has accepted in table A, and App_New stores the cumulative value of the transaction quota it has accepted in table B. The quota transactions corresponding to the data in the two tables do not overlap. When the App_New application checks the quota, it queries the cumulative data in table A to merge the control (A+B) and synchronizes the latest value in the local table B to table B' in the old database. When the App_Old application checks the quota, it merges the data in the local table A and table B' to merge the control (A+B').
[0044] After the switch is complete, migrate table A to the new database, and the old database control logic can be disconnected.
[0045] This solution can be applied to scenarios involving cumulative control over a period of time, such as financial transaction limit management, API traffic quota management, and resource acquisition.
[0046] Step S20: In response to the customer's transaction limit request, the transaction flow is switched from the old limit processing application to the new limit processing application. When checking the limit, the new limit processing application merges the data of the third data table and the first data table for summary calculation, and continuously synchronizes the latest value of the first data table to the second data table. Next, in response to the customer's transaction limit request, the transaction traffic is switched from the old limit processing application to the new limit processing application.
[0047] Specifically, a transaction limit request refers to a customer-initiated transaction request that requires a limit check, such as bank card payments, money transfers, and cash withdrawals. The transaction flow refers to the sum of all transaction requests requiring limit processing. Flow switching is implemented through a transaction limit access gateway (referred to as Gateway_App), which is responsible for receiving transaction requests from the business system and forwarding them according to routing rules. Before the switch, all transaction limit requests are processed by the old limit processing application; after the switch, some or all of the transaction limit requests are processed by the new limit processing application.
[0048] Specifically, the new limit processing application merges the data from the third data table and the first data table for summary calculation during limit checks. When a limit transaction request is routed to the new limit processing application, it first queries the third data table in the old database to obtain the customer's cumulative transaction value in the old system up to the present; simultaneously, it queries the first data table in the new database to obtain the customer's cumulative transaction value in the new system up to the present; the two are added together to obtain a summary cumulative value; then, the summary cumulative value is compared with a preset limit threshold to determine whether the current transaction exceeds the limit.
[0049] Meanwhile, the new quota processing application continuously synchronizes the latest values from the first data table to the second data table. In other words, whenever the new quota processing application processes a transaction and updates the cumulative value in the first data table, this updated value is synchronized to the second data table in the old database via near real-time synchronization. The purpose of this is that during the traffic switching process, some customers' transactions may still be processed by the old quota processing application. The old quota processing application needs to merge the third and second data tables for quota checks, therefore it must ensure that the data in the second data table is consistent with the first data table to ensure the accuracy of the quota check results from the old quota processing application.
[0050] During the transaction traffic switching process, the old quota processing application retains its ability to merge the third and second data tables in case of a rollback. A rollback refers to the process where, after switching traffic to the new system, if anomalies are found in the new system (such as performance issues, data inconsistencies, or logical errors), the transaction traffic needs to be switched back to the old system. Because the old quota processing application always retains the ability to merge the third and second data tables, after a rollback, it can still perform accurate quota checks based on complete cumulative data (including the old system's own accumulated third data table and the new system's accumulated and synchronized second data table), ensuring that the cumulative quota value is not lost.
[0051] As one implementation method, during the transaction traffic switching process, transaction traffic switching is performed at the customer level to ensure that at any given time, the quota processing for the same customer is executed by only one of the new quota processing application or the old quota processing application. "At the customer level" means that traffic routing decisions are made on a per-customer basis. That is, for all quota transaction requests from a particular customer, all requests are either processed by the new quota processing application or all requests are processed by the old quota processing application. This prevents a situation where some transactions from the same customer are processed by the new system and some by the old system. The technical advantage of this approach is that it avoids the cumulative quota value for the same customer being updated by both the new and old systems simultaneously, thus eliminating quota check errors that may be caused by data synchronization delays. For example, suppose a customer's transactions are simultaneously routed to both the new and old systems. Due to the millisecond-level delay in near real-time synchronization, the new system may have updated the cumulative value, but the old system may not have received the synchronized data, leading the old system to make an incorrect quota check conclusion based on an incomplete cumulative value. After switching to the customer dimension, only one system updates the customer's cumulative value at any given time, while the other system only performs queries and merge calculations. There is no issue of concurrent updates, thus ensuring the accuracy of the limit check.
[0052] During the transaction traffic switchover process, the switchover scope can be gradually expanded using a canary release approach. This allows for timely identification and adjustment of issues during the migration process, reducing migration risks.
[0053] Step S30: After completing all traffic switching, stop the transaction processing of the old quota processing application and make the third data table in the old database enter a static data state. Then, after all traffic switching is completed, transaction processing of the old quota processing application is stopped, and the third data table in the old database enters a static data state.
[0054] Specifically, completing the full traffic switch means that all customer limit transaction requests have been switched to the new limit processing application, and the old limit processing application no longer receives any new limit transaction requests. At this point, the old limit processing application can stop service or enter standby mode. Since the old limit processing application no longer processes any transactions, the third data table no longer undergoes any update operations, thus entering a static data state, meaning its data content no longer changes. This static data state is a prerequisite for subsequent data migration. Only when the data remains unchanged can data be safely migrated from one database to another without worrying about data being overwritten or lost during the migration process.
[0055] After confirming that the third data table in the old database is no longer being updated, the quota data migration operation is performed. Confirmation that the third data table is no longer being updated can be achieved by: checking the transaction processing logs of the old quota processing application to confirm that no transaction records have been recorded since a certain point in time; or by monitoring the latest update timestamp of the third data table through database triggers or monitoring tools to confirm that it has not changed over a period of time.
[0056] Step S40: Migrate the entire third data table, which is in a static data state, to the new database and store it as the fourth data table. Change the limit check logic of the new limit processing application from merging the third data table and the first data table to merging the fourth data table and the first data table, and disconnect the synchronization link from the first data table to the second data table. Finally, the third data table, which is in a static data state, is migrated to the new database and stored as a fourth data table (which can be denoted as table A'). The limit check logic of the new limit processing application is switched from merging the third data table and the first data table to merging the fourth data table and the first data table, and the synchronization link from the first data table to the second data table is disconnected.
[0057] Specifically, the overall migration refers to completely copying all data records from the third data table to the fourth data table in the new database. Since the third data table is already in a static data state, no new data will be written during the migration process. Therefore, batch export / import methods (such as using database import / export tools, ETL tools, etc.) can be used for the migration, without worrying about data consistency issues. After the migration is complete, the fourth data table is a complete copy of the third data table in the new database.
[0058] After the migration is complete, the limit checking logic of the new limit processing application needs to be modified. During the switchover phase (before migration), the new limit processing application merged the third data table (located in the old database) and the first data table (located in the new database) for limit checks. This meant that each limit check required a cross-database query, posing risks of network latency and cross-database dependencies. After the migration, the new limit processing application changed to merging the fourth data table (located in the new database) and the first data table (located in the new database). Both are now in the same database, resulting in higher query efficiency and eliminating the dependency on the old database.
[0059] While switching the inspection logic, disconnect the synchronization link between the first data table and the second data table. Since the old quota processing application no longer processes transactions, and the second data table is no longer queried by any application, synchronization between the first and second data tables is unnecessary, and the synchronization link can be disconnected to free up system resources. Disconnecting the synchronization link can be done by: shutting down the message queue consumer, stopping the database log parsing task, or removing the synchronization code logic from the application.
[0060] Through the above steps, a complete migration of quota processing from the old system to the new system was achieved. Throughout the migration process, business services did not need to be interrupted, and customer transactions were unaffected; the cumulative quota values of the old and new systems were stored and updated independently, avoiding data overwriting and concurrency conflicts; migration and rollback did not require waiting for specific period boundaries (such as the beginning of the month, quarter, or year) and could be executed at any time; the old data was static during data migration, making the migration logic simple and reliable. The method in this embodiment is not only applicable to quota migration in bank transaction systems but can also be used for lossless migration scenarios in all systems involving periodic cumulative resource control, such as API traffic quota management and resource acquisition.
[0061] Based on the first embodiment described above, a second embodiment of this application is proposed. In this embodiment, the following steps are further included: when the cumulative data of the first data table is synchronized to the second data table in the old database in near real-time, if the near real-time synchronization fails, a background asynchronous compensation processing mechanism is started to ensure that the final data of the first data table and the second data table are consistent.
[0062] Specifically, while near real-time synchronization can guarantee that data from the first data table is synchronized to the second data table within a short time in most cases, in actual production environments, due to various reasons such as network jitter, message queue backlog, database connection anomalies, and application crashes, near real-time synchronization may fail or be delayed. If synchronization fails without any compensation mechanism, data inconsistency will occur between the first and second data tables, leading to incorrect judgments made by the old quota processing application during quota checks based on incomplete cumulative values.
[0063] To address this, this embodiment introduces a background asynchronous compensation mechanism. Background asynchronous compensation refers to the process where, when the near real-time synchronization link detects a synchronization failure, the main business process is not immediately blocked or interrupted. Instead, the synchronization failure event is recorded (e.g., in a failure log table or failure message queue), and a separate background compensation thread or service periodically scans these failure records to re-attempt synchronize the changed data from the first data table to the second data table.
[0064] For example, suppose near real-time synchronization is implemented using a message queue: Each time the new quota processing application updates the first data table, it sends a synchronization message containing the changed content to the message queue. The consumer on the old database side receives the message and updates the second data table. If the consumer fails to process a message due to a database connection timeout, the message is marked as failed and moved to the retry queue. A background asynchronous compensation thread scans the retry queue at fixed time intervals (e.g., every 5 minutes) and retryes consuming failed messages. If the retry still fails, it can continue to retry according to an exponential backoff strategy (e.g., retrying after 1 minute, 5 minutes, 15 minutes, and 1 hour) until successful.
[0065] Eventual data consistency means that after a period of time (which may include several retries), the first and second data tables finally reach a state of data consistency. Before eventual consistency, there may be a brief window of data inconsistency. However, because this solution adopts a strategy of switching traffic based on the customer dimension, the quota processing for the same customer at any given time is only executed by either the new quota processing application or the old quota processing application. Therefore, even if there is a brief data synchronization delay or a gap in the compensation period, the quota for the same customer will not be accumulated repeatedly or missed.
[0066] Specifically, if a customer's traffic has been switched to the new system, the new system will handle the limit check. The new system will directly query the first data table and will not rely on the second data table. Therefore, the synchronization delay will not affect the accuracy of the customer's limit check. If a customer's traffic has not yet been switched and is still processed by the old system, the old system will merge the third and second data tables for limit checks. In this case, the second data table may not contain the customer's latest cumulative value in the new system due to the synchronization delay. However, since the customer's traffic has not been switched and the customer has not actually made any transactions in the new system, the second data table should not contain the customer's cumulative data in the new system in the first place. Therefore, the synchronization delay will not have a substantial impact.
[0067] Through the above steps, an asynchronous compensation mechanism is added on the basis of near real-time synchronization, which further improves the reliability of data synchronization and ensures the final consistency of quota accumulation data between the old and new systems. This ensures that the accuracy of quota checks can be guaranteed no matter what kind of anomaly occurs in the synchronization link.
[0068] Based on any of the above embodiments, a third embodiment of this application is proposed. In this embodiment, the following steps are further included: when the new quota processing application encounters an anomaly and needs to be switched back, the transaction traffic is switched back to the old quota processing application, and the old quota processing application executes the summary check logic of merging the third data table and the second data table.
[0069] Specifically, the "abnormalities in the new quota processing application" refer to various abnormal situations that may lead to service unavailability or data errors during the operation of the new quota processing application, including but not limited to: application crashes or process exits, database connection pool exhaustion, response timeouts, returned error codes, data inconsistency alarms, and system resource exhaustion. These abnormalities may be caused by a variety of reasons such as code defects, configuration errors, hardware failures, network partitions, and sudden increases in traffic.
[0070] A rollback is required when the anomalies of the new quota processing application reach a certain level (such as the error rate exceeding the threshold, the response time exceeding the SLA, or manual judgment indicating the need for rollback). In this case, the operations and maintenance personnel or the automated disaster recovery system decide to switch the transaction traffic from the new quota processing application back to the old quota processing application to restore normal business operations.
[0071] Switching the transaction traffic back to the old limit-handling application is achieved by modifying the routing rules of the limit-handling transaction access gateway (Gateway_App). The specific operation is the reverse of the forward traffic switching: the gateway reroutes limit-handling transaction requests that were originally routed to the new limit-handling application back to the old limit-handling application. Similar to the forward traffic switching, the switchback is also performed at the customer level, ensuring that limit-handling for the same customer is executed by only one of the old and new systems at any given time. The switchback can be a one-time full switchback or a gradual switchback at the customer level.
[0072] The key to ensuring the accuracy of limit checks after a rollback is that the old limit processing application performs the summary check logic that merges the third data table and the second data table. When transaction traffic is switched back to the old limit processing application, the old limit processing application needs to merge the third data table (which records the accumulated limit value of the old system) and the second data table (which records the accumulated limit value of the new system and synchronized it) during the limit check to obtain the summarized accumulated value before determining the limit threshold.
[0073] This embodiment ensures that the aggregated cumulative value used for the quota check after the switchback includes all the cumulative data from both the old and new systems by merging the third and second data tables, thus guaranteeing the correctness of the quota control.
[0074] Furthermore, after the rollback is completed, the synchronization link from the first data table to the second data table continues to operate, ensuring that if there are still transactions during the rollback period (in a phased rollback scenario, the transactions of customers who have not been rolled back are still processed by the new system), their cumulative values can still be synchronized to the second data table for use by the old system during limit checks.
[0075] Through the above steps, a seamless rollback capability is achieved in the event of an anomaly in the new system. The rollback process does not require pausing business services or waiting for period boundaries (such as the beginning of the month, quarter, or year), and can be executed at any time. After the rollback, the old quota processing application performs quota checks based on the complete aggregated cumulative values, ensuring that the cumulative quota values are not lost and quota control remains effective, truly achieving two-way lossless migration and rollback. This technology is significantly superior to traditional full data migration solutions (rollback requires data migration, resulting in long service interruptions) and period-aligned migration solutions (rollback requires waiting for period boundaries, which is inflexible).
[0076] The technical solution of this embodiment will be described in detail below with reference to specific scenarios: This embodiment provides a method for lossless quota control during system migration. The method includes steps such as building a new quota processing application, switching traffic, staticizing old data, and migrating old data. The following is combined with... Figures 2 to 6 Step by step, the explanation will be provided.
[0077] Please see Figure 2 This demonstrates the overall architecture of this application. Figure 2 This includes a limit transaction access gateway (Gateway_App), an old limit processing application (App_Old), a new limit processing application (App_New), an old database (containing tables A and B'), and a new database (containing table B). The gateway is responsible for receiving transaction requests from business systems and forwarding them to App_Old or App_New according to routing rules. App_Old and App_New process limit transactions independently and store the accumulated values in tables A and B, respectively. Data in table B is synchronized to table B' in the old database via a near real-time synchronization link. Limit control is achieved between the old and new systems through merge queries.
[0078] The core idea of the overall architecture of this application is that the old and new systems accumulate data independently, and the data is only merged during the limit check, thereby avoiding data conflicts during the migration process.
[0079] First, build a new quota processing application and deploy it to the new database. See details below. Figure 3 , Figure 3The white background on the left side divides the existing quota processing service before the migration, including the old quota processing application (App_Old) and its database (including table A), as well as the gateway. The yellow background (darker color) on the right side represents the newly built quota processing application (App_New) and the new database (including table B). During construction, App_New is deployed on the new server, and a first data table (table B) is created independently to record the cumulative value of all quota transactions processed by App_New. The table structure of table B includes fields such as customer identifier, quota period type (daily, monthly, quarterly, yearly), cumulative amount, and last update time. At the same time, a second data table (table B') is created in the old database, with the same structure as table B. After construction, a near real-time synchronization channel is configured to push the changed data of table B to the old database side in real time through a message queue (such as Kafka), and the consumer updates table B'. In addition, the quota checking logic of App_Old needs to be modified so that it merges the data of the local tables A and B' (i.e., A+B') during the check. After the modification, in the un-switched phase, since table B' is empty, table A is still the actual reference; however, once data is synchronized, App_Old can perceive the cumulative value of the new system.
[0080] Then, in response to the customer's transaction limit request, the transaction flow is switched from App_Old to App_New. Please refer to [link / reference needed] for this stage. Figure 4 , Figure 4 This demonstrates the interaction relationships during the parallel phase of quota-based traffic switching. Figure 4 In this process, the gateway (Gateway_App) routes some transactions to App_New based on the customer dimension, while the rest are still routed to App_Old. When a transaction enters App_New, before performing a limit check, App_New simultaneously queries table A in the old database and table B in the new database, adds the values of the two to obtain a total cumulative value (A+B), and compares it with the limit threshold. If it passes, table B is updated, and the latest value in table B is updated to table B' in the old database via the synchronization link. Meanwhile, for transactions still processed by App_Old, App_Old queries its local tables A and B', merges (A+B'), and then checks the limit.
[0081] Once the new quota service is ready, traffic switching can begin. Switching can be done on a customer-by-customer basis. This ensures that at any given time, quota processing for a single customer will only be handled by either the new or old quota application, preventing synchronization delays from causing errors in quota determination.
[0082] When checking the limit, the App_New application queries the cumulative data merging control (A+B) in table A, and simultaneously synchronizes the latest value in the local table B to table B' in the old database.
[0083] If an anomaly is found in the accumulated data of the old system during the traffic cut-off process, a rollback is required. In this case, simply switch the traffic back to App_Old. When the App_Old application checks the limit, it merges the local A table data with the B' table data and controls the merge (A+B'), ensuring that the accumulated limit value is not lost after the switch and guaranteeing the correctness of the limit control.
[0084] Once all traffic switching is complete, the traffic cut-off completion phase begins, specifically as follows: Figure 5 As shown. After the quota cutoff is completed, App_Old will no longer handle quota transactions. At this time, the data in table A will remain unchanged and become static data. Then, you can consider starting the migration of quota data from the old database.
[0085] exist Figure 5 In this process, App_Old no longer receives any transaction requests, and its processing module can be taken offline or set to read-only. Table A enters a static data state because no new transactions are being written. At this time, table B' is also no longer updated, because although synchronization of table B continues, App_Old is no longer in use and can be retained. Figure 5 The synchronous link still exists, but it has no actual impact.
[0086] Finally, perform the quota data migration, such as... Figure 6 As shown, in Figure 6 In the process, the static table A is exported as a whole and imported into a new database, named the fourth data table (table A').
[0087] Migrate the cumulative limit data A from the old database to the new database A'. After the migration is complete, change the App_New application to merge the limit data of A' and B, and disconnect the logic of B synchronizing with B'. At this point, the limit processing has been fully migrated from the old to the new limit.
[0088] After the migration was completed, the limit check logic of App_New was changed from merging A+B to merging A'+B (both are in the new database), resulting in higher query efficiency and no longer relying on the old database. At the same time, the synchronization link between table B and table B' was disconnected.
[0089] Through the above steps, this embodiment achieves a lossless migration of quotas from the old system to the new system. Throughout the process, business services are never interrupted; old and new data are stored in isolation, without interference; migration and rollback do not require waiting for cycle boundaries; and the old tables are already inactive during data migration, making the logic simple and reliable. Therefore, this method significantly reduces migration complexity and risk, and is applicable to various periodic cumulative resource control scenarios.
[0090] This application achieves the following technical effects by storing the cumulative limit values of the old and new systems separately and merging them only during limit checks: 1. Seamless business switchover: The entire migration process does not require interrupting transaction services, and customer transactions are unaffected, achieving a zero-downtime system migration.
[0091] 2. Reduced complexity of limit control: The cumulative limit values of the new and old systems are stored and updated independently, avoiding the complex exception handling such as limit rollback due to transaction failure in the traditional dual-write dual-control scheme, and there is no need to worry about data consistency issues between multiple databases in a distributed deployment.
[0092] 3. Eliminate switching time restrictions: Regardless of whether the quota is based on a daily, monthly, or yearly cumulative period, it can be switched off and reverted at any time without waiting for a specific time window when the period ends, greatly improving the flexibility and operability of migration.
[0093] 4. Simple and reliable data migration: Since the old data table is in a static state after the data slicing is completed, there is no need to consider concurrent write issues during data migration. The migration logic is simple and data consistency is guaranteed.
[0094] 5. Lossless rollback capability: If a new system anomaly is detected at any time, the system can be switched back to the old system at any time. After the rollback, the cumulative limit value is completely retained, and the limit control is accurate and error-free.
[0095] Furthermore, to achieve the above objectives, this application also proposes a device for implementing lossless control of limits during system migration, such as... Figure 7 As shown, the device includes: Module 10 is used to build a new quota processing application and deploy it on a new database. A first data table is independently created on the new database to record the cumulative value of all quota transactions accepted by the new quota processing application. The old database of the old quota processing application is configured with a second data table and a third data table. The cumulative data of the first data table is synchronized to the second data table in the old database in near real-time. When the old quota processing application checks the quota, it merges the third data table and the second data table in the old database. The switching module 20 is used to switch the transaction traffic from the old limit processing application to the new limit processing application in response to the customer's limit transaction request. The new limit processing application merges the data of the third data table and the first data table for summary calculation during limit checking, and continuously synchronizes the latest value of the first data table to the second data table. The static management module 30 is used to stop the transaction processing of the old quota processing application after all traffic switching is completed, so that the third data table in the old database enters the static data state. The migration module 40 is used to migrate the third data table, which is in a static data state, to the new database and store it as a fourth data table. The limit check logic of the new limit processing application is switched from merging the third data table and the first data table to merging the fourth data table and the first data table, and the synchronization link from the first data table to the second data table is disconnected.
[0096] The apparatus for implementing lossless limit control during system migration provided in this application, employing the method for implementing lossless limit control during system migration described in the above embodiments, can improve the flexibility and reliability of system migration. Compared with the prior art, the beneficial effects of the apparatus for implementing lossless limit control during system migration provided in this application are the same as those of the method for implementing lossless limit control during system migration provided in the above embodiments, and other technical features in the apparatus for implementing lossless limit control during system migration are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0097] Furthermore, to achieve the above objectives, this application also proposes an apparatus for implementing limit-based lossless control during system migration, the apparatus comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the method for implementing limit-based lossless control during system migration as described above.
[0098] The following is for reference. Figure 8 This document illustrates a structural diagram of a device suitable for implementing limit-based lossless control during system migration in the embodiments of this application. The device implementing limit-based lossless control during system migration in the embodiments of this 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 Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 8 The device shown for implementing limit-based lossless control in system migration is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments in this application.
[0099] like Figure 8As shown, the device implementing limit-based lossless control during system migration may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in read-only memory 1002 or a program loaded from storage device 1003 into random access memory 1004. Random access memory 1004 also stores various programs and data required for the operation of the device implementing limit-based lossless control during system migration. The processing unit 1001, read-only memory 1002, and random access memory 1004 are interconnected via bus 1005. Input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows devices implementing limit-based lossless control during system migration to communicate wirelessly or wiredly with other devices to exchange data. While the figures show devices implementing limit-based lossless control during system migration with various systems, it should be understood that implementation or possession of all shown systems is not required. More or fewer systems may be implemented alternatively.
[0100] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0101] The device for implementing limit-based lossless control during system migration provided in this application, employing the method for implementing limit-based lossless control during system migration described in the above embodiments, can improve the flexibility and reliability of system migration. Compared with the prior art, the beneficial effects of the device for implementing limit-based lossless control during system migration provided in this application are the same as the beneficial effects of the method for implementing limit-based lossless control during system migration provided in the above embodiments, and other technical features of the device for implementing limit-based lossless control during system migration are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.
[0102] It should be understood that the various parts disclosed in this application can be implemented using 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 suitable manner in one or more embodiments or examples.
[0103] Furthermore, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the method for implementing limit-based lossless control in system migration as described above.
[0104] The computer-readable storage medium provided in this 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 thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0105] The aforementioned computer-readable storage medium may be included in the device that implements limit-based lossless control during system migration; or it may exist independently and not be assembled into the device that implements limit-based lossless control during system migration.
[0106] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by a device implementing lossless limit control during system migration, the device implementing lossless limit control during system migration causes the following: A new limit processing application is built and deployed in a new database. The new database independently creates a first data table to record the cumulative value of all limit transactions processed by the new limit processing application. The old database of the old limit processing application is configured with a second and a third data table. The cumulative data in the first data table is synchronized to the second data table in the old database in near real-time. During limit checks, the old limit processing application merges the third and second data tables in the old database. In response to a customer's limit transaction request, the transaction flow is redirected from the old limit processing application... The application is switched to the new quota processing application. During quota checks, the new quota processing application merges the data from the third data table and the first data table for summary calculation, and continuously synchronizes the latest value of the first data table to the second data table. After all traffic switching is completed, the transaction processing of the old quota processing application is stopped, and the third data table in the old database enters a static data state. The third data table in the static data state is migrated to the new database and stored as a fourth data table. The quota check logic of the new quota processing application is switched from merging the third data table and the first data table to merging the fourth data table and the first data table, and the synchronization link from the first data table to the second data table is disconnected.
[0107] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0108] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0109] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0110] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the method for implementing limit-based lossless control in the above-described system migration, thereby improving the flexibility and reliability of system migration. 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 method for implementing limit-based lossless control in the system migration provided in the above embodiments, and will not be repeated here.
[0111] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the method for implementing limit-based lossless control in system migration as described above.
[0112] The computer program product provided in this application can improve the flexibility and reliability of system migration. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the method for achieving limit-based lossless control in system migration provided in the above embodiments, and will not be repeated here.
[0113] One or more technical solutions proposed in this application have at least the following technical effects: A new limit processing application is constructed and deployed on a new database. A first data table is independently created on the new database to record the cumulative value of all limit transactions processed by the new limit processing application. A second data table and a third data table are configured in the old database of the old limit processing application. The cumulative data in the first data table is synchronized to the second data table in the old database in near real-time. During limit checks, the old limit processing application merges the third data table and the second data table in the old database. In response to a customer's limit transaction request, the transaction flow is switched from the old limit processing application to the new limit processing application. During the limit check, the application merges the data from the third data table and the first data table for summary calculation, and continuously synchronizes the latest value from the first data table to the second data table. After completing the full traffic switch, the transaction processing of the old limit processing application is stopped, causing the third data table in the old database to enter a static data state. The third data table in the static data state is migrated to the new database and stored as a fourth data table. The limit check logic of the new limit processing application is switched from merging the third data table and the first data table to merging the fourth data table and the first data table, and the synchronization link from the first data table to the second data table is disconnected.
[0114] The technical solution proposed in this application ensures that business services do not need to be interrupted and customer transactions are unaffected throughout the migration process. The cumulative limit values of the old and new systems are stored and updated independently, avoiding data overwriting and concurrency conflicts. Migration and rollback do not require waiting for specific period boundaries (such as the beginning of the month, quarter, or year) and can be executed at any time. Old data is statically rendered during data migration, making the migration logic simple and reliable. This achieves a seamless business switchover, eliminating the need to pause services or impact business operations during the switchover window. Simultaneously, it reduces the complexity of limit control, avoiding the challenges of handling exceptions such as rollbacks due to transaction failures in traditional dual-write, dual-control systems, and eliminates the limitation of switchover time points. Limits for various cumulative periods such as daily, monthly, and yearly can be switched and rolled back at any time without waiting for specific period boundaries, thereby improving the flexibility and reliability of system migration.
[0115] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for implementing lossless limit control during system migration, characterized in that, The method includes: A new limit processing application is built and deployed on a new database. A first data table is independently created on the new database to record the cumulative value of all limit transactions accepted by the new limit processing application. A second data table and a third data table are configured in the old database of the old limit processing application. The cumulative data of the first data table is synchronized to the second data table in the old database in near real-time. When the old limit processing application checks the limit, it merges the third data table and the second data table in the old database. In response to a customer's transaction limit request, the transaction flow is switched from the old limit processing application to the new limit processing application. When checking the limit, the new limit processing application merges the data from the third data table and the first data table for summary calculation, and continuously synchronizes the latest value of the first data table to the second data table. After the complete traffic switch is completed, the transaction processing of the old quota processing application is stopped, and the third data table in the old database enters a static data state. The entire third data table, which is in a static data state, is migrated to the new database and stored as the fourth data table. The limit check logic of the new limit processing application is switched from merging the third data table and the first data table to merging the fourth data table and the first data table, and the synchronization link from the first data table to the second data table is disconnected.
2. The method as described in claim 1, characterized in that, The method further includes: During the transaction flow switching process, the old limit processing application retains the ability to merge the third data table and the second data table in case of a rollback.
3. The method as described in claim 2, characterized in that, The method further includes: During the transaction flow switching process, the transaction flow is switched according to the customer dimension to ensure that the limit processing for the same customer at any given time is executed by only one of the new limit processing application or the old limit processing application.
4. The method as described in claim 1, characterized in that, The method further includes: If the near real-time synchronization fails when the cumulative data in the first data table is synchronized to the second data table in the old database, an asynchronous compensation mechanism will be initiated in the background to ensure that the final data in the first data table and the second data table are consistent.
5. The method as described in claim 2, characterized in that, The method further includes: When the new quota processing application encounters an anomaly and needs to be switched back, the transaction traffic is switched back to the old quota processing application, which then performs the summary check logic to merge the third data table and the second data table.
6. The method as described in claim 1, characterized in that, Before migrating the entire third data table, which is in a static data state, to the new database and storing it as the fourth data table, the process also includes: Confirm whether the third data table in the old database has been updated; After confirming that the third data table in the old database will no longer be updated, the subsequent quota data migration operation is performed.
7. A device for implementing limit-based lossless control during system migration, characterized in that, The device includes: The building module is used to build a new quota processing application and deploy it on a new database. A first data table is independently created on the new database to record the cumulative value of all quota transactions accepted by the new quota processing application. The old database of the old quota processing application is configured with a second data table and a third data table. The cumulative data of the first data table is synchronized to the second data table in the old database in near real-time. When the old quota processing application checks the quota, it merges the third data table and the second data table in the old database. The switching module is used to switch the transaction traffic from the old limit processing application to the new limit processing application in response to the customer's limit transaction request. The new limit processing application merges the data of the third data table and the first data table for summary calculation during limit checks, and continuously synchronizes the latest value of the first data table to the second data table. The static management module is used to stop the transaction processing of the old quota processing application after the completion of all traffic switching, so that the third data table in the old database enters the static data state. The migration module is used to migrate the third data table, which is in a static data state, to the new database and store it as the fourth data table. The limit check logic of the new limit processing application is switched from merging the third data table and the first data table to merging the fourth data table and the first data table, and the synchronization link from the first data table to the second data table is disconnected.
8. A device for implementing limit-based lossless control during system migration, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the method for achieving limit-based lossless control during system migration as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the method for implementing limit-based lossless control in system migration as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the method for implementing limit-based lossless control during system migration as described in any one of claims 1 to 6.
