Configuration update synchronization method and device

By generating configuration summary information on the client and verifying it with the configuration center, the problem of inconsistency between the client and the configuration center is solved, and the consistency synchronization of configuration is achieved, and the reliability and correctness of the system are improved.

CN112181926BActive Publication Date: 2025-03-18WEBANK (CHINA)
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011179079.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-29
Publication Date
2025-03-18
Estimated Expiration
2040-10-29

AI Technical Summary

Technical Problem

The existing technology cannot ensure that the configurations of the client and the configuration center are synchronous and consistent, resulting in the client that may miss configuration changes during downtime or disconnection, and the use of the old configuration will affect the correct operation of the system.

Method used

The summary information of each group of configuration verification data is generated on the client and sent to the configuration center for verification. If inconsistencies are found, obtain the corresponding configuration information from the configuration center for calibration to ensure that the configuration between the client and the configuration center is consistent.

Benefits of technology

The configuration consistency synchronization between the client and the configuration center is achieved, which avoids system operation abnormalities caused by inconsistent configurations and improves the reliability of business operations of financial institutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112181926B_ABST
    Figure CN112181926B_ABST
Patent Text Reader

Abstract

The present invention discloses a configuration update synchronization method and device, wherein the method is: if the client successfully obtains the updated configuration information from the configuration center, then the full configuration information is updated according to the updated configuration information; at a preset time, the client performs consistency synchronization in the following manner: the client generates each first summary information of each group of configuration verification data; the client sends each group of configuration item keywords and each first summary information of each group of configuration verification data to the configuration center; if the client receives a synchronization request sent by the configuration center, the configuration information corresponding to the synchronization request is obtained from the configuration center, thereby completing consistency synchronization. When the above method is applied to financial technology (Fintech), it can quickly compare whether each group of configuration verification data of the client is consistent with that of the configuration center through the summary information, and obtain the corresponding configuration information, so as to calibrate the configuration information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of configuration management in the field of financial technology (Fintech), and in particular to a configuration update synchronization method and device. Background Art

[0002] With the development of computer technology, more and more technologies are being applied in the financial field. Traditional finance is gradually transforming to Fintech. However, due to the security and real-time requirements of the financial industry, higher requirements are also placed on technology. Financial institutions have a low tolerance for misconfiguration. Therefore, it is crucial to ensure that the configuration of the client and the configuration center are synchronized and consistent.

[0003] However, in the current solution, when the client starts, it will send a registration request to register with the configuration center. After successful registration, when the configuration changes, the configuration center will send new configuration information to all registered clients. After the client receives the configuration center, it will save the configuration information. However, when the client is down or offline, the configuration change of the configuration center may be missed, and the configuration change cannot be synchronized to the client. At this time, the client will still use the old configuration after repair and startup, thus affecting the correct operation of the system. Therefore, in the current solution, it cannot guarantee that the configuration of the client and the configuration center are synchronized and consistent, which is a problem that needs to be solved urgently. Summary of the invention

[0004] The present invention provides a configuration update synchronization method and device, which solves the problem in the prior art that the synchronization of configurations between a client and a configuration center cannot be guaranteed.

[0005] In a first aspect, the present invention provides a configuration update synchronization method, comprising: if the client successfully obtains updated configuration information from a configuration center, the full configuration information is updated according to the updated configuration information; at a preset time, the client performs consistency synchronization in the following manner: the client generates each first summary information of each group of configuration verification data; for any group of configuration verification data in the groups of configuration verification data, the group of configuration verification data is the configuration information of at least one configuration item in each configuration item of the full configuration information; the configuration information of the at least one configuration item is arranged according to a preset arrangement rule; the client sends each group of configuration item keywords and the first summary information of the groups of configuration verification data to the configuration center; if the client receives a synchronization request sent by the configuration center, the configuration information corresponding to the synchronization request is obtained from the configuration center, thereby completing consistency synchronization; the synchronization request is used to indicate that the second summary information generated by at least one group of configuration verification data in the configuration center is inconsistent with the first summary information of the at least one group of configuration verification data.

[0006] Under the above method, after the client successfully obtains the updated configuration information and updates the full configuration information, it will also perform a consistency check at a preset time. Even if the full configuration information in the client is inconsistent with the full configuration information in the configuration center, the summary information can be calculated in groups. Since the configuration information in each group of configuration verification data is arranged according to a preset arrangement rule, each group of configuration verification data should be the same if configured correctly. Therefore, it is possible to quickly compare whether each group of configuration verification data of the client is consistent with that of the configuration center, obtain a synchronization request indicating at least one group of configuration verification data, and obtain the corresponding configuration information, thereby performing configuration information calibration.

