Configuration file updating method and device, micro-service configuration file management method and device, equipment and medium

By using the configuration file update method and microservice configuration file management method in the microservice system in the field of artificial intelligence technology, the target configuration file is obtained and updated from the network additional storage system, the complex and inflexible problem of microservice configuration file maintenance and update are solved, automatic update and simplified management are realized, and configuration file management needs in the field of AI algorithms are met.

CN119536840APending Publication Date: 2025-02-28CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411580131.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In the field of artificial intelligence technology, the maintenance and update of microservices' profiles work is complex and inflexible. Traditional configuration centers and single properties configuration files cannot meet the management needs of various forms of profiles.

Method used

Provides a configuration file update method and a microservice configuration file management method. By obtaining the configuration file update request of the microservice server, the target configuration file and target configuration information are determined from the network additional storage system. If the preset update conditions are met, the target configuration file is sent to the microservice server to update the configuration file.

Benefits of technology

It realizes automatic update of configuration files, simplifies the maintenance and update of configuration files by microservice servers, makes it simpler and more flexible, meets a large number of configuration file management needs in the field of AI algorithms, and has good security and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536840A_ABST
    Figure CN119536840A_ABST
Patent Text Reader

Abstract

The invention discloses a configuration file updating method and device, a micro-service configuration file management method and device, equipment and a medium, and the configuration file updating method comprises the steps that a configuration file updating request sent by a micro-service server is acquired, and the configuration file updating request comprises configuration file information; determining a target configuration file corresponding to the configuration file information and target configuration information corresponding to the target configuration file from the network additional storage system according to the configuration file information; and if the configuration file information and the target configuration information meet a preset updating condition, sending the target configuration file to the micro-service server, so that the micro-service server updates the configuration file according to the target configuration file. According to the technical scheme, the configuration file is automatically updated through the configuration file updating request, so that the maintenance and updating work of the micro-service server on the configuration file is simpler and more flexible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a configuration file update, microservice configuration file management method, device, equipment and medium. Background Art

[0002] In the microservice architecture, the configuration center is a warehouse that uniformly stores the configuration of each microservice. The configuration file is generally in the file format of properties. When the springboot microservice starts the project, it will automatically load the properties configuration file with the same name as the microservice name, read the configuration information and inject it into the configuration class or properties in the project.

[0003] In the field of artificial intelligence technology, since the algorithm relies on a large number of configuration files in various forms, such as dictionary files with the dic suffix, binary algorithm model files, csv files that define the rule engine, and excel files that are easy for business parties to edit, the traditional configuration center and a single properties configuration file cannot meet the needs, and the configuration maintenance work is complicated and inflexible. Summary of the invention

[0004] The embodiments of the present invention provide a configuration file update and microservice configuration file management method, device, equipment and medium to solve the problem that the maintenance and update of microservice configuration files in the field of artificial intelligence technology are complicated and inflexible.

[0005] A configuration file updating method, comprising: Obtain a configuration file update request sent by the microservice server, wherein the configuration file update request includes configuration file information; According to the configuration file information, determining a target configuration file corresponding to the configuration file information and target configuration information corresponding to the target configuration file from a network attached storage system; If the configuration file information and the target configuration information meet a preset update condition, the target configuration file is sent to the microservice server, so that the microservice server updates the configuration file according to the target configuration file.

[0006] Further, after determining, from a network attached storage system according to the configuration file information, a target configuration file corresponding to the configuration file information and target configuration information corresponding to the target configuration file, the method further includes: If the configuration file information and the target configuration information do not satisfy the preset update condition, then within a first preset time, the target configuration information corresponding to the target configuration file is updated in real time to obtain updated configuration information; If the configuration file information and the update configuration information meet the preset update condition, the target configuration file is sent to the microservice server, so that the microservice server updates the configuration file according to the target configuration file.

[0007] Further, the configuration file information includes a first modification time of the initial configuration file; the target configuration information includes a second modification time of the target configuration file; The preset update condition is that the first modification time and the second modification time are different.

[0008] A microservice configuration file management method, comprising: According to the preset annotation attributes of the springbean instance, obtain the initial configuration file corresponding to the preset annotation attributes and the configuration file information corresponding to the initial configuration file; Initialize the springbean instance according to the initial configuration file and the configuration file information; Sending a configuration file update request corresponding to the initial configuration file to the configuration file update system; The target configuration file sent by the configuration file updating system is obtained, and the initial configuration file is updated according to the target configuration file.

