Configuration data acquisition method and device, computer readable medium and electronic device

By introducing a two-layer local caching mechanism into the configuration system, the problem of abnormal business services caused by accidental deletion of configuration data or system failures was solved, ensuring reliable acquisition of configuration data and improving the availability and stability of the system.

CN122285960APending Publication Date: 2026-06-26TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2024-12-25
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In the configuration system, accidental deletion of configuration data or system failure can prevent business services from obtaining configuration data, resulting in business service abnormalities.

Method used

A two-tier local caching mechanism is employed. The first local cache stores configuration data synchronized from the backend, while the second local cache stores configuration data retrieved from the backend. When the first local cache fails to retrieve the target configuration data, or when the query from the backend fails, the system switches to the second local cache to ensure the reliability of the configuration data.

Benefits of technology

Even if configuration data is accidentally deleted or the system fails, configuration data can still be retrieved from the second local cache, ensuring the availability and stability of business services and improving system reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122285960A_ABST
    Figure CN122285960A_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, computer-readable medium, and electronic device for acquiring configuration data. The method includes: when target configuration data requested for querying is obtained from the backend, storing the target configuration data in a first local cache and a second local cache, respectively. The first local cache stores configuration data synchronously updated from the backend, and the second local cache stores configuration data obtained from the backend. When the target configuration data needs to be acquired again, if the target configuration data is not found in the first local cache, a request is made to query the target configuration data from the backend; if the target configuration data is not found in the backend, the target configuration data is acquired from the second local cache. The solution of this application can acquire configuration data in abnormal scenarios, improving the availability of the business system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of configuration system technology, and more specifically, to a method, apparatus, computer-readable medium, and electronic device for acquiring configuration data. Background Technology

[0002] Currently, if a user accidentally deletes configuration data in the configuration system, or if the configuration system malfunctions and the configuration data is cleared or deleted, the business service will be unable to obtain the corresponding configuration, resulting in business service anomalies. Summary of the Invention

[0003] Embodiments of this application provide a method, apparatus, computer-readable medium, and electronic device for obtaining configuration data, thereby enabling the recovery of lost configuration data, at least to a certain extent, when a user mistakenly deletes configuration data in the configuration system or when the configuration system malfunctions and causes the configuration data to be lost.

[0004] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.

[0005] According to one aspect of the embodiments of this application, a method for obtaining configuration data is provided. The method includes: when target configuration data requested for querying is obtained from the backend, storing the target configuration data in a first local cache and a second local cache, respectively, wherein the first local cache is used to store configuration data synchronously updated from the backend, and the second local cache is used to store configuration data obtained from the backend; when the target configuration data needs to be obtained again, if the target configuration data is not obtained from the first local cache, then requesting to query the target configuration data from the backend; if the target configuration data is not found from the backend, then obtaining the target configuration data from the second local cache.

[0006] According to one aspect of the embodiments of this application, a configuration data acquisition apparatus is provided. The apparatus includes: a data storage unit, configured to, when a target configuration data requested for querying is obtained from a background, store the target configuration data in a first local cache and a second local cache, respectively, wherein the first local cache is used to store configuration data synchronously updated from the background, and the second local cache is used to store configuration data obtained from the background; a data query unit, configured to, when the target configuration data needs to be obtained again, request to query the target configuration data from the background if the target configuration data is not obtained from the first local cache; and a data acquisition unit, configured to, if the target configuration data is not found in the background query, acquire the target configuration data from the second local cache.

[0007] In some embodiments of this application, based on the foregoing scheme, the first local cache and the second local cache are storage spaces corresponding to the local proxy end, and the device further includes a data return unit; after obtaining the target configuration data from the second local cache, the data return unit is used to: return the target configuration data obtained from the second local cache to the business service deployed locally, so that the business service provides services based on the target configuration data.

[0008] In some embodiments of this application, based on the foregoing scheme, the data storage unit is configured to: update the target configuration data to the first local cache corresponding to the agent, and write the target configuration data to a local cache file located locally corresponding to the agent, wherein the local cache file is used to restore the first local cache; update the target configuration data to the second local cache corresponding to the agent, and write the target configuration data to an escape cache file located locally corresponding to the agent, wherein the escape cache file is used to restore the second local cache.

[0009] In some embodiments of this application, based on the foregoing scheme, the data storage unit is configured to: write the target configuration data to a message queue; retrieve the target configuration data from the message queue and update the target configuration data to the second local cache corresponding to the agent; and write the target configuration data located in the second local cache to an escape cache file located locally corresponding to the agent.

[0010] In some embodiments of this application, based on the foregoing scheme, the apparatus further includes an acquisition and deletion unit; before the target configuration data needs to be acquired again, the acquisition and deletion unit is used to: acquire a configuration deletion request from the background, and delete the target configuration data in the first local cache and the local cache file according to the configuration deletion request, wherein the configuration deletion request is generated by the background after receiving a deletion instruction for the target configuration data, and the background deletes the target configuration data stored in the background when it receives the deletion instruction for the target configuration data.

[0011] In some embodiments of this application, based on the foregoing scheme, the device further includes a data cleaning unit; before updating the target configuration data to the second local cache corresponding to the agent, the data cleaning unit is used to: if the space occupied by the second local cache corresponding to the agent reaches a predetermined upper limit of space occupied, delete at least one configuration data with the earliest query time in the second local cache and the escape cache file corresponding to the agent.

[0012] In some embodiments of this application, based on the foregoing scheme, the data return unit is configured to: return the target configuration data obtained from the second local cache to the third local cache corresponding to the software development kit, and return the target configuration data to the business service through the third local cache, wherein the software development kit is integrated into the business service deployed locally.

[0013] In some embodiments of this application, based on the foregoing scheme, the apparatus further includes a determining unit; before requesting to query the target configuration data from the background, the determining unit is configured to: when receiving a target configuration data query request from the software development kit, determine that the target configuration data needs to be obtained again, wherein the target configuration data query request is triggered when the configuration data in the third local cache expires or when the business service is started and completed, and the target configuration data query request is used to obtain the configuration data in the third local cache again, wherein the configuration data includes the target configuration data.

[0014] In some embodiments of this application, based on the foregoing scheme, the device further includes a receiving and synchronization unit; the receiving and synchronization unit is used to: receive configuration data query requests periodically sent by the software development kit, and synchronize and update the configuration data in the first local cache to the third local cache corresponding to the software development kit according to the configuration data query requests.

[0015] According to one aspect of the embodiments of this application, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the configuration data acquisition method as described in the above embodiments.

[0016] According to one aspect of the embodiments of this application, an electronic device is provided, including: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the configuration data acquisition method as described in the above embodiments.

