Data source configuration loading method, electronic equipment, medium and computer program product

By processing data source configuration in the caching module and utilizing monitors, callback functions, status flags, and update detection tasks, the system performance issues caused by frequent changes in data source configuration are resolved. This achieves efficient and flexible data source configuration management, reduces resource consumption, and improves system performance and applicability.

CN121579094APending Publication Date: 2026-02-27CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511762181.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

In modern microservice architectures and distributed systems, data source configuration management suffers from frequent network requests, leading to high client and server loads, high resource consumption, and performance degradation. This is especially true when data source configurations change frequently, and the existing dynamic loading mechanism lacks optimization.

Method used

By receiving and processing the server's data source configuration in the caching module, real-time responses are achieved using monitors and callback functions. Combining status flags and update detection tasks, update detection tasks are scheduled in sequence. A suspension mechanism is introduced to reduce unnecessary network requests, and multi-language configuration is supported.

Benefits of technology

It improves the real-time responsiveness and update efficiency of data source configuration, reduces resource consumption on both the client and server sides, enhances system performance and flexibility, and supports dynamic loading in multi-language environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579094A_ABST
    Figure CN121579094A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a data source configuration loading method, electronic equipment, a medium and a computer program product, and the data source configuration loading method comprises the steps: loading data source configuration of a server side into a cache module; and processing the data source configuration in the cache module, and loading the processed data source configuration into a client application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of data processing technology, and in particular relates to a data source configuration loading method, electronic device, medium and computer program product. Background Technology

[0002] In modern microservice architectures and distributed systems, data source configuration management is a crucial aspect of ensuring stable system operation. As business needs evolve, the system places higher demands on the dynamic acquisition and real-time updates of data source configurations, leading to clients frequently sending network requests to the server to retrieve these configurations. This high volume of network requests results in high load on both the client and server sides, significant resource consumption, and a degraded overall system performance. Summary of the Invention

[0003] This application provides a data source configuration loading method, electronic device, medium, and computer program product that can improve the efficiency and stability of client applications loading data source configurations.

[0004] This application provides a data source configuration loading method, the method including: Load the server-side data source configuration into the cache module; The data source configuration is processed in the caching module, and the processed data source configuration is loaded into the client application.

[0005] In some embodiments, the caching module includes a monitor; the monitor corresponds to a callback function; the processing of the data source configuration in the caching module includes: processing the data source configuration based on the callback function corresponding to the monitor.

[0006] As can be seen, by introducing a monitor and callback function into the caching module, the callback function can be automatically invoked through the monitor when the data source configuration is received, triggering the execution logic of the data source configuration. This improves the real-time response to the data source configuration, reduces the need for manual intervention, and enhances the automation level and operating efficiency of the client.

[0007] In some embodiments, the data source configuration includes at least two configurations; the caching module includes stored data source configurations; the stored data source configurations include status identifiers; before processing the data source configurations in the caching module and loading the processed data source configurations into the client application, the method further includes: comparing the status identifiers of each of the at least two configurations with the status identifiers of the stored data source configurations to determine a target configuration among the at least two configurations; the status identifier of the target configuration is different from the status identifier of the stored data source configurations; processing the data source configurations in the caching module and loading the processed data source configurations into the client application includes: processing the target configurations in the caching module and loading the processed target configurations into the client application.

[0008] It can be seen that by comparing the status flags of the data source configuration and only processing and loading the target configuration that has changed, it is beneficial to accurately obtain the updated data source configuration, improve the utilization of computing resources, and improve the efficiency of data source configuration updates.

[0009] In some embodiments, before loading the server-side data source configuration into the cache module, the method further includes: generating an update detection task corresponding to the data source configuration; the update detection task is used to receive the updated data source configuration in the server when the data source configuration in the server is updated; and sending the update detection task to the server; loading the server-side data source configuration into the cache module includes: loading the updated data source configuration in the server into the cache module.

[0010] As can be seen, by generating update detection tasks, the latest data source configuration can be obtained in a timely manner when the data source configuration on the server changes, enabling dynamic loading and improving the timeliness and accuracy of data source configuration synchronization. At the same time, by sending update detection tasks to the server, it is not necessary to continuously obtain updated data source configurations from the server, reducing the number of network requests and helping to improve resource utilization on the client side.

[0011] In some embodiments, the data source configuration includes at least two configurations; sending the update detection task to the server includes: determining the execution time period corresponding to the update detection task of each of the at least two configurations; and sending the update detection task corresponding to each configuration to the server in the order of the execution time periods based on the execution time periods corresponding to the update detection task of each configuration.

[0012] It can be seen that by scheduling multiple configuration update detection tasks in sequence, the parallel execution of multiple update detection tasks can be avoided, which helps to reduce the processing pressure on the client and server and improve resource utilization.

