A configuration information synchronization method, system, medium, and device
By adopting a multi-target architecture and logical isolation of full and incremental threads in the payment app, combined with batch number verification, the problem of excessive throughput pressure during the synchronization of marketing information in the payment app was solved, achieving high efficiency and accuracy in data synchronization, and ensuring the integrity of information and the normality of external access.
Patent Information
- Application Number
- CN202210843643.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-18
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2042-07-18
AI Technical Summary
Existing payment apps, during the synchronization of marketing information, face high throughput requirements that lead to excessive pressure on the backend storage area, affecting the real-time synchronization and update of marketing information.
A multi-target architecture is adopted, which separates data reading and writing operations through transformation and writing components, and uses message queues for data transmission. Combined with logical isolation of full and incremental threads and batch number verification, the efficiency and accuracy of data synchronization are ensured.
It achieves high scalability on the target side, reduces the pressure on the configuration source, ensures the efficiency and accuracy of data synchronization, avoids the situation where old data overwrites new data, and guarantees the normality of external access.
Smart Images

Figure CN115168493B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of database technology, and in particular to a method, system, medium, and device for synchronizing configuration information. Background Technology
[0002] Currently, payment apps typically run marketing campaigns. Marketing information within these campaigns (such as store details, coupons, brands, and promotions) needs to be configured or imported in batches through a marketing platform. For example, if an operations staff member modifies a store's name on the marketing platform, the changes are written to the platform's source database. By monitoring the source database, one or more updated marketing data entries are imported from the source database into the payment app's backend storage (such as cache or database). This allows each payment app to access the backend storage and achieve real-time updates to the marketing information displayed on its interface.
[0003] To achieve real-time synchronization of marketing information from the source database to the backend storage, this is primarily accomplished through data synchronization nodes. However, the high throughput requirements of the payment app create access pressure on the backend storage, thus affecting the real-time synchronization of marketing information and further causing delays in the payment app's updates to marketing information. Summary of the Invention
[0004] This application provides a configuration information synchronization method, system, medium, and device to improve the synchronization of configuration information.
[0005] In a first aspect, embodiments of this application provide a configuration information synchronization method, comprising: a conversion component in a synchronization system obtaining information to be synchronized from a configuration source and converting the information to be synchronized before storing it in a message queue, wherein the conversion processing is used to make the information to be synchronized conform to the usage requirements of the target end; N writing components in the synchronization system obtaining the converted information to be synchronized from the message queue and writing it to their respective N target ends; the N target ends being used to respond to external access.
[0006] In the above method, by setting multiple target endpoints, the target endpoints can meet various throughput requirements when responding to external access. When the external access target endpoint requires higher throughput, the number of target endpoints can be increased to expand the target endpoints and enable them to support higher throughput requirements. Conversely, when lower throughput is required, the number of target endpoints can be reduced, achieving high scalability of the target endpoints. At the same time, regardless of the number of target endpoints, only one component accesses the configuration source, reducing the pressure on the configuration source.
[0007] In one possible implementation, the conversion component includes a first control thread, a first incremental thread, and a first full thread; the writing component includes a second control thread, a second incremental thread, and a second full thread; the conversion component in the synchronization system obtains information to be synchronized from a configuration source, converts the information, and stores it in a message queue, including: the conversion component, based on the first control thread, starts the first incremental thread or the first full thread, and synchronizes the starting result to the second control threads of each of the N writing components; based on the first incremental thread, it obtains information to be synchronized newly added after the previous full cycle from the configuration source, converts the information, and stores it in an incremental message queue; based on the... The first full thread obtains each piece of information to be synchronized newly added during the full cycle from the configuration source, transforms the information, and stores it in the full message queue. The N writing components in the synchronization system obtain the transformed information to be synchronized from the message queue and write it to their respective N target terminals. This includes: for any writing component, the writing component starts the second incremental thread or the second full thread based on the startup result obtained by the second control thread; obtains the transformed information to be synchronized from the incremental message queue based on the second incremental thread and writes it to the corresponding target terminal; and obtains the transformed information to be synchronized from the full message queue based on the second full thread and writes it to the corresponding target terminal.
[0008] The above method achieves logical isolation between full threads and incremental threads; that is, when full threads are enabled, incremental threads are disabled, and vice versa. Furthermore, incremental threads ensure efficient configuration information synchronization, while full threads compensate for potential data defects in incremental threads.
[0009] In one possible implementation, the method further includes: the conversion component, based on the first control thread, generates a batch number corresponding to any full cycle when it arrives and synchronizes the batch number to the second control thread; storing the information to be synchronized in an incremental message queue after conversion processing includes: the conversion component, based on the first incremental thread, converts the information to be synchronized and adds the batch number before storing it in the incremental message queue; storing each piece of information to be synchronized in a full message queue after conversion processing includes: the conversion component, based on the first full thread, converts the information to be synchronized and adds the batch number before storing it in the full message queue; after the second incremental thread obtains the converted information to be synchronized from the incremental message queue and before writing it to the corresponding target end, the method further includes: determining, based on the second incremental thread, that the batch number of the converted information to be synchronized is the same as the batch number obtained from the second control thread; after the second full thread obtains the converted information to be synchronized from the full message queue and before writing it to the corresponding target end, the method further includes: determining, based on the second full thread, that the batch number of the converted information to be synchronized is the same as the batch number obtained from the second control thread. If the batch number of the converted information to be synchronized, determined based on the second incremental thread, is different from the batch number obtained from the second control thread, then the converted information to be synchronized is discarded. If the batch number of the converted information to be synchronized, determined based on the second full thread, is different from the batch number obtained from the second control thread, then the converted information to be synchronized is discarded.
[0010] By following the steps above, batch numbers can be used to distinguish between information to be synchronized before and after the full cycle has arrived, which can effectively avoid the situation where old data replaces new data.
[0011] In one possible implementation, the conversion component obtains first exception information during the execution of the first incremental thread or the first full thread based on the first control thread, and synchronizes the first exception information to the second control thread; the writing component stops the writing operation of the second incremental thread or the second full thread to the information to be synchronized based on the first exception information obtained by the second control thread.
[0012] By following the steps above, upon receiving the first abnormal message, the writing operation of the information to be synchronized can be stopped in time, avoiding the writing of incorrect information to be synchronized to the target end and ensuring that the target end can provide normal external access.
[0013] In one possible implementation, the writing component obtains second exception information during the execution of the second incremental thread or the second full thread based on the second control thread; the writing component stops the writing operation of the second incremental thread or the second full thread on the information to be synchronized based on the second exception information obtained by the second control thread.
[0014] By following the steps above, when the second abnormal information is received, the writing component can promptly stop writing the information to be synchronized and not continue writing the information to be synchronized to the target end, thus saving transmission resources.
[0015] In one possible implementation, stopping the write operation of the second incremental thread on the information to be synchronized includes: the write component discarding the information to be synchronized indicated by the first exception information, and / or the information to be synchronized indicated by the second exception information, through the second incremental thread. Stopping the write operation of the second full thread on the information to be synchronized includes: the write component discarding the information to be synchronized of the same batch number indicated by the first exception information and / or the second exception information, through the second full thread, and performing a rollback operation on the information to be synchronized of the same batch number already written to the target end.
[0016] By using the above method, it can be ensured that when abnormal information occurs, the information to be synchronized in the current batch will be discarded, but the original information to be synchronized in the previous batch on the target end will not be discarded. This ensures the integrity of the information on the target end and the normal operation of external access.
[0017] In one possible implementation, the first control thread synchronizes information with the second control thread through a signal control queue.
[0018] In the above method, the synchronization of information between the first control thread and the second control thread is achieved by using a signal control queue, which can effectively ensure that signal transmission is not interrupted and improve the reliability of information synchronization.
[0019] Secondly, embodiments of this application provide a data synchronization system comprising: a conversion component, a message queue, and N writing components; the conversion component is used to obtain information to be synchronized from a configuration source, convert the information to be synchronized, and store it in the message queue, the conversion being used to make the information to be synchronized conform to the usage requirements of the target end; the message queue is used to store the converted information to be synchronized; the N writing components are used to obtain the converted information to be synchronized from the message queue and write it to their respective N target ends; the N target ends are used to respond to external access.
[0020] In one possible implementation, the conversion component includes a first control thread, a first incremental thread, and a first full thread; the writing component includes a second control thread, a second incremental thread, and a second full thread; the message queue includes an incremental message queue and a full message queue; the first control thread is used to start the first incremental thread or the first full thread and synchronize the start result to the second control thread of each of the N writing components; the first incremental thread is used to obtain the information to be synchronized added after the previous full cycle from the configuration source, convert the information to be synchronized, and store it in the incremental message queue; the first full thread is used to obtain each piece of information to be synchronized added during the full cycle from the configuration source, convert the information to be synchronized, and store it in the full message queue; the second control thread is used to start the second incremental thread or the second full thread based on the obtained start result; the second incremental thread is used to obtain the converted information to be synchronized from the incremental message queue and write it to the corresponding target end; the second full thread is used to obtain the converted information to be synchronized from the full message queue and write it to the corresponding target end.
[0021] In one possible implementation, the first control thread is further configured to generate a batch number corresponding to any full cycle upon arrival and synchronize the batch number to the second control thread; the first incremental thread is further configured to convert the information to be synchronized, add the batch number, and store it in an incremental message queue; the first full cycle thread is further configured to convert the information to be synchronized, add the batch number, and store it in a full cycle message queue; the second incremental thread is further configured to determine whether the batch number of the converted information to be synchronized is the same as the batch number obtained from the second control thread, and if they are the same, write the converted information to be synchronized to the corresponding target end, otherwise discard the converted information to be synchronized; the second full cycle thread is further configured to determine whether the batch number of the converted information to be synchronized is the same as the batch number obtained from the second control thread, and if they are the same, write the converted information to be synchronized to the corresponding target end, otherwise discard the converted information to be synchronized.
[0022] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run, executes any of the methods described in the first aspect above.
[0023] Fourthly, embodiments of this application provide a computing device, including: a memory for storing program instructions; and a processor for calling the program instructions stored in the memory and executing the method in any of the designs in the first aspect above according to the obtained program.
[0024] Fifthly, embodiments of this application provide a computer program product that, when run on a processor, implements the method as described in any of the designs in the first aspect above.
[0025] The beneficial effects of the second to fifth aspects mentioned above can be specifically referred to as the beneficial effects that can be achieved by any of the designs in the first aspect mentioned above, and will not be elaborated here. Attached Figure Description
[0026] Figure 1 An exemplary schematic diagram of a scenario architecture provided by an embodiment of this application is shown;
[0027] Figure 2 An exemplary flowchart of a data synchronization method provided in an embodiment of this application is shown.
[0028] Figure 3 An exemplary schematic diagram of a system architecture provided in an embodiment of this application is shown;
[0029] Figure 4 An exemplary diagram illustrates a synchronous information system architecture provided in an embodiment of this application;
[0030] Figure 5 An exemplary flowchart of an information synchronization method provided in an embodiment of this application is shown.
[0031] Figure 6 An exemplary schematic diagram of a message queue provided in an embodiment of this application is shown;
[0032] Figure 7 This illustration shows another system architecture provided by an embodiment of the present application;
[0033] Figure 8 The following is an exemplary flowchart illustrating another information synchronization method provided in an embodiment of this application. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0035] Figure 1 This illustration shows a scenario architecture diagram provided by an embodiment of this application. Figure 1 As shown, the scenario architecture includes an operational database as the configuration source, a synchronization system, a backend storage medium as the target end, and the UnionPay App for accessing the backend storage medium.
[0036] The information displayed on the front-end interface of some apps is usually maintained by a dedicated operation platform, such as... Figure 1 As shown, the UnionPay app contains marketing information such as store information, coupon information, and marketing activity information. This information is typically maintained by a dedicated operations platform. For example, adding a new store, changing a store name, or configuring discount coupons for the Double Eleven shopping festival. Operations personnel configure this marketing information on the front-end interface of the operations platform and store it in the operations database. Then, a data synchronization system synchronizes the information from the operations database to the back-end storage of the UnionPay app. The data synchronization system generally includes three steps: data reading, data transformation, and data writing, which can be performed within a single node. Figure 2 An exemplary flowchart illustrates a data synchronization method provided in an embodiment of this application. Figure 2 As shown, the method includes:
[0037] Step 201: Read data containing marketing information from the operations database.
[0038] The data in the operations database is strongly related to marketing information, such as store names, coupon denominations and quantities, brand names, and promotional discount amounts. Operations personnel configure this information in real-time on the operations platform's front end, and then store it in the operations platform's database. When synchronizing data from the operations platform's database to the UnionPay app, data must first be retrieved from the operations platform's database.
[0039] Step 202: Convert the data format.
[0040] The data storage format of the backend storage medium for the UnionPay app is generally different from that of the operational database. Therefore, when importing data from the operational database to the backend storage medium of the UnionPay app, data format conversion is required. This step includes merging real-time configured marketing data. For example, if the coupon values of multiple stores change at the same time, to save transmission resources, this data is merged and organized into a format suitable for display in the UnionPay app.
[0041] Step 203: Write the converted data to the backend storage medium corresponding to the UnionPay app.
[0042] The backend storage media for the UnionPay app includes cache, databases, and search engines. For example, there's a remote dictionary server (Redis) and a search engine (Elasticsearch). Elasticsearch is a search server based on the full-text search engine (Lucene). It provides a distributed, multi-user full-text search engine based on a representational state transfer (RESTful web) interface. Elasticsearch is developed in Java and released as open source under the Apache License; it's a popular enterprise-level search engine.
[0043] In steps 201-203 above, the synchronization system connects to the operational database on one end and to the backend storage media of the UnionPay QuickPass APP on the other. This means that a single synchronization system can only synchronize data from one operational database to a set of backend storage media for the UnionPay QuickPass APP. However, for payment or shopping apps like the UnionPay QuickPass APP, the throughput requirements for accessing the backend storage media change in real time. Since the throughput of a single storage media set is limited, it cannot meet the APP's throughput requirements. For example, during a promotional campaign, the number of user accesses to the APP per unit time is far higher than usual. Using only one storage media set will cause system lag, affecting the campaign's progress. Therefore, before the promotional campaign begins, the number of storage media sets needs to be increased to meet the campaign's throughput requirements. Simultaneously, the number of data synchronization systems needs to be increased so that each storage media set can synchronize complete marketing data.
[0044] Figure 3 An exemplary schematic diagram of a system architecture provided in an embodiment of this application is shown, such as... Figure 3 The system shown includes a source database, N synchronization systems, and N back-end storage media. Each of the N synchronization systems is connected to the source database, and the other end of each synchronization system is connected to one of the N back-end storage media. These connections can be wired or wireless, and are not limited here. N is an integer greater than 1. While this system allows for flexible configuration of system throughput during data synchronization, it also increases the access volume of the synchronization systems to the source database, thus placing significant pressure on the source database. The number of synchronization systems and the number of back-end storage media, i.e., the size of N, are limited by the performance of the source database, and the scalability of the back-end storage media is also restricted.
[0045] Based on this, embodiments of this application provide an information synchronization method to improve the scalability of the backend storage medium and avoid the scalability of the backend storage medium being limited by the performance of the source database.
[0046] Figure 4 An exemplary schematic diagram of a synchronous information system provided in an embodiment of this application is shown. Figure 4 As shown, the system architecture includes a configuration source, an information synchronization system, and N target terminals. For example, the configuration source can be one of the above-mentioned... Figure 3 The source database in the system, the information synchronization system, and the synchronization system function similarly in the overall system architecture. The target end can be the aforementioned... Figure 3 The back-end storage medium in the process.
[0047] One possible implementation is, such as Figure 4 As shown, the aforementioned information synchronization system includes a conversion component, a message queue, and N write components. The conversion component is connected to a configuration source, reads data from the configuration source, converts the read data, and transmits the converted data to the message queue. Each write component can read data from the message queue and write the read data to the target end.
[0048] In another possible implementation, different threads can be set up in the information synchronization system. By switching between threads, the information in the configuration source can be synchronized to the target end in different modes.
[0049] It should be noted that the information synchronization system in this embodiment differs from that described above. Figure 1 The synchronization system in the above Figure 1 In a synchronous system, data reading, data conversion, and data writing all occur on a single node. This node can be a server or a CPU. To meet the high throughput requirements of the backend storage media, such as... Figure 3 As shown in the diagram, when multiple synchronization systems are set up to write data to the backend storage medium, each synchronization system needs to read data from the source database once when performing data synchronization, which puts a significant burden on the source database. However, the information synchronization system in this embodiment places data writing and data conversion into two separate nodes. Data reading and data conversion are performed through the conversion component of one node, while data writing is performed through the writing component of the other node.
[0050] A message queue is set up between the transformation component and the writing component. The message queue can be stored on a separate server, or it can be partitioned from the server of the writing node for dedicated storage. There is no limitation here.
[0051] based on Figure 4The architecture in Figure 5 This illustration shows a flowchart of an information synchronization method provided in an embodiment of this application. The flowchart is provided for clarity and ease of understanding. Figure 5 This example only shows one write component and one target end; multiple write components can be executed in parallel by referring to the steps in this embodiment. Figure 5 As shown, the method includes:
[0052] Step 501: The conversion component in the synchronization system obtains the information to be synchronized from the configuration source.
[0053] The configuration source can be one of the above. Figure 3 The source database in the system is used to store information such as stores and coupons that need to be synchronized with the operating platform. It can also be any other database or storage medium that needs to interact with other terminals.
[0054] Step 502: The conversion component performs conversion processing on the information to be synchronized, which is used to make the information to be synchronized meet the usage requirements of the target end.
[0055] Taking the example in step 501 above, if the information to be synchronized is the name of a store, the name of the store is stored in the configuration source. The conversion process can be to convert the Chinese store name into binary machine code, and then this binary machine code is the standard usage requirement of the target end.
[0056] Step 503: The conversion component stores the information to be synchronized after conversion processing into a message queue.
[0057] Step 504: The N writing components in the synchronization system retrieve the converted information to be synchronized from the message queue.
[0058] Figure 6 An exemplary schematic diagram of a message queue provided in an embodiment of this application is shown, such as... Figure 6 The message queue shown is a linear message queue, where data is stored in the order it was created. Figure 6 The message queue shown can store D data, where D is a positive integer. In this embodiment, the data producer of the message queue is a conversion component, and data 1, data 2, data 3, data 4, data 5... data D are the information to be synchronized after conversion by the conversion component. The consumers of the message queue are N writing components, and the N writing components can simultaneously obtain data from the message queue.
[0059] Step 505: The N writing components write the acquired, transformed information to be synchronized to their respective N target terminals. The N target terminals are used to respond to external access.
[0060] In the above method, by setting multiple target endpoints, the target endpoints can meet various throughput requirements when responding to external access. When the external access target endpoint requires higher throughput, the number of target endpoints can be increased to expand the target endpoints and enable them to support higher throughput requirements; conversely, when lower throughput is required, the number of target endpoints can be reduced. This achieves high scalability of the target endpoints. Furthermore, regardless of the number of target endpoints, only one component accesses the configuration source, reducing the pressure on the configuration source.
[0061] Typically, information synchronization systems establish incremental and full threads during information synchronization. The incremental thread monitors changes in the configuration source in real time. Whenever the data in the configuration source changes, the incremental thread is triggered to write the changed data to the target end and delete the old data in the target end. The full thread is triggered periodically. At the set time, it imports all data from the configuration source to the target end, achieving a complete data update.
[0062] Figure 7 This illustration shows another system architecture provided in an embodiment of this application. It is provided for clarity and ease of understanding. Figure 7 The image only shows one writing component and one target end, such as Figure 7 As shown, the conversion component is equipped with a first control thread, a first incremental thread, and a first full thread; the writing component is equipped with a second control thread, a second incremental thread, and a second full thread.
[0063] The conversion component starts the first incremental thread or the first full thread based on the first control thread, and synchronizes the startup result to the second control thread of each of the N writing components.
[0064] For example, the first control thread includes a full-increment switching component, used to switch the incremental thread to the full thread at a set time, or to switch to the incremental thread after the full thread has finished. Simultaneously with the switching, a switching signal is generated and synchronized to the second control thread in the writing component via a signal control queue.
[0065] In steps 501 to 503 above, the writing component can obtain the new information to be synchronized after the previous full cycle from the configuration source based on the first incremental thread, and store the information to be synchronized in the incremental message queue after conversion processing. Alternatively, it can obtain each piece of information to be synchronized during the full cycle from the configuration source based on the first full thread, and store the information to be synchronized in the full message queue after conversion processing.
[0066] In steps 504 and 505 above, the writing component starts either the second incremental thread or the second full thread based on the startup result obtained by the second control thread. Then, the writing component retrieves the converted information to be synchronized from the incremental message queue based on the second incremental thread and writes it to the corresponding target end; or, it retrieves the converted information to be synchronized from the full message queue based on the second full thread and writes it to the corresponding target end.
[0067] For example, the startup result obtained by the full-increment switching component in the second control thread can be used to switch between the incremental message queue and the full message queue.
[0068] By employing the above method, logical isolation between full threads and incremental threads can be achieved; that is, when full threads are enabled, incremental threads are disabled, and vice versa. This ensures that full threads can compensate for data deficiencies in incremental threads.
[0069] However, in the above Figure 7 In the information synchronization system, the conversion and writing components are located on two separate nodes. After the full thread is started, due to information delays in the message queue or failures in the propagation link, some information remains in the incremental thread's message queue. This information is from the configuration source before the set time. However, after the full thread is started, the information in the message queue is from the configuration source after the set time. After importing all the information and switching to the incremental thread, the information remaining in the incremental thread's queue will continue to be written to the target. This results in the older information before the set time overwriting the newer information after the set time on the target.
[0070] Therefore, this application introduces batch numbers to solve the above problems, and the specific implementation is as follows:
[0071] based on Figure 7 Information synchronization system in China Figure 8 This illustration shows a flowchart of another information synchronization method provided in an embodiment of this application. Figure 8 As shown, the method includes:
[0072] Step 801: The conversion component, based on the first control thread, generates a batch number corresponding to any full cycle when it arrives and synchronizes the batch number to the second control thread.
[0073] Under normal circumstances, full data synchronization is performed periodically, for example, every 24 hours. The batch number is an incrementing number starting from 0. Each time a full data synchronization cycle is reached, the batch number is incremented by 1, and the first control thread synchronizes the updated batch number to the second control thread.
[0074] Step 802: The conversion component converts the information to be synchronized based on the first full thread, adds a batch number, and stores it in the incremental message queue.
[0075] In this step, the conversion component adds a batch number suffix to each message when converting it. For example, if the batch number of a full cycle is 1, then a converted message can be "message-1". Then "message-1" is added to the full message queue.
[0076] Step 803: Based on the second full thread, determine whether the batch number of the converted information to be synchronized is the same as the batch number obtained from the second control thread; if yes, proceed to step 804; otherwise, proceed to step 805.
[0077] Taking "Information-1" in step 803 above as an example, the second full thread determines whether the batch number of the node being written is 1. If so, it means that "Information-1" is the information of this full synchronization, and step 804 is executed.
[0078] If the second full thread determines that the batch number of the information to be synchronized after conversion is different from the batch number obtained from the second control thread, it means that the information to be synchronized is very likely the residual data in the incremental thread before this full thread, and then step 805 is executed.
[0079] Step 804: After obtaining the converted information to be synchronized from the full message queue based on the second full thread, write it to the corresponding target end.
[0080] Step 805: Discard the converted information to be synchronized.
[0081] By following the steps above, batch numbers can be used to distinguish between information to be synchronized before and after the full cycle has arrived, which can effectively avoid the situation where old data replaces new data.
[0082] It should be noted that steps 801-805 above are illustrated using full information synchronization as an example. Incremental information synchronization can be performed in accordance with steps 801-805 above, and will not be repeated here.
[0083] In steps 501-503 above, the conversion component obtains the first exception information during the execution of the first full thread based on the first control thread, and synchronizes the first exception information to the second control thread.
[0084] In one possible example, the first error message might be caused by a conversion error in the conversion component when converting the format of the information to be synchronized. For example, the information to be synchronized is a price, but text information appears in the converted information.
[0085] In another possible example, the first exception message might be generated when the conversion component is unable to obtain data from the configuration source, such as due to a broken communication link with the configuration source or an error in the network transmission protocol.
[0086] For example, after the second control thread obtains the first exception information, it can control the writing component to stop the second full thread from writing the synchronization information.
[0087] By following the steps above, upon receiving the first abnormal message, the writing operation of the information to be synchronized can be stopped in time, avoiding the writing of incorrect information to be synchronized to the target end and ensuring that the target end can provide normal external access.
[0088] In steps 504 and 505 above, the writing component obtains the second exception information during the execution of the second full thread based on the second control thread; based on the second exception information obtained by the second control thread, the writing component stops the writing operation of the second full thread to be synchronized.
[0089] For example, the second exception message could be due to the write component's inability to retrieve data from the full message queue. This could be caused by a malfunction in the write component itself, preventing it from reading data from the full message queue, or by a disconnection between the write component and the full message queue. Upon receiving the second exception message, the write component will stop the write operation of the second full thread for the synchronization information.
[0090] By following the steps above, when the second abnormal information is received, the writing component can promptly stop writing the information to be synchronized and not continue writing the information to be synchronized to the target end, thus saving transmission resources.
[0091] It should be noted that the above explanation uses full information synchronization as an example. Incremental information synchronization can be performed in the same way, and will not be repeated here.
[0092] In one possible implementation, stopping the second incremental thread's write operation on the information to be synchronized can be achieved by the writing component discarding the data to be synchronized indicated by the first exception message through the second incremental thread, and / or, the data to be synchronized indicated by the second exception message. The data to be synchronized indicated by the first exception message can be data that has been converted but the conversion was incorrect, and the data to be synchronized indicated by the second exception message can be data in the message queue.
[0093] In another possible implementation, stopping the writing operation of the second full thread on the information to be synchronized can be achieved by the writing component discarding the information to be synchronized of the same batch number indicated by the first exception information and / or the second exception information through the second full thread, and performing a rollback operation on the information to be synchronized of the same batch number that has been written to the target end.
[0094] For example, the synchronization information of the same batch number written to the target end can be deleted, or a control signal can be sent to the target end to make the synchronization information of the same batch number written to the target end ineffective.
[0095] By using the above method, it can be ensured that when abnormal information occurs, the information to be synchronized in the current batch will be discarded, but the original information to be synchronized in the previous batch on the target end will not be discarded. This ensures the integrity of the information on the target end and the normal operation of external access.
[0096] Based on the same technical concept, embodiments of this application also provide a configuration information synchronization system. For example... Figure 4 As shown, the system includes: a conversion component, a message queue, and N writing components;
[0097] The conversion component is used to obtain the information to be synchronized from the configuration source, convert the information to be synchronized, and then store it in the message queue. The conversion process is used to make the information to be synchronized meet the usage requirements of the target end.
[0098] The message queue is used to store the information to be synchronized after conversion processing;
[0099] The N writing components are used to retrieve the converted information to be synchronized from the message queue and write it to their respective N target terminals; the N target terminals are used to respond to external access.
[0100] Based on the same technical concept, embodiments of the present invention also provide a computing device, including: a memory for storing program instructions;
[0101] The processor is used to call program instructions stored in the memory and execute them according to the obtained program. Figure 5 and Figure 8 The method shown.
[0102] Based on the same technical concept, embodiments of the present invention also provide a computer-readable storage medium, which, when the computer program product is run on a processor, implements the following: Figure 5 and Figure 8 The method shown.
[0103] Based on the same technical concept, embodiments of the present invention also provide a computer program product, which, when run on a processor, implements the following: Figure 5 and Figure 8 The method shown.
[0104] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0105] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0106] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0107] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0108] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for synchronizing configuration information, characterized in that, The method includes: The conversion component in the synchronization system obtains the information to be synchronized from the configuration source, converts the information to be synchronized, and stores it in the message queue. The conversion process is used to make the information to be synchronized meet the usage requirements of the target end. The N writing components in the synchronization system respectively obtain the converted information to be synchronized from the message queue and write it to their respective N target terminals; the N target terminals are used to respond to external access; The conversion component includes a first control thread, a first incremental thread, and a first full thread; the writing component includes a second control thread, a second incremental thread, and a second full thread. The conversion component in the synchronization system obtains the information to be synchronized from the configuration source, converts the information, and stores it in the message queue, including: The conversion component, based on the first control thread, starts the first incremental thread or the first full thread, and synchronizes the startup result to the second control thread of each of the N writing components. Based on the first incremental thread, the newly added information to be synchronized after the previous full cycle is obtained from the configuration source, and the information to be synchronized is converted and stored in the incremental message queue; based on the first full cycle, the newly added information to be synchronized during the full cycle is obtained from the configuration source, and the information to be synchronized is converted and stored in the full message queue. The N writing components in the synchronization system respectively retrieve the converted information to be synchronized from the message queue and write it to their respective N target terminals, including: For any write component, the write component starts the second incremental thread or the second full thread based on the startup result obtained by the second control thread; The second incremental thread retrieves the converted information to be synchronized from the incremental message queue and writes it to the corresponding target end; the second full thread retrieves the converted information to be synchronized from the full message queue and writes it to the corresponding target end.
2. The method as described in claim 1, characterized in that, The method further includes: The conversion component, based on the first control thread, generates a batch number corresponding to any full cycle when a full cycle arrives and synchronizes the batch number to the second control thread. The information to be synchronized is converted and then stored in the incremental message queue, including: The conversion component converts the information to be synchronized based on the first incremental thread, adds the batch number, and stores it in the incremental message queue. After the information to be synchronized is transformed and processed, it is stored in the full message queue, including: The conversion component converts the information to be synchronized based on the first full thread, adds the batch number, and stores it in the full message queue. After the second incremental thread obtains the transformed information to be synchronized from the incremental message queue and before writing it to the corresponding target end, the process further includes: Based on the second incremental thread, the batch number of the converted information to be synchronized is the same as the batch number obtained from the second control thread; After the second full thread retrieves the transformed information to be synchronized from the full message queue, and before writing it to the corresponding target end, the process further includes: The batch number of the converted information to be synchronized is determined by the second full thread and is the same as the batch number obtained from the second control thread.
3. The method as described in claim 2, characterized in that, The method further includes: If the batch number of the converted information to be synchronized is different from the batch number obtained from the second control thread, the converted information to be synchronized is discarded.
4. The method as described in claim 2, characterized in that, The method further includes: If the batch number of the converted information to be synchronized, determined based on the second full thread, is different from the batch number obtained from the second control thread, then the converted information to be synchronized is discarded.
5. The method as described in claim 1, characterized in that, The method further includes: The conversion component, based on the first control thread, obtains the first exception information during the execution of the first incremental thread or the first full thread, and synchronizes the first exception information to the second control thread. The writing component stops the writing operation of the second incremental thread or the second full thread on the information to be synchronized based on the first abnormal information obtained by the second control thread.
6. The method as described in claim 5, characterized in that, The method further includes: The writing component, based on the second control thread, obtains second exception information during the execution of the second incremental thread or the second full thread. The writing component stops the writing operation of the second incremental thread or the second full thread on the information to be synchronized based on the second exception information obtained by the second control thread.
7. The method as described in claim 6, characterized in that, Stop the second incremental thread from writing information to be synchronized, including: The writing component discards the information to be synchronized indicated by the first exception information through the second incremental thread, and / or the information to be synchronized indicated by the second exception information.
8. The method as described in claim 6, characterized in that, Stop the second full thread from writing synchronization information, including: The writing component discards the first exception information and / or the batch number of information to be synchronized indicated by the second exception information through the second full thread, and performs a rollback operation on the batch number of information to be synchronized that has been written to the target end.
9. The method as described in claim 5 or 6, characterized in that, The method further includes: The first control thread synchronizes information with the second control thread through a signal control queue.
10. A configuration information synchronization system, characterized in that, The system includes: a conversion component, a message queue, and N writing components; The conversion component is used to obtain information to be synchronized from the configuration source, convert the information to be synchronized, and store it in a message queue. The conversion process is used to make the information to be synchronized meet the usage requirements of the target end. The conversion component is provided with a first control thread, a first incremental thread, and a first full thread. When the conversion component performs the step of obtaining the information to be synchronized from the configuration source, converting the information to be synchronized, and storing it in the message queue, it is specifically used for: Based on the first control thread, start the first incremental thread or the first full thread, and synchronize the startup result to the second control thread of each of the N writing components; Based on the first incremental thread, the newly added information to be synchronized after the previous full cycle is obtained from the configuration source, and the information to be synchronized is converted and stored in the incremental message queue; based on the first full cycle, the newly added information to be synchronized during the full cycle is obtained from the configuration source, and the information to be synchronized is converted and stored in the full message queue. The message queue is used to store the information to be synchronized after conversion processing; The N writing components are used to retrieve the converted information to be synchronized from the message queue and write it to their respective N target terminals; the N target terminals are used to respond to external access; each writing component is equipped with a second control thread, a second incremental thread, and a second full thread; When the N writing components perform the steps of retrieving the transformed information to be synchronized from the message queue and writing it to their respective N target terminals, they are specifically used for: For any write component, the write component starts the second incremental thread or the second full thread based on the startup result obtained by the second control thread; The second incremental thread retrieves the converted information to be synchronized from the incremental message queue and writes it to the corresponding target end; the second full thread retrieves the converted information to be synchronized from the full message queue and writes it to the corresponding target end.
11. The system as claimed in claim 10, characterized in that, The message queue includes an incremental message queue and a full message queue; The first control thread is used to start the first incremental thread or the first full thread, and synchronize the start result to the second control thread of each of the N write components; The first incremental thread is used to obtain the new information to be synchronized after the previous full cycle from the configuration source, and to convert and process the information to be synchronized and store it in the incremental message queue. The first full thread is used to obtain each piece of information to be synchronized newly added during the full cycle from the configuration source and to convert and process the information to be synchronized and then store it in the full message queue. The second control thread is used to start the second incremental thread or the second full thread based on the obtained startup result; The second incremental thread is used to obtain the converted information to be synchronized from the incremental message queue and write it to the corresponding target end; The second full thread is used to retrieve the converted information to be synchronized from the full message queue and write it to the corresponding target end.
12. The system as claimed in claim 11, characterized in that, The first control thread is also configured to generate a batch number corresponding to the full volume period when any full volume period arrives and synchronize the batch number to the second control thread; The first incremental thread is also used to convert and process the information to be synchronized, add the batch number, and then store it in the incremental message queue; The first full thread is also used to convert and process the information to be synchronized, add the batch number, and then store it in the full message queue; The second incremental thread is also used to determine whether the batch number of the converted information to be synchronized is the same as the batch number obtained from the second control thread. If they are the same, the converted information to be synchronized is written to the corresponding target end; if they are different, the converted information to be synchronized is discarded. The second full thread is also used to determine whether the batch number of the converted information to be synchronized is the same as the batch number obtained from the second control thread. If they are the same, the converted information to be synchronized is written to the corresponding target end; if they are different, the converted information to be synchronized is discarded.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, performs the method as described in any one of claims 1 to 9.
14. A computing device, characterized in that, include: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the method as described in any one of claims 1 to 9 according to the obtained program.
Citation Information
Patent Citations
DB2 database data synchronization method, device and system
CN110737720A
Data exchange method and system based on full fragmentation and incremental log analysis
CN111339103A