[0017] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium, a processor of a computer device reading the computer instructions from the computer-readable storage medium, and the processor executing the computer instructions to cause the computer device to perform the configuration data acquisition method as described in the above embodiments.

[0018] In some embodiments of this application, when the target configuration data requested for local query is obtained from the background, the target configuration data is stored in a first local cache and a second local cache respectively. When the target configuration data needs to be obtained again, the system first attempts to obtain the target configuration data from the first local cache to ensure efficient data retrieval. If the target configuration data is not obtained from the first local cache, a request is made to query the target configuration data from the background. If the target configuration data cannot be found from the background, the target configuration data is obtained from the second local cache. Since the first local cache is used to store configuration data synchronously updated from the background, and the second local cache is used to store configuration data obtained from the background, even if the user mistakenly deletes the target configuration data in the configuration system, the target configuration data will not be deleted from the second local cache. That is, the target configuration data can still be stored in the second local cache, and therefore, the lost target configuration data can still be obtained from the second local cache. Similarly, when the configuration system malfunctions, causing the target configuration data to be lost or even all configuration data to be abnormally cleared, the lost target configuration data can still be obtained from the second local cache. Since the target configuration data can be obtained in various abnormal scenarios in this application embodiment, and the target configuration data can be used to support the operation of business services, the availability of business services can be effectively improved.

[0019] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0020] 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. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:

[0021] Figure 1 An architectural block diagram of the configuration system in the related technology is shown;

[0022] Figure 2 A schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of this application can be applied is shown;

[0023] Figure 3 A flowchart illustrating a method for obtaining configuration data according to an embodiment of this application is shown;

[0024] Figure 4 An architectural block diagram of a configuration system according to an embodiment of this application is shown;

[0025] Figure 5 An embodiment according to this application is shown. Figure 3 A flowchart detailing step 310 in the embodiment;

[0026] Figure 6 An embodiment according to this application is shown. Figure 5 A flowchart of the steps preceding step 313 in the embodiment;

[0027] Figure 7 The flowchart illustrates a specific process according to an embodiment of this application, in which target configuration data is updated to the second local cache corresponding to the agent and the target configuration data is written to the escape cache file located locally corresponding to the agent.

[0028] Figure 8 A schematic diagram illustrating the principle of escape cache generation according to an embodiment of this application is shown;

[0029] Figure 9 An embodiment according to this application is shown. Figure 5 Flowchart of the steps preceding step 340 in the embodiment;

[0030] Figure 10 A schematic diagram illustrating the principle of configuring accidental deletion scenarios is shown;

[0031] Figure 11 An embodiment according to this application is shown. Figure 3 Flowchart of the steps preceding step 340 in the embodiment;

[0032] Figure 12 A schematic diagram illustrating the principle of an escape caching application according to an embodiment of this application is shown;

[0033] Figure 13 An embodiment according to this application is shown. Figure 3 A flowchart of the steps following step 350 in the embodiment;

[0034] Figure 14 An embodiment according to this application is shown. Figure 13 A flowchart detailing step 360 in the embodiment;

[0035] Figure 15 A block diagram of a configuration data acquisition apparatus according to an embodiment of this application is shown;

[0036] Figure 16 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown. Detailed Implementation

[0037] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.

[0038] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.

[0039] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0040] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0041] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0042] Figure 1 An architectural block diagram of a configuration system in related technologies is shown. Please refer to [link / reference]. Figure 1 As shown, the architecture of the configuration system in related technologies includes a management service, a database, a processor, an agent, and a business service containing an SDK. The management service writes configuration data to the database for persistent storage, the processor reads the configuration data from the database, and distributes it to the agent or the SDK of the business service to take effect.

[0043] The following scenarios may be encountered when using the above configuration system:

[0044] Scenario 1: If a user accidentally deletes a used configuration through the management service, the business service will be unable to retrieve the corresponding configuration, causing service failure. Some configuration system SDKs have memory caching, so when the business service restarts, it will not be able to retrieve the accidentally deleted configuration.

[0045] Scenario 2: If the configuration system itself malfunctions and the configuration data in the backend database is abnormally cleared, all configurations will be distributed to the agent and the SDK of the business service via the processor to take effect. Similar to Scenario 1, the business service will also fail to obtain the configuration, resulting in an exception.

[0046] Both of these scenarios will cause business services to be unable to obtain the required configuration data, resulting in service anomalies. Scenario 2 is particularly problematic because the configuration system is usually deployed centrally and relies on a single configuration system globally. Therefore, if the backend database or backend service fails, it will lead to widespread business service failures.

[0047] Therefore, the configuration system in the related technology has the following drawbacks:

[0048] 1. Data is stored in the database in the configuration system backend. The database is usually in a master-slave architecture. If data is deleted abnormally, it will cause the backend service to malfunction.

[0049] 2. To maintain data consistency with the agent, the background service of the configuration system usually updates its cache via heartbeat. When the configuration data is deleted due to database or other reasons, the agent will also clear its own cache, which will cause the SDK to be unable to obtain the deleted configuration data.

[0050] 3. Some configuration systems also have cache files on the SDK side. Similar to the previous point, the SDK will also keep the agent's cache consistent. When the configuration data cached by the agent is deleted, the SDK will also update its own cache file, which will also result in the inability to obtain the deleted configuration data.

[0051] Therefore, this application first provides a method for obtaining configuration data. The method for obtaining configuration data provided in this application can overcome the above-mentioned deficiencies in related technologies, and can ensure that the client can still obtain the lost configuration data even when the configuration system malfunctions and causes data loss in the background, or when configuration data is accidentally deleted through the configuration system management terminal.