[0009] Furthermore, the obtaining, according to the preset annotation attribute of the springbean instance, an initial configuration file corresponding to the preset annotation attribute and configuration file information corresponding to the initial configuration file includes: Determining a configuration file reader according to the preset annotation attribute; According to the preset annotation attribute, the configuration file reader is used to obtain configuration file information corresponding to the preset annotation attribute.

[0010] Further, the sending the configuration file update request corresponding to the initial configuration file to the configuration file update system includes: A configuration file update request corresponding to the initial configuration file is sent to the configuration file update system in a long polling request manner.

[0011] A configuration file updating device, comprising: A request acquisition module, used to acquire a configuration file update request sent by a microservice server, wherein the configuration file update request includes configuration file information; An information acquisition module, used to determine, from a network attached storage system according to the configuration file information, a target configuration file corresponding to the configuration file information and target configuration information corresponding to the target configuration file; The update condition judgment module is used to send the target configuration file to the microservice server if the configuration file information and the target configuration information meet the preset update condition, so that the microservice server updates the configuration file according to the target configuration file.

[0012] A microservice configuration file management device, comprising: A configuration acquisition module is used to acquire, according to a preset annotation attribute of a springbean instance, an initial configuration file corresponding to the preset annotation attribute and configuration file information corresponding to the initial configuration file; An initialization module, used to initialize the springbean instance according to the initial configuration file and the configuration file information; A request sending module, used for sending a configuration file update request corresponding to the initial configuration file to the configuration file update system; The file updating module is used to obtain the target configuration file sent by the configuration file updating system, and update the initial configuration file according to the target configuration file.

[0013] A computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the configuration file updating method or the steps of the microservice configuration file management method when executing the computer program.

[0014] A computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the configuration file updating method or the steps of the microservice configuration file management method.

[0015] The above-mentioned configuration file update, microservice configuration file management method, device, equipment and medium, the configuration file update method includes: obtaining a configuration file update request sent by a microservice server, the configuration file update request includes configuration file information, and according to the configuration file information, determining a target configuration file corresponding to the configuration file information and a target configuration information corresponding to the target configuration file from a network attached storage system; if the configuration file information and the target configuration information meet the preset update conditions, the target configuration file is sent to the microservice server, so that the microservice server updates the configuration file according to the target configuration file, so that when the target configuration file in the network attached storage system is updated, the microservice server realizes automatic update of the configuration file through the configuration file update request, making the maintenance and update of the configuration file by the microservice server simpler and more flexible.

[0016] The microservice configuration file management method includes obtaining the initial configuration file corresponding to the preset annotation attributes and the configuration file information corresponding to the initial configuration file according to the preset annotation attributes of the springbean instance, initializing the springbean instance according to the initial configuration file and the configuration file information, sending a configuration file update request corresponding to the initial configuration file to the configuration file update system, obtaining the target configuration file sent by the configuration file update system, and updating the initial configuration file according to the target configuration file, so that the configuration file can be conveniently managed through the configuration file update system on the front-end interface, and the automatic injection of configuration can be realized through custom annotations when used in the microservice server. At the same time, the latest modification time of the configuration file is monitored through the configuration file update request, and the hot refresh of the configuration file change is realized in a lightweight manner, which meets the needs of a large number of configuration file management in the field of AI algorithms, and has good security and scalability, and low maintenance cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0018] Figure 1 is a flow chart of a configuration file updating method in one embodiment of the present invention; Figure 2 is another flow chart of a configuration file updating method according to an embodiment of the present invention; Figure 3 is a flow chart of a microservice configuration file management method in one embodiment of the present invention; Figure 4 is another flow chart of a microservice configuration file management method in one embodiment of the present invention; Figure 5 is a schematic diagram of a configuration file updating device in one embodiment of the present invention; Figure 6 is a schematic diagram of a microservice configuration file management device in one embodiment of the present invention; Figure 7 It is a schematic diagram of an application environment of a configuration file updating method or a microservice configuration file management method in an embodiment of the present invention; Figure 8 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0020] The embodiment of the present invention provides a configuration file update method and a microservice configuration file management method, which can be applied as follows: Figure 7 Specifically, the microservice system includes: Figure 7 The client 1, microservice management system 2 and configuration file update system 3 are shown.