[0007] Optionally, the preset moment is a moment in the jth second preset period within the i-th first preset period, where i and j are positive integers; the first preset period includes multiple second preset periods; the preset moment is obtained in the following manner: based on the update results of the full configuration information in each second preset period within the i-1th first preset period, the jth second preset period is selected in the i-th first preset period; based on the update results of the full configuration information in at least one second preset period before the j-th second preset period, the preset moment is selected in the j-th second preset period.

[0008] In the above method, the update results of the full configuration information in each second preset period within the i-1th first preset period can effectively represent the update status of the i-1th first preset period. Then, the rules of adjacent first preset periods can more specifically select the jth second preset period. Further, the update results in at least one second preset period before the jth second preset period can effectively represent the update rules of the full configuration information in the adjacent first preset period, so that the preset time can be more specifically selected based on the rules in the historical second preset periods.

[0009] Optionally, the preset moment is specifically any one of multiple moments in the j-th second preset period; the multiple moments are specifically obtained in the following manner: taking the update moment of the full configuration information in at least one second preset period as n update moments; n is a positive integer; based on the n update moments, according to preset statistical processing rules, the multiple moments are obtained.

[0010] In the above method, the n update moments of the full configuration information in the at least one second preset period are historical update moments. If the full configuration information is verified and synchronized in time after the update moment, the consistency of the configuration information is enhanced. Furthermore, based on the n update moments and according to the preset statistical processing rules, a reasonable plurality of moments are selected to fit the possible update moments in the jth second preset period, thereby enhancing the consistency of the configuration information.

[0011] Optionally, the multiple moments are obtained according to the n update moments according to preset statistical processing rules, including: selecting multiple candidate moments according to the n update moments in a preset time order; and obtaining the multiple moments according to the average of the time differences between the multiple candidate moments and the n update moments.

[0012] Under the above method, multiple candidate moments are selected according to the ranking in preset time order, and multiple representative moments can be selected first. The average of the time differences between the n update moments represents the expectation of changes after each full configuration information update. Therefore, the multiple moments obtained in combination with the multiple candidate moments can further fit the possible update moments within the jth second preset period, thereby enhancing the consistency of the configuration information.

[0013] Optionally, selecting the jth second preset period in the i-th first preset period based on the update results of the full configuration information in each second preset period within the i-1th first preset period includes: obtaining the first m second preset periods with the largest number of updates of the full configuration information within the i-1th first preset period; and selecting the jth second preset period in the i-th first preset period based on the first m second preset periods.

[0014] Under the above method, the second preset period with the most updates in the i-th first preset period can be estimated based on the m second preset periods, so that the second preset period with the most possible updates can be selected in a targeted manner, so that the second preset period with the most updates can be checked more frequently to enhance the consistency of the configuration information.

[0015] Optionally, if the client fails to obtain the updated configuration information from the configuration center and the number of failures is less than a preset retry threshold, the client re-obtains the updated configuration information from the configuration center according to a third preset period; the preset retry threshold is determined based on statistics of historical successful retries.

[0016] Under the above method, if the update configuration information fails to be obtained from the configuration center and the number of failures is less than the preset retry threshold, the update configuration information is re-obtained from the configuration center according to the third preset period, and the preset retry threshold is determined based on the statistics of the historical number of successful retries. It will not blindly retry multiple times, nor will it retry too little, thereby increasing the consistency of the full configuration information during the update phase.

[0017] Optionally, the client stores the full configuration information in the following manner: the client stores the keywords of the configuration items and the corresponding configuration information in the form of key-value pairs in accordance with the preset arrangement rule.

[0018] In the above manner, the keywords of each configuration item and the corresponding configuration information are stored according to the preset arrangement rules, and the storage in the form of key-value pairs is more structured, so that it is easier to obtain each set of verification data and more convenient to verify and synchronize the configuration information.

[0019] Optionally, each group of configuration verification data includes only one group of configuration verification data, and the group of configuration verification data is the full configuration information.

[0020] In the above manner, each group of configuration verification data contains only one group of configuration verification data, so that the full amount of configuration information can be verified and synchronized at one time.