[0052] Figure 2 A schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of this application can be applied is shown. For example... Figure 2As shown, the system architecture 200 may include a user terminal 210, a management server 220, a database server 230, a backend server 240, a first business server 250, a second business server 260, and a third business server 270. Each business server and the database server 230 establishes a communication connection with the backend server 240. The user terminal 210 and the database server 230 also establish a communication connection with the management server 220. The management server 220 deploys a management server, the user terminal 210 deploys a management client capable of accessing the management server, the database server 230 deploys a configuration database storing configuration data, the backend server 240 deploys a backend service, and each business server deploys an agent and a software development kit (SDK) integrating the configuration system. The service of the Kit (SDK) allows the agent to communicate with the configuration system SDK. Each service server also has an in-process cache corresponding to each agent. Each service server can serve as the execution subject of the scheme in this application embodiment. Taking the first service server 250 as the execution subject of the scheme in this application embodiment as an example, when the configuration data acquisition method provided in this application embodiment is applied to... Figure 2In the system architecture shown, a process can be as follows: First, the business service on the first business server 250 calls the configuration system SDK to request and obtain the target configuration data. Then, the configuration system SDK sends a configuration query request to the agent. If the agent finds the target configuration data in its corresponding in-process cache according to the configuration query request, it will directly return the target configuration data to the business service on the first business server 250 through the configuration system SDK. If the agent fails to find the target configuration data in its corresponding in-process cache according to the configuration query request, it will send a configuration query request to the background service on the background server 240. The background service sends a query instruction to the configuration database on the database server 230 according to the configuration query request, obtains the target configuration data returned by the configuration database according to the query instruction, and returns the target configuration data to the agent on the first business server 250. The agent will update the target configuration data in its corresponding in-process cache, retrieve the target configuration data from the in-process cache, and return the target configuration data to the business service on the first business server 250 through the configuration system SDK. The agent will also write the target configuration data to its local cache. In the cache file; then, the user mistakenly sends a deletion command for the target configuration data to the management server on the management server 220 through the management client on the user terminal 210. The management server will delete the target configuration data in the configuration database, and the configuration database will generate a corresponding configuration deletion request; the background service of the background server 240 will load the configuration deletion request, and the agent on the first business server 250 will pull the configuration deletion request from the background server 240 and delete the target configuration data in the in-process cache of the agent according to the configuration deletion request; then, when the business service on the first business server 250 calls the configuration system SDK again to request the target configuration data, the configuration system SDK sends a configuration query request to the agent. Since the agent cannot find the target configuration data in its corresponding in-process cache, it will send a configuration query request to the background service on the background server 240. Since the background service cannot find the target configuration data in the configuration database on the database server 230, the agent will find the target configuration data in the local escape cache file and return the target configuration data to the business service on the first business server 250 through the configuration system SDK.

[0053] In some embodiments of this application, each business server also has a cache corresponding to the configuration system SDK of each business service. The cache is used to store configuration data that is synchronously updated by the background service. The configuration system SDK sends a configuration query request to the agent when the target configuration data is not found in the cache corresponding to the configuration system SDK.

[0054] In some embodiments of this application, each business server also has a local cache file corresponding to each agent. The agent on the first business server 250 will also synchronize the target configuration data to the local cache file corresponding to the agent according to the in-process cache corresponding to the agent.

[0055] In some embodiments of this application, when the agent on the first business server 250 restarts, the agent on the first business server 250 will restore the configuration data in the in-process cache corresponding to the agent according to the local cache file corresponding to the agent.

[0056] In some embodiments of this application, each business server also has an escape cache corresponding to each agent. The agent on the first business server 250 writes the target configuration data into the escape cache corresponding to the agent, and then writes the target configuration data into the local escape cache file based on the escape cache.

[0057] In some embodiments of this application, the business service on the first business server 250 calls the configuration system SDK again to request the target configuration data when the configuration data in the cache corresponding to the configuration system SDK of the business service expires or the business service is restarted.

[0058] In some embodiments of this application, the backend server 240 also has a cache corresponding to the backend service. The cache is used to store configuration data in the database. When the target configuration data is not found in the cache corresponding to the backend service, the backend service sends a query instruction to the configuration database on the database server 230 according to the configuration query request.

[0059] In some embodiments of this application, the database is configured as a relational database.

[0060] It should be understood that Figure 2 The number of user terminals, management servers, database servers, backend servers, and business servers shown is merely illustrative. Depending on implementation needs, there can be any number of user terminals, management servers, database servers, backend servers, and business servers. That is, there can be multiple user terminals, management servers, database servers, and backend servers, and each of these can also be a server cluster composed of multiple servers.

[0061] It should be noted that, Figure 2 The illustration shown is merely one embodiment of this application. Although in Figure 2In the embodiment of the scheme, the user terminal is a desktop computer, but in other embodiments of this application, the user terminal can also be various types of terminal devices such as smartphones, laptops, tablets, vehicle terminals, portable wearable devices, and workstations; although in Figure 2 In the embodiment, the configuration database is a relational database, but in other embodiments of this application, the configuration database can also be a non-relational database; although in Figure 2 In the embodiment, the configuration database and the backend service reside on two different databases. However, in other embodiments of this application, they can also reside in the same location; for example, the configuration database and the backend service can both reside in the cloud. Figure 2 In the embodiment, the method for obtaining configuration data is applied to a scenario where a user mistakenly deletes configuration data. However, in other embodiments of this application, the method can also be applied to a scenario where a configuration system malfunction causes the configuration data stored in the configuration database to be cleared. Although in Figure 2 In the embodiment, after obtaining the target configuration data, the agent first updates the target configuration data to the in-process cache corresponding to the agent, then retrieves the target configuration data from the in-process cache and returns the target configuration data to the business service on the first business server 250 through the configuration system SDK. However, in other embodiments of this application, after obtaining the target configuration data, the agent can also directly return the target configuration data to the business service on the first business server 250 through the configuration system SDK. This application does not limit the scope of protection in any way, and the protection scope of this application should not be limited as a result.

[0062] It is easy to understand that the configuration data acquisition method provided in the embodiments of this application is generally executed by a server, and correspondingly, the configuration data acquisition device is generally located in the server. However, in other embodiments of this application, the terminal device may also have similar functions to the server, thereby executing the configuration data acquisition scheme provided in the embodiments of this application.

[0063] Therefore, the embodiments of this application can be applied to terminals or servers. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, and this application does not impose any restrictions.

[0064] The implementation details of the technical solutions in the embodiments of this application are described in detail below:

[0065] Figure 3 A flowchart illustrating a method for acquiring configuration data according to an embodiment of this application is shown. This method can be executed by various devices with processing and computing capabilities. Specifically, it can be executed by a target device, such as a user terminal or a cloud server. User terminals include, but are not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, smartwatches, etc. Please refer to... Figure 3 As shown, the method for obtaining this configuration data includes at least the following steps:

[0066] In step 310, when the target configuration data requested by the local request is obtained from the backend, the target configuration data is stored in the first local cache and the second local cache respectively. The first local cache is used to store the configuration data that is synchronously updated from the backend, and the second local cache is used to store the configuration data obtained from the backend.

[0067] The local machine can be a business server or a client machine, where a business service and its corresponding agent can be deployed. The business service may integrate a configuration system's Software Development Kit (SDK). The agent is used to perform the task of retrieving configuration data; specifically, it can provide configuration data to its corresponding business service. In this embodiment, the configuration data can be various data used to support the operation of the business service. For example, configuration data can be the number of threads. By configuring the number of threads for the business service, the concurrency and responsiveness of the service can be improved, while avoiding resource waste and excessive competition. Depending on the business scenario, the type of configuration data can be defined as needed.

[0068] You can deploy only one business service and one corresponding proxy client locally; of course, you can also deploy multiple business services and one proxy client for each business service locally; in addition, when deploying multiple business services locally, you can also deploy only one proxy client locally, which is used to provide services for all business services deployed locally.