[0021] Exemplarily, the microservice management system 2 includes a microservice server 21. The client 1 communicates with the microservice server 21 through a network to implement a microservice configuration file management method.

[0022] Exemplarily, the configuration file update system 3 includes a configuration management server 31 and a network attached storage system 32. The configuration file update system includes a NAS (Network Attached Storage, NAS for short) disk for storing configuration files. The underlying storage NAS disk is easy to expand and maintain, and has good security.

[0023] The microservice server 21 and the configuration management server 31 communicate with each other through a network to implement a configuration file updating method.

[0024] The client, also known as the user end, refers to the program that corresponds to the microservice server and provides local services to customers. The client can be installed on, but not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The microservice server or configuration management server can be implemented as an independent server or a server cluster consisting of multiple servers.

[0025] This embodiment provides a configuration file update method, such as Figure 1 As shown, the application in the above configuration management server includes: S101: Obtain a configuration file update request sent by a microservice server, where the configuration file update request includes configuration file information.

[0026] S102: Determine, according to the configuration file information, from the network attached storage system a target configuration file corresponding to the configuration file information and target configuration information corresponding to the target configuration file.

[0027] S103: If the configuration file information and the target configuration information meet the preset update condition, the target configuration file is sent to the microservice server, so that the microservice server updates the configuration file according to the target configuration file.

[0028] Among them, the configuration file update request refers to a request sent by the microservice server, which is used to update the initial configuration file. Exemplarily, the initial configuration file is a configuration file stored in the configuration center in the microservice architecture. The configuration file information is the information corresponding to the initial configuration file. Optionally, the configuration file information includes the configuration file address and the configuration file modification time, etc. It can be understood that the configuration file address is the address corresponding to the folder where the configuration file is located. The configuration file address includes the configuration file name of the configuration file. The configuration file modification time is the last modification time of the configuration file. The network attached storage system is a storage system including a NAS disk, and all configuration files of the microservice system are stored in the NAS disk, so that the configuration file is easy to expand and maintain, and has good security. The target configuration file refers to a configuration file stored in the network attached storage system and corresponding to the configuration file information. For example, the target configuration file is a configuration file with the same configuration file address as the initial configuration file. It can be understood that the target configuration file is the same configuration file as the initial configuration file, or the configuration file obtained after the initial configuration file is updated in the network attached storage system. The target configuration information refers to the configuration file information corresponding to the target configuration file. The preset update condition is a condition for judging whether the initial configuration file is updated.

[0029] As an example, in step S101, the microservice server can send a configuration file update request to the configuration management server by long polling, and reduce system performance loss by long polling. After the configuration management server microservice server sends the configuration file update request, the configuration file information is parsed from the configuration file update request. In this example, the configuration file information can be used by the configuration management server to perform configuration file search and configuration file change detection, that is, to detect whether the configuration file has changed.

[0030] As an example, when the microservice system is started, the microservice server initializes the springbean instance, and then caches the corresponding configuration file in the local configuration file cache of the microservice system. When the configuration file in the network attached storage system is updated, the microservice server can automatically synchronize and update the configuration file cached in the local configuration file cache by sending a configuration file update request to the configuration management server according to the configuration file update information sent by the configuration management server. Exemplarily, the configuration file in the network attached storage system can be updated through the human-computer interaction platform (front-end interface), such as adding configuration files, deleting configuration files, and modifying configuration files.

[0031] Exemplarily, in step S102, according to the configuration file information, a target configuration file corresponding to the configuration file information and target configuration information corresponding to the target configuration file are determined from the network attached storage system. The configuration management server parses the configuration file information, obtains the configuration file address corresponding to the configuration file to be detected, determines the configuration file with the same configuration file address from the network attached storage system, determines the configuration file as the target configuration file, and obtains the target configuration information corresponding to the target configuration file. The target configuration file can be determined from the network attached storage system conveniently, accurately and quickly.