[0013] In some embodiments, the server is configured to suspend the update detection task after receiving it, and return the result of the update detection task after a preset condition is met; wherein the preset condition includes any one of the following: a preset time period or an update is detected in the data source configuration.

[0014] It can be seen that by suspending the update detection task and processing it only when the preset conditions are met, the resource consumption on the server can be effectively reduced, which helps to improve the processing performance of the server.

[0015] In some embodiments, the at least two configurations include configurations in at least two languages.

[0016] It can be seen that dynamic loading that supports multilingual configurations helps to enhance the system's flexibility and applicability.

[0017] This application provides an electronic device, which includes a processor and a memory for storing computer programs capable of running on the processor; wherein, The processor is used to run the computer program to execute any of the above-described data source configuration loading methods.

[0018] This application provides a computer storage medium storing a computer program that, when executed by a processor, implements any of the above-described data source configuration loading methods.

[0019] This application provides a computer program product, including a computer program that, when executed by a processor, implements any of the above-described data source configuration loading methods.

[0020] This application provides a data source configuration loading method, an electronic device, a medium, and a computer program product. Based on the data source configuration loading method provided in this embodiment, a caching module is set up to receive and process the data source configuration from the server. By loading the processed data source configuration into the client application, updates to the client application can be achieved. Through the method provided in this application embodiment, the caching module uniformly receives and processes the data source configuration. The client can directly obtain the data source configuration from the caching module, eliminating the need for the client to frequently request the data source configuration from the server, and also eliminating the need for the server to frequently process and respond to network requests from the client for data source configuration. This reduces resource consumption on both the client and server sides and improves system performance. Attached Figure Description

[0021] Figure 1 This is a flowchart of a data source configuration loading method provided in an embodiment of this application; Figure 2 This is a schematic diagram of a data source configuration loading method provided in an embodiment of this application; Figure 3 This is a schematic diagram illustrating the execution of a time-wheel scheduling algorithm provided in an embodiment of this application; Figure 4 This is a schematic diagram illustrating the loading of a data source configuration according to an embodiment of this application; Figure 5 This is a schematic diagram of an asynchronous long polling process within a client provided in an embodiment of this application; Figure 6 This is a schematic diagram of server-side processing provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a data source configuration loading device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0023] In traditional microservice architectures and distributed systems, managing data source configurations is crucial for stable system operation. Traditional static data source configuration requires application restarts when data source configurations change, impacting user experience and increasing operational costs. Data source configuration centers (such as servers) address this issue by dynamically pushing data source configuration changes; however, current dynamic loading mechanisms, such as timed fetching, suffer from frequent network requests, high server resource consumption, and poor performance. This approach lacks optimization for the data source configuration loading process, resulting in poor performance under frequent configuration changes and limiting its ability to load only a single data source configuration.

[0024] To overcome the problems existing in related technologies and achieve dynamic loading of data source configurations while reducing resource consumption on both the client and server, embodiments of this application provide a data source configuration loading method, electronic device, medium, and computer program product. The data source configuration loading method provided in this application can receive and load data source configurations from the server through a caching module, and process the data source configurations through the caching module. This helps reduce resource consumption on both the server and client, and facilitates unified processing of multiple data source configurations through the caching module.

[0025] The embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the embodiments provided herein are merely illustrative of the embodiments of this application and are not intended to limit the embodiments of this application. Furthermore, the embodiments provided below are some embodiments for implementing this application, and not all embodiments for implementing this application. Unless otherwise specified, the technical solutions described in the embodiments of this application can be implemented in any combination.

[0026] It should be noted that, in the embodiments of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a method or apparatus that includes a list of elements includes not only the elements expressly described, but also other elements not expressly listed, or elements inherent to implementing the method or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of other related elements in the method or apparatus that includes that element (e.g., steps in the method or units / modules in the apparatus; for example, units / modules in the apparatus may be portions of circuitry, processors, programs, or software, etc.).

[0027] The data source configuration loading method provided in this application includes a series of steps, but the data source configuration loading method provided in this application is not limited to the steps described. Similarly, the data source configuration loading device provided in this application includes a series of modules, but the device provided in this application is not limited to the modules explicitly described, but may also include modules that need to be set when obtaining relevant information or processing based on information.

[0028] This application provides a data source configuration loading method, such as... Figure 1 As shown, Figure 1 A flowchart of a data source configuration loading method is shown. Figure 1 The data source configuration loading methods shown include: Step 101: Load the server-side data source configuration into the cache module.