[0069] The backend can include backend services and configuration databases, which can be located on the same server or on different servers.

[0070] The first local cache and the first local cache can be the storage space corresponding to the local proxy. In fact, both the first local cache and the first local cache can be local caches, that is, local memory space.

[0071] Since both the first local cache and the second local cache are local caches, and local caches are local memory spaces, they can be two different local memory spaces. Because the read / write speed of memory space is generally much faster than that of disk, storing the target configuration data in the first local cache and the second local cache respectively can improve the query efficiency of the target configuration data. Of course, local caches can also be other storage spaces with read / write speeds faster than disk.

[0072] Of course, the first local cache can also be replaced by a first storage space, and the first local cache can also be replaced by a second storage space. Both the first and second storage spaces can be disk space used to store cache files; that is, cache files can be stored in both the first and second storage spaces. Alternatively, one of the first and second storage spaces can be disk space used to store cache files, while the other can be a local cache.

[0073] The first local cache is used to store configuration data that is synchronized from the backend. In other words, the configuration data stored in the first local cache will be synchronized with the backend.

[0074] The target configuration data can be the configuration data corresponding to the target key. The key can be used to identify a configuration data item, and the configuration data corresponding to the key is the configuration data under that configuration data item.

[0075] Figure 4 An architectural block diagram of a configuration system according to an embodiment of this application is shown. See also... Figure 4 As shown, the configuration system can include several objects: openapi, database, processor, agent, business server, configuration file, and escape file. Openapi is the management service, database is the backend relational database, processor is the backend service, agent is the proxy, and business server is the business service. The configuration system's SDK is embedded within it. Setting up an agent allows for lighter business services and decoupling; upgrades to the agent will not affect the business services.

[0076] Please continue reading Figure 4As shown, the agent includes a configuration cache and an escape cache. The configuration cache can be the first local cache in the above embodiment, while the escape cache can be the second local cache in the above embodiment. Both the configuration cache and the escape cache are located within the agent, meaning they are both in-process caches. This significantly improves read / write efficiency and configuration data retrieval efficiency. Without data cleanup, configuration data in the escape cache will only be added, not deleted. The configuration data in the configuration cache will remain consistent with the backend; therefore, modification, deletion, and addition operations can be performed on the configuration cache.

[0077] Both the configuration cache and the escape cache are local caches, but the contents of the configuration cache and the escape cache are not always exactly the same.

[0078] Assume that both the configuration cache and the escape cache initially contain three configurations: A, B, and C.

[0079] The configuration changes in the configuration cache and escape cache during the following processes are as follows:

[0080] 1. After the backend successfully issues configuration D, the configuration in the configuration cache becomes: A, B, C, D, and the configuration in the escape cache becomes: A, B, C, D.

[0081] 2. After the backend requests to delete configuration B, the configurations in the configuration cache become: A, C, D, while the configurations in the escape cache remain unchanged as: A, B, C, D.

[0082] 3. After the backend requests to delete configuration A, the configurations in the configuration cache become C and D, while the configurations in the escape cache remain unchanged as A, B, C, and D.

[0083] 4. After the backend successfully issues configuration E, the configuration in the configuration cache becomes: C, D, E, and the configuration in the escape cache becomes: A, B, C, D, E.

[0084] 5. After the backend requests to clear all configurations, the configuration in the configuration cache becomes empty, while the configuration in the escape cache remains: A, B, C, D, E.

[0085] Therefore, compared to configuration caching, the unique feature of escape caching is that it stores all successfully retrieved configuration data. It is unaffected by background deletion commands; even if a background request deletes the configuration data or the configuration data in the background database is cleared, the local machine can still retrieve the successfully retrieved configuration data from the escape cache. Furthermore, because escape caching exists in the form of a cache, it enables efficient retrieval of configuration data.

[0086] The configuration data stored in the first storage space will be synchronized with the backend. When the backend deletes configuration data A, the first storage space will also delete configuration data A (at this time, the first storage space will not receive configuration data A, but will receive a deletion instruction for configuration data A. This instruction contains the index corresponding to configuration data A, not configuration data A itself. The first storage space will delete the stored configuration data A according to this index).

[0087] The second storage space will only store the configuration data successfully obtained by the first storage space. Since the deletion command for configuration data A is not the successfully obtained configuration data, the second storage space will not respond to the deletion command for configuration data A, that is, the second storage space will not delete configuration data A.

[0088] When the backend sends out configuration data B, both the first storage space and the second storage space will store configuration data B, because configuration data B is the configuration data successfully obtained by the first storage space.

[0089] Figure 5 An embodiment according to this application is shown. Figure 3 A flowchart detailing step 310 in the embodiment is provided. Please refer to [link / reference]. Figure 5 As shown, storing the target configuration data in the first local cache and the second local cache respectively can include the following steps:

[0090] In step 311, the target configuration data is updated to the first local cache corresponding to the agent, and the target configuration data is written to the local cache file corresponding to the agent located locally. The local cache file is used to restore the first local cache.

[0091] Local cache files can be stored on the local disk.

[0092] The data in the local cache file needs to be consistent with the data in the first local cache. By writing the target configuration data to the local cache file located locally and corresponding to the agent, the data in the local cache file can be kept consistent with the data in the first local cache. The first local cache can also be restored based on the local cache file.

[0093] In the introduction Figure 5 Before step 313 in the embodiment, the steps preceding step 313 will be described in detail.

[0094] Figure 6 An embodiment according to this application is shown. Figure 5 A flowchart of the steps preceding step 313 in this embodiment. Please refer to [link / reference]. Figure 6As shown, before updating the target configuration data to the corresponding second local cache on the agent side, the method for obtaining the configuration data may also include the following steps:

[0095] In step 312, if the space occupied by the second local cache corresponding to the current agent reaches the predetermined space limit, then delete at least one configuration data with the earliest query time in the second local cache and escape cache files corresponding to the agent.

[0096] Delete one or more configuration data with the earliest query time in the second local cache corresponding to the agent, and delete the corresponding configuration data in the escape cache file to make the data in the escape cache file consistent with the data in the second local cache.

[0097] The query time corresponding to the configuration data here refers to the time when the configuration data was most recently queried.

[0098] The configuration data in the second local cache corresponding to the agent can be sorted from smallest to largest according to the corresponding query time, thereby finding one or more configuration data with the earliest query time in the second local cache.

[0099] Of course, whenever the configuration data in the second local cache changes, the configuration data can be immediately sorted according to the corresponding query time from smallest to largest to obtain a sorting result. When configuration data needs to be written to the second local cache, this sorting result can be used directly without re-sorting. Therefore, by prioritizing sorting, this embodiment of the application can improve the efficiency of writing configuration data to the second local cache.