[0032] As an example, in step S103, if the configuration file information and the target configuration information meet the preset update conditions, the target configuration file is sent to the microservice server so that the microservice server updates the configuration file according to the target configuration file. Exemplarily, when the configuration management server determines that the initial configuration file has changed based on the configuration file information and the target configuration information. Exemplarily, the change in the initial configuration file includes the addition, modification and deletion of the file content of the initial configuration file. The configuration management server compares the configuration file information with the target configuration information to determine whether the initial configuration file in the microservice management system cache and the corresponding target configuration file in the network attached storage system are the same, thereby determining whether the initial configuration file has changed. Determining whether the initial configuration file and the target configuration file are the same includes determining whether the change time is the same, or whether the configuration file content is the same.

[0033] In this embodiment, a configuration file update request sent by the microservice server is obtained, the configuration file update request includes configuration file information, and a target configuration file corresponding to the configuration file information and a target configuration information corresponding to the target configuration file are determined from the network attached storage system according to the configuration file information. If the configuration file information and the target configuration information meet a preset update condition, the target configuration file is sent to the microservice server, so that the microservice server updates the configuration file according to the target configuration file. When the target configuration file in the network attached storage system is updated, the microservice server realizes automatic updating of the configuration file through the configuration file update request, so that the maintenance and updating of the configuration file by the microservice server is simpler and more flexible.

[0034] In one embodiment, if Figure 2 As shown, after step S102, after determining the target configuration file corresponding to the configuration file information and the target configuration information corresponding to the target configuration file from the network attached storage system according to the configuration file information, the following steps are included: S201: If the configuration file information and the target configuration information do not satisfy a preset update condition, then within a first preset time, the target configuration information corresponding to the target configuration file is updated in real time to obtain updated configuration information.

[0035] S202: If the configuration file information and the update configuration information meet the preset update condition, the target configuration file is sent to the microservice server, so that the microservice server updates the configuration file according to the target configuration file.

[0036] The first preset time is a custom set time. The updated configuration information refers to the configuration information after the target configuration information is updated.

[0037] As an example, in step S201, if the configuration file information and the target configuration information do not satisfy the preset update condition, the target configuration information corresponding to the target configuration file is updated in real time within a first preset time to obtain the updated configuration information.

[0038] Exemplarily, the microservice server communicates with the configuration management server through long polling. When the configuration management server receives a configuration file update request, if the configuration file information and the target configuration information do not meet the preset update condition, that is, the target configuration file is not updated, the configuration management server suspends the configuration file update request and updates the target configuration information corresponding to the target configuration file within a first preset time, so as to detect whether the target configuration file is updated within the first preset time to reduce performance loss.

[0039] As an example, in step S202, if the configuration file information and the updated configuration information meet the preset update condition, the target configuration file is sent to the microservice server so that the microservice server updates the configuration file according to the target configuration file. In this embodiment, after obtaining the updated configuration information, the configuration management server re-determines whether the configuration file information and the updated configuration information meet the preset update condition, so as to send the updated target configuration file to the microservice server in time so that the microservice server updates the configuration file according to the target configuration file.

[0040] In this embodiment, if the configuration file information and the target configuration information do not meet the preset update condition, the target configuration information corresponding to the target configuration file is updated in real time within the first preset time to obtain the updated configuration information. If the configuration file information and the updated configuration information meet the preset update condition, the target configuration file is sent to the microservice server so that the microservice server updates the configuration file according to the target configuration file, thereby reducing performance loss through long polling, and at the same time, the updated target configuration file is sent to the microservice server in time so that the microservice server updates the configuration file according to the target configuration file.

[0041] In one embodiment, the configuration file information includes a first modification time of the initial configuration file; the target configuration information includes a second modification time of the target configuration file; and the preset update condition is that the first modification time and the second modification time are different.

[0042] The first modification time is the modification time of the initial configuration file, and the second modification time is the modification time of the target configuration file.

[0043] In this embodiment, when the first modification time and the second modification time are not the same, it can be determined that a target configuration file corresponding to the initial configuration file in the network attached storage system has changed. Therefore, the configuration management server can quickly determine whether to update the initial configuration file in the microservice management system by determining whether the first modification time of the initial configuration file and the second modification time of the target configuration file are the same.

[0044] This embodiment provides a microservice configuration file management method, such as Figure 3 As shown, the application in the above microservice server includes: S301: According to the preset annotation attributes of the springbean instance, an initial configuration file corresponding to the preset annotation attributes and configuration file information corresponding to the initial configuration file are obtained.

