Configuration data updating method and distributed system
Through the configuration load confirmation mechanism, the configuration update delay or missed problem caused by network jitter by client instances in the distributed microservice architecture is solved, ensuring that all business-side systems load update configuration data at the same time to avoid business transaction exceptions.
Patent Information
- Application Number
- CN202411505895.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-02-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the distributed microservice architecture system, some client instances have delayed configuration updates or missed configuration updates due to network jitters, resulting in failure to load the latest published configuration information in time, affecting the accuracy of business transactions and causing system transaction errors.
By configuring the load confirmation mechanism, each business end system first saves the update configuration data locally. When the configuration service cluster determines that all business end systems meet the update conditions, it sends load notifications to each business end system to ensure that all business end systems load at the same time. Update configuration data.
Ensure that all business-side systems load update configuration data at the same time, and avoid the problems of business transaction abnormalities due to delayed configuration updates or missed configuration updates on individual business-side systems.
Smart Images

Figure CN119402335A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a configuration data updating method and a distributed system. Background Art
[0002] In the existing distributed microservice architecture system, when the server monitors the configuration data update, it will notify each client instance to obtain the configuration data so as to update the configuration data to each client instance.
[0003] However, in distributed high-concurrency scenarios of microservices, some client instances may experience configuration update delays or miss configuration updates due to network jitter and other reasons, causing some client instances to fail to load the latest published configuration information in a timely manner, affecting the accuracy of business transactions and causing system transaction errors. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a configuration data updating method and distributed system, wherein each business-end system first saves the updated configuration data locally, and then uses the configuration loading confirmation mechanism. When the configuration service cluster determines that each business-end system meets the update conditions, a loading notification is sent to each business-end system to ensure that all business-end systems load the updated configuration data at the same time, thereby avoiding business transaction abnormalities caused by configuration update delays or missed configuration updates of individual business-end systems.
[0005] The embodiment of the present application provides a method for updating configuration data, the updating method is applied to a configuration service cluster in a distributed system, the distributed system also includes multiple service end systems; the updating method includes:
[0006] In response to a data update request sent by each business end system, sending updated configuration data to each business end system so that each business end system saves the updated configuration data locally;
[0007] Receiving a configuration loading confirmation long polling request sent by each service end system; wherein the configuration loading confirmation long polling request is used to request the configuration service cluster to load the updated configuration data that has been saved locally;
[0008] Determine whether each business end system meets the update conditions according to each received configuration loading confirmation long polling request;
[0009] When it is determined that each business end system meets the update conditions, in response to each configuration loading confirmation long polling request, a loading notification for loading the updated configuration data is sent to each business end system respectively, so that each business end system updates the original configuration data based on the locally stored updated configuration data.
[0010] Further, in response to the data update request sent by each service end system, sending the update configuration data to each service end system includes:
[0011] Receiving a configuration update monitoring long polling request sent by each service end system; wherein the configuration update monitoring long polling request is used to confirm with the configuration service cluster whether the configuration data is updated;
[0012] Regularly monitor whether the version of configuration data in the local database has changed;
[0013] If a version change is detected, the updated configuration data is obtained from the local database, and in response to each configuration update monitoring long polling request, a configuration data update notification is sent to each business end system, so that each business end system initiates a data acquisition request to the configuration service cluster;
[0014] In response to the data acquisition request sent by each service end system, the updated configuration data is sent to each service end respectively.
[0015] Further, the step of determining whether each service end system meets the update condition according to each received configuration loading confirmation long polling request includes:
[0016] Determining, according to each received configuration loading confirmation long polling request, whether all service end systems in the distributed system have successfully saved the updated configuration data locally;
[0017] If all the service-end systems have successfully saved the update configuration data locally, it is determined that each service-end system meets the update condition.
[0018] Further, the determining, based on each received configuration loading confirmation long polling request, whether all service end systems in the distributed system have successfully saved the updated configuration data locally includes:
[0019] When a configuration loading confirmation long polling request is received from any business end system, the timing is started;
[0020] Record the business end system identifier corresponding to each received configuration loading confirmation long polling request in the configuration loading confirmation table;
[0021] Regularly counting the service end systems in the distributed system to obtain the total number of service end systems;
[0022] Before the timing reaches a predetermined time, if the total number of the business end systems is equal to the number of business end system identifiers recorded in the configuration loading confirmation table, it is determined that all business end systems in the distributed system have successfully saved the updated configuration data locally; wherein the predetermined time is less than the response time corresponding to the configuration loading confirmation long polling request;
[0023] When the timing reaches a predetermined time, if the total number of the business end systems is still greater than the number of business end system identifiers recorded in the configuration loading confirmation table, it is determined that there is a business end system in the distributed system that has failed to successfully save the updated configuration data locally.
[0024] Furthermore, the distributed system also includes a management and control server; and the updating method also includes:
[0025] The configuration loading confirmation table records whether each business-end system has successfully saved the updated configuration data locally, so that the management and control server can determine the status of this configuration update by regularly scanning the configuration loading confirmation table, and when the status is determined to be an update failure, determine the business-end system that caused the update failure.
[0026] Furthermore, the updating method further includes:
[0027] When it is determined that at least one service end system does not meet the update conditions, in response to each configuration update monitoring long polling request, a cancellation notification for canceling the configuration data update is sent to each service end system respectively, so that each service end system clears the locally stored updated configuration data.
[0028] The embodiment of the present application also provides a method for updating configuration data, the updating method being applied to any service end system among multiple service end systems in a distributed system, the distributed system further comprising a configuration service cluster; the updating method comprising:
[0029] Sending a data update request to the configuration service cluster, and obtaining updated configuration data sent by the configuration service cluster in response to the data update request;
[0030] The updated configuration data is saved locally, and after successful saving, a configuration loading confirmation long polling request is sent to the configuration service cluster; wherein the configuration loading confirmation long polling request is used to request the configuration service cluster to load the updated configuration data that has been saved locally;
[0031] receiving a loading notification of loading the updated configuration data sent by the configuration service cluster in response to the configuration loading confirmation long polling request;
[0032] According to the loading notification, the original configuration data is updated based on the locally stored updated configuration data.
[0033] Further, sending a data update request to the configuration service cluster, and obtaining updated configuration data sent by the configuration service cluster in response to the data update request, includes:
[0034] A configuration update monitoring long polling request sent to the configuration service cluster; wherein the configuration update monitoring long polling request is used to confirm with the configuration service cluster whether the configuration data is updated;
[0035] Receiving a configuration data update notification sent by the configuration service cluster in response to the configuration update monitoring long polling request when the configuration service cluster monitors that a version of the configuration data in the local database has changed;
[0036] Initiate a data acquisition request to the configuration service cluster according to the configuration data update notification;
[0037] The updated configuration data sent by the configuration service cluster in response to the data acquisition request is received.
[0038] The embodiment of the present application also provides a method for updating configuration data, the updating method being applied to a distributed system; the distributed system comprising a plurality of service end systems and a configuration service cluster; the updating method comprising:
[0039] Each business end system sends a data update request to the configuration service cluster;
[0040] The configuration service cluster sends updated configuration data to each service end system in response to the data update request;
[0041] Each service end system saves the updated configuration data locally, and after successful saving, sends a configuration loading confirmation long polling request to the configuration service cluster; wherein the configuration loading confirmation long polling request is used to request the configuration service cluster to load the updated configuration data saved locally;
[0042] The configuration service cluster determines whether each service end system meets the update condition according to each received configuration loading confirmation long polling request, and when it is determined that each service end system meets the update condition, responds to each configuration loading confirmation long polling request and sends a loading notification for loading the updated configuration data to each service end system respectively;
[0043] Each service end system updates the original configuration data based on the locally stored updated configuration data according to the loading notification.
[0044] The embodiment of the present application also provides a distributed system, including a configuration service cluster and multiple service end systems;
[0045] Each service end system is used to send a data update request to the configuration service cluster, obtain the updated configuration data sent by the configuration service cluster in response to the data update request; save the updated configuration data locally, and send a configuration loading confirmation long polling request to the configuration service cluster after the saving is successful; wherein the configuration loading confirmation long polling request is used to request the configuration service cluster to load the updated configuration data saved locally; receive a loading notification of loading the updated configuration data sent by the configuration service cluster in response to the configuration loading confirmation long polling request; according to the loading notification, update the original configuration data based on the locally saved updated configuration data;
[0046] The configuration service cluster is used to respond to data update requests sent by each business end system and send updated configuration data to each business end system; receive configuration loading confirmation long polling requests sent by each business end system; determine whether each business end system meets the update conditions based on each received configuration loading confirmation long polling request; when it is determined that each business end system meets the update conditions, respond to each configuration loading confirmation long polling request and send a loading notification to each business end system to load the updated configuration data.
[0047] The embodiments of the present application provide a configuration data updating method and a distributed system. Each business end system first saves the updated configuration data locally, and then uses a configuration loading confirmation mechanism. When the configuration service cluster determines that each business end system meets the update conditions, a loading notification is sent to each business end system to ensure that all business end systems load the updated configuration data at the same time, thereby avoiding the problem of abnormal business transactions due to configuration update delays or missed configuration updates of individual business end systems.
[0048] When it is determined that at least one business end system does not meet the update conditions, the configuration service cluster sends a cancellation notification to each business end system to cancel the configuration data update, so that each business end system clears the locally saved updated configuration data to ensure the consistency of configuration data in each business end system.
[0049] Among them, each business end system confirms whether the configuration data is updated by sending a configuration update monitoring long polling request; and when receiving a configuration data update notification, it initiates a data acquisition request to obtain the updated configuration data. Through such a configuration update monitoring mechanism, the updated configuration data can be obtained in a timely manner to ensure the immediacy of the configuration information.
[0050] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 One of the flow charts of a method for updating configuration data provided in an embodiment of the present application is shown;
[0053] Figure 2 A second flowchart of a method for updating configuration data provided in an embodiment of the present application is shown;
[0054] Figure 3 A third flowchart of a method for updating configuration data provided in an embodiment of the present application is shown;
[0055] Figure 4 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0056] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0057] Research has found that in the existing distributed microservice architecture system, when the server monitors the configuration data update, it will notify each client instance to obtain the configuration data so as to update the configuration data to each client instance.
[0058] However, in distributed high-concurrency scenarios of microservices, some client instances may experience configuration update delays or miss configuration updates due to network jitter and other reasons, causing some client instances to fail to load the latest published configuration information in a timely manner, affecting the accuracy of business transactions and causing system transaction errors.
[0059] Based on this, the embodiments of the present application provide a configuration data updating method and a distributed system to ensure that all business end systems load and update the configuration data at the same time, avoiding business transaction abnormalities caused by configuration update delays or missed configuration updates of individual business end systems.
[0060] See also Figure 1 , Figure 1 One of the flowcharts of a configuration data updating method provided in an embodiment of the present application. The updating method is applied to a configuration service cluster in a distributed system; a configuration service cluster (config-server) refers to a service cluster that centrally manages the configuration data of each application in a distributed system. By separating the configuration data of the system from the application code, the configuration data can be dynamically adjusted at runtime without redeploying the application to improve the flexibility, maintainability and scalability of the system; the distributed system also includes multiple business end systems (also called services or microservices), which communicate and collaborate through the network to achieve complex business functions, and each business end system (config-sdk) can run client instances of multiple applications. The configuration data may include runtime parameters, environment variables, etc. of the application. During the actual operation process, the configuration data will be updated, so it is necessary to synchronize the configuration data in each business end system in a timely manner through the configuration service cluster to ensure the consistency of the configuration data in each business end system.
[0061] like Figure 1 As shown in , the updating method provided in the embodiment of the present application includes:
[0062] S101. In response to a data update request sent by each business end system, update configuration data is sent to each business end system, so that each business end system saves the update configuration data locally.
[0063] In specific implementation, each business-end system can periodically send data update requests to the configuration service cluster to request the latest version of configuration data; the configuration service cluster receives the data update requests, and when the configuration data is updated, it can respond to each data update request and send the updated configuration data to each business-end system; each business-end system saves the received updated configuration data locally in each business-end system and waits for update.
[0064] In specific implementation, step S101 may include:
[0065] Receive configuration update monitoring long polling requests sent by each business end system; regularly monitor whether there is any change in the version of the configuration data in the local database; if a version change is detected, obtain the updated configuration data from the local database, and respond to each configuration update monitoring long polling request, send configuration data update notifications to each business end system respectively, so that each business end system initiates a data acquisition request to the configuration service cluster; respond to the data acquisition request sent by each business end system, and send the updated configuration data to each business end respectively.
[0066] Among them, Long Polling is a technology used for real-time data push. The client sends a long polling request to the server, and the server keeps the long polling request open until new data is available or the timeout period is reached. Once there is new data, the server immediately responds to the long polling request and returns the response result.
[0067] In an embodiment of the present application, a configuration update monitoring long polling request is used to confirm with the configuration service cluster whether the configuration data is updated. After receiving a configuration update monitoring long polling request, the configuration service cluster first suspends the request and maintains the connection status with the corresponding business end system. At the same time, the configuration service cluster monitors whether the version of the configuration data in the local database of the cluster has changed through a scheduled task; if there is a change, the updated configuration data is extracted from the local database through event processing; thereafter, in response to each received configuration update monitoring long polling request, a configuration data update notification is sent to each business end system respectively to notify each business end system that the configuration data has been updated. After receiving the configuration data update notification, each business end system can initiate a data acquisition request for updating the configuration data to the configuration service cluster. In response to the data acquisition request sent by each business end system, the configuration service cluster sends updated configuration data to each business end respectively.
[0068] S102: Receive a configuration loading confirmation long polling request sent by each business end system.
[0069] In this step, after each business end system saves the updated configuration data of the new version locally, the updated configuration data has not yet been loaded into the actual application instance, but is in a waiting-to-load state. Afterwards, each business end system sends a configuration loading confirmation long polling request to the configuration service cluster to request the configuration service cluster to load the updated configuration data saved locally, that is, to request to load the updated configuration data into the actual application instance.
[0070] S103: Determine whether each service end system meets the update condition according to each received configuration loading confirmation long polling request.
[0071] In this step, the configuration service cluster determines whether each business end system has met the update condition according to the received configuration loading confirmation long polling request sent by each business end system.
[0072] In specific implementation, it can be determined whether all service end systems in the distributed system have successfully saved the updated configuration data locally according to each received configuration loading confirmation long polling request. Here, because the configuration loading confirmation long polling request is triggered only after the service end system saves the updated configuration data locally, when a configuration loading confirmation long polling request is received from any service end system, it can be determined that the service end system has met the update conditions.
[0073] Afterwards, if it is determined that all business-end systems have successfully saved the updated configuration data locally, it is determined that each business-end system meets the update conditions, and subsequent data update operations can be performed.
[0074] More specifically, the following steps can be used to determine whether all business-end systems in the distributed system have successfully saved the updated configuration data locally:
[0075] When a configuration loading confirmation long polling request is received from any business end system, the timing is started; the business end system identifier corresponding to each received configuration loading confirmation long polling request is recorded in the configuration loading confirmation table; the business end systems in the distributed system are regularly counted to obtain the total number of business end systems; before the timing reaches a predetermined time, if the total number of business end systems is equal to the number of business end system identifiers recorded in the configuration loading confirmation table, it is determined that all business end systems in the distributed system have successfully saved the updated configuration data locally; wherein the predetermined time is less than the response time corresponding to the configuration loading confirmation long polling request; when the timing reaches the predetermined time, if the total number of business end systems is still greater than the number of business end system identifiers recorded in the configuration loading confirmation table, it is determined that there is a business end system in the distributed system that has not successfully saved the updated configuration data locally.
[0076] S104. When it is determined that each business end system meets the update conditions, in response to each configuration loading confirmation long polling request, a loading notification for loading the updated configuration data is sent to each business end system respectively, so that each business end system updates the original configuration data based on the locally stored updated configuration data.
[0077] In this step, when it is determined that each business end system meets the update conditions, the configuration service cluster can respond to each configuration loading confirmation long polling request and send a loading notification to each business end system respectively, and the loading notification is used to instruct each business end system to load the updated configuration data. After receiving the loading notification, each business end system can update the original configuration data based on the locally saved updated configuration data, that is, load the updated configuration data into the actual application instance.
[0078] Furthermore, the distributed system also includes a management and control server (config-portal), which can be used to receive the new version of the configuration data sent by the upstream channel and write the new version of the configuration data into the local database of the configuration service cluster. In an embodiment of the present application, the update method also includes:
[0079] The configuration loading confirmation table records whether each business end system has successfully saved the updated configuration data locally, so that the management and control server can determine the status of this configuration update by regularly scanning the configuration loading confirmation table, and the status includes update success, update failure, and updating. When the management and control server determines that the status is update failure, it can also determine the business end system that caused the update failure, so that the operation and maintenance personnel can trace and locate the problem.
[0080] Furthermore, the updating method further includes:
[0081] When it is determined that there is at least one business-end system that does not meet the update conditions, in response to each configuration loading confirmation long polling request, a cancellation notification for canceling the configuration data update is sent to each business-end system respectively, so that each business-end system clears the updated configuration data saved locally, that is, cancels the configuration data update of this version, so as to ensure the consistency of configuration data in each business-end system.
[0082] A configuration data updating method provided in an embodiment of the present application is applied to a configuration service cluster in a distributed system, wherein the distributed system also includes multiple business end systems; the updating method includes: in response to a data update request sent by each business end system, sending updated configuration data to each business end system, so that each business end system saves the updated configuration data locally; receiving a configuration loading confirmation long polling request sent by each business end system; wherein the configuration loading confirmation long polling request is used to request the configuration service cluster to load the updated configuration data that has been saved locally; determining whether each business end system meets the update condition based on each received configuration loading confirmation long polling request; when it is determined that each business end system meets the update condition, sending a loading notification for loading the updated configuration data to each business end system in response to each configuration loading confirmation long polling request, so that each business end system updates the original configuration data based on the locally saved updated configuration data.
[0083] In this way, the configuration update method provided in the embodiment of the present application is based on long connection notification and asynchronous non-blocking communication technology, and adds a configuration loading confirmation mechanism on the basis of ensuring the immediacy and consistency of configuration data. When the configuration service cluster determines that each business end system meets the update conditions, a loading notification is sent to each business end system to ensure that all business end systems load and update configuration data at the same time, avoiding the problem of abnormal business transactions due to delays in configuration updates of individual business end systems or missed configuration updates.
[0084] Based on the same inventive concept, the embodiment of the present application also provides another configuration data updating method, which is applied to any service end system in a plurality of service end systems in a distributed system, wherein the distributed system further includes a configuration service cluster.
[0085] See also Figure 2 , Figure 2 This is a second flow chart of a method for updating configuration data provided in an embodiment of the present application. Figure 2 As shown in , the updating method provided in the embodiment of the present application includes:
[0086] S201: Send a data update request to the configuration service cluster, and obtain updated configuration data sent by the configuration service cluster in response to the data update request.
[0087] In specific implementation, step S201 may include:
[0088] A configuration update monitoring long polling request sent to the configuration service cluster; wherein the configuration update monitoring long polling request is used to confirm with the configuration service cluster whether the configuration data is updated;
[0089] Receiving a configuration data update notification sent by the configuration service cluster in response to the configuration update monitoring long polling request when the configuration service cluster monitors that a version of the configuration data in the local database has changed;
[0090] Initiate a data acquisition request to the configuration service cluster according to the configuration data update notification;
[0091] The updated configuration data sent by the configuration service cluster in response to the data acquisition request is received.
[0092] S202: Save the updated configuration data locally, and after successful saving, send a configuration loading confirmation long polling request to the configuration service cluster.
[0093] The configuration loading confirmation long polling request is used to request the configuration service cluster to load the updated configuration data that has been saved locally;
[0094] S203: Receive a loading notification of loading the updated configuration data, which is sent by the configuration service cluster in response to the configuration loading confirmation long polling request.
[0095] S204: According to the loading notification, the original configuration data is updated based on the locally stored update configuration data.
[0096] Here, the description of S201 to S204 can refer to the description of S101 to S104, and can achieve the same technical effect, which is not elaborated herein.
[0097] Based on the same inventive concept, the embodiment of the present application also provides another configuration data updating method. The updating method is applied to a distributed system; the distributed system includes multiple business end systems, a configuration service cluster and a management and control server.
[0098] See also Figure 3 , Figure 3 This is a third flowchart of a method for updating configuration data provided in an embodiment of the present application. Figure 3 A service end system is schematically shown in FIG. 1 . The updating method provided in the embodiment of the present application includes:
[0099] S301. Any business end system initiates a long polling request to confirm whether configuration data is updated.
[0100] S302: Update the configuration data of the latest version.
[0101] Operation and maintenance personnel or other upstream channels update the latest version of configuration data to the management and control server through configuration release / rollback.
[0102] S303: The management and control server writes the latest version of the configuration data into the local database of the configuration service cluster.
[0103] S304: The configuration service cluster monitors that a version of the configuration data has changed.
[0104] S305: The configuration service cluster sends a configuration data update notification to the business end system.
[0105] S306: The business end system initiates a data acquisition request to the configuration service cluster.
[0106] S307: The configuration service cluster sends the updated configuration data to the business end system.
[0107] S308: The business end system sends a long polling request to the configuration service cluster to request loading and updating configuration data.
[0108] S309: The configuration service cluster records the business end system identifier in the configuration loading confirmation table, and determines whether each business end system meets the update condition.
[0109] S310: When the configuration service cluster determines that each business end system meets the update condition, a loading notification is sent to the business end system.
[0110] S311. The business end system updates the original configuration data based on the locally stored update configuration data.
[0111] S312. The management and control server periodically scans the configuration loading confirmation table to determine the status of this configuration update, and when the status is determined to be update failure, determines the business end system that caused the update failure.
[0112] Based on the same concept, the embodiment of the present application also provides a distributed system, including a configuration service cluster and multiple service end systems;
[0113] Each service end system is used to send a data update request to the configuration service cluster, obtain the updated configuration data sent by the configuration service cluster in response to the data update request; save the updated configuration data locally, and send a configuration loading confirmation long polling request to the configuration service cluster after the saving is successful; wherein the configuration loading confirmation long polling request is used to request the configuration service cluster to load the updated configuration data saved locally; receive a loading notification of loading the updated configuration data sent by the configuration service cluster in response to the configuration loading confirmation long polling request; according to the loading notification, update the original configuration data based on the locally saved updated configuration data;
[0114] The configuration service cluster is used to respond to data update requests sent by each business end system and send updated configuration data to each business end system; receive configuration loading confirmation long polling requests sent by each business end system; determine whether each business end system meets the update conditions based on each received configuration loading confirmation long polling request; when it is determined that each business end system meets the update conditions, respond to each configuration loading confirmation long polling request and send a loading notification to each business end system to load the updated configuration data.
[0115] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown in , the electronic device 400 includes a processor 410 , a memory 420 and a bus 430 .
[0116] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, the above-mentioned Figures 1 to 3 The specific implementation of the steps of the method for updating configuration data in the method embodiment shown can be found in the method embodiment, which will not be described in detail here.
[0117] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figures 1 to 3 The specific implementation of the steps of the method for updating configuration data in the method embodiment shown can be found in the method embodiment, which will not be described in detail here.
[0118] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0119] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0120] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0121] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0122] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0123] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for updating configuration data, characterized in that: The updating method is applied to a configuration service cluster in a distributed system, wherein the distributed system further includes a plurality of service end systems; the updating method includes: In response to a data update request sent by each business end system, sending updated configuration data to each business end system so that each business end system saves the updated configuration data locally; Receiving a configuration loading confirmation long polling request sent by each service end system; wherein the configuration loading confirmation long polling request is used to request the configuration service cluster to load the updated configuration data that has been saved locally; Determine whether each business end system meets the update conditions according to each received configuration loading confirmation long polling request; When it is determined that each business end system meets the update conditions, in response to each configuration loading confirmation long polling request, a loading notification for loading the updated configuration data is sent to each business end system respectively, so that each business end system updates the original configuration data based on the locally stored updated configuration data.
2. The updating method according to claim 1, characterized in that: The step of sending updated configuration data to each service end system in response to a data update request sent by each service end system includes: Receiving a configuration update monitoring long polling request sent by each service end system; wherein the configuration update monitoring long polling request is used to confirm with the configuration service cluster whether the configuration data is updated; Regularly monitor whether the version of configuration data in the local database has changed; If a version change is detected, the updated configuration data is obtained from the local database, and in response to each configuration update monitoring long polling request, a configuration data update notification is sent to each business end system, so that each business end system initiates a data acquisition request to the configuration service cluster; In response to the data acquisition request sent by each service end system, the updated configuration data is sent to each service end respectively.
3. The updating method according to claim 1, characterized in that: The step of determining whether each service end system meets the update condition according to each received configuration loading confirmation long polling request includes: Determining, according to each received configuration loading confirmation long polling request, whether all service end systems in the distributed system have successfully saved the updated configuration data locally; If all the service-end systems have successfully saved the update configuration data locally, it is determined that each service-end system meets the update condition.
4. The updating method according to claim 3, characterized in that: The determining, based on each received configuration loading confirmation long polling request, whether all service end systems in the distributed system have successfully saved the updated configuration data locally includes: When a configuration loading confirmation long polling request is received from any business end system, the timing is started; Record the business end system identifier corresponding to each received configuration loading confirmation long polling request in the configuration loading confirmation table; Regularly counting the service end systems in the distributed system to obtain the total number of service end systems; Before the timing reaches a predetermined time, if the total number of the business end systems is equal to the number of business end system identifiers recorded in the configuration loading confirmation table, it is determined that all business end systems in the distributed system have successfully saved the updated configuration data locally; wherein the predetermined time is less than the response time corresponding to the configuration loading confirmation long polling request; When the timing reaches the predetermined time, if the total number of the business end systems is still greater than the number of business end system identifiers recorded in the configuration loading confirmation table, it is determined that there is a business end system in the distributed system that has not successfully saved the updated configuration data locally.
5. The updating method according to claim 4, characterized in that: The distributed system also includes a management and control server; the update method also includes: The configuration loading confirmation table records whether each business-end system has successfully saved the updated configuration data locally, so that the management and control server can determine the status of this configuration update by regularly scanning the configuration loading confirmation table, and when the status is determined to be an update failure, determine the business-end system that caused the update failure.
6. The updating method according to claim 1, characterized in that: The updating method further comprises: When it is determined that at least one service end system does not meet the update conditions, in response to each configuration update monitoring long polling request, a cancellation notification for canceling the configuration data update is sent to each service end system respectively, so that each service end system clears the locally stored updated configuration data.
7. A method for updating configuration data, characterized in that: The updating method is applied to any service end system among a plurality of service end systems in a distributed system, wherein the distributed system further comprises a configuration service cluster; the updating method comprises: Sending a data update request to the configuration service cluster, and obtaining updated configuration data sent by the configuration service cluster in response to the data update request; The updated configuration data is saved locally, and after successful saving, a configuration loading confirmation long polling request is sent to the configuration service cluster; wherein the configuration loading confirmation long polling request is used to request the configuration service cluster to load the updated configuration data that has been saved locally; receiving a loading notification of loading the updated configuration data sent by the configuration service cluster in response to the configuration loading confirmation long polling request; According to the loading notification, the original configuration data is updated based on the locally stored updated configuration data.
8. The updating method according to claim 7, characterized in that: Sending a data update request to the configuration service cluster, and obtaining updated configuration data sent by the configuration service cluster in response to the data update request, includes: A configuration update monitoring long polling request sent to the configuration service cluster; wherein the configuration update monitoring long polling request is used to confirm with the configuration service cluster whether the configuration data is updated; Receiving a configuration data update notification sent by the configuration service cluster in response to the configuration update monitoring long polling request when the configuration service cluster monitors that a version of the configuration data in the local database has changed; Initiate a data acquisition request to the configuration service cluster according to the configuration data update notification; The updated configuration data sent by the configuration service cluster in response to the data acquisition request is received.
9. A method for updating configuration data, characterized in that: The updating method is applied to a distributed system; The distributed system includes multiple business end systems and a configuration service cluster; the update method includes: Each business end system sends a data update request to the configuration service cluster; The configuration service cluster sends updated configuration data to each service end system in response to the data update request; Each service end system saves the updated configuration data locally, and after successful saving, sends a configuration loading confirmation long polling request to the configuration service cluster; wherein the configuration loading confirmation long polling request is used to request the configuration service cluster to load the updated configuration data saved locally; The configuration service cluster determines whether each service end system meets the update condition according to each received configuration loading confirmation long polling request, and when it is determined that each service end system meets the update condition, responds to each configuration loading confirmation long polling request and sends a loading notification for loading the updated configuration data to each service end system respectively; Each service end system updates the original configuration data based on the locally stored updated configuration data according to the loading notification.
10. A distributed system, characterized in that: Including configuration of service clusters and multiple business end systems; Each service end system is used to send a data update request to the configuration service cluster, obtain the updated configuration data sent by the configuration service cluster in response to the data update request; save the updated configuration data locally, and send a configuration loading confirmation long polling request to the configuration service cluster after the saving is successful; wherein the configuration loading confirmation long polling request is used to request the configuration service cluster to load the updated configuration data saved locally; receive a loading notification of loading the updated configuration data sent by the configuration service cluster in response to the configuration loading confirmation long polling request; according to the loading notification, update the original configuration data based on the locally saved updated configuration data; The configuration service cluster is used to respond to data update requests sent by each business end system and send updated configuration data to each business end system; receive configuration loading confirmation long polling requests sent by each business end system; determine whether each business end system meets the update conditions based on each received configuration loading confirmation long polling request; when it is determined that each business end system meets the update conditions, respond to each configuration loading confirmation long polling request and send a loading notification to each business end system to load the updated configuration data.
Citation Information
Patent Citations
Distributed system and configuration information updating method in distributed system
CN104092718A
Distributed transaction coordination method and device and electronic equipment
CN112148394A
Micro-service cluster distributed transaction processing method and related equipment thereof
CN117093588A
Method and device for realizing strong consistency of data
CN117407404A