[0100] Of course, after obtaining the sorting results, one or more configuration data with the earliest query time can be marked directly based on the sorting results. When it is necessary to write configuration data to the second local cache, the marked configuration data can be deleted directly.

[0101] The maximum space that can be reserved can be set based on experience; for example, it can be set to 500M.

[0102] The data stored in the second local cache and escape cache files will grow larger and larger, causing memory growth and disk space occupation by the storage files. In this embodiment, when target configuration data needs to be written to the second local cache, if the predetermined space occupation limit is reached, it will be cleaned up. This makes the storage space occupied by the second local cache and escape cache files controllable after the target configuration data is written. At the same time, since only at least one configuration data with the earliest query time is deleted, and if the query time of a configuration data is relatively early, the probability of it being queried again in the future is low. Therefore, the impact on the entire system can be minimized. Of course, in other embodiments of this application, the second local cache and escape cache files can also be cleaned up periodically.

[0103] Please continue reading Figure 5 and Figure 6 In step 313, the target configuration data is updated to the second local cache corresponding to the agent, and the target configuration data is written to the escape cache file located locally corresponding to the agent. The escape cache file is used to restore the second local cache.

[0104] It is easy to understand that writing the target configuration data to the local cache file corresponding to the agent can be performed before or after step 313.

[0105] The second local cache is the escape cache.

[0106] The data in the escape cache file needs to be consistent with the data in the second local cache. By writing the target configuration data to the escape cache file located locally and corresponding to the agent, the data in the escape cache file can be kept consistent with the data in the second local cache. The second local cache can also be restored based on the escape cache file.

[0107] Escape cache files can be stored on the local disk.

[0108] In this embodiment, by setting a first local cache and a second local cache, when configuration data needs to be queried through the agent, the configuration data can be directly retrieved from either the first or second local cache, improving query efficiency. Furthermore, since the first and second local caches are in memory, the data stored therein is easily lost after the agent restarts. Therefore, the local cache files and escape cache files can achieve persistent storage of configuration data, preventing data loss. Moreover, when the agent restarts, the cache can be directly restored from the local cache file, reducing the number of requests sent by the agent to the backend server and lowering the pressure on the backend service. Alternatively, a local cache file can be omitted; when the first local cache needs to be restored, a request can be sent to the backend service to obtain the data required for restoring the first local cache.

[0109] Figure 7 This document illustrates a flowchart illustrating, according to an embodiment of this application, the updating of target configuration data to the second local cache corresponding to the agent, and the writing of the target configuration data to the escape cache file located locally corresponding to the agent. Please refer to [link to relevant documentation]. Figure 7 As shown, updating the target configuration data to the second local cache corresponding to the agent and writing the target configuration data to the escape cache file located locally corresponding to the agent can specifically include the following steps:

[0110] In step 710, the target configuration data is written to the message queue.

[0111] In step 720, the target configuration data is retrieved from the message queue and updated to the corresponding second local cache on the agent side.

[0112] The target configuration data can be retrieved from the message queue via an asynchronous thread and written to a second local cache.

[0113] In step 730, the target configuration data located in the second local cache is written to the escape cache file located locally corresponding to the agent.

[0114] Target configuration data can also be written to the escape cache file via an asynchronous thread.

[0115] The second local cache and escape cache files actually store the configuration data that the SDK successfully retrieved.

[0116] In this embodiment, by using a message queue to transmit target configuration data, the various components in the system can be decoupled, making their dependencies looser, improving the system's flexibility and maintainability. It can also enable asynchronous communication, improving the system's response speed and throughput, avoiding the impact of time-consuming operations on the overall system performance, and effectively coping with sudden traffic spikes by temporarily storing requests in the queue and then processing them step by step, preventing the system from crashing due to instantaneous high load. In addition, when a component in the system fails, the message queue can act as a buffer to ensure that messages are not lost, and processing can continue after the failed component recovers.

[0117] In one embodiment of this application, after storing the target configuration data in a first local cache and a second local cache respectively, the method for obtaining the configuration data further includes: returning the target configuration data stored in the first local cache to the business service deployed locally, so that the business service can provide services based on the target configuration data.

[0118] After returning the target configuration data to the business service, the business service can be run based on the target configuration data.

[0119] In one embodiment of this application, returning target configuration data stored in a first local cache to a locally deployed business service includes: returning the target configuration data stored in the first local cache to a third local cache corresponding to the software development kit, and returning the target configuration data stored in the first local cache to the business service through the third local cache, wherein the software development kit is integrated into the locally deployed business service.

[0120] The third local cache is the local memory space corresponding to the SDK, which is used to store configuration data that is synchronously updated from the backend to the business services that have integrated the SDK.

[0121] Figure 8 A schematic diagram illustrating the principle of escape cache generation according to an embodiment of this application is shown. Please refer to... Figure 8 As shown, the escape cache generation process may include the following steps:

[0122] 1. Query configuration.

[0123] In this embodiment, the local system also has a cache corresponding to the SDK. When a business service calls the configuration system's SDK, it sends a configuration retrieval request to the SDK to query the target configuration data corresponding to the target key. When the configuration data in the SDK's cache expires, an asynchronous thread used to refresh the cache sends a corresponding configuration data query request to the agent to retrieve the configuration data. When the business service restarts, the SDK's cache is cleared. In this case, the configuration retrieval request triggers the SDK to send a corresponding configuration data query request to the agent to retrieve the configuration data.

[0124] 2.1 Query local cache.

[0125] After receiving a configuration query request from the SDK, the agent will first query the configuration cache (agent process cache). If the target configuration data is successfully retrieved from the agent process cache, the target configuration data will be returned directly to the SDK, and the query process will end.

[0126] 2.2 Query the remote server.

[0127] If the target configuration data cannot be found in the agent process cache, the agent will continue to send a query request to the background processor to retrieve the target configuration data. The processor can directly query the background database and retrieve the target configuration data. The processor can also have its own cache. When a processor receives a query request, it can first directly query the target configuration data from its corresponding cache. If found, the processor returns the target configuration data directly to the agent. If the processor does not find the target configuration data in its cache, it can request to query the target configuration data from the background database (such as a relational or non-relational database). When the target configuration data exists in the background database, a corresponding configuration update request is generated. The processor can load this configuration update request and write the target configuration data into its corresponding cache according to the request. The processor also returns the retrieved target configuration data to the agent. The background processor is the remote server, i.e., the background service. The configuration update request can include configuration update instructions and the corresponding target configuration data.

[0128] 3.1 Update local cache.