[0045] S302: Initialize the springbean instance according to the initial configuration file and configuration file information.

[0046] S303: Send a configuration file update request corresponding to the initial configuration file to the configuration file update system.

[0047] S304: Obtain a target configuration file sent by the configuration file update system, and update the initial configuration file according to the target configuration file.

[0048] Among them, the preset annotation attribute is the attribute corresponding to the preset annotation. The preset annotation attribute includes the configuration file address and the configuration file type. Exemplarily, the preset annotation is a user-defined annotation. Exemplarily, the preset annotation can be @ConfigFile(path=” / data / sensitive.json”,type=JSON); path is the configuration file address, and type is the configuration file type.

[0049] As an example, in step S301, according to the preset annotation attributes of the springbean instance, the initial configuration file corresponding to the preset annotation attributes and the configuration file information corresponding to the initial configuration file are obtained. Exemplarily, the microservice server obtains the client package, and obtains the initial configuration file corresponding to the preset annotation attributes and the configuration file information corresponding to the initial configuration file from the client package. The client package is a java program code package. Exemplarily, the client package includes components such as preset annotations, configuration initialization register NasConfigFileRegister, configuration listener NasConfigListener, and configuration cache pool NasConfigFileLocalCache.

[0050] As an example, in step S302, the springbean instance is initialized according to the initial configuration file and configuration file information. Exemplarily, the microservice server creates the NasConfigFileRegister class according to the preset configuration class annotation. The NasConfigFileRegister class can implement the BeanPostProcessor interface, which is used to register the springbean instance when the Spring container is started. When the microservice management system is started, the NasConfigFileRegister class is called, and the attribute values ​​corresponding to the preset annotation attributes are set in the springbean instance through the BeanPostProcessor interface, so as to achieve the purpose of automatic injection of the initial configuration file. After the attribute value assignment is completed, the initial configuration file and configuration file information are added to the local configuration cache pool NasConfigFileLocalCache held by the configuration listener NasConfigListener.

[0051] As an example, in step S303, a configuration file update request corresponding to the initial configuration file is sent to the configuration file update system. Exemplarily, the microservice server interacts with the configuration file update system via the http protocol. The microservice server sends a configuration file update request corresponding to the initial configuration file to the configuration file update system to automatically update the initial configuration file through the configuration file update request.

[0052] As an example, in step S304, the target configuration file sent by the configuration file update system is obtained, and the initial configuration file is updated according to the target configuration file. In this example, the microservice server will destroy the springbean instance holding the configuration attributes of the initial configuration file from the local configuration cache pool NasConfigFileLocalCache, reload the springbean instance, that is, reload the target configuration file, to achieve hot refresh of the configuration file.

[0053] In this embodiment, according to the preset annotation attributes of the springbean instance, the initial configuration file corresponding to the preset annotation attributes and the configuration file information corresponding to the initial configuration file are obtained, the springbean instance is initialized according to the initial configuration file and the configuration file information, a configuration file update request corresponding to the initial configuration file is sent to the configuration file update system, the target configuration file sent by the configuration file update system is obtained, and the initial configuration file is updated according to the target configuration file, so that the configuration file can be conveniently managed through the configuration file update system on the front-end interface, and the automatic injection of configuration can be realized through custom annotations when used in the microservice server. At the same time, the latest modification time of the configuration file is monitored through the configuration file update request, and the hot refresh of the configuration file change is realized in a lightweight manner, which meets the needs of a large number of configuration file management in the field of AI algorithms, and has good security and scalability, and low maintenance cost.

[0054] In one embodiment, if Figure 4 As shown, in step S301, according to the preset annotation attributes of the springbean instance, the initial configuration file corresponding to the preset annotation attributes and the configuration file information corresponding to the initial configuration file are obtained, including: S401: Determine a configuration file reader according to preset annotation attributes.

[0055] S402: According to the preset annotation attribute, a configuration file reader is used to obtain configuration file information corresponding to the preset annotation attribute.

[0056] As an example, in step S401, the configuration file type of the initial configuration file is determined according to the preset annotation attribute, and the configuration file reader corresponding to the configuration file type is determined according to the configuration file type. Exemplarily, if the configuration file type is JSON, the configuration file reader is determined to be Json2ObjFileReader.