[0029] A caching module can be a data structure or caching model that loads data source configuration received from the server. It can be the core of a local cache, ensuring that when the data source configuration is updated or retrieved, the system can quickly identify and process the data source configuration accordingly, while reducing frequent access to the server and improving system stability and performance. A caching module can be independent of both the server and client, or it can be a module within the client specifically designed to receive data source configuration sent from the server.

[0030] The server-side data source configuration can include configuration information obtained from multiple configuration sources. This information may include multilingual resource data, business rules, etc., suitable for different business scenarios and user needs. By loading the server-side data source configuration into the caching module, centralized management of configuration information can be achieved, avoiding the need for remote network requests every time it is used, thereby improving system response speed and stability. Data source configuration can include selecting service types, adding service references, and setting connection parameters.

[0031] In practical applications, the server can be a multilingual configuration backend server, supporting multiple language environments and allowing users to switch between language interfaces according to their needs, achieving cross-language interaction. A multilingual configuration backend server can ensure accurate data display and normal functioning across different language versions by configuring language resource files, database design, and front-end / back-end interaction logic.

[0032] In practical applications, data source configurations can be loaded from the server into the caching module using a Software Development Kit (SDK) component in the client application. When the client application starts for the first time, it needs to actively load the configurations of multiple data sources currently in the caching module. The client first sends a Hypertext Transfer Protocol (HTTP) request to the server to implement a Remote Procedure Call (RPC), loading all the required multi-source data source configurations into the caching module. The caching module then processes these configurations to complete the first startup of the client application. In this case, the caching module loads and processes all the multi-source data source configurations for the client application. Retrieving data source configurations from the server via RPC allows remote calls to be completed without blocking the main thread, ensuring smooth operation of the client application.

[0033] Subsequently, when the data source configuration on the server is updated, the server can send the updated configuration to the caching module. The caching module can process the updated configuration and load it into the client application, thus updating the client application. Specifically, the caching module can determine the execution logic for different data source configurations and process each configuration based on the corresponding execution logic. For example, it can trigger corresponding parsing, validation, or caching logic based on the type of data source configuration.

[0034] The caching module allows clients to obtain data source configurations without frequently accessing the server. The caching module reduces the frequency of client accesses to the server, decreases network overhead, reduces server load, and improves overall system performance and availability.

[0035] Step 102: Process the data source configuration in the caching module and load the processed data source configuration into the client application.

[0036] The caching module processes the loaded data source configuration. Based on the method described in the above embodiments, the caching module processes the data source configuration according to the execution logic corresponding to the data source configuration. The caching module dynamically selects the corresponding execution logic, such as parsing, validation, execution, and caching, based on the type and parameters of the data source configuration.

[0037] Next, the caching module loads the processed data source configuration into the client application for direct use. This process directly injects the processed data source configuration into the relevant business modules of the client application, allowing these modules to dynamically adjust their processing modes based on the configuration. For example, in a multilingual support scenario, the client application can load the corresponding translated text based on the current user's language preference, enabling real-time interface switching. In a business rule configuration scenario, the client application can dynamically modify business logic based on the specific content of the data source configuration, such as adjusting billing rules and access control.

[0038] The data source configuration loading method provided in this application embodiment achieves efficient management and dynamic loading of data source configurations by loading the server-side data source configurations into a caching module, processing them in the caching module, and then loading them into the client application. This method utilizes a caching mechanism to reduce frequent access to the server, improving system performance. Simultaneously, the caching module facilitates unified management of multiple data source configurations, meeting the data source configuration needs of complex business scenarios and exhibiting good scalability and practicality. The data source configuration loading method provided in this application embodiment loads the data source configurations sent by the server through a caching module and processes the data source configurations to load and update the client application. This eliminates the need for the client to frequently receive and process server-side data source configurations, reducing resource consumption on the client. Especially when dealing with a large number of data source configurations, the caching module enables centralized and unified processing of data source configurations, ensuring consistency.

[0039] In practical applications, steps 101 to 102 can be implemented based on a processor, which can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), Controller, Microcontroller, and Microprocessor.

[0040] Based on the data source configuration loading method given in the above embodiments, in order to further optimize the processing of data source configuration, in some embodiments, the above-mentioned cache module includes a monitor; the monitor corresponds to a callback function; the above-mentioned processing of data source configuration in the cache module includes: processing the data source configuration based on the callback function corresponding to the monitor.

[0041] The monitor in the caching module is used to monitor in real time whether there are new data source configurations in the caching module, or whether the data source configuration in the caching module has been updated. In this embodiment, the monitor is integrated into the caching module to monitor changes in the data source configuration in the caching module, and activates the corresponding callback function of the monitor when the data source configuration changes. By introducing the monitor, real-time response to data source configuration can be achieved, thereby improving the dynamic update capability of the caching module.