[0129] The agent can receive the target configuration data returned by the remote server by pulling the above configuration update request from the processor. The agent first updates the local in-process cache according to the query result message (target configuration data) and then updates the target configuration data to the local cache file.

[0130] 3.2 Write to the escape message queue.

[0131] The agent writes the query result messages to the message queue.

[0132] 3.3 Asynchronous thread writes to the escape cache.

[0133] An asynchronous thread retrieves the query result message from the message queue and writes the target configuration data into the escape cache. The asynchronous thread also writes the target configuration data in the escape cache into the escape cache file.

[0134] In detail Figure 3 and Figure 5 Before step 340 in the embodiment, the steps preceding step 340 will be introduced first. Figure 9 An embodiment according to this application is shown. Figure 5 A flowchart of the steps preceding step 340 in this embodiment. Please refer to [link / reference]. Figure 9 As shown, before it is necessary to retrieve the target configuration data again, that is, before it is determined that the target configuration data needs to be retrieved again, the method for retrieving the configuration data may also include the following steps:

[0135] In step 320, a configuration deletion request is obtained from the backend, and the target configuration data in the first local cache and the local cache file is deleted according to the configuration deletion request. The configuration deletion request is generated by the backend after receiving the deletion instruction for the target configuration data. When the backend receives the deletion instruction for the target configuration data, it will delete the target configuration data stored in the backend.

[0136] Upon receiving a deletion command for the target configuration data, the backend can delete the target configuration data stored in the backend and generate a corresponding configuration deletion request based on the deletion command. The deletion command for the target configuration data can be triggered by a user through the configuration system's management interface.

[0137] In one embodiment of this application, the method for obtaining configuration data may further include the following steps: receiving configuration data query requests periodically sent by the software development kit, and synchronously updating the configuration data in the first local cache to the third local cache corresponding to the software development kit according to the configuration data query requests.

[0138] The software development kit can periodically send configuration data query requests to the agent to update the corresponding cached configuration data.

[0139] Figure 10 A schematic diagram illustrating the principle of configuring an accidental deletion scenario is shown. Please refer to [link / reference]. Figure 10As shown, the specific process for configuring the accidental deletion scenario is as follows:

[0140] 1. Accidentally deleted the configuration key.

[0141] A user (Actor) mistakenly deleted the configuration data corresponding to the target key in the configuration system's management interface (openapi), thus triggering a deletion command for the target configuration data.

[0142] 2. Delete the corresponding DB configuration from the management console.

[0143] The configuration system's management console deletes the target configuration data corresponding to the target key from the backend database (DB). A corresponding configuration deletion request is also generated in the DB, and this request can include the target key. In the extreme scenario where the DB data is completely cleared, all configuration data in the DB will be deleted.

[0144] 3. The background service loads the configuration deletion request.

[0145] The configuration system's background service (processor) loads the configuration deletion request from the database and deletes the target configuration data corresponding to the target key in the processor's cache.

[0146] 4. The agent retrieves the configuration deletion request.

[0147] The agent on the client side of the configuration system retrieves the configuration deletion request from the processor. Of course, in other embodiments of this application, the processor can also push the configuration deletion request to the agent.

[0148] 5. The agent deletes the corresponding configuration from the cache.

[0149] The agent will delete the configuration data corresponding to the target key from the agent process cache (configuration cache), and at the same time delete the configuration data corresponding to the target key from the local cache file.

[0150] 6. SDK query failed.

[0151] The configuration system SDK used by the business service periodically sends packets to the agent to query configuration data. Since the configuration data corresponding to the key has been deleted on the agent side, the SDK will also delete the configuration data corresponding to the key in its own cache. This will eventually cause the business service to be unable to obtain the configuration data corresponding to the key, thus causing an exception. In the scenario where the backend database is abnormally cleared, a global failure with a wide range of exceptions will occur.

[0152] Figure 11 An embodiment according to this application is shown. Figure 3A flowchart of the steps preceding step 340 in this embodiment. Please refer to [link / reference]. Figure 11 As shown, before requesting to query the target configuration data from the backend, the method for obtaining the configuration data may also include the following steps:

[0153] In step 330, when a target configuration data query request is received from the software development kit, it is determined that the target configuration data needs to be retrieved again. The target configuration data query request is triggered when the configuration data in the third local cache expires or when the business service is started. The target configuration data query request is used to retrieve the configuration data in the third local cache again. The configuration data includes the target configuration data.

[0154] The third local cache can be the cache corresponding to the SDK. An expiration mechanism can be set for the SDK-related cache. For example, every predetermined period (e.g., one day), all configuration data in the SDK-related cache will expire. At this time, the SDK-related cache can be cleared, triggering the generation of a target configuration data query request. This target configuration data query request can be used to query all configuration data required by the business service. In this embodiment, configuration data can be queried from the first local cache based on the target configuration data query request. That is, the target configuration data query request is used to instruct a subsequent request to retrieve configuration data that previously existed in the third local cache and is currently required by the business service from the first local cache.

[0155] When a business service restarts, it calls the configuration system's SDK and sends a configuration retrieval request to the SDK. Since the SDK's corresponding cache will be cleared, in this case, the configuration retrieval request triggers the SDK to send a corresponding configuration data query request to the agent to retrieve the configuration data.

[0156] Please continue reading Figure 3 In step 340, when the target configuration data needs to be retrieved again, if the target configuration data is not retrieved from the first local cache, a request is made to query the target configuration data from the backend.

[0157] When it is necessary to retrieve the configuration data corresponding to the target key again, the system will first query the first storage space (first local cache) for the configuration data corresponding to the target key. If the first storage space does not find the configuration data corresponding to the target key, a query request can be sent to the backend. If the first storage space finds the target configuration data corresponding to the target key, the target configuration data can be directly returned to the business service through the SDK, and the query process ends.

[0158] In step 350, if the target configuration data is not found in the background, the target configuration data is obtained from the second local cache.

[0159] If the backend retrieves the target configuration data, it will return the target configuration data to the agent, and the agent will then return the target configuration data to the business service.

[0160] Figure 12 A schematic diagram illustrating the principle of an escape caching application according to an embodiment of this application is shown. Please refer to... Figure 4 and Figure 12 As shown, in the event of a configuration system malfunction, the business service can recover the configuration from the escape cache. The entire process is transparent to the business service, and the specific process is as follows:

[0161] 1. Query configuration.

[0162] When the cache expires or the business service starts, the business service will use the configuration system SDK to send a packet to the agent to query the configuration data for the corresponding key.

[0163] 2.1 Query local cache.

[0164] If the query results are cached within the agent's process, the results are returned directly to the business service via the SDK, and the query process ends.

[0165] 2.2. Query the remote server.