[0021] In a second aspect, the present invention provides a configuration update synchronization device, comprising: an acquisition module, for updating the full configuration information according to the updated configuration information if the updated configuration information is successfully acquired from the configuration center; a processing module, for performing consistency synchronization at a preset time in the following manner: generating first summary information of each group of configuration verification data; for any group of configuration verification data in the groups of configuration verification data, the group of configuration verification data is the configuration information of at least one configuration item in the configuration items of the full configuration information; the configuration information of the at least one configuration item is arranged according to a preset arrangement rule; sending the configuration item keywords of each group of configuration verification data and the first summary information to the configuration center; if a synchronization request sent by the configuration center is received, obtaining the configuration information corresponding to the synchronization request from the configuration center, thereby completing consistency synchronization; the synchronization request is used to indicate that the second summary information generated by at least one group of configuration verification data in the configuration center is inconsistent with the first summary information of the at least one group of configuration verification data.

[0022] Optionally, the preset moment is a moment in the jth second preset period within the i-th first preset period, where i and j are positive integers; the first preset period includes multiple second preset periods; the preset moment is obtained in the following manner: based on the update results of the full configuration information in each second preset period within the i-1th first preset period, the jth second preset period is selected in the i-th first preset period; based on the update results of the full configuration information in at least one second preset period before the j-th second preset period, the preset moment is selected in the j-th second preset period.

[0023] Optionally, the preset moment is specifically any one of multiple moments in the j-th second preset period; the multiple moments are specifically obtained in the following manner: taking the update moment of the full configuration information in at least one second preset period as n update moments; n is a positive integer; based on the n update moments, according to preset statistical processing rules, the multiple moments are obtained.

[0024] Optionally, the multiple moments are obtained according to the n update moments according to preset statistical processing rules, including: selecting multiple candidate moments according to the n update moments in a preset time order; and obtaining the multiple moments according to the average of the time differences between the multiple candidate moments and the n update moments.

[0025] Optionally, selecting the jth second preset period in the i-th first preset period based on the update results of the full configuration information in each second preset period within the i-1th first preset period includes: obtaining the first m second preset periods with the largest number of updates of the full configuration information within the i-1th first preset period; and selecting the jth second preset period in the i-th first preset period based on the first m second preset periods.

[0026] Optionally, the processing module is also used to: if the update configuration information fails to be obtained from the configuration center and the number of failures is less than a preset retry threshold, then the update configuration information is re-obtained from the configuration center according to a third preset period; the preset retry threshold is determined based on the statistics of historical successful retries.

[0027] Optionally, the processing module is further used to store the full configuration information in the following manner: according to the preset arrangement rule, the keywords of each configuration item and the corresponding configuration information are stored in the client in the form of key-value pairs.

[0028] The beneficial effects of the above-mentioned second aspect and each optional device of the second aspect can refer to the beneficial effects of the above-mentioned first aspect and each optional method of the first aspect, and will not be repeated here.

[0029] In a third aspect, the present invention provides a computer device, including a program or an instruction, which, when executed, is used to execute the above-mentioned first aspect and each optional method of the first aspect.

[0030] In a fourth aspect, the present invention provides a storage medium, comprising a program or an instruction, which, when executed, is used to execute the above-mentioned first aspect and each optional method of the first aspect.

[0031] These and other aspects of the present invention will become more apparent from the following description of the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0033] Figure 1 A schematic diagram of a flow chart corresponding to a configuration update synchronization method provided in an embodiment of the present invention;

[0034] Figure 2 A schematic diagram of a specific process flow corresponding to a configuration update synchronization method provided by an embodiment of the present invention;

[0035] Figure 3 A schematic diagram of the structure of a configuration update synchronization device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0037] During the operation of financial institutions (banking institutions, insurance institutions or securities institutions) (such as bank loan business, deposit business, etc.), financial institutions have a low tolerance for incorrect configurations. Therefore, it is crucial to ensure that the configurations of the client and the configuration center are synchronized. Currently, when the client is down or offline, the configuration changes of the configuration center may be missed, and the configuration changes cannot be synchronized to the client. In this case, the client will still use the old configuration after the repair and startup, thus affecting the correct operation of the system. This situation does not meet the needs of banks and other financial institutions, and cannot guarantee the efficient operation of various businesses of financial institutions. For this reason, if Figure 1 As shown, the present application provides a configuration update synchronization method.

[0038] Step 101: If the client successfully obtains the updated configuration information from the configuration center, the client updates the full configuration information according to the updated configuration information.