[0042] A callback function is a function in a programming design pattern that is invoked when a specific event occurs to perform a corresponding operation. In this embodiment, the monitor is bound to a callback function. When the monitor detects a new data source configuration or a change in the data source configuration in the caching module, it automatically calls the callback function bound to the monitor to execute the data source configuration update-related processing logic or the execution logic described in the above embodiment, such as refreshing the local cache or notifying the business thread, thereby processing the data source configuration. By using callback functions, the processing of data source configuration can be decoupled from the overall flow of the client application, improving the flexibility and maintainability of the client application.

[0043] In practical applications, to achieve unified processing of different data source configurations, the caching module can also include a monitor queue consisting of at least two monitors, with each monitor in the queue corresponding to a callback function. The data source configuration includes at least two configurations; that is, when there are at least two data source configurations, the caching module can process each of the at least two configurations separately based on the monitor queue.

[0044] Each monitor in the monitor queue can be arranged in a preset order, that is, the callback functions corresponding to each monitor are arranged in order. When two monitors have a dependency relationship, such as when monitor 2 needs to process based on the processing result of monitor 1, monitor 2 can be placed after monitor 1.

[0045] For example, the caching module can prioritize the first configuration loaded into the caching module, based on the order in which each of the at least two configurations is loaded. It can search the monitor queue for a matching target monitor based on the first configuration's name, type, or tag, and process the first configuration by triggering the target monitor's callback function.

[0046] Alternatively, when at least two configurations are loaded in the cache module, each monitor in the monitor queue can be traversed sequentially according to its order. For each monitor, a matching configuration is checked, and if one exists, its callback function is triggered to process the matching configuration. When a configuration needs to be processed by at least two monitors, at least two target monitors can be determined in the monitor queue based on the configuration's name, type, or tag. The configuration is then processed according to the order of these target monitors in the queue, based on the callback function corresponding to each of the at least two target monitors.

[0047] As can be seen, the monitor queue in the cache module enables real-time monitoring and processing of data source configurations loaded into the cache module. Through the corresponding callback functions preset by each monitor in the monitor queue, the processing of multiple data source configurations can be achieved through the monitor queue, which reduces the pressure on the client to process different data source configurations for different applications separately and improves the processing efficiency of multiple data source configurations.

[0048] To further effectively identify updated data source configurations, in some embodiments, the data source configuration includes at least two configurations; the cache module includes stored data source configurations; the stored data source configurations include status identifiers; before processing the data source configurations in the cache module and loading the processed data source configurations into the client application, the method further includes: comparing the status identifiers of each of the at least two configurations with the status identifiers of the stored data source configurations to determine a target configuration among the at least two configurations; the status identifier of the target configuration is different from the status identifier of the stored data source configurations; processing the data source configurations in the cache module and loading the processed data source configurations into the client application includes: processing the target configuration in the cache module and loading the processed target configuration into the client application.

[0049] When the caching module includes previously loaded and stored data source configurations, it can identify and process only the updated data source configurations. For example, when the client application starts for the first time, the caching module can only process the data source configurations that update the application. Data source configurations can include at least two configurations: the previously loaded data source configuration and the one loaded in real-time by the server. Both the previously loaded and the one loaded in real-time configurations include corresponding status identifiers. The status identifier indicates whether the configuration content of the data source configuration has changed. The status identifier can be a version number in numeric or string form (such as changeID). The status identifier changes whenever the specific configuration content of the data source configuration is updated. By comparing the status identifier of each configuration loaded by the server with the status identifier of the previously loaded data source configurations in the caching module, it is possible to identify which data source configurations have changed and determine the target configuration. This avoids repeatedly loading the same or invalid data source configurations, reducing unnecessary resource consumption and network request counts.

[0050] In practical applications, once the target configuration is determined, the target configuration can be processed through the callback function corresponding to the monitor based on the method given in the above embodiments, and the processed target configuration can be loaded into the client application.

[0051] Based on the method given in the above embodiments, Figure 2 The diagram illustrates the structure of a caching module, which may include a multilingual resource dataset, a changeID, and a monitor queue. The multilingual resource dataset stores data source configurations in different languages ​​sent by the server. The changeID, the aforementioned status identifier, is used to detect whether the configuration content of the data source has changed. The monitor queue includes at least two monitors, which, upon detecting a change in the configuration content of the data source (such as a changeID change), process the changed data source configuration through corresponding callback functions.

[0052] As can be seen, in this embodiment, by adopting a comparison mechanism based on status identifiers and an intelligent loading method of the cache module, efficient identification and loading of the updated target configuration are achieved, and real-time dynamic loading and optimization management of configurations from multiple data sources are realized.