[0166] If the query in the agent's in-process cache does not find a result, the agent continues to send a packet to the remote server (processor) to query. The remote server queries the configuration data for the corresponding key from its own in-process cache. After finding the data, it returns the query result to the agent. This process is called a background query.

[0167] 2.3. Query snapshot cache.

[0168] If the configuration data for the corresponding key is not found in either of the above two steps, the agent continues to query the local escape cache. Since the business service updates and writes the configuration data for the corresponding key to the escape cache after successfully querying it using the configuration system SDK during the escape cache generation phase, this query on the escape cache will yield a result, and the query result can then be returned to the business service through the configuration system SDK.

[0169] The agent retrieves the configuration data for the corresponding key from the escape cache. Although this provides a fallback for the business service, the two types of accidental deletion mentioned above are still abnormal scenarios. Therefore, when the configuration system detects these two types of accidental deletion, it can issue an alert to notify the configuration system maintenance personnel so that the problem can be located and repaired in a timely manner.

[0170] Figure 13An embodiment according to this application is shown. Figure 3 A flowchart of the steps following step 350 in this embodiment. Please refer to [link / reference]. Figure 13 As shown, after retrieving the target configuration data from the second local cache, the method for retrieving the configuration data may further include the following steps:

[0171] In step 360, the target configuration data obtained from the second local cache is returned to the business service deployed locally, so that the business service can provide services based on the target configuration data.

[0172] Once the business service successfully obtains the target configuration data again, it can run the business service based on the target configuration data.

[0173] Figure 14 An embodiment according to this application is shown. Figure 13 A flowchart detailing step 360 in the embodiment is provided. Please refer to [link / reference]. Figure 14 As shown, the target configuration data obtained from the second local cache will be returned to the locally deployed business service, which may include the following steps:

[0174] In step 360', the target configuration data obtained from the second local cache is returned to the third local cache corresponding to the software development kit, and the target configuration data is returned to the business service through the third local cache. The software development kit is integrated into the business service deployed locally.

[0175] The retrieved target configuration data is returned to the business service through the cache corresponding to the SDK of the configuration system. Specifically, after updating the target configuration data to the cache corresponding to the SDK, the SDK can retrieve the target configuration data from its corresponding cache and return it to the business service; the business service can also retrieve the target configuration data directly from the cache corresponding to the SDK.

[0176] It is easy to understand that although the escape mechanism is implemented on the agent side in the above embodiments, in other embodiments of this application, the escape mechanism can also be implemented on the SDK side, that is, by adding an escape cache and escape files to the SDK. However, this brings the problem that business services need to be upgraded and modified, which increases both the progress and the risks; at the same time, the multi-process deployment of business services will result in multiple SDK escape caches and files, bringing multiple times the memory and file overhead, and also bringing the risk of inconsistency between multiple caches and files. For example, for a configuration system with an agent, escape can be implemented on the agent side, while for a configuration system without an agent, escape can be implemented on the SDK side.

[0177] In summary, the method for obtaining configuration data provided in the embodiments of this application can achieve at least the following technical effects:

[0178] 1. The solution in this application can avoid situations where business services cannot obtain configuration data due to malfunctions in the configuration system itself or errors in the configuration system management terminal, which could lead to service abnormalities or global failures. It provides a fallback solution for business services to obtain configuration data, solves the problem of business services being unable to obtain configuration data in abnormal scenarios, reduces system-level risks and failures, and greatly improves the availability of the entire business system.

[0179] 2. By adding escape caching and corresponding files on the agent side of the client, the architecture change is made very lightweight. Moreover, it does not require upgrading business services or modifying the SDK, which reduces the scope of impact and can speed up the upgrade and transformation process.

[0180] The following describes an apparatus embodiment of this application, which can be used to execute the configuration data acquisition method in the above embodiments of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the configuration data acquisition method described above.

[0181] Figure 15 A block diagram of a configuration data acquisition apparatus according to an embodiment of this application is shown. Please refer to... Figure 15 As shown, a configuration data acquisition device 1500 according to an embodiment of this application includes: a data storage unit 1510, a data query unit 1520, and a data acquisition unit 1530. The data storage unit 1510 is used to store the target configuration data requested for querying locally in a first local cache and a second local cache when the target configuration data is obtained from the background. The first local cache stores configuration data synchronously updated from the background, and the second local cache stores configuration data obtained from the background. The data query unit 1520 is used to request a query from the background if the target configuration data is not found in the first local cache when it needs to be obtained again. The data acquisition unit 1530 is used to obtain the target configuration data from the second local cache if the target configuration data is not found in the background query.

[0182] In some embodiments of this application, based on the foregoing scheme, the first local cache and the second local cache are storage spaces corresponding to the local proxy end, and the device further includes a data return unit; after obtaining the target configuration data from the second local cache, the data return unit is used to: return the target configuration data obtained from the second local cache to the business service deployed locally, so that the business service provides services based on the target configuration data.

[0183] In some embodiments of this application, based on the foregoing scheme, the data storage unit 1510 is configured to: update the target configuration data to the first local cache corresponding to the agent, and write the target configuration data to a local cache file located locally corresponding to the agent, wherein the local cache file is used to restore the first local cache; update the target configuration data to the second local cache corresponding to the agent, and write the target configuration data to an escape cache file located locally corresponding to the agent, wherein the escape cache file is used to restore the second local cache.

[0184] In some embodiments of this application, based on the foregoing scheme, the data storage unit 1510 is configured to: write the target configuration data to a message queue; obtain the target configuration data from the message queue and update the target configuration data to the second local cache corresponding to the agent; and write the target configuration data located in the second local cache to the escape cache file located locally corresponding to the agent.

[0185] In some embodiments of this application, based on the foregoing scheme, the apparatus further includes an acquisition and deletion unit; before the target configuration data needs to be acquired again, the acquisition and deletion unit is used to: acquire a configuration deletion request from the background, and delete the target configuration data in the first local cache and the local cache file according to the configuration deletion request, wherein the configuration deletion request is generated by the background after receiving a deletion instruction for the target configuration data, and the background deletes the target configuration data stored in the background when it receives the deletion instruction for the target configuration data.

[0186] In some embodiments of this application, based on the foregoing scheme, the device further includes a data cleaning unit; before updating the target configuration data to the second local cache corresponding to the agent, the data cleaning unit is used to: if the space occupied by the second local cache corresponding to the agent reaches a predetermined upper limit of space occupied, delete at least one configuration data with the earliest query time in the second local cache and the escape cache file corresponding to the agent.

[0187] In some embodiments of this application, based on the foregoing scheme, the data return unit is configured to: return the target configuration data obtained from the second local cache to the third local cache corresponding to the software development kit, and return the target configuration data to the business service through the third local cache, wherein the software development kit is integrated into the business service deployed locally.