[0057] As an example, in step S402, according to the preset annotation attribute, a configuration file reader is used to obtain the configuration file information corresponding to the preset annotation attribute. The configuration file reader is selected to read the file content of the initial configuration file according to the configuration file address path, and the file content is converted into an object, that is, the configuration file information, to be assigned to the attribute value of the configuration class of the springbean instance.

[0058] In this embodiment, a configuration file reader is determined according to preset annotation attributes, and the configuration file information corresponding to the preset annotation attributes is acquired using the configuration file reader according to the preset annotation attributes, so as to realize automatic injection of the initial configuration file and configuration file information.

[0059] In one embodiment, in step S303, sending a configuration file update request corresponding to the initial configuration file to the configuration file update system includes: sending the configuration file update request corresponding to the initial configuration file to the configuration file update system in a long polling request manner. In this embodiment, the configuration file update request corresponding to the initial configuration file is sent to the configuration file update system in a long polling request manner to reduce system energy loss.

[0060] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0061] In one embodiment, a configuration file updating device is provided, and the configuration file updating device corresponds to the configuration file updating method in the above embodiment. Figure 5 As shown, the configuration file updating device includes a request obtaining module 501, an information obtaining module 502 and an updating condition judging module 503. The detailed description of each functional module is as follows: The request acquisition module 501 is used to acquire a configuration file update request sent by the microservice server, where the configuration file update request includes configuration file information; An information acquisition module 502, configured to determine, from a network attached storage system according to the configuration file information, a target configuration file corresponding to the configuration file information and target configuration information corresponding to the target configuration file; The update condition judgment module 503 is used to send the target configuration file to the microservice server if the configuration file information and the target configuration information meet the preset update condition, so that the microservice server updates the configuration file according to the target configuration file.

[0062] Furthermore, the configuration file updating device also includes: An update condition module, used to update the target configuration information corresponding to the target configuration file in real time within a first preset time to obtain the updated configuration information when the configuration file information and the target configuration information do not meet the preset update condition; The condition judgment module is used to send the target configuration file to the microservice server when the configuration file information and the update configuration information meet the preset update condition, so that the microservice server updates the configuration file according to the target configuration file.

[0063] For the specific definition of the configuration file updating device, please refer to the definition of the configuration file updating method above, which will not be repeated here. Each module in the above configuration file updating device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above 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 each of the above modules.

[0064] In one embodiment, a microservice configuration file management device is provided, and the microservice configuration file management device corresponds one-to-one to the microservice configuration file management method in the above embodiment. Figure 6 As shown, the configuration file updating device includes a configuration acquisition module 601, an initialization module 602, a request sending module 603 and a file updating module 604. The detailed description of each functional module is as follows: Configuration acquisition module 601, used for acquiring the initial configuration file corresponding to the preset annotation attribute and the configuration file information corresponding to the initial configuration file according to the preset annotation attribute of the springbean instance; Initialization module 602, used to initialize the springbean instance according to the initial configuration file and configuration file information; A request sending module 603, used to send a configuration file update request corresponding to the initial configuration file to the configuration file update system; The file updating module 604 is used to obtain the target configuration file sent by the configuration file updating system, and update the initial configuration file according to the target configuration file.

[0065] Furthermore, the configuration acquisition module 601 includes: A reader unit, used for determining a configuration file reader according to a preset annotation attribute; The configuration acquisition unit is used to acquire configuration file information corresponding to the preset annotation attribute by using a configuration file reader according to the preset annotation attribute.

[0066] Further, the request sending module 603 includes: The polling request unit is used to send a configuration file update request corresponding to the initial configuration file to the configuration file update system in a long polling request manner.

[0067] For the specific definition of the microservice configuration file management device, please refer to the definition of the microservice configuration file management method above, which will not be repeated here. Each module in the above-mentioned microservice configuration file management 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.

[0068] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface and a database connected through 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, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used for configuration file update or microservice configuration file management. 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, a configuration file update method or a microservice configuration file management method is implemented.

[0069] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the configuration file updating method or the microservice configuration file management method in the above-mentioned embodiment is implemented. To avoid repetition, it is not described here. Alternatively, when the processor executes the computer program, the functions of each module / unit in the configuration file updating device, configuration file updating method, or microservice configuration file management device embodiment are implemented. To avoid repetition, it is not described here.