[0053] Based on the methods of the above embodiments, in order to further improve the resource utilization when the client obtains the data source configuration from the server, avoid the client frequently obtaining updated data source configurations from the server, and avoid frequently sending network requests, in some embodiments, before loading the server's data source configuration into the cache module, the method further includes: generating an update detection task corresponding to the data source configuration; the update detection task is used to receive the updated data source configuration from the server when there is an update in the data source configuration on the server; sending the update detection task to the server; the above loading the server's data source configuration into the cache module includes: loading the updated data source configuration from the server into the cache module.

[0054] To obtain real-time updates to data source configurations from the server, the client can generate update detection tasks corresponding to each data source configuration and send these tasks to the server via network requests. When the client needs to obtain updates for different data source configurations, it can generate corresponding update detection tasks for each data source configuration and send each update detection task to the server.

[0055] In this embodiment, the update detection task is an asynchronous task. After the client sends the update detection task to the server, the server can send the updated data source configuration to the caching module in real time once an update exists, without the client continuously sending requests to the server for the updated data source configuration, thus reducing resource consumption on the client side. The update detection task can be initiated by the client's SDK component, sending the task to the server via asynchronous long polling, waiting for notification of data source configuration updates or a timeout response from the server. Asynchronous long polling avoids the resource waste associated with traditional periodic fetching of data source configurations from the server, while ensuring the real-time acquisition of data source configuration changes from the server.

[0056] When the server has an updated data source configuration, the updated data source configuration can be loaded into the aforementioned cache module, and the cache module can then process and load the updated data source configuration into the client application, thus completing the update of the client application.

[0057] In this embodiment, by generating an update detection task and loading the updated data source configuration on the server into the cache module, dynamic perception of changes in the data source configuration on the server is achieved, which improves the real-time performance and accuracy of loading the data source configuration on the server, further reduces network request pressure and enhances system stability.

[0058] To further achieve orderly acquisition of configurations from multiple data sources and reduce resource consumption during data source acquisition, in some embodiments, the above-mentioned sending of update detection tasks to the server includes: determining the execution time period corresponding to the update detection task for each of at least two configurations; and sending the update detection task corresponding to each configuration to the server in the order of the execution time periods, based on the execution time period corresponding to the update detection task for each configuration.

[0059] When a client needs to retrieve at least two configurations, an update detection task for each configuration can be determined. The execution time period for each configuration update detection task can also be determined, and these time periods can be different for each configuration update detection task. Retrieving at least two configurations supports unified management of configurations from multiple independent data sources (such as multi-language, multi-environment, and multi-business modules). For example, a client application might need to load resources in multiple languages ​​such as Chinese, English, and French simultaneously, or it might need to retrieve data source configurations from different microservice modules.

[0060] For example, the execution time period can be the time window for the update detection task configured for each data source. This determines when the update detection task will start and how long afterward it will re-check for data source configuration changes. The execution time period can be a fixed interval (e.g., every 30 seconds) or dynamically adjusted based on configured priority. By setting an execution time period, you can avoid initiating update detection tasks for multiple data source configurations simultaneously, which could lead to a surge in server load and achieve load balancing and resource optimization.

[0061] Based on the method presented in this embodiment, in practical applications, to achieve dynamic monitoring of multiple data source configurations, i.e., at least two configurations, update detection tasks for each configuration can be executed periodically or at regular intervals. For example, a time-wheel scheduling algorithm can be used to handle update detection tasks for at least two configurations. Specifically, a corresponding update detection task can be created for each configuration, and the update detection task for each configuration can be added to the corresponding slot of the time-wheel scheduling algorithm through asynchronous long polling. The update detection task for each configuration will be processed periodically to detect updates to the corresponding configuration. When an update to the configuration is detected, the execution logic corresponding to the configuration will be triggered, such as updating the cache or sending a notification.

[0062] like Figure 3 As shown, Figure 3 A schematic diagram of a time-wheel scheduling algorithm is shown. This algorithm consists of eight ticks, each capable of handling tasks within a 7.5-second timeframe. After the update detection task at the current tick is completed, it is removed from the time wheel, and the pointer rotates to point to the next tick. One tick can also correspond to two tasks, for example... Figure 3 Task A (i.e., update detection task A) and task E can be executed based on a timescale. That is, within 7.5 seconds, task A is executed first, followed by task E. Then, tasks A and E are removed, and tasks B, C, and D are executed in sequence. In this way, real-time sequential monitoring of different configurations can be achieved, enabling dynamic acquisition of updated data source configurations.