[0039] Step 102: At a preset time, the client generates first summary information of each set of configuration verification data.

[0040] Step 103: The client sends each group of configuration item keywords of each group of configuration verification data and each first summary information to the configuration center.

[0041] Among them, each group of configuration item keywords can be used to identify the configuration items in each group of configuration verification data.

[0042] Step 104: If the client receives a synchronization request sent by the configuration center, the client obtains configuration information corresponding to the synchronization request from the configuration center, thereby completing consistency synchronization.

[0043] In steps 101 to 104, for any one of the groups of configuration verification data, the group of configuration verification data is the configuration information of at least one configuration item in the configuration items of the full configuration information; the configuration information of the at least one configuration item is arranged according to a preset arrangement rule. The synchronization request is used to indicate that the second summary information generated by at least one group of configuration verification data in the configuration center is inconsistent with the first summary information of the at least one group of configuration verification data.

[0044] It should be noted that in steps 101 to 104, verification is performed according to the required configuration information. If the first summary information of one or more groups of configuration verification data is inconsistent with the corresponding second summary information in the configuration information, only this group or groups will be synchronized.

[0045] For example, the full configuration information has 10 configuration items: configuration item 1, configuration item 2, configuration item 3, configuration item 4, configuration item 5, configuration item 6, configuration item 7, configuration item 8, configuration item 9, and configuration item 10.

[0046] The first group of configuration verification data includes: configuration information of configuration item 1, configuration information of configuration item 2, and configuration information of configuration item 3;

[0047] The second group of configuration verification data is: configuration information of configuration item 4 and configuration information of configuration item 5;

[0048] The third group of configuration verification data is: configuration information of configuration item 6, configuration information of configuration item 7, and configuration information of configuration item 8;

[0049] The fourth group of configuration verification data is: configuration information of configuration item 9 and configuration information of configuration item 10.

[0050] Then the first summary information generated by the client for the first set of configuration verification data is summary information A1; the first summary information generated for the second set of configuration verification data is summary information A2; the first summary information generated for the third set of configuration verification data is summary information A3; and the first summary information generated for the fourth set of configuration verification data is summary information A4.

[0051] The client sends the keywords of the configuration items of the first to fourth groups of configuration verification data and the first summary information A1 to A4 to the configuration center, so that the configuration center can know which configuration items' configuration information needs to be verified.

[0052] Then, the configuration center also finds the configuration information corresponding to the configuration item keyword and generates the second summary information. For example, the configuration center receives the configuration item keyword of the first group of configuration verification data, and also knows that the configuration items to be verified in this group include the configuration information of configuration items 1 to 3. It also generates the second summary information B1 for the configuration information of configuration items 1 to 3, and then compares A1 and B1 to see if they are consistent. If they are consistent, the verification passes. If they are inconsistent, it is necessary to send a synchronization request to the client to send the configuration information of configuration items 1 to 3 to the client.

[0053] It should be noted that the configuration information of the configuration items in the above-mentioned 1st to 4th groups of configuration verification data must be distinguished in order, that is, they must be arranged according to preset arrangement rules, so as to ensure that when each group of configuration verification data is the same as the configuration information of the configuration items in the configuration center, the generated summary information is the same; for example, the first summary information A1 is generated by the configuration information of configuration item 1, the configuration information of configuration item 2, and the configuration information of configuration item 3, but the first summary information generated by the configuration information of configuration item 2, the configuration information of configuration item 1, and the configuration information of configuration item 3 is not A1. The configuration information needs to know the order of the configuration items in each group of configuration verification data in order to perform effective consistency verification.

[0054] Particularly, in an optional implementation manner, each group of configuration verification data includes only one group of configuration verification data, and the group of configuration verification data is the full configuration information.

[0055] For example, the group of coordination verification data includes configuration information of configuration items 1 to 10, and the generated full configuration information is A10.

[0056] In an optional implementation manner, the client stores the full configuration information in the following manner:

[0057] The client stores the keywords of the configuration items and the corresponding configuration information in the form of key-value pairs in the client according to the preset arrangement rule.

[0058] For example, the configuration items may be arranged directly in alphabetical order az of the keywords.

[0059] Furthermore, the configuration information of each configuration item can be obtained in order according to the preset arrangement rule, and the configuration center can also agree to follow the preset arrangement rule. Then, when the keyword of the configuration item is received, the corresponding configuration information can be quickly found in order, thereby improving the efficiency of consistency verification.