[0070] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the configuration file updating method or the microservice configuration file management method in the above-mentioned embodiment is implemented, and to avoid repetition, it is not repeated here. Alternatively, when the computer program is executed by a processor, the functions of each module / unit in the configuration file updating device, the configuration file updating method, or the microservice configuration file management device embodiment are implemented, and to avoid repetition, it is not repeated here.

[0071] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented 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-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of 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), etc.

[0072] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0073] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A configuration file updating method, characterized in that: include: Obtain a configuration file update request sent by the microservice server, wherein the configuration file update request includes configuration file information; According to the configuration file information, determining a target configuration file corresponding to the configuration file information and target configuration information corresponding to the target configuration file from a network attached storage system; If the configuration file information and the target configuration information meet a preset update condition, the target configuration file is sent to the microservice server, so that the microservice server updates the configuration file according to the target configuration file.

2. The configuration file updating method according to claim 1, characterized in that: After determining, from a network attached storage system according to the configuration file information, a target configuration file corresponding to the configuration file information and target configuration information corresponding to the target configuration file, the method includes: If the configuration file information and the target configuration information do not satisfy the preset update condition, then within a first preset time, the target configuration information corresponding to the target configuration file is updated in real time to obtain updated configuration information; If the configuration file information and the update configuration information meet the preset update condition, the target configuration file is sent to the microservice server, so that the microservice server updates the configuration file according to the target configuration file.

3. The configuration file updating method according to claim 1, characterized in that: The configuration file information includes a first modification time of the initial configuration file; the target configuration information includes a second modification time of the target configuration file; The preset update condition is that the first modification time and the second modification time are different.

4. A microservice configuration file management method, characterized in that: include: According to the preset annotation attributes of the springbean instance, obtain the initial configuration file corresponding to the preset annotation attributes and the configuration file information corresponding to the initial configuration file; Initialize the springbean instance according to the initial configuration file and the configuration file information; Sending a configuration file update request corresponding to the initial configuration file to the configuration file update system; The target configuration file sent by the configuration file updating system is obtained, and the initial configuration file is updated according to the target configuration file.

5. The microservice configuration file management method according to claim 4, characterized in that: The step of obtaining, according to the preset annotation attributes of the springbean instance, an initial configuration file corresponding to the preset annotation attributes and configuration file information corresponding to the initial configuration file includes: Determining a configuration file reader according to the preset annotation attribute; According to the preset annotation attribute, the configuration file reader is used to obtain configuration file information corresponding to the preset annotation attribute.

6. The microservice configuration file management method according to claim 5, characterized in that: The sending the configuration file update request corresponding to the initial configuration file to the configuration file update system includes: A configuration file update request corresponding to the initial configuration file is sent to the configuration file update system in a long polling request manner.

7. A configuration file updating device, characterized in that: include: A request acquisition module, used to acquire a configuration file update request sent by a microservice server, wherein the configuration file update request includes configuration file information; An information acquisition module, used to determine, from a network attached storage system according to the configuration file information, a target configuration file corresponding to the configuration file information and target configuration information corresponding to the target configuration file; The update condition judgment module is used to send the target configuration file to the microservice server if the configuration file information and the target configuration information meet the preset update condition, so that the microservice server updates the configuration file according to the target configuration file.

8. A microservice configuration file management device, characterized in that: include: A configuration acquisition module is used to acquire, according to a preset annotation attribute of a springbean instance, an initial configuration file corresponding to the preset annotation attribute and configuration file information corresponding to the initial configuration file; An initialization module, used to initialize the springbean instance according to the initial configuration file and the configuration file information; A request sending module, used for sending a configuration file update request corresponding to the initial configuration file to the configuration file update system; The file updating module is used to obtain the target configuration file sent by the configuration file updating system, and update the initial configuration file according to the target configuration file.

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 processor implements the steps of the configuration file updating method according to any one of claims 1 to 3, or implements the steps of the microservice configuration file management method according to any one of claims 4 to 6.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the configuration file updating method according to any one of claims 1 to 3 are implemented, or the steps of the microservice configuration file management method according to any one of claims 4 to 6 are implemented.

Citation Information

Cited By

  • Interface file processing method and device, electronic equipment and storage medium

    CN120335798A