[0063] Based on the method given in the above embodiments, Figure 4 This illustrates a data source configuration loading diagram, such as... Figure 4 As shown, the client SDK's working mechanism can initialize two threads, where thread 1 is used to implement, for example... Figure 3 The time-wheel scheduling algorithm shown uses thread 2 to fully load multiple data source configurations (i.e., at least two configurations in the above embodiment). Figure 4 Taking the loading of three configurations as an example, thread 1 is used to retrieve configurations A, B, and C respectively. Upon the first execution of the client application, configurations A, B, and C can be fully loaded into the cache module, and the client application can be executed based on these configurations. Afterwards, an update detection task A corresponding to configuration A can be generated, producing results such as... Figure 4 The asynchronous long-polling monitor A shown executes update detection task A to asynchronously poll for updates to configuration A on the server. Similarly, update detection tasks B and C are generated for configurations B and C, respectively. Figure 4 The asynchronous long-polling monitors B and C are shown. Next, the execution time periods of asynchronous long-polling monitors A, B, and C can be determined. Then, using the initial time-wheel scheduling algorithm of thread 1, update detection tasks with different configurations are executed sequentially through the time-wheel scheduling algorithm to asynchronously obtain the updated configurations from the server.

[0064] Combination Figure 4The illustrated data source configuration loading diagram, in practical applications, taking a client including a multilanguage client worker as an example, allows the multilanguage client worker to complete the update and acquisition of a large batch of configurations using two threads based on the methods given in the above embodiments, thus completing asynchronous long-polling configuration updates. Alternatively, a single-threaded executor can acquire a preset batch of configurations to be polled according to a preset time period, for example, 1000 configurations per batch every 30 seconds. The server retrieves instances of configurations to be polled, encapsulates them into an asynchronous long-polling task (i.e., an update detection task), and submits it to the time-wheel scheduling algorithm for processing. Thread 2 initializes the time-wheel scheduling algorithm for scheduling and processing, obtaining the updated configurations.

[0065] Figure 5 This diagram illustrates an asynchronous long polling process within the client, such as... Figure 5 As shown, configurations to be polled in a preset batch can be obtained according to a preset time period. The server retrieves instances of configurations to be polled, for example, by sharding every 1000 configurations. Executor 1 encapsulates each instance corresponding to 1000 configurations into an asynchronous long polling task (MultiLanguageLongPollingTask). Different identifiers can be assigned to different asynchronous long polling tasks, such as taskID=0. Then, each asynchronous long polling task is submitted to a thread pool executor for processing. The thread pool executor can maintain a maximum of 10 threads. The asynchronous long polling task processed internally by the client mainly consists of four steps: Step 1: Check local configuration, i.e., check the client's local multi-language configuration, identify currently loaded configuration items, check whether the configuration requires a callback to the monitor, and determine which configurations are bound to monitors and callback functions (e.g., through annotations, interface registration, or configuration tags). Subsequent changes will only be made to these configurations. Step 2: Check the server-side configuration. This involves sending an asynchronous long-polling request (an update detection request using the asynchronous long-polling method) to the server. The timeout for this request can be set to 30 seconds. The client retrieves the latest configuration from the server and returns a list of key-value pairs whose configuration content has changed. This list may not include the full configuration to reduce data transfer. Step 3: Update the local snapshot. Based on the key-value pair list, the client requests the latest configuration values ​​from the server again, obtaining the specific configuration content and updating the client's local snapshot. The latest configuration is then merged into the cache model to ensure data integrity. Step 4: Call back the monitor. Check if the changeID is consistent. If not, the updated configuration needs to be processed through the callback function bound to the monitor.

[0066] During the above execution process, if an execution error occurs in the asynchronous long polling task, the next configuration update retrieval can be initiated after a preset time period, avoiding repeated configuration calls and reducing the processing pressure on the server. Simultaneously, the server will receive the corresponding update detection task again.

[0067] Based on the method given in the above embodiments, in some embodiments, the server is used to suspend the update detection task after receiving it, and return the result of the update detection task after a preset condition is met; wherein, the preset condition includes any one of the following: greater than a preset time, or a data source configuration that has detected an update.

[0068] Suspending a task means that after receiving an update check task initiated by a client, the server does not immediately return a result, but temporarily suspends the update check task and waits for further processing. Suspending avoids frequently responding to unchanged requests, thereby reducing network traffic and server resource consumption.

[0069] When the server detects that the data source configuration has not changed and the preset time limit has not been exceeded, the server will continue to suspend the update detection task until the preset conditions are met. For example, if the data source configuration has not changed for a long time, it can automatically return a response indicating no change after a preset time (such as 30 seconds) to avoid long waiting times for the client. However, if the data source configuration is updated, the server will immediately wake up the suspended update detection task and return the updated data source configuration to ensure the real-time performance and consistency of the data source configuration.