[0060] It should be noted that the preset time can be selected in a variety of ways, such as when the system is started, the time obtained by calculation is used to periodically execute the consistency synchronization task.

[0061] In an optional implementation manner (hereinafter referred to as an implementation manner based on a preset period), the preset moment is a moment in the jth second preset period within the i-th first preset period, where i and j are positive integers; the first preset period includes a plurality of the second preset periods; the preset moment is obtained in the following manner:

[0062] According to the update results of the full configuration information in each second preset period within the i-1th first preset period, the jth second preset period is selected in the i-th first preset period; according to the update results of the full configuration information in at least one second preset period before the j-th second preset period, the preset time is selected in the j-th second preset period.

[0063] The update result of the full configuration information may include the number of updates and the amount of updated data.

[0064] For example, the first preset period is a month, and the second preset period is a day; the i-1th first preset period is September, and the ith first preset period is October. The date for consistency synchronization in October can be selected based on the amount of updated data of the full configuration information every day in September. For example, the dates with the largest amount of updated data of the full configuration information in September are September 5, September 15, and September 28. It can be inferred that under normal business operation, the dates with the largest amount of updated data in October are also close to October 5, October 15, and October 28. Then October 5, October 15, and October 28 can be selected as the dates for consistency synchronization. Further settings can be made, such as skipping holidays, that is, jumping directly from October 5 to October 8. The jth second preset period is a day among October 5, October 15, and October 28, and the preset time is the time of this day.

[0065] In an implementation based on a preset cycle, a possible scenario is:

[0066] The preset moment is specifically any one of the multiple moments in the jth second preset period; the multiple moments are specifically obtained in the following manner: the update moment of the full configuration information in at least one second preset period is taken as n update moments; n is a positive integer; based on the n update moments, the multiple moments are obtained according to the preset statistical processing rules.

[0067] For example, the jth second preset period is October 28, and the at least one second preset period is 7 days. The update times from October 21 to October 27 can be selected as n update times. If n update times are 70 update times, then multiple times are selected based on these 70 update times.

[0068] It should be noted that the values ​​of the n update times are based on the second preset period, for example, 09:30 on October 21 and 09:30 on October 22 have the same value.

[0069] More specifically, in the above situation, the specific method of obtaining the multiple moments may be:

[0070] According to the n update moments, multiple candidate moments are selected according to a preset time order; and according to the average of the time differences between the multiple candidate moments and the n update moments, the multiple moments are obtained.

[0071] Specifically, after the above 70 update times are arranged in order, the 21st update time 07:15, the 42nd update time 11:10 and the 61st update time 19:20 are selected, so that three discretely distributed update times are selected to more evenly reflect the update situation in different time periods; and the average time difference of the 70 update times is 0.5 hours, the 3 candidate times can be added to the average, then the multiple times can be 07:55, 11:40, 19:50.

[0072] In an implementation method based on a preset period, a possible scenario for selecting the j-th second preset period is:

[0073] Obtain the first m second preset periods in which the full configuration information is updated the most times within the (i-1)th first preset period; and select the jth second preset period in the (i)th first preset period based on the first m second preset periods.

[0074] For example, the full configuration information is updated most frequently on June 5, June 15, and June 28 in June, so July 5, July 15, and July 28 can be selected as the dates for consistency synchronization, and further settings can be made.

[0075] It should be noted that another situation corresponding to step 101 is as follows:

[0076] If the client fails to obtain the updated configuration information from the configuration center and the number of failures is less than a preset retry threshold, the client re-obtains the updated configuration information from the configuration center according to a third preset period; the preset retry threshold is determined based on statistics of historical successful retries.

[0077] For example, the preset retry times threshold is twice the average value of the historical successful retry times, so as to cover most of the retries that can be successful.

[0078] Combine the following Figure 2 , detailed description Figure 1 The configuration update synchronization method shown. It can include the following three aspects of consistency synchronization protection: first, continuous retries during the process of pushing the updated configuration information (also called configuration change events) for full configuration information update; second, the preset time is when the system starts, check consistency, and perform consistency synchronization; third, the preset time is the start time of the scheduled task, and the consistency is checked according to the scheduled task, and consistency synchronization is performed. It should be noted that Figure 2 The process shown is only Figure 1 A more detailed explanation is not intended to Figure 1 Limitation of the method.

[0079] The first process is as follows:

[0080] When the configuration center pushes a configuration change event to the client, the configuration change event can be any of the following events: configuration addition event, configuration update event, configuration deletion event, and configuration full synchronization event.

[0081] When the client receives a configuration change event from the configuration center, it can initiate a configuration information query request to query the latest configuration information from the configuration center. After obtaining the latest configuration information, it can first save the configuration information locally, and then save the configuration information to the memory. The time when the client receives the configuration change event from the configuration center will be recorded as the historical update time to facilitate intelligent scheduling and consistency synchronization.

[0082] It should be noted that if the client fails to pull the latest configuration from the configuration center, it will retry at most M times (for example, 20 times), and the value of M will be obtained based on the statistics of the number of successful retries.

[0083] Specifically, the value is twice the average number of successful retries. For example, if k retries are made, the value is (m1+m2+m3+...+mk)*2 / k=10, and the interval between each retry is 10 seconds.

[0084] If a retry succeeds, the subsequent processing logic will continue according to the updated configuration information. After the retry succeeds, the number of successful retries will be recorded. Before each abnormal retry, it will check whether the number of retries exceeds M times. If it still fails after more than M times, an alarm message will be printed and an abnormal notification will be pushed to the relevant personnel. Manual intervention can be made. If the retry fails after M times, it will wait for a certain period of time (such as half an hour) to reschedule the configuration and pull the configuration information.

[0085] If the configuration center does not receive a configuration information query request within a certain period of time (10 minutes), it will push the configuration change event to the client again.

[0086] The second process is as follows:

[0087] Secondly, intelligent slicing can be used for consistency synchronization, that is, the full configuration information is grouped and the configuration verification data of each group is verified.

[0088] When the client starts the service, it will first read the configuration information contained in the local client. After reading the client's configuration key, the configuration information key can be sorted alphabetically, and then the configuration information can be obtained from az in turn. After obtaining the configuration, these configurations will be combined in the form of key-value pairs. If it is found that the size of the read configuration information exceeds the set data volume (such as 64M, which can be automatically matched according to the heap memory size configured by the client virtual machine, such as using 1 / 10 of the configured maximum heap memory as the benchmark value), the first summary value will be calculated based on the current set of configuration verification data.

[0089] The client then calculates the first summary information of the remaining configuration information in the same way according to the logic of sharding, and then initiates a request (which needs to include the identifier of the configuration item, such as the keyword and the first summary value of the configuration item in a set of configuration principles) to the configuration center. After receiving the request, the configuration center server will calculate the second summary information in the same sharding manner as the client, and compare it with the first summary information sent by the client to see if they are consistent.

[0090] If each first summary value is consistent with the corresponding second summary value, it means that the full configuration information of the client and the configuration center are consistent, and the server will return a response to the client indicating that the configuration information is consistent. If the summary information of any set of configuration verification data is inconsistent, it means that the full configuration information of the client and the configuration center is inconsistent, and the configuration center will return a response to the client indicating that the configuration information of the shard is inconsistent.

[0091] The client receives the returned response. If the response is that the configuration information is consistent, the full configuration information is read into the memory and the client starts running normally. If the response is that the configuration verification data of some groups is inconsistent, a request is initiated to pull the configuration information of the group, pull the configuration information of the group locally, save it to a local file first, and then save it to the memory. This improves the efficiency of consistency verification.

[0092] The third process is as follows:

[0093] During operation, the client will detect the time when the configuration center pushes configuration changes on a weekly basis, analyze the regularity of configuration change time, and match a scheduling plan that automatically detects the consistency of the full configuration information. As the full configuration information changes, the scheduling plan will also be automatically optimized. Analyze the time points of each configuration change on a weekly basis.

[0094] First, based on the daily dimension, according to the n update times (such as a week) in the recent period (such as a week), the update times a, b, and c corresponding to the rankings 2 / 7, 4 / 7, and 6 / 7 are calculated respectively (the number of update times is configurable, and 3 update times are taken as an example here), and the mean m of the difference between the n update times is calculated. Then, the three values ​​of a, b, and c are added to the calculated mean m to obtain the new a1, b1, and c1.

[0095] According to the dates of previous configuration changes, the 8 most frequently updated dates in a month are calculated. If the corresponding date is a holiday, it is postponed to the next working day, so as to obtain 8 dates. During these 8 dates, the program initiates a scheduling check for configuration consistency at the three update times a1, b1, and c1 every day. If there is a push on the same day, an additional consistency check will be initiated every hour within 24 hours after the push. After the check task is scheduled, all configuration information will be read first, the configuration key-value pairs will be sorted alphabetically, and then the first summary value will be calculated, and then a confirmation request will be sent to the configuration center.

