Configuration loading method and device, equipment and medium

By loading only the recently accessed hot configurations on the configuration center client and using the cache mechanism, the problem of excessive memory consumption on the configuration center client is solved, memory optimization and system stability are improved, and it is suitable for massive business configuration scenarios.

CN118550592APending Publication Date: 2024-08-27SHANGHAI SHUHE INFORMATION TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410595733.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-14
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

The existing configuration center client loads all configuration items at startup, resulting in excessive memory consumption. Especially in business configurations with a long life cycle, it is difficult to identify and delete unnecessary configurations to reduce memory pressure.

Method used

The configuration center client only loads the recently accessed hot configuration when it starts, and automatically identifies and manages hot and cold configurations through local caching and illegal configuration caching mechanisms, asynchronously obtains hot update configurations, reduces memory usage, and avoids unnecessary request traversal. through.

Benefits of technology

It effectively reduces the memory pressure on the client and server of the configuration center, reduces memory usage, improves system stability, avoids configuration abnormalities, and meets massive business configuration needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550592A
    Figure CN118550592A
Patent Text Reader

Abstract

The invention relates to a configuration loading method and device, equipment and a medium. The configuration loading method comprises the following steps: an access configuration acquisition step: when a configuration center client is started, acquiring an accessed configuration within a set time from a current time from a configuration center server; an update configuration obtaining step: the configuration center client obtains the hot update configuration from the configuration center server; a configuration cache step: the configuration center client puts the accessed configuration into a local cache; and a reporting step: reporting the accessed configuration to the configuration center server. According to the configuration loading method, only the hot configuration needing to be accessed recently is loaded, the memory pressure of the client side and the server side can be greatly reduced, only less memory needs to be used for supporting, and business personnel do not need to recognize the configuration needing to be deleted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a configuration loading method, device, equipment and medium. Background Art

[0002] The client of the existing configuration center will load all configuration items when it starts. When the configuration contains large configuration scenarios such as business configuration and decision configuration, the client application will consume a lot of memory to store the configuration. However, many business configurations have a very strong life cycle. At the back end of the life cycle, the probability of use is getting smaller and smaller, or even no longer used. The larger the stored configuration, the more memory consumption will increase. If you want to reduce memory consumption, you need to delete unnecessary configurations, but it is difficult for the business to identify which configurations need to be deleted.

[0003] To address the above problems, no effective solution has been proposed yet. Summary of the invention

[0004] Based on this, it is necessary to provide a configuration loading method, device, equipment and medium for the above technical problems. The configuration loading method of the present invention only loads the hot configuration that needs to be accessed recently after the client of the configuration center is started, which can greatly reduce the memory pressure of the configuration center client and the configuration center server, and only needs to use less memory for support, without the need for business personnel to identify the configuration that needs to be deleted.

[0005] According to a first aspect of the present invention, there is provided a configuration loading method, comprising:

[0006] In the access configuration acquisition step, the configuration center client obtains the configuration that has been accessed within the set time from the current time from the configuration center server when it starts; in the update configuration acquisition step, the configuration center client obtains the hot update configuration from the configuration center server; in the configuration cache step, the configuration center client puts the accessed configuration into the local cache; in the reporting step, the accessed configuration is reported to the configuration center server.

[0007] In some embodiments, it also includes: a cold and hot configuration identification step, the configuration center client reports the last access time of the configuration, and the configuration center server identifies the cold and hot configurations according to the last access time of the configuration.

[0008] In some embodiments, it also includes: the identification of cold and hot configurations includes: calculating the time interval between the last access time and the current time, treating the configuration whose time interval exceeds the specified value as a cold configuration, and treating the configuration whose time interval does not exceed the specified value as a hot configuration.

[0009] In some embodiments, it also includes: a cache configuration processing step, the configuration center client queries whether there is the required configuration in the local cache, and if not, initiates a call for the required configuration to the configuration center server. If the configuration center server does not have the required configuration, the configuration name of the required configuration is placed in the illegal configuration cache as an illegal configuration; the configuration center client's request for illegal configuration will not penetrate to the configuration center server.

[0010] In some embodiments, it also includes: an illegal configuration processing step. When the configuration in the configuration center server changes, check whether there is a configuration with a configuration name in the illegal configuration cache in the configuration center. If so, delete the configuration name of the configuration from the illegal configuration cache.

[0011] In some embodiments, the configuration of obtaining hot updates is asynchronous acquisition.

[0012] In some embodiments, it also includes: an abnormality detection step, detecting when the configuration of the configuration center client changes, if a configuration failure is detected, performing a rollback operation to restore the configuration of the configuration center client to the original stable state, and reporting the failure.

[0013] According to a second aspect of the present invention, there is provided a configuration loading device, comprising:

[0014] The access configuration acquisition module is used for the configuration center client to obtain the configuration that has been accessed within a set time from the current time from the configuration center server when it starts; the update configuration acquisition module is used for the configuration center client to obtain the hot update configuration from the configuration center server; the configuration cache module is used for the configuration center client to put the accessed configuration into the local cache; the reporting module is used to report the accessed configuration to the configuration center server.

[0015] According to a third aspect of the present invention, there is provided a computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-mentioned method embodiments when executing the computer program.

[0016] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method of any of the above embodiments are implemented.

[0017] The present invention can automatically identify hot configurations, and only load the hot configurations that need to be accessed recently, which greatly reduces the memory pressure of the configuration center client and the configuration center server. Only less memory is needed for support, and there is no need for business personnel to identify the configuration that needs to be deleted. The use of hot and cold separation loading technology on the configuration center server can reduce the pressure on configuration customers and also meet the needs of massive business configurations. By setting up illegal configuration caches, the pressure on the configuration center server is reduced. Through abnormal detection and rollback operations, the stability of the system is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 are flow charts of some embodiments of the configuration loading method of the present invention;

[0019] Figure 2 are flow charts of other embodiments of the configuration loading method of the present invention;

[0020] Figure 3 is a schematic diagram of the structure of some embodiments of the configuration loading device of the present invention;

[0021] Figure 4 It is a diagram of the internal structure of a computer device used to implement some embodiments of the present invention. DETAILED DESCRIPTION

[0022] Embodiments of the present invention will be described more fully below with reference to the accompanying drawings, in which embodiments of the present invention are shown. However, the present invention can be embodied in many different forms and should not be construed as limited to the embodiments set forth herein.

[0023] The terms used herein are used only for the purpose of describing specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a", "an", "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that when used herein, the term "comprising" specifies the presence of the claimed features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof.

[0024] Unless otherwise defined, the terms (including technical and scientific terms) used herein have the same meanings as commonly understood by those of ordinary skill in the art to which the present disclosure belongs. The terms used herein should be interpreted as having the meanings consistent with their meanings in the context of this specification and in the relevant field, and should not be interpreted in an idealized or overly formal sense, unless specifically defined as such herein.

[0025] Figure 1 Flowcharts showing some embodiments of the configuration loading method of the present invention.

[0026] like Figure 1 As shown, the method includes:

[0027] In step S102 of obtaining access configuration, the configuration center client obtains the configurations accessed within a set time from the current time from the configuration center server when starting.

[0028] In the update configuration acquisition step S104, the configuration center client acquires the hot updated configuration from the configuration center server; the acquisition method is preferably asynchronous acquisition.

[0029] In some embodiments, it may also include a cache configuration processing step: the configuration center client queries whether there is the required configuration in the local cache, and if not, initiates a call for the required configuration to the configuration center server; if the configuration center server does not have the required configuration, the configuration name of the required configuration is placed in the illegal configuration cache as an illegal configuration; the configuration center client's request for illegal configuration will not penetrate to the configuration center server.

[0030] In order to avoid the configuration being identified as an illegal configuration when a corresponding configuration exists after a change occurs on the configuration center server, the illegal configuration processing step may be further included: when the configuration in the configuration center server changes, check whether there is a configuration with a configuration name in the illegal configuration cache in the configuration center, and if so, delete the configuration name of the configuration from the illegal configuration cache.

[0031] Configuration cache step S106, the configuration center client puts the accessed configuration into the local cache;

[0032] In the reporting step S108, the accessed configuration is reported to the configuration center server.

[0033] In order to automatically identify the hot and cold configurations and implement the hot and cold separation loading technology, in some embodiments, the cold and hot configuration identification step may also be included: the configuration center client reports the last access time of the configuration, and the configuration center server identifies the hot and cold configurations according to the last access time of the configuration. The method for identifying the hot and cold configurations may be: calculating the time interval between the last access time and the current time, treating the configuration whose time interval exceeds a specified value (configurable by itself) as a cold configuration, and treating the configuration whose time interval does not exceed the specified value as a hot configuration.

[0034] In order to improve system stability and avoid system failure due to configuration anomalies, in some embodiments, an anomaly detection step may also be included: detection is performed when the configuration of the configuration center client changes. If a configuration failure is detected, a rollback operation is performed to restore the configuration of the configuration center client to the original stable state, and a fault report is performed.

[0035] Figure 2Flowcharts showing other embodiments of the configuration loading method of the present invention.

[0036] like Figure 2 As shown, the steps to configure the loading method are as follows:

[0037] 1. Get the configuration that has been accessed recently at startup (the time is configurable).

[0038] 2. Asynchronously obtain the hot update configuration (obtain the currently updated configuration).

[0039] 3. Put the accessed configuration into the cache and wait for a period of time to report (the time is configurable).