[0070] In practical applications, suspending tasks can be accomplished through blocking queues or event monitoring mechanisms. Figure 6 A schematic diagram of server-side processing is shown, such as Figure 6 As shown, after receiving an asynchronous long-polling update detection task, the server adds the task to a blocking queue and marks it as suspended through the long-polling service processor, while registering an event for configuration change monitoring. Once a data source configuration update is detected or a preset time is reached, the server retrieves the update detection task from the blocking queue and executes the corresponding response logic.

[0071] In addition, the preset duration can be flexibly configured according to business needs. For scenarios with high timeliness requirements (such as order processing, permission verification, etc.), a shorter preset duration can be set to ensure rapid response; while for scenarios with higher stability requirements (such as log recording, cache refresh, etc.), the preset duration can be appropriately extended to reduce server load.

[0072] In this embodiment, by introducing a suspension mechanism on the server side and combining it with preset conditions, the response frequency to update detection tasks can be effectively controlled, resource consumption can be reduced, and the overall operating efficiency and stability of the system can be improved. By introducing a suspension mechanism on the server side and combining it with preset conditions, unnecessary network communication and server computing overhead can be reduced. This approach can reduce server pressure and energy consumption, and support larger-scale access and more complex application scenarios.

[0073] In some embodiments, the above at least two configurations include configurations in at least two languages.

[0074] Configuration in at least two languages ​​refers to the storage and management of data source configuration information in different language versions within the system, such as Chinese, English, and Spanish. Configuration in at least two languages ​​is typically used to support multilingual user interfaces, internationalized text display, and other similar features. In this embodiment, the SDK component actively loads configurations in at least two languages ​​from multiple data sources and categorizes and caches these configurations according to different language types. Each configuration in at least two languages ​​can include a changeID field, used to detect whether the configuration content in at least two languages ​​has changed, thereby triggering the corresponding monitor callback mechanism.

[0075] In practical applications, when the client starts, the SDK first fetches all configured language resource data and loads this data into the cache model. Then, based on the method described above, it periodically checks whether the data source configuration for each language type has been updated. If a change is detected in the data source configuration for a particular language type, the data source configuration for that language type is fetched again, and the data source configuration in the cache model is updated.

[0076] Furthermore, supporting configurations in at least two languages ​​means the system has good scalability, allowing it to flexibly add or remove supported language types based on business needs. For example, in a global deployment scenario, the system can gradually add configurations for more languages ​​such as French and German without making major adjustments to the existing architecture, effectively improving user experience and enhancing the product's adaptability.

[0077] In summary, this embodiment enables dynamic configuration loading in a multilingual environment by setting configurations for at least two languages. By configuring at least two languages, the system can support the language preferences of users in different regions, thereby improving the system's international adaptability, enhancing user experience, and reducing the development and maintenance costs of multilingual systems.

[0078] This application provides a method for loading data source configurations, enabling dynamic loading of configurations from multiple data sources. It offers wider adaptability and strong scalability. Through a time-wheel scheduling algorithm, the dynamic loading of multiple data source configurations does not block update detection tasks on the client and server sides, resulting in higher processing efficiency for update detection tasks and reduced processing pressure on the server, ensuring the stability of the server device. A caching module efficiently caches data source configurations, ensuring data consistency. For the update retrieval of multiple data source configurations, the method provided in this application ensures efficient scheduling of data source configurations, further reducing the pressure on the client SDK.

[0079] Those skilled in the art will understand that the order in which the steps are written in the above-described method of the specific implementation does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic. The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

[0080] Based on the data source configuration loading method proposed in the foregoing embodiments, this application also provides a data source configuration loading device. Figure 7 A schematic diagram of a data source configuration loading device is shown, such as... Figure 7 As shown, the data source configuration loading device includes: The first processing module 701 is used to load the server's data source configuration into the cache module.

[0081] The second processing module 702 is used to process the data source configuration in the cache module and load the processed data source configuration into the client application.

[0082] In practical applications, the first processing module 701 and the second processing module 702 can be implemented based on a processor and a communication device.

[0083] In some embodiments, the caching module includes a monitor; the monitor corresponds to a callback function; the second processing module 702 is specifically used to process the data source configuration based on the callback function corresponding to the monitor.

[0084] In some embodiments, the data source configuration includes at least two configurations; the cache module includes a stored data source configuration; the stored data source configuration includes a status identifier; before processing the data source configuration in the cache module and loading the processed data source configuration into the client application, the second processing module 702 is further configured to compare the status identifier of each of the at least two configurations with the status identifier of the stored data source configuration to determine a target configuration among the at least two configurations; the status identifier of the target configuration is different from the status identifier of the stored data source configuration; specifically, the second processing module 702 is configured to process the target configuration in the cache module and load the processed target configuration into the client application.