[0096] After receiving a configuration consistency request, the configuration center will first read the full configuration information (or grouped configuration verification data) corresponding to the client, sort the configuration key-value pairs alphabetically, and then calculate the summary information to compare whether the two summary information are consistent. If they are consistent, the configuration information will be responded to the client to be consistent. If not, the configuration information will be responded to be inconsistent.

[0097] When the client receives a consistent response, no processing is performed. When an inconsistent response is received, a synchronization request for the full configuration information of the shard is initiated. After obtaining the latest configuration information, the configuration information is first saved to a local file and then updated to the memory.

[0098] Obviously, based on Figure 2 The triple protection shown can ensure that the full configuration information used by the client is strongly consistent with the full configuration information of the configuration center, thereby avoiding operational abnormalities caused by the use of old configuration information when unexpected situations occur.

[0099] like Figure 3As shown, the present invention provides a configuration update synchronization device, including: an acquisition module 301, which is used to update the full configuration information according to the updated configuration information if the updated configuration information is successfully obtained from the configuration center; a processing module 302, which is used to perform consistency synchronization at a preset time in the following manner: generate each first summary information of each group of configuration verification data; for any group of configuration verification data in the groups of configuration verification data, the group of configuration verification data is the configuration information of at least one configuration item in each configuration item of the full configuration information; the configuration information of the at least one configuration item is arranged according to a preset arrangement rule; the keywords of each group of configuration items of the groups of configuration verification data and the first summary information are sent to the configuration center; if a synchronization request sent by the configuration center is received, the configuration information corresponding to the synchronization request is obtained from the configuration center, thereby completing consistency synchronization; the synchronization request is used to indicate that the second summary information generated by at least one group of configuration verification data in the configuration center is inconsistent with the first summary information of the at least one group of configuration verification data.

[0100] Optionally, the preset moment is a moment in the jth second preset period within the i-th first preset period, where i and j are positive integers; the first preset period includes multiple second preset periods; the preset moment is obtained in the following manner: based on the update results of the full configuration information in each second preset period within the i-1th first preset period, the jth second preset period is selected in the i-th first preset period; based on the update results of the full configuration information in at least one second preset period before the j-th second preset period, the preset moment is selected in the j-th second preset period.

[0101] Optionally, the preset moment is specifically any one of multiple moments in the j-th second preset period; the multiple moments are specifically obtained in the following manner: taking the update moment of the full configuration information in at least one second preset period as n update moments; n is a positive integer; based on the n update moments, according to preset statistical processing rules, the multiple moments are obtained.

[0102] Optionally, the multiple moments are obtained according to the n update moments according to preset statistical processing rules, including: selecting multiple candidate moments according to the n update moments in a preset time order; and obtaining the multiple moments according to the average of the time differences between the multiple candidate moments and the n update moments.

[0103] Optionally, selecting the jth second preset period in the i-th first preset period based on the update results of the full configuration information in each second preset period within the i-1th first preset period includes: obtaining the first m second preset periods with the largest number of updates of the full configuration information within the i-1th first preset period; and selecting the jth second preset period in the i-th first preset period based on the first m second preset periods.

[0104] Optionally, the processing module 302 is also used to: if the update configuration information fails to be obtained from the configuration center and the number of failures is less than a preset retry threshold, then the update configuration information is re-obtained from the configuration center according to a third preset period; the preset retry threshold is determined based on the statistics of historical successful retries.

[0105] Optionally, the processing module 302 is further used to store the full configuration information in the following manner: according to the preset arrangement rule, the keywords of each configuration item and the corresponding configuration information are stored in the client in the form of key-value pairs.

[0106] Based on the same inventive concept, an embodiment of the present invention further provides a computer device, including a program or an instruction. When the program or the instruction is executed, the configuration update synchronization method and any optional method provided in the embodiment of the present invention are executed.

[0107] Based on the same inventive concept, an embodiment of the present invention further provides a computer-readable storage medium, including a program or instructions. When the program or instructions are executed, the configuration update synchronization method and any optional method provided in the embodiment of the present invention are executed.

