Configuration parameter updating method, apparatus and device
By acquiring a new configuration cache unit and switching to the new configuration cache unit at the effective time, the problem of uninterrupted service during system configuration changes is solved, ensuring the system stability and data consistency of financial enterprises during 24/7 service.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WEBANK (CHINA)
- Filing Date
- 2021-12-17
- Publication Date
- 2026-05-12
AI Technical Summary
How can we ensure uninterrupted service and continuous provision of services when system configuration changes occur, especially in financial institutions that require 24/7 service?
By acquiring a new configuration cache unit and determining its effective time, the original configuration cache unit is switched to the new configuration cache unit when the effective time arrives, while the business unit is in a service-maintaining state. This allows the business unit to process new business requests through the new configuration cache unit, while simultaneously processing existing business requests that have already been received through the original configuration cache unit.
This ensures that updating system configuration parameters does not affect service continuity, avoids conflicts between old and new configurations, and guarantees that the system continues to provide services during configuration changes.
Smart Images

Figure CN114064681B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of financial technology (Fintech), and more particularly to a method, apparatus, and device for updating configuration parameters. Background Technology
[0002] With the development of computer technology, more and more technologies are being applied in the financial sector, and the traditional financial industry is gradually transforming into Fintech. Financial institutions use electronic systems to process business, thus requiring the operation and maintenance of these systems, which often necessitates updating various configuration parameters.
[0003] Currently, system updates are generally performed when business volume is low, such as in the early morning, when the system stops providing services. However, with the continuous development of economic globalization, financial enterprises often need to provide services around the clock. Therefore, how to ensure uninterrupted service and continuous provision of services when the system configuration changes has become an urgent technical problem to be solved. Summary of the Invention
[0004] This application provides a configuration parameter update method, apparatus, and device to solve the technical problem of how to ensure uninterrupted service and continuous external service when the system configuration changes.
[0005] Firstly, this application provides a method for updating configuration parameters, including:
[0006] Obtain the new configuration cache unit and determine the effective time of the new configuration cache unit. The new configuration cache unit is used to carry the new version of the configuration dataset in the data source to improve the processing performance of the business unit calling the configuration dataset to process the business. The configuration dataset includes multiple configuration parameters, which are used to set the operation mode of the business unit.
[0007] When the effective time arrives, while the business unit maintains its service status, the original configuration cache unit corresponding to the business unit will be switched to the new configuration cache unit. This will enable the business unit to process new business requests through the new configuration cache unit, while simultaneously processing existing business requests that have already been received through the original configuration cache unit. The new business requests are those received by the business unit after the effective time.
[0008] In one possible design, when multiple business units exist, the effective time of the new configuration cache unit is determined, including:
[0009] Obtain the interaction records of each business unit receiving business requests;
[0010] Based on the historical records of each business unit meeting the preset filtering requirements in the interaction log, determine the next interaction time for each business unit;
[0011] The effective time is determined based on each interaction time and the preset first delay time.
[0012] In one possible design, the next interaction time for each business unit is determined based on the historical records of each business unit meeting preset filtering requirements in the interaction log, including:
[0013] Based on the latest preset number of historical records for each business unit, determine the next interaction time for each business unit.
[0014] In one possible design, the effective time is determined based on the various interaction times and a first delay time, including:
[0015] Select the latest time from all interaction times;
[0016] The effective time is the time after the latest time plus the first delay time.
[0017] In one possible design, the method also includes:
[0018] Get the completion status of existing business requests corresponding to the original configured cache unit;
[0019] Determine whether to delete the original configuration cache unit based on the completion status, so as to ensure that the business unit will not have a conflict in calling the configuration parameters when processing existing business requests.
[0020] In one possible design, determining whether to delete the original configuration cache unit based on the completion status includes:
[0021] Upon receiving a completion signal for an existing service request, determine whether the cumulative value is greater than 1. The cumulative value is used to represent the number of incomplete existing service requests.
[0022] When the cumulative value equals 1, delete the original configuration cache unit.
[0023] In one possible design, after determining whether the cumulative value is 1, the following steps are also included:
[0024] When the cumulative value is greater than 1, the system will continuously monitor whether the cumulative value is 0 according to a preset time interval.
[0025] If not, confirm and send a notification message to indicate that the original configuration cache unit is still in use;
[0026] If so, delete the original configuration cache unit.
[0027] In one possible design, the cumulative value is cyclically monitored to see if it is 0 according to a preset time interval, including:
[0028] The loop determines the preset time interval based on the completion time of the latest n existing services and the preset second delay time;
[0029] At each preset time interval, check if the cumulative value is 0.
[0030] In one possible design, obtaining a new configuration cache unit includes:
[0031] According to the preset inspection cycle, the version number in the data source is monitored cyclically to see if it changes. The version number is used to represent different versions of the configuration dataset.
[0032] If so, create a new configuration cache unit;
[0033] The updated configuration dataset is loaded into the new configuration cache unit.
[0034] In one possible design, after loading the updated configuration dataset into the new configuration cache unit, the following is also included:
[0035] Based on the preset number of parameters, extract the corresponding configuration parameters from the new configuration cache unit and the data source to determine the first parameter set and the second parameter set. The first parameter set corresponds to the new configuration cache unit, and the second parameter set corresponds to the data source.
[0036] Using a preset splicing model, each configuration parameter in the first parameter set is spliced into a first string, and each configuration parameter in the second parameter set is spliced into a second string;
[0037] Using a preset hash model, a first hash value is determined based on a first string, and a second hash value is determined based on a second string;
[0038] Determine whether the first hash value and the second hash value are the same;
[0039] If so, then confirm that the new configuration cache unit is loaded correctly;
[0040] If not, clear the configuration parameter set in the new configuration cache unit and reload the configuration parameter set from the data source.
[0041] Secondly, this application provides a configuration parameter updating device, comprising:
[0042] The acquisition module is used to acquire new configuration cache units. These new configuration cache units are used to hold new versions of configuration datasets from the data source to improve the processing performance of business units that call configuration datasets to process business. The configuration dataset includes multiple configuration parameters, which are used to set the operating mode of the business unit.
[0043] The processing module is used to determine the effective time of the new configuration cache unit, and when the effective time arrives, while the business unit maintains its service status, it switches the original configuration cache unit corresponding to the business unit to the new configuration cache unit, so that the business unit can process new business requests through the new configuration cache unit, and at the same time process existing business requests that have been received through the original configuration cache unit. The new business requests are business requests received by the business unit after the effective time.
[0044] Thirdly, this application provides an electronic device, comprising:
[0045] Memory, used to store program instructions;
[0046] The processor is used to call and execute program instructions in memory, and to execute any possible method for determining item storage information provided in the first aspect.
[0047] Fourthly, this application provides a storage medium storing a computer program for executing any of the possible configuration parameter update methods provided in the first aspect.
[0048] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements any of the possible configuration parameter update methods provided in the first aspect.
[0049] This application provides a configuration parameter update method, apparatus, and device. It obtains a new configuration cache unit and determines its effective time. The new configuration cache unit carries the new version of the configuration dataset from the data source, improving the processing performance of business units calling the configuration dataset. Then, when the effective time arrives, while the business unit maintains its service status, the original configuration cache unit corresponding to the business unit is switched to the new configuration cache unit. This allows the business unit to process new business requests through the new configuration cache unit and simultaneously process existing business requests received through the original configuration cache unit. This solves the technical problem of how to achieve uninterrupted service and continuous external service when the system's configuration changes. It achieves the technical effect of updating the system's configuration parameters without affecting the system's external service, and effectively avoids conflicts between the old and new configurations during the update process. Attached Figure Description
[0050] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0051] Figure 1 This is a schematic diagram illustrating an application scenario of a configuration parameter update method provided in an embodiment of this application.
[0052] Figure 2 A flowchart illustrating a configuration parameter update method provided in this application;
[0053] Figure 3 A flowchart illustrating another configuration parameter update method provided for the implementation of this application;
[0054] Figure 4 This is a schematic diagram of the structure of a configuration parameter updating device provided in an embodiment of this application;
[0055] Figure 5 This is a schematic diagram of the structure of an electronic device provided in this application.
[0056] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort, including but not limited to combinations of multiple embodiments, are within the scope of protection of this application.
[0058] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0059] The following is an explanation of the technical terms used in this application:
[0060] Sharding refers to the horizontal partitioning of a database, which is a way to horizontally scale a shared database; it is also known as database sharding.
[0061] Multiple data sources: refers to data that is shared by multiple databases under an application system and is managed by sharding.
[0062] A cache is a hardware or software component used to store data that will be requested in the future, and to make data retrieval faster. Any structure located between two pieces of hardware with significantly different speeds, used to coordinate the difference in data transfer speeds between them, can be called a cache. Examples of hardware caches include CPU (central processing unit) cache, GPU (graphics processing unit) cache, and DSP (Digital Signal Processing) cache; software caches include disk cache and web cache.
[0063] In a multi-data source system, configuration parameters typically use the same set of data. To meet performance requirements in certain scenarios, these parameters need to be cached. Since the same data is used, a simple implementation is possible: place the configuration parameters on each application instance, and each instance allocates an independent cache space for caching. When the parameters change, the changes are applied by restarting the application instance. This caching approach in the above scenario has low technical requirements and low cost, and can meet the needs of most systems. However, it has shortcomings for systems with high availability or high requirements for automated operation and maintenance.
[0064] In a mature system, automated operation and maintenance (also known as hot reloading) is a common requirement when changing business configuration parameters. The multi-data source system mentioned above will encounter the following difficulties when business parameters change:
[0065] (1) How to ensure uninterrupted service and continuous provision of services when configuration changes occur;
[0066] (2) When configuration changes, how to ensure that a user uses the same parameter configuration during the business acceptance process.
[0067] In summary, when updating the configuration of a multi-source system, it is necessary to ensure that existing service requests are not affected during the system change process, while ensuring the consistency of configuration data in multiple application instances (i.e., business units) to avoid chaotic access to old and new configuration data and conflicts in the processing of old and new business requests.
[0068] To solve the above problems, the inventive concept of this application is as follows:
[0069] A new cache is created for each data source to load the changed parameters. Once the new caches for all application services are created, requests are switched to reading from the new cache. Simultaneously, the number of requests currently being processed in the old cache is counted. When the new cache has taken effect and the request count reaches zero, the old cache is destroyed. This entire process fulfills the system's requirement for automated parameter changes without requiring a service restart.
[0070] Figure 1 This is a schematic diagram illustrating an application scenario for a configuration parameter update method provided in this application. For example... Figure 1 As shown, the multi-data source system contains multiple data sources 101. Each data source 101 is implemented using a database. Multiple configuration parameters are stored in the data tables of each data source 101. When the configuration parameters are updated, multiple new cache units 102 (i.e., new caches) are created for each data source. The number of new cache units 102 corresponds to the number of business units 103 (also referred to as application instances in this application). The updated configuration parameters are loaded into the new cache units 102. Then, at an appropriate time, the original cache units 104 in the business units 103 are replaced. It should be noted that the replacement can be performed one business unit 103 at a time, or multiple business units 103 or all business units 103 can be replaced simultaneously in parallel.
[0071] The following is based on Figure 1 The application scenarios shown illustrate the state data processing method provided in this application:
[0072] Figure 2 This is a flowchart illustrating a configuration parameter update method provided in an embodiment of this application. Figure 2 As shown, this configuration parameter update method is applied to a multi-data source system, and the specific steps include:
[0073] S201. Obtain the new configuration cache unit and determine the effective time of the new configuration cache unit.
[0074] In this step, the new configuration cache unit is used to hold the new version of the configuration dataset in the data source to improve the processing performance of the business unit when calling the configuration dataset to process business. The configuration dataset includes multiple configuration parameters, which are used to set the operation mode of the business unit.
[0075] In this embodiment, it is first necessary to... Figure 1 The configuration parameters in the configuration parameter table (i.e., the configuration dataset) stored in each data source 101 shown are modified and adjusted. After the adjustment is completed, the new configuration parameters are saved, causing the version number of the configuration parameter table (i.e., the configuration dataset) to change.
[0076] At this point, in response to the update of configuration parameters, or when a change in the version number of the configuration dataset is detected through periodic inspection (i.e., when the version number of the configuration dataset in the original configuration cache unit of the business unit is different from the version number of the configuration dataset in the data source), each data source that has updated the configuration parameters creates a new configuration cache unit for each business unit, and then loads all the configuration parameters in the data source into this new configuration cache unit.
[0077] The methods for determining the effective date include:
[0078] One approach is to set a fixed time, such as 5 to 30 minutes after the new configuration cache unit has finished loading its configuration parameters, for example, 10, 15, or 20 minutes, before enabling the new configuration cache unit.
[0079] Another approach is to dynamically collect the time taken for the hot reloading of the new configuration cache unit corresponding to each business unit. Specifically, the next interaction time is estimated based on the most recent preset number of interaction records for each business unit. The latest interaction time is selected from all interaction times, and a preset delay time is added to obtain the effective time.
[0080] It should be noted that the interaction record of a business unit is a record of the time when the business unit receives the business request.
[0081] S202. When the effective time arrives, while the business unit maintains its service status, the original configuration cache unit corresponding to the business unit will be switched to the new configuration cache unit.
[0082] In this step, the original configuration cache unit is switched to the new configuration cache unit, so that the business unit processes new business requests through the new configuration cache unit, and at the same time processes existing business requests that have been received through the original configuration cache unit. The new business requests are those received by the business unit after the effective time.
[0083] It's important to note that when a new configuration cache unit is switched over, the business unit retains the original configuration cache unit to continue processing existing business requests that have been received but not yet completed. The original configuration cache unit is only destroyed to free up memory space after all existing business requests corresponding to it have been completed.
[0084] The above process is also known as hot reloading. This means that the business unit does not stop providing services; instead, between two adjacent business requests, the original configuration cache unit is replaced with a new configuration cache unit to handle the new request. Furthermore, by not immediately destroying the original configuration cache unit, it ensures that multiple business requests initiated simultaneously by the same user are processed using the same configuration parameters.
[0085] In one possible design, when configuration datasets from multiple data sources need to be updated, a canary release is implemented for each data source. That is, after the updated configuration data from one data source is loaded into a newly created configuration cache unit, each business unit switches over sequentially. The next business unit only begins switching after the previous one has completed the switch. The advantage of this approach is that if an error occurs after a business unit switches over, subsequent business units will stop switching, avoiding any impact on service provision. Similarly, hot-loading the configuration data from one data source only after the configuration data from another data source has been fully hot-loaded is performed. This is also to promptly detect errors and prevent simultaneous updates from causing all business units to lose service, resulting in significant economic losses.
[0086] It should be noted that for multi-data source systems, in order to avoid excessive memory consumption during configuration updates, the number of data sources 101 that can be updated simultaneously can be set to less than or equal to 5.
[0087] This application provides a configuration parameter update method. It obtains a new configuration cache unit and determines its effective time. The new configuration cache unit carries the new version of the configuration dataset from the data source, improving the processing performance of business units calling the configuration dataset. Then, when the effective time arrives, while the business unit maintains its service status, the original configuration cache unit corresponding to the business unit is switched to the new configuration cache unit. This allows the business unit to process new business requests through the new configuration cache unit and simultaneously process existing business requests received through the original configuration cache unit. This solves the technical problem of how to ensure uninterrupted service and continuous external service when the system's configuration changes. It achieves the technical effect of updating the system's configuration parameters without affecting the system's external service, and effectively avoids conflicts between old and new configurations during the update process.
[0088] Figure 3 A flowchart illustrating another configuration parameter update method provided for the implementation of this application. For example... Figure 3 As shown, the specific steps of this configuration parameter update method include:
[0089] S301, Obtain the new configuration cache unit.
[0090] This step specifically includes:
[0091] According to the preset inspection cycle, the version number in the data source is monitored cyclically to see if it changes. The version number is used to represent different versions of the configuration dataset.
[0092] If so, create a new configuration cache unit;
[0093] The updated configuration dataset is loaded into the new configuration cache unit.
[0094] For example, an application instance (i.e., a business unit) periodically (e.g., every 5 minutes) checks whether the configuration parameters stored in the database of the data source have changed. In one possible implementation, it reads the version number of the configuration parameter set in the cache block currently used by the application instance (i.e., the original configuration cache unit) and checks whether it matches the version number recorded in the database of the source data. If the version number is smaller than the latter, it is considered that the configuration has changed. If a change in configuration parameters is detected, the cache loader is started, and the table data in the database, i.e., the configuration dataset, is loaded into a new cache block, i.e., a new configuration cache unit.
[0095] In one possible design, after the updated configuration dataset is loaded into the new configuration cache unit, it also includes:
[0096] Based on the preset number of parameters, extract the corresponding configuration parameters from the new configuration cache unit and the data source to determine the first parameter set and the second parameter set. The first parameter set corresponds to the new configuration cache unit, and the second parameter set corresponds to the data source.
[0097] Using a preset splicing model, each configuration parameter in the first parameter set is spliced into a first string, and each configuration parameter in the second parameter set is spliced into a second string;
[0098] Using a preset hash model, a first hash value is determined based on a first string, and a second hash value is determined based on a second string;
[0099] Determine whether the first hash value and the second hash value are the same;
[0100] If so, then confirm that the new configuration cache unit is loaded correctly;
[0101] If not, clear the configuration parameter set in the new configuration cache unit and reload the configuration parameter set from the data source.
[0102] Specifically, each time, a preset number of configuration parameters, say 100, are extracted from both the newly configured cache unit and the data source. These parameters are then concatenated into two strings: a first string and a second string. A hash algorithm is then used to calculate the hash values of these two strings, such as their MD5 (Message-DigestAlgorithm) values. If these two values are equal, it indicates that the newly configured cache unit has been loaded correctly, and the switch can proceed. Otherwise, a reload is required.
[0103] It should be noted that new business requests are only allowed to read configuration parameters from the new configuration cache unit if the two hash values match.
[0104] S302. Obtain the interaction records of each business unit receiving business requests.
[0105] In this step, an interaction log table is pre-set to record the time when each business unit receives a business request, so this interaction log table can be read.
[0106] S303. Based on the historical records of each business unit meeting the preset filtering requirements in the interaction log, determine the next interaction time for each business unit.
[0107] In this step, the next interaction time for each business unit is determined based on the latest preset number of historical records corresponding to each business unit.
[0108] For example, the time interval between each interaction can be determined based on at least two recent historical records, or the average time interval between the five most recent interactions can be calculated using a moving average algorithm, thus predicting the timing of the next interaction.
[0109] Table 1 is a record of the most recent interaction time and the predicted next interaction time for each business unit, i.e., application instance.
[0110]
[0111] Table 1
[0112] S304. Determine the effective time based on each interaction time and the preset first delay time.
[0113] In this step, the latest time is selected from all interaction times; the effective time is then obtained by adding a first delay time after the latest time.
[0114] For example, the effective time point = Max(next interaction time for each application instance) + 1 minute delay. Here, Max(next interaction time for each application instance) represents the maximum value of the next interaction time for each application instance.
[0115] S305. Obtain the completion status of existing business requests corresponding to the original configured cache unit.
[0116] In this step, the information reported by the business unit when completing an existing business request, i.e., the completion status, is received. Then, through steps S306 to S308, it is determined whether to delete the original configuration cache unit based on the completion status, so as to ensure that the business unit does not generate conflicting calls to configuration parameters when processing existing business requests.
[0117] S306. When a completion signal for an existing service request is received, determine whether the cumulative value is greater than 1.
[0118] In this step, the cumulative value is used to represent the number of existing business requests that have not been completed.
[0119] When the cumulative value equals 1, proceed to step S307;
[0120] When the cumulative value is greater than 1, proceed to step S308.
[0121] S307. Delete the original configuration cache unit.
[0122] In this step, when the cumulative value equals 1, a completion signal for an existing business request is received. Then, the cumulative value is decremented by 1, meaning there are no incomplete existing business requests corresponding to the original configuration cache unit. In this case, the original configuration cache unit can be deleted to free up memory space.
[0123] S308. According to the preset time interval, cyclically monitor whether the cumulative value is 0.
[0124] In this step, at a preset time interval, such as every 5 minutes, the cumulative value is checked to see if it is 0, regardless of whether a completion signal is received. If yes, step S307 is executed; otherwise, step S309 is executed.
[0125] Specifically, the preset time interval is determined by the latest n existing business completion times and the preset second delay time; when each preset time interval is reached, the cumulative value is checked to see if it is 0.
[0126] S309. Confirm and send a prompt message.
[0127] In this step, the prompt message indicates that the original configuration cache unit is still in use.
[0128] For example, in steps S306-S309, after switching to the new cache (i.e., the newly configured cache unit), the cache switching controller receives a report of a completed business request. If it's the old service, it checks if the count is 1. If the condition is met, the old cache (i.e., the original configured cache unit) can be directly destroyed. Simultaneously, the application checks the number of requests to the old cache at intervals (e.g., 5 minutes). If not, an alarm is issued. If so, the old cache is destroyed, freeing up memory space. The checking interval can be a configured constant (e.g., 5 minutes) or an adaptive value based on the maximum time spent on statistical business requests plus a buffer value.
[0129] In this embodiment, two caches, one old and one new, are used to achieve hot reloading of parameter configuration changes, reducing the cost of manual maintenance.
[0130] Validate cached data against the data source to ensure system data consistency and guarantee correct system execution;
[0131] The delayed activation mechanism of the new cache can effectively prevent the coexistence of new and old data, and improve the consistency of system data.
[0132] This application provides a configuration parameter update method. It obtains a new configuration cache unit and determines its effective time. The new configuration cache unit carries the new version of the configuration dataset from the data source, improving the processing performance of business units calling the configuration dataset. Then, when the effective time arrives, while the business unit maintains its service status, the original configuration cache unit corresponding to the business unit is switched to the new configuration cache unit. This allows the business unit to process new business requests through the new configuration cache unit and simultaneously process existing business requests received through the original configuration cache unit. This solves the technical problem of how to ensure uninterrupted service and continuous external service when the system's configuration changes. It achieves the technical effect of updating the system's configuration parameters without affecting the system's external service, and effectively avoids conflicts between old and new configurations during the update process.
[0133] Figure 4 This is a schematic diagram of a configuration parameter updating device provided in an embodiment of this application. The configuration parameter updating device 400 can be implemented through software, hardware, or a combination of both.
[0134] like Figure 4 As shown, the configuration parameter updating device 400 includes:
[0135] The acquisition module 401 is used to acquire a new configuration cache unit. The new configuration cache unit is used to carry the new version of the configuration dataset in the data source to improve the processing performance of the business unit calling the configuration dataset to process the business. The configuration dataset includes multiple configuration parameters, which are used to set the operation mode of the business unit.
[0136] Processing module 402 is used to determine the effective time of the new configuration cache unit, and when the effective time arrives, while the business unit maintains its service status, it switches the original configuration cache unit corresponding to the business unit to the new configuration cache unit, so that the business unit can process new business requests through the new configuration cache unit, and at the same time process existing business requests that have been received through the original configuration cache unit. The new business request is the business request received by the business unit after the effective time.
[0137] In one possible design, when there are multiple business units, the acquisition module 401 is used to acquire the interaction records of each business unit receiving business requests.
[0138] Processing module 402 is used for:
[0139] Based on the historical records of each business unit meeting the preset filtering requirements in the interaction log, determine the next interaction time for each business unit;
[0140] The effective time is determined based on each interaction time and the preset first delay time.
[0141] In one possible design, the processing module 402 is used to determine the next interaction time for each business unit based on the latest preset number of historical records corresponding to each business unit.
[0142] In one possible design, processing module 402 is used for:
[0143] Select the latest time from all interaction times;
[0144] The effective time is the time after the latest time plus the first delay time.
[0145] In one possible design, the acquisition module 401 is also used to acquire the completion status of existing business requests corresponding to the original configuration cache unit;
[0146] The processing module 402 is also used to determine whether to delete the original configuration cache unit based on the completion status, so as to ensure that the business unit will not generate a conflict in calling the configuration parameters when processing existing business requests.
[0147] In one possible design, processing module 402 is used for:
[0148] Upon receiving a completion signal for an existing service request, determine whether the cumulative value is greater than 1. The cumulative value is used to represent the number of incomplete existing service requests.
[0149] When the cumulative value equals 1, delete the original configuration cache unit.
[0150] In one possible design, after determining whether the cumulative value is 1, the following steps are also included:
[0151] When the cumulative value is greater than 1, the system will continuously monitor whether the cumulative value is 0 according to a preset time interval.
[0152] If not, confirm and send a notification message to indicate that the original configuration cache unit is still in use;
[0153] If so, delete the original configuration cache unit.
[0154] In one possible design, processing module 402 is used for:
[0155] The loop determines the preset time interval based on the completion time of the latest n existing services and the preset second delay time;
[0156] At each preset time interval, check if the cumulative value is 0.
[0157] In one possible design, module 401 is used for:
[0158] According to the preset inspection cycle, the version number in the data source is monitored cyclically to see if it changes. The version number is used to represent different versions of the configuration dataset.
[0159] If so, create a new configuration cache unit;
[0160] The updated configuration dataset is loaded into the new configuration cache unit.
[0161] In one possible design, the acquisition module 401 is also used for:
[0162] Based on the preset number of parameters, extract the corresponding configuration parameters from the new configuration cache unit and the data source to determine the first parameter set and the second parameter set. The first parameter set corresponds to the new configuration cache unit, and the second parameter set corresponds to the data source.
[0163] Using a preset splicing model, each configuration parameter in the first parameter set is spliced into a first string, and each configuration parameter in the second parameter set is spliced into a second string;
[0164] Using a preset hash model, a first hash value is determined based on a first string, and a second hash value is determined based on a second string;
[0165] Determine whether the first hash value and the second hash value are the same;
[0166] If so, then confirm that the new configuration cache unit is loaded correctly;
[0167] If not, clear the configuration parameter set in the new configuration cache unit and reload the configuration parameter set from the data source.
[0168] It is worth noting that, Figure 4 The apparatus provided in the illustrated embodiments can execute the methods provided in any of the above method embodiments. Their specific implementation principles, technical features, explanations of technical terms, and technical effects are similar and will not be repeated here.
[0169] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 500 may include at least one processor 501 and a memory 502. Figure 5 The example shown is an electronic device using a processor.
[0170] The memory 502 is used to store programs. Specifically, the program may include program code, which includes computer operation instructions.
[0171] The memory 502 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0172] The processor 501 is used to execute computer execution instructions stored in the memory 502 to implement the methods described in the above embodiments.
[0173] The processor 501 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0174] Optionally, the memory 502 can be either standalone or integrated with the processor 501. When the memory 502 is a device independent of the processor 501, the electronic device 500 may further include:
[0175] Bus 503 is used to connect the processor 501 and the memory 502. The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not mean there is only one bus or one type of bus.
[0176] Optionally, in a specific implementation, if the memory 502 and the processor 501 are integrated on a single chip, the memory 502 and the processor 501 can communicate through an internal interface.
[0177] This application also provides a computer-readable storage medium, which may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a disk, or an optical disk. Specifically, the computer-readable storage medium stores program instructions, which are used in the methods described in the above-mentioned method embodiments.
[0178] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the methods described in the above-described method embodiments.
[0179] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.
[0180] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for updating configuration parameters, characterized in that, include: Obtain a new configuration cache unit and determine the effective time of the new configuration cache unit. The new configuration cache unit is used to carry a new version of the configuration dataset in the data source. The configuration dataset includes multiple configuration parameters, which are used to set the operation mode of the business unit. When the effective time arrives, while the service unit remains in service status, the original configuration cache unit corresponding to the service unit is switched to the new configuration cache unit, so that the service unit processes new service requests through the new configuration cache unit and at the same time processes existing service requests that have been received through the original configuration cache unit. The new service request is the service request received by the service unit after the effective time. The process of obtaining the new configuration cache unit includes: According to a preset inspection cycle, the version number in the data source is monitored cyclically to see if it changes. The version number is used to represent different versions of the configuration dataset. If so, then create the new configuration cache unit; The updated configuration dataset is loaded into the new configuration cache unit; after loading the updated configuration dataset into the new configuration cache unit, the method further includes: Based on the preset number of parameters, extract the new configuration cache unit and the corresponding multiple configuration parameters from the data source to determine the first parameter set and the second parameter set. The first parameter set corresponds to the new configuration cache unit, and the second parameter set corresponds to the data source. Using a preset splicing model, each configuration parameter in the first parameter set is spliced into a first string, and each configuration parameter in the second parameter set is spliced into a second string; Using a preset hash model, a first hash value is determined based on the first string, and a second hash value is determined based on the second string; Determine whether the first hash value and the second hash value are the same; If so, then the new configuration cache unit is loaded correctly; If not, the configuration parameter set in the new configuration cache unit is cleared, and the configuration parameter set is reloaded from the data source.
2. The configuration parameter update method according to claim 1, characterized in that, When multiple business units exist, determining the effective time of the new configuration cache unit includes: Obtain the interaction records of each of the aforementioned business units receiving the business requests; Based on the historical records of each business unit in the interaction record that meet the preset filtering requirements, the next interaction time of each business unit is determined. The effective time is determined based on each of the interaction times and a preset first delay time.
3. The configuration parameter update method according to claim 2, characterized in that, The step of determining the next interaction time for each of the business units based on the historical records of each business unit meeting the preset filtering requirements in the interaction record includes: The next interaction time for each business unit is determined based on the latest preset number of historical records corresponding to each business unit.
4. The configuration parameter update method according to claim 2, characterized in that, Determining the effective time based on each of the interaction times and the first delay time includes: Select the latest time from all the aforementioned interaction times; The effective time is the time when the first delay time is added after the latest time.
5. The configuration parameter update method according to any one of claims 1-4, characterized in that, Also includes: Obtain the completion status of existing business requests corresponding to the original configured cache unit; Based on the completion status, determine whether to delete the original configuration cache unit to ensure that the business unit does not generate a call conflict to the configuration parameters when processing the existing business request.
6. The configuration parameter update method according to claim 5, characterized in that, The step of determining whether to delete the original configuration cache unit based on the completion status includes: Upon receiving the completion signal of the existing service request, it is determined whether the cumulative value is greater than 1. The cumulative value is used to represent the number of the existing service requests that have not been completed. When the cumulative value equals 1, the original configuration cache unit is deleted.
7. The configuration parameter update method according to claim 6, characterized in that, After determining whether the cumulative value is 1, the following steps are also included: When the cumulative value is greater than 1, the system continuously monitors whether the cumulative value is 0 according to a preset time interval. If not, confirm and send a prompt message to indicate that the original configuration cache unit is still in use; If so, then delete the original configuration cache unit.
8. The configuration parameter update method according to claim 7, characterized in that, The step of cyclically monitoring whether the cumulative value is 0 according to a preset time interval includes: The preset time interval is determined by the loop based on the completion time of the latest n existing services and the preset second delay time; When each preset time interval is reached, it is checked whether the cumulative value is 0.
9. A configuration parameter updating device, characterized in that, The apparatus is used to implement the method as described in any one of claims 1-8, the apparatus comprising: The acquisition module is used to acquire a new configuration cache unit, which is used to carry a new version of the configuration dataset in the data source to improve the processing performance of the business unit calling the configuration dataset to process the business. The configuration dataset includes multiple configuration parameters, which are used to set the operation mode of the business unit. The processing module is used to determine the effective time of the new configuration cache unit, and when the effective time arrives, while the service unit maintains its service status, to switch the original configuration cache unit corresponding to the service unit to the new configuration cache unit, so that the service unit processes new service requests through the new configuration cache unit, and at the same time processes existing service requests that have been received through the original configuration cache unit. The new service request is a service request received by the service unit after the effective time.
10. An electronic device, characterized in that, include: processor; as well as, Memory for storing the computer program of the processor; The processor is configured to execute the configuration parameter update method according to any one of claims 1 to 8 by executing the computer program.