[0085] In some embodiments, before loading the server-side data source configuration into the cache module, the first processing module 701 is further configured to generate an update detection task corresponding to the data source configuration; the update detection task is configured to receive the updated data source configuration in the server when there is an update in the data source configuration in the server; and send the update detection task to the server; specifically, the first processing module 701 is configured to load the updated data source configuration in the server into the cache module.

[0086] In some embodiments, the data source configuration includes at least two configurations; the first processing module 701 is specifically used to determine the execution time period corresponding to the update detection task of each of the at least two configurations; and based on the execution time period corresponding to the update detection task of each configuration, send the update detection task corresponding to each configuration to the server in the order of the execution time periods.

[0087] It should be noted that the descriptions of the above device embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0088] It should be noted that, in the embodiments of this application, if the above-described methods are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a terminal, server, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.

[0089] This application also provides an electronic device. Figure 8 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of this application, as shown below. Figure 8 As shown, the electronic device 80 may include: Memory 801 is used to store executable instructions.

[0090] The processor 802 is used to implement any of the above-described data source configuration loading methods when executing executable instructions stored in the memory 801.

[0091] The processor 802 mentioned above can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.

[0092] The aforementioned computer-readable storage medium or memory 801 may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM), etc.; it may also be various terminals that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0093] This application embodiment further provides a computer storage medium storing computer-executable instructions, which are used to implement any of the data source configuration loading methods provided in the above embodiments.

[0094] Correspondingly, this application embodiment further provides a computer program product, the computer program product including computer executable instructions, which are used to implement any of the data source configuration loading methods provided in the above embodiments.

[0095] In some embodiments, the functions or modules of the apparatus provided in this application can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0096] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.

[0097] The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined to obtain new method embodiments without conflict.

[0098] The features disclosed in the various product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0099] The features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0100] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0101] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of protection of this application, and these forms are all within the protection scope of this application.

Claims

1. A data source configuration loading method, characterized by, The method comprises: loading a data source configuration of a server into a cache module; processing the data source configuration in the cache module, and loading the processed data source configuration into a client application.

2. The method of claim 1, wherein, The cache module comprises a monitor; the monitor corresponds to a callback function; processing the data source configuration in the cache module comprises: processing the data source configuration based on the callback function corresponding to the monitor.

3. The method of claim 1, wherein, The data source configuration comprises at least two configurations; the cache module comprises a stored data source configuration; the stored data source configuration comprises a state identifier; before processing the data source configuration in the cache module and loading the processed data source configuration into the client application, the method further comprises: comparing the state identifier of each configuration in the at least two configurations with the state identifier of the stored data source configuration to determine a target configuration in the at least two configurations; the state identifier of the target configuration is different from the state identifier of the stored data source configuration; processing the target configuration in the cache module, and loading the processed target configuration into the client application. Before loading the data source configuration of the server into the cache module, the method further comprises:

4. The method of claim 1, wherein, generating an update detection task corresponding to the data source configuration; the update detection task is used to receive an updated data source configuration in the server when there is an update in the data source configuration in the server; sending the update detection task to the server; loading the updated data source configuration of the server into the cache module. The data source configuration comprises at least two configurations; sending the update detection task to the server comprises: determining an execution time period corresponding to the update detection task of each configuration in the at least two configurations; 5. The method of claim 4, wherein, sending the update detection task corresponding to each configuration to the server in the order of the execution time period based on the execution time period corresponding to the update detection task of each configuration. The server is configured to suspend the update detection task after receiving the update detection task, and return a result of the update detection task when a preset condition is met; the preset condition comprises any one of the following: greater than a preset time period, detecting the updated data source configuration. The at least two configurations comprise configurations of at least two languages.

6. The method of claim 4, wherein, The electronic device comprises a processor and a memory for storing a computer program capable of running on the processor; wherein, 7. The method according to claim 3 or 5, characterized in that, The processor is configured to run the computer program to execute the method of any one of claims 1 to 7.

8. An electronic device, comprising: The computer program is executed by the processor to implement the method of any one of claims 1 to 7. The computer program is executed by the processor to implement the method of any one of claims 1 to 7.

9. A computer storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the method of any one of claims 1 to 7.

10. A computer program product comprising a computer program, characterized in that, ​

Citation Information

Patent Citations

  • Data loading method based on client request

    CN109672736A

  • Method suitable for multi-language hot update

    CN117270927A

  • Web page access method, device and equipment

    CN119691298A

  • Map data management method, device and system, electronic equipment and computer program product

    CN120123443A

  • Keyword jump positioning method and device, electronic equipment and storage medium

    CN121008859A