[0108] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0109] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A configuration update synchronization method, characterized in that: include: If the client successfully obtains the updated configuration information from the configuration center, the client updates the full configuration information according to the updated configuration information; At a preset time, the client performs consistency synchronization in the following manner: The client generates first summary information of each group of configuration verification data; for any group of configuration verification data in the groups of configuration verification data, the group of configuration verification data is configuration information of at least one configuration item in each configuration item of the full configuration information; the configuration information of the at least one configuration item is arranged according to a preset arrangement rule; The client sends each group of configuration item keywords of each group of configuration verification data and each first summary information to the configuration center; If the client receives a synchronization request sent by the configuration center, the client obtains the configuration information corresponding to the synchronization request from the configuration center, thereby completing consistency synchronization; the synchronization request is used to indicate that the second summary information generated by at least one set of configuration verification data in the configuration center is inconsistent with the first summary information of the at least one set of configuration verification data; The preset time is a time in the jth second preset period within the i-th first preset period, i and j are positive integers; the first preset period includes a plurality of the second preset periods; the preset time is obtained in the following manner: according to the update result of the full configuration information in each second preset period within the i-1th first preset period, the jth second preset period is selected in the i-th first preset period; The preset time is selected in the jth second preset period according to an update result of the full configuration information in at least one second preset period before the jth second preset period.

2. The method according to claim 1, characterized in that The preset time is specifically any one of multiple time in the jth second preset period; the multiple time is specifically obtained in the following manner: The update time of the full configuration information in the at least one second preset period is taken as n update time; n is a positive integer; According to the n update moments, the multiple moments are obtained according to preset statistical processing rules.

3. The method according to claim 2, characterized in that The obtaining the multiple moments according to the n update moments and according to a preset statistical processing rule comprises: According to the n update moments, multiple candidate moments are selected according to a preset time sequence; The multiple moments are obtained according to the average of the time differences between the multiple candidate moments and the n update moments.

4. The method according to claim 1, characterized in that The selecting the jth second preset period in the i-th first preset period according to the update results of the full configuration information in each second preset period within the i-1th first preset period comprises: Obtain the first m second preset periods in which the full configuration information is updated the most times within the (i-1)th first preset period; The jth second preset period is selected from the i-th first preset period according to the first m second preset periods.

5. The method according to any one of claims 1 to 4, characterized in that: include: If the client fails to obtain the updated configuration information from the configuration center, and the number of failures is less than a preset retry number threshold, the client re-obtains the updated configuration information from the configuration center according to a third preset period; The preset retry times threshold is determined based on the statistics of historical successful retry times.

6. The method according to any one of claims 1 to 4, characterized in that: The client stores the full configuration information in the following manner: The client stores the keywords of the configuration items and the corresponding configuration information in the form of key-value pairs in the client according to the preset arrangement rule.

7. The method according to any one of claims 1 to 4, characterized in that: Each group of configuration verification data includes only one group of configuration verification data, and this group of configuration verification data is the full configuration information.

8. A configuration update synchronization device, characterized in that: include: An acquisition module, configured to update the full configuration information according to the updated configuration information if the updated configuration information is successfully acquired from the configuration center; The processing module is used to perform consistency synchronization at a preset time in the following manner: Generate each first summary information of each group of configuration verification data; for any group of configuration verification data in the groups of configuration verification data, the group of configuration verification data is the configuration information of at least one configuration item in each configuration item of the full configuration information; the configuration information of the at least one configuration item is arranged according to a preset arrangement rule; Sending each group of configuration item keywords and each first summary information of each group of configuration verification data to a configuration center; If a synchronization request sent by the configuration center is received, the configuration information corresponding to the synchronization request is obtained from the configuration center, thereby completing consistency synchronization; the synchronization request is used to indicate that the second summary information generated by at least one set of configuration verification data in the configuration center is inconsistent with the first summary information of the at least one set of configuration verification data; The preset time is a time in the jth second preset period within the i-th first preset period, i and j are positive integers; the first preset period includes a plurality of the second preset periods; the preset time is obtained in the following manner: according to the update result of the full configuration information in each second preset period within the i-1th first preset period, the jth second preset period is selected in the i-th first preset period; The preset time is selected in the jth second preset period according to an update result of the full configuration information in at least one second preset period before the jth second preset period.

9. A computer device, characterized in that: The method comprises a program or an instruction, and when the program or the instruction is executed, the method according to any one of claims 1 to 7 is performed.

Citation Information

Patent Citations

  • Storage data synchronization method and device

    CN110830580A