[0040] 4. If the required configuration is not available in the local cache, a call for the configuration item is initiated to the configuration center server. If the configuration center server does not have the configuration either, the configuration name is placed in the illegal configuration cache. The next time the configuration is queried, it is known to be an illegal configuration, preventing the request from penetrating to the configuration center server again.

[0041] 5. Report the accessed configuration as a hot configuration.

[0042] In addition, the configuration center server loads a table to identify hot and cold configurations. The content of the table is shown in Table 1. The server can identify hot and cold configurations by reporting the last access time by the client. The configuration that has not been accessed for a period of time (configurable) minus the current time is a cold configuration.

[0043] Table 1:

[0044] Fields illustrate Application Name Reported application name Configuration Name The number or ID of the configuration item, used to uniquely identify the configuration Last visit time The last time the application read the configuration

[0045] Figure 3 The following is a schematic diagram showing the structures of some embodiments of the configuration loading device of the present invention.

[0046] like Figure 3 As shown, the configuration loading device in the embodiment includes:

[0047] The access configuration acquisition module 100 is used for the configuration center client to acquire the configurations accessed within a set time from the current time from the configuration center server when starting;

[0048] Update configuration acquisition module 200, used for the configuration center client to obtain hot update configuration from the configuration center server;

[0049] Configuration cache module 300, used for the configuration center client to put the accessed configuration into the local cache;

[0050] The reporting module 400 is used to report the accessed configuration to the configuration center server.

[0051] For the specific definition of a configuration loading device, please refer to the definition of a configuration loading method above, which will not be repeated here. Each module in the above-mentioned configuration loading device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0052] The present invention also provides a computer device, which may be a terminal, and its internal structure diagram may be as shown in Figure 4 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the above-mentioned configuration loading method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc. Those skilled in the art can understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0053] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned configuration loading method is implemented.

[0054] Those skilled in the art can understand that all or part of the processes in the above method embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus), direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0055] So far, the embodiments of the present invention have been described in detail. In order to avoid obscuring the concept of the present invention, some details known in the art are not described. Based on the above description, those skilled in the art can fully understand how to implement the technical solutions disclosed herein.

[0056] Although some specific embodiments of the present invention have been described in detail by way of examples, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It should be understood by those skilled in the art that the above embodiments may be modified or some technical features may be replaced by equivalents without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. A configuration loading method, characterized in that: include: Access configuration acquisition step: when the configuration center client starts, it obtains the configuration that has been accessed within a set time from the current time from the configuration center server; Update configuration acquisition step: the configuration center client obtains the hot update configuration from the configuration center server; Configuration cache step: the configuration center client puts the accessed configuration into the local cache; The reporting step reports the accessed configuration to the configuration center server.

2. The configuration loading method according to claim 1, characterized in that: Also includes: In the step of identifying the hot and cold configurations, the configuration center client reports the last access time of the configuration, and the configuration center server identifies the hot and cold configurations according to the last access time of the configuration.

3. The configuration loading method according to claim 2, characterized in that: Also includes: The identifying of the cold and hot configurations includes: calculating the time interval between the last access time and the current time, treating the configuration whose time interval exceeds the specified value as the cold configuration, and treating the configuration whose time interval does not exceed the specified value as the hot configuration.

4. The configuration loading method according to claim 1, characterized in that: Also includes: In the cache configuration processing step, the configuration center client queries whether there is the required configuration in the local cache. If not, it initiates a call for the required configuration to the configuration center server. If the configuration center server also does not have the required configuration, it puts the configuration name of the required configuration into the illegal configuration cache as an illegal configuration; Requests from the configuration center client regarding illegal configurations will not penetrate to the configuration center server.

5. The configuration loading method according to claim 4, characterized in that: Also includes: Illegal configuration processing steps: when the configuration in the configuration center server changes, check whether there is a configuration with a configuration name in the illegal configuration cache in the configuration center. If so, delete the configuration name of the configuration from the illegal configuration cache.

6. The configuration loading method according to claim 1, characterized in that: The configuration for obtaining hot updates is asynchronous acquisition.

7. The configuration loading method according to claim 1, characterized in that: Also includes: The abnormality detection step detects when the configuration of the configuration center client changes. If a configuration failure is detected, a rollback operation is performed to restore the configuration of the configuration center client to the original stable state, and the failure is reported.

8. A configuration loading device, characterized in that: include: The access configuration acquisition module is used by the configuration center client to obtain the configurations that have been accessed within a set time from the current time from the configuration center server when the configuration center client starts; Update configuration acquisition module, used by the configuration center client to obtain hot update configuration from the configuration center server; The configuration cache module is used by the configuration center client to store the accessed configuration into the local cache; The reporting module is used to report the accessed configuration to the configuration center server.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Multi-level caching method and device for distributed database and medium

    CN120353839A

  • Multi-level caching method, device and medium for distributed database

    CN120353839B