[0188] In some embodiments of this application, based on the foregoing scheme, the apparatus further includes a determining unit; before requesting to query the target configuration data from the background, the determining unit is configured to: when receiving a target configuration data query request from the software development kit, determine that the target configuration data needs to be obtained again, wherein the target configuration data query request is triggered when the configuration data in the third local cache expires or when the business service is started and completed, and the target configuration data query request is used to obtain the configuration data in the third local cache again, wherein the configuration data includes the target configuration data.

[0189] In some embodiments of this application, based on the foregoing scheme, the device further includes a receiving and synchronization unit; the receiving and synchronization unit is used to: receive configuration data query requests periodically sent by the software development kit, and synchronize and update the configuration data in the first local cache to the third local cache corresponding to the software development kit according to the configuration data query requests.

[0190] Figure 16 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown.

[0191] It should be noted that, Figure 16 The computer system 1600 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0192] like Figure 16 As shown, the computer system 1600 includes a Central Processing Unit (CPU) 1601, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 1602 or programs loaded from storage portion 1608 into Random Access Memory (RAM) 1603, such as performing the methods described in the above embodiments. Various programs and data required for system operation are also stored in RAM 1603. The CPU 1601, ROM 1602, and RAM 1603 are interconnected via bus 1604. An input / output (I / O) interface 1605 is also connected to bus 1604.

[0193] The following components are connected to I / O interface 1605: an input section 1606 including a keyboard, mouse, etc.; an output section 1607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1608 including a hard disk, etc.; and a communication section 1609 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1609 performs communication processing via a network such as the Internet. A drive 1610 is also connected to I / O interface 1605 as needed. Removable media 1611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1610 as needed so that computer programs read from them can be installed into storage section 1608 as needed.

[0194] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1609, and / or installed from removable medium 1611. When the computer program is executed by central processing unit (CPU) 1601, it performs various functions defined in the system of this application.

[0195] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0196] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0197] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.

[0198] In one aspect, this application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods described in the above embodiments.

[0199] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0200] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the method according to the embodiments of this application.

[0201] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments 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.

[0202] The data collection and processing plan outlined in this application must be implemented in strict accordance with the requirements of relevant national laws and regulations, obtaining the informed consent or separate consent of the data subject (or having a legal basis as stipulated by the relevant national laws and regulations), and conducting subsequent data use and processing within the scope authorized by laws and regulations and the data subject.

[0203] 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 of acquiring configuration data, characterized by, The method includes: When the target configuration data requested by the local request is obtained from the backend, the target configuration data is stored in the first local cache and the second local cache respectively. The first local cache is used to store the configuration data that is synchronously updated from the backend, and the second local cache is used to store the configuration data obtained from the backend. When the target configuration data needs to be retrieved again, if the target configuration data is not retrieved from the first local cache, a request is made to query the target configuration data from the backend. If the target configuration data is not found in the backend, the target configuration data is obtained from the second local cache.

2. The method of claim 1, wherein, The first local cache and the second local cache are storage spaces corresponding to the local proxy end. After obtaining the target configuration data from the second local cache, the method further includes: The target configuration data obtained from the second local cache is returned to the business service deployed locally, so that the business service can provide services based on the target configuration data.

3. The method of claim 2, wherein, The step of storing the target configuration data into the first local cache and the second local cache respectively includes: The target configuration data is updated to the first local cache corresponding to the agent, and the target configuration data is written to the local cache file located locally corresponding to the agent. The local cache file is used to restore the first local cache. The target configuration data is updated to the second local cache corresponding to the agent, and the target configuration data is written to the escape cache file located locally corresponding to the agent. The escape cache file is used to restore the second local cache.

4. The method of claim 3, wherein, The step of updating the target configuration data to the second local cache corresponding to the agent and writing the target configuration data to the escape cache file located locally corresponding to the agent includes: Write the target configuration data to the message queue; The target configuration data is obtained from the message queue, and the target configuration data is updated to the second local cache corresponding to the agent. The target configuration data located in the second local cache is written to the escape cache file located locally corresponding to the agent.

5. The method for obtaining configuration data according to claim 3, characterized in that, Before needing to retrieve the target configuration data again, the method further includes: The configuration deletion request is obtained from the backend, and the target configuration data in the first local cache and the local cache file is deleted according to the configuration deletion request. The configuration deletion request is generated by the backend after receiving a deletion instruction for the target configuration data. The backend deletes the target configuration data stored in the backend when it receives the deletion instruction for the target configuration data.

6. The method of claim 3, wherein, Before updating the target configuration data to the second local cache corresponding to the agent, the method further includes: If the space occupied by the second local cache corresponding to the current agent reaches the predetermined space limit, then delete at least one configuration data with the earliest query time in the second local cache and escape cache files corresponding to the agent.

7. The method of claim 2, wherein, The step of returning the target configuration data obtained from the second local cache to the business service deployed locally includes: The target configuration data obtained from the second local cache is returned to the third local cache corresponding to the software development kit, and the target configuration data is returned to the business service through the third local cache. The software development kit is integrated into the business service deployed locally.

8. The method of claim 7, wherein, Before requesting a query for the target configuration data from the backend, the method further includes: When a target configuration data query request is received from the software development kit, it is determined that the target configuration data needs to be retrieved again. The target configuration data query request is triggered when the configuration data in the third local cache expires or when the business service is started. The target configuration data query request is used to retrieve the configuration data in the third local cache again. The configuration data includes the target configuration data.

9. The method of claim 7, wherein, The method further includes: The system receives configuration data query requests periodically sent by the software development kit (SDK), and synchronously updates the configuration data in the first local cache to the third local cache corresponding to the SSD based on the configuration data query requests.

10. An acquisition apparatus of configuration data, characterized by, The device includes: The data storage unit is used to store the target configuration data requested from the backend into a first local cache and a second local cache, respectively. The first local cache is used to store configuration data that is synchronously updated from the backend, and the second local cache is used to store configuration data obtained from the backend. The data query unit is used to request the target configuration data from the backend if the target configuration data is not retrieved from the first local cache when it is needed to retrieve the target configuration data again. The data acquisition unit is used to acquire the target configuration data from the second local cache if the target configuration data is not found in the background.

11. A computer readable medium having stored thereon a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for obtaining configuration data as described in any one of claims 1 to 9.

12. An electronic device, comprising: include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the method for acquiring configuration data as described in any one of claims 1 to 9.

13. A computer program product, characterised in that, The computer program product includes computer instructions stored in a computer-readable storage medium, a processor of a computer device reading the computer instructions from the computer-readable storage medium, and the processor executing the computer instructions to cause the computer device to perform the configuration data acquisition method as described in any one of claims 1 to 9.