CN109522043A - Method and device for managing configuration data and storage medium - Google Patents
Method and device for managing configuration data and storage medium Download PDFInfo
- Publication number
- CN109522043A CN109522043A CN201811189519.3A CN201811189519A CN109522043A CN 109522043 A CN109522043 A CN 109522043A CN 201811189519 A CN201811189519 A CN 201811189519A CN 109522043 A CN109522043 A CN 109522043A
- Authority
- CN
- China
- Prior art keywords
- configuration data
- updated
- cache
- database
- processing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 59
- 238000012545 processing Methods 0.000 claims abstract description 153
- 238000012544 monitoring process Methods 0.000 claims abstract description 9
- 238000007726 management method Methods 0.000 claims description 32
- 230000008569 process Effects 0.000 claims description 16
- 238000013523 data management Methods 0.000 abstract description 25
- 238000010586 diagram Methods 0.000 description 21
- 238000012423 maintenance Methods 0.000 description 9
- 238000012986 modification Methods 0.000 description 9
- 230000004048 modification Effects 0.000 description 9
- 230000026676 system process Effects 0.000 description 7
- 230000006870 function Effects 0.000 description 6
- 230000007246 mechanism Effects 0.000 description 6
- 238000001514 detection method Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 238000012217 deletion Methods 0.000 description 3
- 230000037430 deletion Effects 0.000 description 3
- 238000013507 mapping Methods 0.000 description 3
- 238000013480 data collection Methods 0.000 description 2
- 235000019800 disodium phosphate Nutrition 0.000 description 2
- 230000003203 everyday effect Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 239000013078 crystal Substances 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000033772 system development Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明实施例公开了一种配置数据的管理方法,所述方法包括:监听处理平台节点中预先存储的原始的配置数据是否发生变化;当监听到所述原始的配置数据发生变化时,获取更新后的配置数据,其中,所述更新后的配置数据是通过下述方式生成的:根据接收到的由数据库中的更新缓存写入所述处理平台节点的待更新的配置数据,对所述原始的配置数据进行更新生成;判断所述更新后的配置数据是否存储于预先设定的集中式配置数据缓存中,获得相应的判断结果;基于所述判断结果,利用对应的处理策略控制对所述更新后的配置数据进行相应处理。本发明实施例还公开了一种配置数据的管理装置以及存储介质。
The embodiment of the present invention discloses a configuration data management method. The method includes: monitoring whether the original configuration data pre-stored in the processing platform node changes; The updated configuration data, wherein, the updated configuration data is generated in the following manner: according to the received configuration data to be updated written into the processing platform node by the update cache in the database, the original update and generate the configuration data; judge whether the updated configuration data is stored in the preset centralized configuration data cache, and obtain the corresponding judgment result; based on the judgment result, use the corresponding processing strategy to control the processing of the The updated configuration data is processed accordingly. The embodiment of the invention also discloses a configuration data management device and a storage medium.
Description
技术领域technical field
本发明涉及数据处理技术领域,尤其涉及一种配置数据的管理方法、装置及存储介质。The present invention relates to the technical field of data processing, in particular to a management method, device and storage medium for configuration data.
背景技术Background technique
目前,在大数据环境下,业务处理系统往往要处理很多复杂的业务,为了保证业务处理系统的可扩展性与易维护性,通常将生成与业务相关的配置数据来管理业务处理系统。由于业务的复杂性和巨大数据量,往往产生大量的配置数据。因此,有效地管理配置数据,对于业务处理系统的正常运行与维护具有重要意义。At present, in the big data environment, the business processing system often has to handle many complex businesses. In order to ensure the scalability and easy maintenance of the business processing system, business-related configuration data is usually generated to manage the business processing system. Due to the complexity of the business and the huge amount of data, a large amount of configuration data is often generated. Therefore, effective management of configuration data is of great significance to the normal operation and maintenance of business processing systems.
相关技术中,一般采用以下几种方式管理配置数据:In related technologies, the configuration data is generally managed in the following ways:
1)直接使用配置文件管理配置数据,该方式基于SpringBoot、Springmvc等开发框架工具提供的配置文件接口,在初始化业务处理系统时直接读取配置文件,如果要改变配置数据,则需要修改配置文件,并重新启动业务处理系统;1) Directly use the configuration file to manage the configuration data. This method is based on the configuration file interface provided by the development framework tools such as SpringBoot and Springmvc. When the business processing system is initialized, the configuration file is directly read. If you want to change the configuration data, you need to modify the configuration file. And restart the business processing system;
2)使用分布式协调系统中Zookeeper托管配置文件管理配置数据,该方式中配置信息仍存放于配置文件中,与方式1)不同的是,每个配置文件存放在Zookeeper的Znode节点中,从而借助Zookeeper的监听/更新机制,当需要修改配置文件时,只需将修改的配置文件替换到对应的Znode节点中,业务处理系统进程的Zookeeper客户端会自动获取新的配置文件进行重新初始化;2) Use the Zookeeper hosting configuration file in the distributed coordination system to manage the configuration data. In this method, the configuration information is still stored in the configuration file. The difference from method 1) is that each configuration file is stored in the Znode node of Zookeeper, so that with the help of Zookeeper's monitoring/updating mechanism, when the configuration file needs to be modified, just replace the modified configuration file to the corresponding Znode node, and the Zookeeper client of the business processing system process will automatically obtain the new configuration file for reinitialization;
3)使用关系型数据库存储配置数据,该方式中将配置数据之间复杂的关系映射为数据库表之间的关系,通过关系型数据库自身的约束能力管理配置数据,当业务处理系统进程启动时,从数据库表中读取配置信息并进行初始化。3) Use a relational database to store configuration data. In this method, the complex relationship between configuration data is mapped to the relationship between database tables, and the configuration data is managed through the constraint capability of the relational database itself. When the business processing system process starts, Read the configuration information from the database table and initialize it.
然而,上述几种管理配置数据的技术方案仍存在以下问题:However, the above technical solutions for managing configuration data still have the following problems:
针对直接使用配置文件的管理方法,由于需要重启系统进程,造成系统维护困难,且不具备更新配置数据的实时性;For the management method of directly using configuration files, it is difficult to maintain the system due to the need to restart the system process, and it does not have the real-time performance of updating configuration data;
针对使用Zookeeper托管配置文件的管理方法,不需要重启系统进程且能实时更新配置,具有实时性和部分易维护性,然而,当配置数据的关系复杂且数量庞大时,配置文件的维护变得相当困难,可能导致配置数据修改出错,缺乏安全性;For the management method of using Zookeeper to host configuration files, there is no need to restart the system process and the configuration can be updated in real time, which is real-time and partially easy to maintain. However, when the relationship between the configuration data is complex and the number is large, the maintenance of the configuration file becomes considerable. Difficult, which may lead to errors in configuration data modification and lack of security;
针对使用关系型数据库的管理方法,该方法虽可以较好地应对复杂庞大的配置数据,但将配置数据存储在数据库表中,每次更新小部分的配置数据时都要读取完整的配置数据,造成配置数据更新性能下降,缺乏安全性。For the management method using a relational database, although this method can better deal with complex and huge configuration data, the configuration data is stored in the database table, and the complete configuration data must be read every time a small part of the configuration data is updated , resulting in a decrease in configuration data update performance and a lack of security.
因此,相关技术中的管理配置数据的方法都无法同时兼顾实现对配置数据进行管理的实时性、安全性和易维护性。Therefore, none of the methods for managing configuration data in the related art can take into account the real-time performance, security, and ease of maintenance of configuration data management at the same time.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本发明实施例期望提供一种配置数据的管理方法、装置及存储介质,至少用以解决相关技术中难以同时兼顾实现对配置数据进行管理的实时性、安全性和易维护性的问题。In view of this, the embodiment of the present invention expects to provide a configuration data management method, device and storage medium, at least to solve the problem in the related art that it is difficult to simultaneously realize real-time performance, security and easy maintenance of configuration data management. question.
为达到上述目的,本发明实施例的技术方案是这样实现的:In order to achieve the above-mentioned purpose, the technical scheme of the embodiment of the present invention is realized as follows:
第一方面,本发明实施例提供一种配置数据的管理方法,所述方法包括:In a first aspect, an embodiment of the present invention provides a method for managing configuration data, the method including:
监听处理平台节点中预先存储的原始的配置数据是否发生变化;Monitor whether the original configuration data pre-stored in the processing platform node changes;
当监听到所述原始的配置数据发生变化时,获取更新后的配置数据,其中,所述更新后的配置数据是通过下述方式生成的:根据接收到的由数据库中的更新缓存写入所述处理平台节点的待更新的配置数据,对所述原始的配置数据进行更新生成;When it is detected that the original configuration data has changed, the updated configuration data is obtained, wherein the updated configuration data is generated in the following manner: according to the received update cache written in the database The configuration data to be updated of the processing platform node is updated to generate the original configuration data;
判断所述更新后的配置数据是否存储于预先设定的集中式配置数据缓存中,获得相应的判断结果;Judging whether the updated configuration data is stored in a preset centralized configuration data cache, and obtaining a corresponding judgment result;
基于所述判断结果,利用对应的处理策略控制对所述更新后的配置数据进行相应处理。Based on the judgment result, corresponding processing is performed on the updated configuration data by using a corresponding processing policy control.
上述方案中,所述待更新的配置数据为所述更新缓存在接收到所述数据库发送的第一反馈信息时,写入所述处理平台节点的;In the above solution, the configuration data to be updated is written into the processing platform node when the update cache receives the first feedback information sent by the database;
其中,所述第一反馈信息用于表征所述待更新的配置数据成功写入所述数据库中的数据库表的通知消息。Wherein, the first feedback information is used to represent a notification message that the configuration data to be updated is successfully written into the database table in the database.
上述方案中,所述待更新的配置数据在被写入于所述数据库中的数据库表的同时,还被写入于所述更新缓存中。In the above solution, when the configuration data to be updated is written into the database table in the database, it is also written into the update cache.
上述方案中,所述待更新的配置数据是通过下述方式写入所述处理平台节点:In the above solution, the configuration data to be updated is written into the processing platform node in the following manner:
在所述更新缓存中创建以所述数据库表的名称为键,以所述待更新的配置数据的内容为值的键值对;Create a key-value pair with the name of the database table as the key and the content of the configuration data to be updated as the value in the update cache;
以所述键值对的存储数据结构,由所述更新缓存将所述待更新的配置数据写入所述处理平台节点。Using the storage data structure of the key-value pair, the update cache writes the configuration data to be updated into the processing platform node.
上述方案中,所述基于所述判断结果,利用对应的处理策略控制对所述更新后的配置数据进行相应处理,包括:In the above solution, based on the judgment result, using a corresponding processing policy to control the corresponding processing of the updated configuration data includes:
当所述判断结果表征所述更新后的配置数据存储于所述集中式配置数据缓存中时,直接对所述更新后的配置数据进行重新初始化处理。When the judgment result indicates that the updated configuration data is stored in the centralized configuration data cache, the updated configuration data is directly reinitialized.
上述方案中,所述基于所述判断结果,利用对应的处理策略控制对所述更新后的配置数据进行相应处理,包括:In the above solution, based on the judgment result, using a corresponding processing policy to control the corresponding processing of the updated configuration data includes:
当所述判断结果表征所述更新后的配置数据未存储于所述集中式配置数据缓存中时,向所述数据库发送请求获取完整的配置数据的请求消息;When the judgment result indicates that the updated configuration data is not stored in the centralized configuration data cache, sending a request message requesting to obtain complete configuration data to the database;
在基于所述请求消息获得所述完整的配置数据之后,对所述更新后的配置数据进行重新初始化处理。After the complete configuration data is obtained based on the request message, the updated configuration data is re-initialized.
上述方案中,在所述对所述更新后的配置数据进行重新初始化处理之后,所述方法还包括:In the above solution, after the re-initialization of the updated configuration data, the method further includes:
检测所述集中式配置数据缓存中,是否存在距当前时间点的设定时间区间内未被使用的配置数据;Detecting whether there is unused configuration data within a set time interval from the current time point in the centralized configuration data cache;
当确定存在所述未被使用的配置数据时,将所述集中式配置数据缓存中距当前时间点的设定时间区间内未被使用的配置数据删除,以获得相应的缓存空间;When it is determined that the unused configuration data exists, delete the unused configuration data in the centralized configuration data cache within a set time interval from the current time point to obtain a corresponding cache space;
基于所获得的缓存空间,将所述更新后的配置数据适应性存储于所述集中式配置数据缓存中。Adaptively storing the updated configuration data in the centralized configuration data cache based on the obtained cache space.
第二方面,本发明实施例还提供一种配置数据的管理装置,所述装置包括:监听模块、获取模块、判断模块和处理模块;其中,In the second aspect, the embodiment of the present invention also provides a configuration data management device, the device includes: a monitoring module, an acquisition module, a judgment module and a processing module; wherein,
所述监听模块,用于监听处理平台节点中预先存储的原始的配置数据是否发生变化;The monitoring module is used to monitor whether the original configuration data pre-stored in the processing platform node changes;
所述获取模块,用于当监听到所述原始的配置数据发生变化时,获取更新后的配置数据,其中,所述更新后的配置数据是通过下述方式生成的:根据接收到的由数据库中的更新缓存写入所述处理平台节点的待更新的配置数据,对所述原始的配置数据进行更新生成;The obtaining module is configured to obtain updated configuration data when it is detected that the original configuration data has changed, wherein the updated configuration data is generated in the following manner: according to the received The update buffer in writes the configuration data to be updated of the processing platform node, and updates and generates the original configuration data;
所述判断模块,用于判断所述更新后的配置数据是否存储于预先设定的集中式配置数据缓存中,获得相应的判断结果;The judging module is used to judge whether the updated configuration data is stored in a preset centralized configuration data cache, and obtain a corresponding judgment result;
所述处理模块,用于基于所述判断结果,利用对应的处理策略控制对所述更新后的配置数据进行相应处理。The processing module is configured to use a corresponding processing strategy to control the updated configuration data to be processed accordingly based on the judgment result.
上述方案中,所述处理模块,具体用于:当所述判断结果表征所述更新后的配置数据存储于所述集中式配置数据缓存中时,直接对所述更新后的配置数据进行重新初始化处理。In the above solution, the processing module is specifically configured to: directly re-initialize the updated configuration data when the judgment result indicates that the updated configuration data is stored in the centralized configuration data cache deal with.
上述方案中,所述处理模块,具体用于:当所述判断结果表征所述更新后的配置数据未存储于所述集中式配置数据缓存中时,向所述数据库发送请求获取完整的配置数据的请求消息;In the above solution, the processing module is specifically configured to: send a request to the database to obtain complete configuration data when the judgment result indicates that the updated configuration data is not stored in the centralized configuration data cache Request message;
在基于所述请求消息获得所述完整的配置数据之后,对所述更新后的配置数据进行重新初始化处理。After the complete configuration data is obtained based on the request message, the updated configuration data is re-initialized.
上述方案中,所述装置还包括:In the above plan, the device also includes:
检测模块,用于在所述处理模块对所述更新后的配置数据进行重新初始化处理之后,检测所述集中式配置数据缓存中,是否存在距当前时间点的设定时间区间内未被使用的配置数据;A detection module, configured to detect, after the processing module re-initializes the updated configuration data, whether there is an unused configuration data cache within a set time interval from the current time point in the centralized configuration data cache. Configuration Data;
删除模块,用于当确定存在所述未被使用的配置数据时,将所述集中式配置数据缓存中距当前时间点的设定时间区间内未被使用的配置数据删除,以获得相应的缓存空间;A deletion module, configured to delete unused configuration data within a set time interval from the current time point in the centralized configuration data cache when it is determined that the unused configuration data exists, so as to obtain a corresponding cache space;
存储模块,用于基于所获得的缓存空间,将所述更新后的配置数据适应性存储于所述集中式配置数据缓存中。A storage module, configured to adaptively store the updated configuration data in the centralized configuration data cache based on the obtained cache space.
第三方面,本发明实施例还提供一种配置数据的管理装置,包括存储器、处理器及存储在存储器上并能够由所述处理器运行的可执行程序,所述处理器运行所述可执行程序时执行本发明实施例提供的配置数据的管理方法的步骤。In the third aspect, the embodiment of the present invention also provides a device for managing configuration data, including a memory, a processor, and an executable program stored on the memory and capable of being run by the processor, and the processor runs the executable program. The program executes the steps of the configuration data management method provided by the embodiment of the present invention.
第四方面,本发明实施例还提供一种存储介质,其上存储有可执行程序,所述可执行程序被处理器执行时实现本发明实施例提供的配置数据的管理方法的步骤。In a fourth aspect, the embodiment of the present invention further provides a storage medium on which an executable program is stored. When the executable program is executed by a processor, the steps of the method for managing configuration data provided by the embodiment of the present invention are implemented.
本发明实施例所提供的配置数据的管理方法、装置及存储介质,通过监听处理平台节点中预先存储的原始的配置数据是否发生变化;当监听到所述原始的配置数据发生变化时,获取更新后的配置数据,其中,所述更新后的配置数据是通过下述方式生成的:根据接收到的由数据库中的更新缓存写入所述处理平台节点的待更新的配置数据,对所述原始的配置数据进行更新生成;判断所述更新后的配置数据是否存储于预先设定的集中式配置数据缓存中,获得相应的判断结果;基于所述判断结果,利用对应的处理策略控制对所述更新后的配置数据进行相应处理。如此,采用本发明实施例的技术方案,结合处理平台如Zookeeper平台与关系型数据库来管理配置数据,将待更新的配置数据由关系型数据库中的更新缓存写入处理平台节点,以实现关系型数据库到处理平台节点的映射,且处理平台配合更新缓存和集中式配置数据缓存来实现配置数据的动态更新,可以实时、高效地更新配置数据,采用关系型数据库中的数据库表存储关系复杂且数量庞大的配置数据,可以避免配置数据修改出错,保证配置数据的完整性和安全性,并且业务处理系统进程也不需要重新启动,以便于后期的维护与升级。The configuration data management method, device, and storage medium provided by the embodiments of the present invention monitor whether the original configuration data pre-stored in the processing platform node changes; The updated configuration data, wherein, the updated configuration data is generated in the following manner: according to the received configuration data to be updated written into the processing platform node by the update cache in the database, the original update and generate the configuration data; judge whether the updated configuration data is stored in the preset centralized configuration data cache, and obtain the corresponding judgment result; based on the judgment result, use the corresponding processing strategy to control the processing of the The updated configuration data is processed accordingly. In this way, adopt the technical solution of the embodiment of the present invention, combine the processing platform such as Zookeeper platform and relational database to manage configuration data, write the configuration data to be updated from the update cache in the relational database to the processing platform node, to realize relational database The mapping of the database to the processing platform node, and the processing platform cooperates with the update cache and the centralized configuration data cache to realize the dynamic update of the configuration data, which can update the configuration data in real time and efficiently, and use the database table in the relational database to store complex and large quantities Huge configuration data can avoid configuration data modification errors, ensure the integrity and security of configuration data, and the business processing system process does not need to be restarted to facilitate later maintenance and upgrades.
附图说明Description of drawings
图1为本发明实施例提供的一种配置数据的管理方法的实现流程示意图;FIG. 1 is a schematic diagram of the implementation flow of a configuration data management method provided by an embodiment of the present invention;
图2为本发明实施例提供的一种配置数据的管理方法的总体架构示意图;FIG. 2 is a schematic diagram of an overall architecture of a configuration data management method provided by an embodiment of the present invention;
图3为本发明实施例提供的一种配置数据的管理方法的具体实现流程示意图;FIG. 3 is a schematic flowchart of a specific implementation of a configuration data management method provided by an embodiment of the present invention;
图4为本发明实施例提供的一种描述配置数据之间的关系的结构示意图;FIG. 4 is a schematic structural diagram describing the relationship between configuration data provided by an embodiment of the present invention;
图5为本发明实施例提供的一种配置数据的管理装置的功能结构示意图;FIG. 5 is a schematic functional structure diagram of a device for managing configuration data provided by an embodiment of the present invention;
图6为本发明实施例提供的另一种配置数据的管理装置的功能结构示意图;FIG. 6 is a schematic functional structure diagram of another device for managing configuration data provided by an embodiment of the present invention;
图7为本发明实施例提供的一种配置数据的管理装置的硬件结构示意图。FIG. 7 is a schematic diagram of a hardware structure of an apparatus for managing configuration data provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了能够更加详尽地了解本发明实施例的特点与技术内容,下面结合附图对本发明实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本发明。In order to be able to understand the features and technical contents of the embodiments of the present invention in more detail, the implementation of the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for reference only and are not used to limit the present invention.
需要说明的是,在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。It should be noted that, in the following description, "some embodiments" are referred to, which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset of all possible embodiments or different subsets and can be combined with each other without conflict.
图1为本发明实施例提供的一种配置数据的管理方法的实现流程示意图,所述配置数据的管理方法可以应用于处理平台如Zookeeper平台中;如图1所示,本发明实施例中提供的配置数据的管理方法的实现流程,可以包括以下步骤:Fig. 1 is the realization flow diagram of a kind of configuration data management method that the embodiment of the present invention provides, the management method of described configuration data can be applied in the processing platform such as Zookeeper platform; As shown in Fig. 1, provide in the embodiment of the present invention The implementation process of the configuration data management method may include the following steps:
步骤101:监听处理平台节点中预先存储的原始的配置数据是否发生变化。Step 101: Monitor whether the original configuration data pre-stored in the processing platform node changes.
在本发明实施例中,处理平台节点即为在处理平台如Zookeeper平台上部署的若干节点,所述处理平台节点可以用于存储或者获取配置数据,其中,每个数据库表中的配置数据对应存储于一个处理平台节点中。In the embodiment of the present invention, a processing platform node is a number of nodes deployed on a processing platform such as a Zookeeper platform, and the processing platform node can be used to store or obtain configuration data, wherein the configuration data in each database table corresponds to the storage In a processing platform node.
步骤102:当监听到所述原始的配置数据发生变化时,获取更新后的配置数据,其中,所述更新后的配置数据是通过下述方式生成的:根据接收到的由数据库中的更新缓存写入所述处理平台节点的待更新的配置数据,对所述原始的配置数据进行更新生成。Step 102: Obtain updated configuration data when it is detected that the original configuration data has changed, wherein the updated configuration data is generated in the following manner: according to the received update cache in the database Write the to-be-updated configuration data of the processing platform node, and update and generate the original configuration data.
在本发明实施例中,所述待更新的配置数据为所述更新缓存在接收到所述数据库发送的第一反馈信息时,写入所述处理平台节点的;In the embodiment of the present invention, the configuration data to be updated is written into the processing platform node when the update cache receives the first feedback information sent by the database;
其中,所述第一反馈信息用于表征所述待更新的配置数据成功写入所述数据库中的数据库表的通知消息。Wherein, the first feedback information is used to represent a notification message that the configuration data to be updated is successfully written into the database table in the database.
这里,可通过Java代码实现端的机制判断所述待更新的配置数据是否已经成功写入所述数据库中的数据库表。Here, whether the configuration data to be updated has been successfully written into the database table in the database can be judged through the mechanism of the implementation end of the Java code.
这里,所述数据库为关系型数据库,常见的关系型数据库可以包括但不限于MySQL数据库、Oracle数据库。Here, the database is a relational database, and common relational databases may include, but are not limited to, MySQL databases and Oracle databases.
具体来说,本发明实施例中的所述第一反馈信息,用于表征将待更新的配置数据全部存储在关系型数据库,如MySQL或者Oracle数据库的数据库表中的通知消息,也即本发明实施例将关系复杂的待更新的配置数据分拆到不同的数据库表中,通过数据库表之间的关联来实现待更新的配置数据之间的复杂关系,通过关系型数据库的强约束功能来保证待更新的配置数据的完整性与正确性,使得关联的待更新的配置数据之间不会出现错误数据,避免了修改配置文件所带来的错误风险,实现了待更新的配置数据管理的安全性。Specifically, the first feedback information in the embodiment of the present invention is used to represent a notification message that stores all configuration data to be updated in a relational database, such as a database table of a MySQL or Oracle database, that is, a notification message of the present invention In the embodiment, the configuration data to be updated with complex relationships is split into different database tables, and the complex relationship between the configuration data to be updated is realized through the association between database tables, and the strong constraint function of the relational database is used to ensure Integrity and correctness of the configuration data to be updated, so that there will be no wrong data between the associated configuration data to be updated, avoiding the risk of errors caused by modifying configuration files, and realizing the security of configuration data management to be updated sex.
需要指出的是,在本发明实施例中,所述待更新的配置数据可以通过下述方式写入所述处理平台节点:It should be pointed out that, in the embodiment of the present invention, the configuration data to be updated can be written into the processing platform node in the following manner:
在所述更新缓存中创建以所述数据库表的名称为键,以所述待更新的配置数据的内容为值的键值对;Create a key-value pair with the name of the database table as the key and the content of the configuration data to be updated as the value in the update cache;
以所述键值对的存储数据结构,由所述更新缓存将所述待更新的配置数据写入所述处理平台节点。Using the storage data structure of the key-value pair, the update cache writes the configuration data to be updated into the processing platform node.
也就是说,本发明实施例采用以所述数据库表的名称为键,以所述待更新的配置数据的内容为值的键值对的形式,将处理平台节点与关系型数据库关联起来。That is to say, the embodiment of the present invention associates the processing platform node with the relational database in the form of a key-value pair whose key is the name of the database table and whose value is the content of the configuration data to be updated.
这里,所述待更新的配置数据在被写入于所述数据库中的数据库表的同时,还被写入于所述更新缓存中。Here, the configuration data to be updated is also written into the update cache while being written into the database table in the database.
步骤103:判断所述更新后的配置数据是否存储于预先设定的集中式配置数据缓存中,获得相应的判断结果。Step 103: Judging whether the updated configuration data is stored in a preset centralized configuration data cache, and obtaining a corresponding judgment result.
为了适应更新后的配置数据的数据量庞大的场景,本发明实施例改进了Zookeeper平台的缓存机制,即除了Zookeeper平台本身的缓存之外,还提出了一种集中式配置数据缓存,该集中式配置数据缓存用于存储对原始的配置数据进行更新生成的配置数据,即更新后的配置数据。In order to adapt to the scene where the data volume of the updated configuration data is huge, the embodiment of the present invention improves the cache mechanism of the Zookeeper platform, that is, in addition to the cache of the Zookeeper platform itself, a centralized configuration data cache is also proposed. The configuration data cache is used to store the configuration data generated by updating the original configuration data, that is, the updated configuration data.
需要说明的是,所述集中式配置数据缓存中所缓存的更新后的配置数据,通常是一些修改频次较多的配置数据,可以根据具体的业务需求来判断哪些配置数据属于修改频次较多的配置数据。例如,在数据一致性比对系统中,当某子公司一旦进行业务调整就需要更改比对字段的配置,因此,比对字段就是经常需要修改的配置数据即修改频次较多的配置数据;又比如,在移动大网平台5+N接入系统中,由于每天都要更新移动大网中的令牌(Token)证书,因此,Token证书就属于经常变动的配置数据即修改频次较多的配置数据。It should be noted that the updated configuration data cached in the centralized configuration data cache is usually some configuration data that is frequently modified, and which configuration data belongs to the frequently modified configuration data can be determined according to specific business requirements. Configuration Data. For example, in the data consistency comparison system, once a subsidiary company makes business adjustments, it needs to change the configuration of the comparison field. Therefore, the comparison field is the configuration data that often needs to be modified, that is, the configuration data that is modified more frequently; For example, in the 5+N access system of the mobile network platform, since the token (Token) certificate in the mobile network must be updated every day, the Token certificate belongs to the configuration data that changes frequently, that is, the configuration with more frequent modifications data.
在本发明实施例中,可以以数据库表的名称为依据,查询预先设定的集中式配置数据缓存,即查询预先设定的集中式配置数据缓存中是否存储有所述更新后的配置数据。In the embodiment of the present invention, the preset centralized configuration data cache may be queried based on the name of the database table, that is, whether the updated configuration data is stored in the preset centralized configuration data cache.
步骤104:基于所述判断结果,利用对应的处理策略控制对所述更新后的配置数据进行相应处理。Step 104: Based on the judgment result, use a corresponding processing strategy to control the corresponding processing of the updated configuration data.
在一些实施例中,对于本步骤104的实现过程,具体可以包括:当所述判断结果表征所述更新后的配置数据存储于所述集中式配置数据缓存中时,直接对所述更新后的配置数据进行重新初始化处理。In some embodiments, the implementation process of step 104 may specifically include: when the judgment result indicates that the updated configuration data is stored in the centralized configuration data cache, directly Configure data for re -initialization processing.
在一些实施例中,对于本步骤104的实现过程,具体可以包括:当所述判断结果表征所述更新后的配置数据未存储于所述集中式配置数据缓存中时,向所述数据库发送请求获取完整的配置数据的请求消息;In some embodiments, the implementation process of step 104 may specifically include: when the judgment result indicates that the updated configuration data is not stored in the centralized configuration data cache, sending a request to the database Get the request message of the complete configuration data;
在基于所述请求消息获得所述完整的配置数据之后,对所述更新后的配置数据进行重新初始化处理。After the complete configuration data is obtained based on the request message, the updated configuration data is re-initialized.
这里,所述完整的配置数据可以理解为对原始的配置数据全部进行更新获得的配置数据,即由数据库中的更新缓存写入所述处理平台节点的待更新的配置数据,完全替换了处理平台节点中预先存储的原始的配置数据。Here, the complete configuration data can be understood as the configuration data obtained by updating all the original configuration data, that is, the configuration data to be updated written into the processing platform node by the update cache in the database, completely replacing the processing platform The original configuration data stored in the node.
在本发明实施例中,在所述对所述更新后的配置数据进行重新初始化处理之后,所述方法还包括:In the embodiment of the present invention, after the reinitialization of the updated configuration data, the method further includes:
检测所述集中式配置数据缓存中,是否存在距当前时间点的设定时间区间内未被使用的配置数据;Detecting whether there is unused configuration data within a set time interval from the current time point in the centralized configuration data cache;
当确定存在所述未被使用的配置数据时,将所述集中式配置数据缓存中距当前时间点的设定时间区间内未被使用的配置数据删除,以获得相应的缓存空间;When it is determined that the unused configuration data exists, delete the unused configuration data in the centralized configuration data cache within a set time interval from the current time point to obtain a corresponding cache space;
基于所获得的缓存空间,将所述更新后的配置数据适应性存储于所述集中式配置数据缓存中。Adaptively storing the updated configuration data in the centralized configuration data cache based on the obtained cache space.
需要指出的是,所述设定时间区间可以根据实际情况进行设定,这里不做限定。It should be pointed out that the set time interval may be set according to actual conditions, which is not limited here.
采用本发明实施例的技术方案,结合处理平台如Zookeeper平台与关系型数据库来管理配置数据,将待更新的配置数据由关系型数据库中的更新缓存写入处理平台节点,以实现关系型数据库到处理平台节点的映射,且处理平台配合更新缓存和集中式配置数据缓存来实现配置数据的动态更新,可以实时、高效地更新配置数据,采用关系型数据库中的数据库表存储关系复杂且数量庞大的配置数据,可以避免配置数据修改出错,保证配置数据的完整性和安全性,并且业务处理系统进程也不需要重新启动,以便于后期的维护与升级。Adopt the technical scheme of the embodiment of the present invention, combine processing platform such as Zookeeper platform and relational database to manage configuration data, the configuration data to be updated is written into processing platform node by the update cache in relational database, to realize relational database to The mapping of processing platform nodes, and the processing platform cooperates with update cache and centralized configuration data cache to realize dynamic update of configuration data, which can update configuration data in real time and efficiently, and use database tables in relational databases to store complex and large-scale data Configuration data can avoid configuration data modification errors, ensure the integrity and security of configuration data, and the business processing system process does not need to be restarted, so as to facilitate later maintenance and upgrades.
图2为本发明实施例提供的一种配置数据的管理方法的总体架构示意图,如图2所示,配置数据的管理方法的总体架构可以包括两个部分:数据库管理系统(DBMS,DatabaseManagement System)中的关系型数据库处理部分和Zookeeper平台处理部分,本发明实施例在关系型数据库处理部分增加了一个更新缓存,在Zookeeper平台处理部分增加了一个集中式配置数据缓存。当有配置数据需要更新时,将待更新的配置数据同时写入关系型数据库的数据库表以及更新缓存中,当业务处理系统判断出待更新的配置数据成功写入关系型数据库中的数据库表时,关系型数据库向更新缓存反馈一个配置数据写入成功的通知消息,此时,更新缓存将待更新的配置数据发往对应的处理平台节点如Znode节点中,以更新Znode节点中预先存储的原始的配置数据,这样就可以生成更新后的配置数据;且关系型数据库通知Zookeeper服务端Znode节点中的原始的配置数据发生了更新,Zookeeper服务端并将原始的配置数据发生更新的消息通知给Zookeeper客户端,Zookeeper客户端向Zookeeper服务端请求获取Znode节点中存储的更新后的配置数据,利用集中式配置数据缓存对更新后的配置数据重新初始化相应的工作组件,以实现配置数据的动态更新。Fig. 2 is a schematic diagram of an overall architecture of a method for managing configuration data provided by an embodiment of the present invention. As shown in Fig. 2 , the overall architecture of the method for managing configuration data may include two parts: a database management system (DBMS, Database Management System) In the relational database processing part and the Zookeeper platform processing part, the embodiment of the present invention adds an update cache to the relational database processing part, and adds a centralized configuration data cache to the Zookeeper platform processing part. When there is configuration data to be updated, write the configuration data to be updated into the database table of the relational database and the update cache at the same time, when the business processing system determines that the configuration data to be updated is successfully written into the database table in the relational database , the relational database feeds back a notification message that the configuration data is successfully written to the update cache. At this time, the update cache sends the configuration data to be updated to the corresponding processing platform node, such as the Znode node, to update the original stored in the Znode node. configuration data, so that updated configuration data can be generated; and the relational database notifies the Zookeeper server that the original configuration data in the Znode node has been updated, and the Zookeeper server will notify Zookeeper of the update of the original configuration data The client, the Zookeeper client requests the updated configuration data stored in the Znode node from the Zookeeper server, and uses the centralized configuration data cache to re-initialize the corresponding working components for the updated configuration data, so as to realize the dynamic update of the configuration data.
下面结合图2所示的配置数据的管理方法的总体架构,对本发明实施例提供的配置数据的管理方法的具体实现过程做进一步地详细说明。The specific implementation process of the configuration data management method provided by the embodiment of the present invention will be further described in detail below in conjunction with the overall framework of the configuration data management method shown in FIG. 2 .
图3为本发明实施例提供的一种配置数据的管理方法的具体实现流程示意图,如图3所示,所述配置数据的管理方法的具体实现流程,可以包括以下步骤:FIG. 3 is a schematic diagram of a specific implementation process of a configuration data management method provided by an embodiment of the present invention. As shown in FIG. 3 , the specific implementation process of the configuration data management method may include the following steps:
步骤301:业务处理系统获取输入的待更新的配置数据。Step 301: The business processing system obtains the input configuration data to be updated.
步骤302:业务处理系统将待更新的配置数据同时写入关系型数据库的数据库表以及更新缓存中。Step 302: The business processing system writes the configuration data to be updated into the database table of the relational database and the update cache at the same time.
在本发明实施例中,所述更新缓存为在关系型数据库处理部分新增的一个缓存机制,所述更新缓存主要用于接收待更新的配置数据,例如待更新的业务配置数据;所述更新缓存除了用于接收待更新的配置数据以外,如下文所述,所述更新缓存还用于在接收到关系型数据库发送的反馈信息时,将待更新的配置数据写入至处理平台节点,其中,所述反馈信息用于表征所述待更新的配置数据成功写入所述关系型数据库中的数据库表的通知消息。In the embodiment of the present invention, the update cache is a newly added cache mechanism in the relational database processing part, and the update cache is mainly used to receive configuration data to be updated, such as service configuration data to be updated; the update In addition to receiving the configuration data to be updated, as described below, the update cache is also used to write the configuration data to be updated to the processing platform node when receiving the feedback information sent by the relational database, wherein , the feedback information is used to represent a notification message that the configuration data to be updated is successfully written into the database table in the relational database.
步骤303:当判断出待更新的配置数据成功写入关系型数据库的数据库表中时,关系型数据库向更新缓存发送相应的反馈信息。Step 303: When it is determined that the configuration data to be updated is successfully written into the database table of the relational database, the relational database sends corresponding feedback information to the update cache.
在本发明实施例中,所述反馈信息用于表征所述待更新的配置数据成功写入所述关系型数据库的数据库表的通知消息。In the embodiment of the present invention, the feedback information is used to represent a notification message that the configuration data to be updated is successfully written into the database table of the relational database.
这里,可通过Java代码实现端的机制判断所述待更新的配置数据是否已经成功写入关系型数据库的数据库表。Here, it may be judged through the mechanism of the Java code implementation end whether the configuration data to be updated has been successfully written into the database table of the relational database.
在实际应用中,常见的关系型数据库可以包括但不限于MySQL数据库、Oracle数据库。具体来说,本发明实施例中的所述反馈信息,用于表征将待更新的配置数据全部存储在关系型数据库,如MySQL或者Oracle数据库的数据库表中的通知消息,本发明实施例采用关系型数据库来存储关系复杂且数量庞大的配置数据,也即将关系复杂且数量庞大的待更新的配置数据分拆到不同的数据库表中,通过关系型数据库表之间的关联来实现待更新的配置数据之间的复杂关系,通过关系型数据库的强约束功能来保证待更新的配置数据的完整性与正确性,使得关联的待更新的配置数据之间不会出现错误数据,避免了修改配置文件所带来的错误风险,实现了待更新的配置数据管理的安全性。In practical applications, common relational databases may include, but are not limited to, MySQL databases and Oracle databases. Specifically, the feedback information in the embodiment of the present invention is used to represent the notification message that all configuration data to be updated are stored in a relational database, such as a database table of MySQL or Oracle database, and the embodiment of the present invention uses the relational Type database to store configuration data with complex relationships and a large amount, that is, split the configuration data to be updated with complex relationships and a large amount into different database tables, and implement the configuration to be updated through the association between relational database tables For the complex relationship between data, the integrity and correctness of the configuration data to be updated are guaranteed through the strong constraint function of the relational database, so that no wrong data will appear between the associated configuration data to be updated, and configuration file modification is avoided The risk of error brought about realizes the security of the management of the configuration data to be updated.
在实际应用中,对于结算数据采集系统来说,数据采集业务通常需要很多的配置数据,可以为这些配置数据建立对应的表,利用表之间的关联关系来描述配置数据之间的关系。图4为本发明实施例提供的一种描述配置数据之间的关系的结构示意图,如图4所示,先定义采集业务,每个采集业务将会执行至少两个采集任务,比如采集任务1,……,采集任务n,而要执行多个采集任务就需要分别采集目录、采集文件名称、采集主机地址等诸多配置数据,这些配置数据之间的关系均可由表之间的关联关系来维护。In practical applications, for the settlement data collection system, the data collection business usually requires a lot of configuration data, and corresponding tables can be established for these configuration data, and the relationship between the configuration data can be described by using the association relationship between the tables. Fig. 4 is a schematic structural diagram describing the relationship between configuration data provided by an embodiment of the present invention. As shown in Fig. 4, the collection service is first defined, and each collection service will execute at least two collection tasks, such as collection task 1 , ..., collection task n, and to perform multiple collection tasks, it is necessary to collect configuration data such as directory, collection file name, collection host address, etc. The relationship between these configuration data can be maintained by the association relationship between tables
需要指出的是,当判断出待更新的配置数据成功写入关系型数据库的数据库表中时,则表明写入的待更新的配置数据符合关系型数据库的约束能力,也即在完成关系型数据库的入库验证才可以对原始的配置数据进行更新。当判断出待更新的配置数据未成功写入关系型数据库的数据库表中时,则表明待更新的配置数据可能出现问题,此时需要查看问题详情,使得配置数据更新流程结束,可以保证更新配置数据的安全性。It should be pointed out that when it is judged that the configuration data to be updated is successfully written into the database table of the relational database, it indicates that the written configuration data to be updated conforms to the constraints of the relational database, that is, when the relational database is completed The original configuration data can only be updated after the storage verification. When it is determined that the configuration data to be updated has not been successfully written into the database table of the relational database, it indicates that there may be a problem with the configuration data to be updated. At this time, it is necessary to check the details of the problem so that the configuration data update process is completed and the configuration can be updated. Data security.
步骤304:在更新缓存接收到关系型数据库发送的反馈信息之后,将待更新的配置数据写入处理平台节点,对处理平台节点中预先存储的原始的配置数据进行更新,以生成更新后的配置数据。Step 304: After the update cache receives the feedback information sent by the relational database, write the configuration data to be updated into the processing platform node, and update the original configuration data pre-stored in the processing platform node to generate an updated configuration data.
在本发明实施例中,处理平台节点即为在处理平台如Zookeeper平台上部署的若干节点,所述处理平台节点可以用于存储或者获取配置数据,其中,每个数据库表中的配置数据对应存储于一个处理平台节点中。In the embodiment of the present invention, a processing platform node is a number of nodes deployed on a processing platform such as a Zookeeper platform, and the processing platform node can be used to store or obtain configuration data, wherein the configuration data in each database table corresponds to the storage In a processing platform node.
在本发明实施例中,所述待更新的配置数据可以通过下述方式写入处理平台节点:In the embodiment of the present invention, the configuration data to be updated may be written to the processing platform node in the following manner:
在所述更新缓存中创建以所述数据库表的名称为键,以所述待更新的配置数据的内容为值的键值对;Create a key-value pair with the name of the database table as the key and the content of the configuration data to be updated as the value in the update cache;
以所述键值对的存储数据结构,由所述更新缓存将所述待更新的配置数据写入所述处理平台节点。Using the storage data structure of the key-value pair, the update cache writes the configuration data to be updated into the processing platform node.
也就是说,本发明实施例采用以所述数据库表的名称为键,以所述待更新的配置数据的内容为值的键值对的形式,将处理平台节点与关系型数据库进行关联。假设采用键(Key)表示数据库表的名称Table Name,采用值(Value)表示待更新的配置数据的内容Update Data,因此,存储数据结构是一个Key-Value对的形式,即可表示为<Table Name,Update Data>。That is to say, the embodiment of the present invention associates the processing platform node with the relational database in the form of a key-value pair whose key is the name of the database table and whose value is the content of the configuration data to be updated. Assuming that the key (Key) is used to represent the name of the database table Table Name, and the value (Value) is used to represent the content of the configuration data to be updated Update Data, therefore, the storage data structure is in the form of a Key-Value pair, which can be expressed as <Table Name, update data>.
这里,基于业务处理系统开发的实际经验,在业务处理系统运行之后,只会修改一小部分的原始的配置数据,如果使用配置文件管理配置数据,那么原始的配置数据只要做出很小的修改,就需要重新读取整个配置文件,因此,在修改的配置数据的数据量庞大的情况下,会降低配置数据的更新效率,而本发明实施例结合处理平台如Zookeeper平台与关系型数据库来管理配置数据,将待更新的配置数据由关系型数据库中的更新缓存写入处理平台节点,且待更新的配置数据只会修改少量的原始的配置数据,并仅传递该少量的更新后的配置数据,具有很好的对配置数据进行管理的实时性。Here, based on the actual experience of business processing system development, only a small part of the original configuration data will be modified after the business processing system is running. If configuration files are used to manage configuration data, then the original configuration data only needs to be slightly modified , it is necessary to re-read the entire configuration file. Therefore, in the case of a huge amount of modified configuration data, the update efficiency of the configuration data will be reduced. However, the embodiment of the present invention combines a processing platform such as a Zookeeper platform and a relational database to manage Configuration data, write the configuration data to be updated from the update cache in the relational database to the processing platform node, and the configuration data to be updated will only modify a small amount of original configuration data, and only transmit the small amount of updated configuration data , which has good real-time performance for managing configuration data.
步骤305:处理平台的客户端请求获取更新后的配置数据。Step 305: The client side of the processing platform requests to obtain updated configuration data.
步骤306:处理平台在获取到更新后的配置数据之后,判断更新后的配置数据是否存储于集中式配置数据缓存中,获得相应的判断结果。Step 306: After acquiring the updated configuration data, the processing platform judges whether the updated configuration data is stored in the centralized configuration data cache, and obtains a corresponding judgment result.
为了适应更新后的配置数据的数据量庞大的场景,本发明实施例改进了Zookeeper平台的缓存机制,即除了Zookeeper平台本身的缓存之外,还提出了一种集中式配置数据缓存,该集中式配置数据缓存用于存储对原始的配置数据进行更新生成的配置数据,即更新后的配置数据。In order to adapt to the scene where the data volume of the updated configuration data is huge, the embodiment of the present invention improves the cache mechanism of the Zookeeper platform, that is, in addition to the cache of the Zookeeper platform itself, a centralized configuration data cache is also proposed. The configuration data cache is used to store the configuration data generated by updating the original configuration data, that is, the updated configuration data.
需要说明的是,所述集中式配置数据缓存中所缓存的更新后的配置数据,通常是一些修改频次较多的配置数据,可以根据具体的业务需求来判断哪些配置数据属于修改频次较多的配置数据。例如,在数据一致性比对系统中,当某子公司一旦进行业务调整就需要更改比对字段的配置,因此,比对字段就是经常需要修改的配置数据即修改频次较多的配置数据;又比如,在移动大网平台5+N接入系统中,由于每天都要更新移动大网中的Token证书,因此,Token证书就属于经常变动的配置数据即修改频次较多的配置数据。It should be noted that the updated configuration data cached in the centralized configuration data cache is usually some configuration data that is frequently modified, and which configuration data belongs to the frequently modified configuration data can be determined according to specific business requirements. Configuration Data. For example, in the data consistency comparison system, once a subsidiary company makes business adjustments, it needs to change the configuration of the comparison field. Therefore, the comparison field is the configuration data that often needs to be modified, that is, the configuration data that is modified more frequently; For example, in the mobile network platform 5+N access system, because the token certificate on the mobile network is updated every day, the token certificate is a regular configuration data that changes frequently, that is, the configuration data with more frequency modification.
在本发明实施例中,可以以数据库表的名称为依据,查询预先设定的集中式配置数据缓存,即查询预先设定的集中式配置数据缓存中是否存储有所述更新后的配置数据。In the embodiment of the present invention, the preset centralized configuration data cache may be queried based on the name of the database table, that is, whether the updated configuration data is stored in the preset centralized configuration data cache.
步骤307:当判断结果表征更新后的配置数据存储于集中式配置数据缓存中时,处理平台直接对更新后的配置数据进行重新初始化处理,结束当前处理流程。Step 307: When the judgment result indicates that the updated configuration data is stored in the centralized configuration data cache, the processing platform directly re-initializes the updated configuration data, and ends the current processing flow.
步骤308:当判断结果表征更新后的配置数据未存储于集中式配置数据缓存中时,处理平台向关系型数据库发送请求获取完整的配置数据的请求消息。Step 308: When the judgment result indicates that the updated configuration data is not stored in the centralized configuration data cache, the processing platform sends a request message to the relational database requesting to obtain complete configuration data.
步骤309:处理平台在基于请求消息获得完整的配置数据之后,对更新后的配置数据进行重新初始化处理,结束当前处理流程。Step 309: After the processing platform obtains the complete configuration data based on the request message, it re-initializes the updated configuration data, and ends the current processing flow.
在本发明实施例中,在所述对更新后的配置数据进行重新初始化处理之后,所述方法还包括:In the embodiment of the present invention, after the re-initialization of the updated configuration data, the method further includes:
检测所述集中式配置数据缓存中,是否存在距当前时间点的设定时间区间内未被使用的配置数据;Detecting whether there is unused configuration data within a set time interval from the current time point in the centralized configuration data cache;
当确定存在所述未被使用的配置数据时,将所述集中式配置数据缓存中距当前时间点的设定时间区间内未被使用的配置数据删除,以获得相应的缓存空间;When it is determined that the unused configuration data exists, delete the unused configuration data in the centralized configuration data cache within a set time interval from the current time point to obtain a corresponding cache space;
基于所获得的缓存空间,将所述更新后的配置数据适应性存储于所述集中式配置数据缓存中。Adaptively storing the updated configuration data in the centralized configuration data cache based on the obtained cache space.
需要指出的是,所述设定时间区间可以根据实际情况进行设定,这里不做限定。It should be pointed out that the set time interval may be set according to actual conditions, which is not limited here.
采用本发明实施例的技术方案,相较于使用配置文件管理配置数据,采用关系型数据库管理配置数据,可以避免配置数据修改出错,保证配置数据的完整性和正确性;此外,利用关系型数据库中的数据库表分表存储配置数据,可以分离出少量的更新后的配置数据,只需将少量的更新后的配置数据传递给业务进程,而不需要重新读取整个配置文件的数据,降低了数据传输量,具有较好的实时性;相较于只使用关系型数据库管理配置数据,本发明实施例结合处理平台如Zookeeper平台与关系型数据库共同来管理配置数据,并引入了更新缓存和集中式配置数据缓存,可以实时、高效地更新原始的配置数据,且业务处理系统也不需要进行重新启动,方便了系统后期的维护与升级。By adopting the technical solution of the embodiment of the present invention, compared with using configuration files to manage configuration data, using a relational database to manage configuration data can avoid configuration data modification errors and ensure the integrity and correctness of configuration data; in addition, using a relational database The database tables in the database store configuration data in sub-tables, which can separate a small amount of updated configuration data, and only need to pass a small amount of updated configuration data to the business process without re-reading the data of the entire configuration file, reducing the The amount of data transmission has better real-time performance; compared with only using a relational database to manage configuration data, the embodiment of the present invention combines a processing platform such as a Zookeeper platform and a relational database to jointly manage configuration data, and introduces an update cache and centralized The configuration data cache can update the original configuration data in real time and efficiently, and the business processing system does not need to be restarted, which facilitates the later maintenance and upgrade of the system.
为了实现上述配置数据的管理方法,本发明实施例还提供了一种配置数据的管理装置,所述配置数据的管理装置可应用于服务器中,图5为本发明实施例提供的一种配置数据的管理装置的功能结构示意图;如图5所示,所述配置数据的管理装置包括:监听模块51、获取模块52、判断模块53和处理模块54。下面对上述各程序模块的功能进行说明。其中,In order to achieve the management method of the above configuration data, the embodiment of the present invention also provides a management device configuring data that configures the data can be applied to the server. Figure 5 is a configuration data provided by the invention embodiment. The functional structure diagram of the management device; as shown in Figure 5, the management device of the configuration data includes: monitoring module 51, acquisition module 52, judgment module 53, and processing module 54. The functions of the above program modules will be described below. in,
所述监听模块51,用于监听处理平台节点中预先存储的原始的配置数据是否发生变化;The monitoring module 51 is used to monitor whether the original configuration data pre-stored in the processing platform node changes;
所述获取模块52,用于当监听到所述原始的配置数据发生变化时,获取更新后的配置数据,其中,所述更新后的配置数据是通过下述方式生成的:根据接收到的由数据库中的更新缓存写入所述处理平台节点的待更新的配置数据,对所述原始的配置数据进行更新生成;The obtaining module 52 is configured to obtain updated configuration data when it is detected that the original configuration data has changed, wherein the updated configuration data is generated in the following manner: according to the received The update cache in the database writes the configuration data to be updated of the processing platform node, and updates and generates the original configuration data;
所述判断模块53,用于判断所述更新后的配置数据是否存储于预先设定的集中式配置数据缓存中,获得相应的判断结果;The judging module 53 is configured to judge whether the updated configuration data is stored in a preset centralized configuration data cache, and obtain a corresponding judging result;
所述处理模块54,用于基于所述判断结果,利用对应的处理策略控制对所述更新后的配置数据进行相应处理。The processing module 54 is configured to use a corresponding processing strategy to control the updated configuration data to be processed accordingly based on the judgment result.
在本发明实施例中,所述待更新的配置数据为所述更新缓存在接收到所述数据库发送的第一反馈信息时,写入所述处理平台节点的;In the embodiment of the present invention, the configuration data to be updated is written into the processing platform node when the update cache receives the first feedback information sent by the database;
其中,所述第一反馈信息用于表征所述待更新的配置数据成功写入所述数据库中的数据库表的通知消息。Wherein, the first feedback information is used to represent a notification message that the configuration data to be updated is successfully written into the database table in the database.
在本发明实施例中,所述待更新的配置数据在被写入于所述数据库中的数据库表的同时,还被写入于所述更新缓存中。In the embodiment of the present invention, when the configuration data to be updated is written into the database table in the database, it is also written into the update cache.
在本发明实施例中,所述待更新的配置数据是通过下述方式写入所述处理平台节点:In the embodiment of the present invention, the configuration data to be updated is written into the processing platform node in the following manner:
在所述更新缓存中创建以所述数据库表的名称为键,以所述待更新的配置数据的内容为值的键值对;Create a key-value pair with the name of the database table as the key and the content of the configuration data to be updated as the value in the update cache;
以所述键值对的存储数据结构,由所述更新缓存将所述待更新的配置数据写入所述处理平台节点。Using the storage data structure of the key-value pair, the update cache writes the configuration data to be updated into the processing platform node.
在一些实施例中,对于所述处理模块54基于所述判断结果,利用对应的处理策略控制对所述更新后的配置数据进行相应处理来说,可以采用以下方式来实现:当所述判断结果表征所述更新后的配置数据存储于所述集中式配置数据缓存中时,直接对所述更新后的配置数据进行重新初始化处理。In some embodiments, for the processing module 54 to use the corresponding processing strategy to control the corresponding processing of the updated configuration data based on the judgment result, the following methods can be adopted: when the judgment result When the updated configuration data is stored in the centralized configuration data cache, the updated configuration data is directly re-initialized.
在一些实施例中,对于所述处理模块54基于所述判断结果,利用对应的处理策略控制对所述更新后的配置数据进行相应处理来说,可以采用以下方式来实现:当所述判断结果表征所述更新后的配置数据未存储于所述集中式配置数据缓存中时,向所述数据库发送请求获取完整的配置数据的请求消息;In some embodiments, for the processing module 54 to use the corresponding processing strategy to control the corresponding processing of the updated configuration data based on the judgment result, the following methods can be adopted: when the judgment result When indicating that the updated configuration data is not stored in the centralized configuration data cache, sending a request message requesting to obtain complete configuration data to the database;
在基于所述请求消息获得所述完整的配置数据之后,对所述更新后的配置数据进行重新初始化处理。After the complete configuration data is obtained based on the request message, the updated configuration data is re-initialized.
图6为本发明实施例提供的另一种配置数据的管理装置的功能结构示意图,如图6所示,所述配置数据的管理装置还包括:Fig. 6 is a schematic functional structure diagram of another device for managing configuration data provided by an embodiment of the present invention. As shown in Fig. 6, the device for managing configuration data further includes:
检测模块55,用于在所述处理模块54对所述更新后的配置数据进行重新初始化处理之后,检测所述集中式配置数据缓存中,是否存在距当前时间点的设定时间区间内未被使用的配置数据;The detection module 55 is configured to detect, after the processing module 54 re-initializes the updated configuration data, whether there is any in the centralized configuration data cache that has not been processed within a set time interval from the current time point. The configuration data used;
删除模块56,用于当所述检测模块55确定存在所述未被使用的配置数据时,将所述集中式配置数据缓存中距当前时间点的设定时间区间内未被使用的配置数据删除,以获得相应的缓存空间;A deletion module 56, configured to delete unused configuration data within a set time interval from the current time point in the centralized configuration data cache when the detection module 55 determines that the unused configuration data exists , To obtain the corresponding cache space;
存储模块57,用于基于所获得的缓存空间,将所述更新后的配置数据适应性存储于所述集中式配置数据缓存中。The storage module 57 is configured to adaptively store the updated configuration data in the centralized configuration data cache based on the obtained cache space.
需要说明的是:上述实施例提供的配置数据的管理装置在对配置数据进行管理时,仅以上述各程序模块的划分进行举例说明,实际应用中,可以根据需要而将上述处理分配由不同的程序模块完成,即将配置数据的管理装置的内部结构划分成不同的程序模块,以完成以上描述的全部或者部分处理。另外,上述实施例提供的配置数据的管理装置与配置数据的管理方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再详细赘述。It should be noted that the management device of the configuration data provided by the above embodiments is managed when managing the configuration data, and only the above -mentioned program modules are divided into examples. In practical applications, the above processing can be allocated from different ones according to needs. The program module is completed, and the internal structure of the management device that is about to configure the data is divided into different program modules to complete all or part of the above description. In addition, the management devices of the configuration data provided by the above embodiments are the same concept as the management method of configuration data. For details of the specific implementation process, see the implementation examples, which will not be repeated in detail here.
在实际应用中,所述监听模块51、获取模块52、判断模块53、处理模块54、检测模块55、删除模块56和存储模块57均可由位于服务器上的中央处理器(CPU,CentralProcessing Unit)、微处理器(MPU,Micro Processor Unit)、数字信号处理器(DSP,Digital Signal Processor)或现场可编程门阵列(FPGA,Field Programmable GateArray)等实现。In practical applications, the monitoring module 51, acquisition module 52, judgment module 53, processing module 54, detection module 55, deletion module 56 and storage module 57 can all be located on the central processing unit (CPU, Central Processing Unit) on the server, Implementations such as a microprocessor (MPU, Micro Processor Unit), a digital signal processor (DSP, Digital Signal Processor) or a field programmable gate array (FPGA, Field Programmable GateArray).
为了实现上述配置数据的管理方法,本发明实施例还提供了一种配置数据的管理装置的硬件结构。现在将参考附图描述实现本发明实施例的配置数据的管理装置,所述配置数据的管理装置可以以各种形式的服务器来实施。下面对本发明实施例的配置数据的管理装置的硬件结构做进一步说明,可以理解,图7仅仅示出了配置数据的管理装置的示例性结构而非全部结构,根据需要可以实施图7示出的部分结构或全部结构。In order to implement the above configuration data management method, an embodiment of the present invention further provides a hardware structure of a configuration data management device. A configuration data management device implementing an embodiment of the present invention, which can be implemented in various forms of servers, will now be described with reference to the accompanying drawings. The hardware structure of the configuration data management device of the embodiment of the present invention will be further described below. It can be understood that FIG. 7 only shows an exemplary structure of the configuration data management device but not the entire structure, and the configuration data shown in FIG. 7 can be implemented as required. Some structures or all structures.
参见图7,图7为本发明实施例提供的一种配置数据的管理装置的硬件结构示意图,实际应用中可以应用于前述运行应用程序的各种服务器,图7所示的配置数据的管理装置700包括:至少一个处理器701、存储器702、用户接口703和至少一个网络接口704。所述配置数据的管理装置700中的各个组件通过总线系统705耦合在一起。可以理解,总线系统705用于实现这些组件之间的连接通信。总线系统705除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图7中将各种总线都标为总线系统705。See Figure 7, FIG. 7 is a hardware structure diagram of the management device that configures the data provided by the invention embodiment. In practical applications, it can be applied to various servers that run the application in the aforementioned application. 700 includes: at least one processor 701, memory 702, user interface 703, and at least one network interface 704. Each component of the management device 700 of the configuration data is coupled together through the bus system 705. It is understandable that the bus system 705 is used to implement connection communication between these components. In addition to the data bus, the bus system 705 also includes a power bus, a control bus and a status signal bus. However, in order to clarify, various bus system 705 was marked in Figure 7.
其中,用户接口703可以包括显示器、键盘、鼠标、轨迹球、点击轮、按键、按钮、触感板或者触摸屏等。Wherein, the user interface 703 may include a display, a keyboard, a mouse, a trackball, a click wheel, keys, buttons, a touch panel or a touch screen, and the like.
可以理解,存储器702可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。It will be appreciated that memory 702 may be either volatile memory or non-volatile memory, and may include both volatile and non-volatile memory.
本发明实施例中的存储器702用于存储各种类型的数据以支持配置数据的管理装置700的操作。这些数据的示例包括:用于在配置数据的管理装置700上操作的任何计算机程序,如可执行程序7021和操作系统7022,实现本发明实施例的配置数据的管理方法的程序可以包含在可执行程序7021中。The memory 702 in the embodiment of the present invention is used to store various types of data to support the operation of the management device 700 for configuring data. Examples of these data include: any computer program for operating on the configuration data management device 700, such as an executable program 7021 and an operating system 7022. Program 7021.
本发明实施例揭示的配置数据的管理方法可以应用于处理器701中,或者由处理器701实现。处理器701可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述配置数据的管理方法的各步骤可以通过处理器701中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器701可以是通用处理器、DSP,或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。处理器701可以实现或者执行本发明实施例中提供的各配置数据的管理方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本发明实施例所提供的配置数据的管理方法的步骤,可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储介质中,该存储介质位于存储器702,处理器701读取存储器702中的信息,结合其硬件完成本发明实施例提供的配置数据的管理方法的步骤。The management method of the configuration data revealed by the embodiment of the present invention can be applied to the processor 701, or it is implemented by the processor 701. The processor 701 may be an integrated circuit chip with signal processing capability. During the implementation process, each step of the management method of the above configuration data can be completed through the integrated logic circuit or software form in the processor 701. The above processor 701 may be general processors, DSPs, or other programmable logic devices, separate doors or crystal tube logic devices, and separate hardware components. The processor 701 can implement or execute the management methods, steps and logic box diagrams of each configuration data provided by the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the configuration data provided by the embodiment provided by the invention can be directly reflected in the execution of the hardware decoding processor, or the combination of the hardware and software module in the decoder processor is completed. The software module can be located in the storage medium. The storage medium is located in the memory 702, the processor 701 reads the information in the memory 702, and combines its hardware to complete the steps of the management method provided by the embodied data provided by the invention.
本发明实施例中,所述配置数据的管理装置700包括存储器702、处理器701及存储在存储器702上并能够由所述处理器701运行的可执行程序7021,所述处理器701运行所述可执行程序7021时实现:监听处理平台节点中预先存储的原始的配置数据是否发生变化;当监听到所述原始的配置数据发生变化时,获取更新后的配置数据,其中,所述更新后的配置数据是通过下述方式生成的:根据接收到的由数据库中的更新缓存写入所述处理平台节点的待更新的配置数据,对所述原始的配置数据进行更新生成;判断所述更新后的配置数据是否存储于预先设定的集中式配置数据缓存中,获得相应的判断结果;基于所述判断结果,利用对应的处理策略控制对所述更新后的配置数据进行相应处理。In the embodiment of the present invention, the device 700 for managing configuration data includes a memory 702, a processor 701, and an executable program 7021 stored on the memory 702 and capable of being run by the processor 701, and the processor 701 runs the When the executable program 7021 is executed: monitor whether the original configuration data pre-stored in the processing platform node changes; when the original configuration data is detected to be changed, obtain updated configuration data, wherein the updated The configuration data is generated in the following manner: according to the received configuration data to be updated written into the processing platform node by the update cache in the database, the original configuration data is updated and generated; after the update is judged According to whether the configuration data is stored in the preset centralized configuration data cache, a corresponding judgment result is obtained; based on the judgment result, the corresponding processing strategy is used to control the corresponding processing of the updated configuration data.
作为一种实施方式,所述处理器701运行所述可执行程序7021时实现:所述待更新的配置数据为所述更新缓存在接收到所述数据库发送的第一反馈信息时,写入所述处理平台节点的;其中,所述第一反馈信息用于表征所述待更新的配置数据成功写入所述数据库中的数据库表的通知消息。As an implementation manner, when the processor 701 runs the executable program 7021, it is realized that the configuration data to be updated is written into the update cache when receiving the first feedback information sent by the database. The processing platform node; wherein, the first feedback information is used to represent a notification message that the configuration data to be updated is successfully written into the database table in the database.
作为一种实施方式,所述处理器701运行所述可执行程序7021时实现:所述待更新的配置数据在被写入于所述数据库中的数据库表的同时,还被写入于所述更新缓存中。As an implementation manner, when the processor 701 runs the executable program 7021, it is realized that: while the configuration data to be updated is written in the database table in the database, it is also written in the Update the cache.
作为一种实施方式,所述处理器701运行所述可执行程序7021时实现:所述待更新的配置数据是通过下述方式写入所述处理平台节点:在所述更新缓存中创建以所述数据库表的名称为键,以所述待更新的配置数据的内容为值的键值对;以所述键值对的存储数据结构,由所述更新缓存将所述待更新的配置数据写入所述处理平台节点。As an implementation manner, when the processor 701 runs the executable program 7021, it is realized that: the configuration data to be updated is written into the processing platform node in the following manner: create in the update cache The name of the database table is a key, and the content of the configuration data to be updated is a key-value pair; the storage data structure of the key-value pair is used to write the configuration data to be updated by the update cache Enter the processing platform node.
作为一种实施方式,所述处理器701运行所述可执行程序7021时实现:当所述判断结果表征所述更新后的配置数据存储于所述集中式配置数据缓存中时,直接对所述更新后的配置数据进行重新初始化处理。As an implementation manner, when the processor 701 runs the executable program 7021, it is implemented: when the judgment result indicates that the updated configuration data is stored in the centralized configuration data cache, directly The updated configuration data is reinitialized.
作为一种实施方式,所述处理器701运行所述可执行程序7021时实现:当所述判断结果表征所述更新后的配置数据未存储于所述集中式配置数据缓存中时,向所述数据库发送请求获取完整的配置数据的请求消息;在基于所述请求消息获得所述完整的配置数据之后,对所述更新后的配置数据进行重新初始化处理。As an implementation manner, when the processor 701 runs the executable program 7021, it realizes: when the judgment result indicates that the updated configuration data is not stored in the centralized configuration data cache, send the The database sends a request message requesting to obtain complete configuration data; after the complete configuration data is obtained based on the request message, the updated configuration data is re-initialized.
作为一种实施方式,所述处理器701运行所述可执行程序7021时实现:在所述对所述更新后的配置数据进行重新初始化处理之后,检测所述集中式配置数据缓存中,是否存在距当前时间点的设定时间区间内未被使用的配置数据;当确定存在所述未被使用的配置数据时,将所述集中式配置数据缓存中距当前时间点的设定时间区间内未被使用的配置数据删除,以获得相应的缓存空间;基于所获得的缓存空间,将所述更新后的配置数据适应性存储于所述集中式配置数据缓存中。As an implementation manner, when the processor 701 runs the executable program 7021, it is implemented: after the re-initialization of the updated configuration data is performed, it is detected in the centralized configuration data cache whether there is Configuration data that has not been used within the set time interval from the current time point; when it is determined that there is the unused configuration data, cache the centralized configuration data that is not The used configuration data is deleted to obtain a corresponding cache space; based on the obtained cache space, the updated configuration data is adaptively stored in the centralized configuration data cache.
在示例性实施例中,本发明实施例还提供了一种存储介质,所述存储介质可为光盘、闪存或磁盘等存储介质,可选为非瞬间存储介质。In an exemplary embodiment, the embodiment of the present invention further provides a storage medium, the storage medium may be a storage medium such as an optical disk, a flash memory, or a magnetic disk, and may optionally be a non-transitory storage medium.
本发明实施例中,所述存储介质上存储有可执行程序7021,所述可执行程序7021被处理器701执行时实现:监听处理平台节点中预先存储的原始的配置数据是否发生变化;当监听到所述原始的配置数据发生变化时,获取更新后的配置数据,其中,所述更新后的配置数据是通过下述方式生成的:根据接收到的由数据库中的更新缓存写入所述处理平台节点的待更新的配置数据,对所述原始的配置数据进行更新生成;判断所述更新后的配置数据是否存储于预先设定的集中式配置数据缓存中,获得相应的判断结果;基于所述判断结果,利用对应的处理策略控制对所述更新后的配置数据进行相应处理。In the embodiment of the present invention, an executable program 7021 is stored on the storage medium, and when the executable program 7021 is executed by the processor 701, it is implemented to: monitor whether the original configuration data pre-stored in the processing platform node changes; When the original configuration data changes, the updated configuration data is obtained, wherein the updated configuration data is generated in the following manner: according to the received update cache in the database, write the processing For the configuration data to be updated of the platform node, update and generate the original configuration data; judge whether the updated configuration data is stored in the preset centralized configuration data cache, and obtain the corresponding judgment result; based on the According to the judgment result, the corresponding processing policy is used to control the updated configuration data to be processed accordingly.
作为一种实施方式,所述可执行程序7021被处理器701执行时实现:所述待更新的配置数据为所述更新缓存在接收到所述数据库发送的第一反馈信息时,写入所述处理平台节点的;其中,所述第一反馈信息用于表征所述待更新的配置数据成功写入所述数据库中的数据库表的通知消息。As an implementation manner, when the executable program 7021 is executed by the processor 701, it is realized that the configuration data to be updated is written into the update cache when the first feedback information sent by the database is received. The processing platform node; wherein, the first feedback information is used to represent a notification message that the configuration data to be updated is successfully written into the database table in the database.
作为一种实施方式,所述可执行程序7021被处理器701执行时实现:所述待更新的配置数据在被写入于所述数据库中的数据库表的同时,还被写入于所述更新缓存中。As an implementation manner, when the executable program 7021 is executed by the processor 701, it is realized that: while the configuration data to be updated is written in the database table in the database, it is also written in the update In cache.
作为一种实施方式,所述可执行程序7021被处理器701执行时实现:所述待更新的配置数据是通过下述方式写入所述处理平台节点:在所述更新缓存中创建以所述数据库表的名称为键,以所述待更新的配置数据的内容为值的键值对;以所述键值对的存储数据结构,由所述更新缓存将所述待更新的配置数据写入所述处理平台节点。As an implementation, when the executable program 7021 is executed by the processor 701, it is realized that: the configuration data to be updated is written into the processing platform node in the following manner: create in the update cache with the The name of the database table is the key value pair based on the content of the content of the content of the configuration data to be updated; the storage data structure of the key value pair will be written by the renewal cache to write the configuration data to be updated to the update data to the updated data to the updated data to the update data to the updated data to The processing platform node.
作为一种实施方式,所述可执行程序7021被处理器701执行时实现:当所述判断结果表征所述更新后的配置数据存储于所述集中式配置数据缓存中时,直接对所述更新后的配置数据进行重新初始化处理。As an implementation manner, when the executable program 7021 is executed by the processor 701, it is implemented: when the judgment result indicates that the updated configuration data is stored in the centralized configuration data cache, directly update the The subsequent configuration data is re -initialized.
作为一种实施方式,所述可执行程序7021被处理器701执行时实现:当所述判断结果表征所述更新后的配置数据未存储于所述集中式配置数据缓存中时,向所述数据库发送请求获取完整的配置数据的请求消息;在基于所述请求消息获得所述完整的配置数据之后,对所述更新后的配置数据进行重新初始化处理。As an implementation manner, when the executable program 7021 is executed by the processor 701, it realizes: when the judgment result indicates that the updated configuration data is not stored in the centralized configuration data cache, send Sending a request message requesting to obtain complete configuration data; after obtaining the complete configuration data based on the request message, performing re-initialization processing on the updated configuration data.
作为一种实施方式,所述可执行程序7021被处理器701执行时实现:在所述对所述更新后的配置数据进行重新初始化处理之后,检测所述集中式配置数据缓存中,是否存在距当前时间点的设定时间区间内未被使用的配置数据;当确定存在所述未被使用的配置数据时,将所述集中式配置数据缓存中距当前时间点的设定时间区间内未被使用的配置数据删除,以获得相应的缓存空间;基于所获得的缓存空间,将所述更新后的配置数据适应性存储于所述集中式配置数据缓存中。As an embodiment, the execution program 7021 is implemented when the processor 701 is executed: after re -initialization of the updated configuration data, check whether there is a distance in the concentrated configuration data cache in the cache of the centralized configuration data cache. The configuration data that is not used in the current time point is set in the time interval; when the unused configuration data is determined, the centralized configuration data cache is not within the set time interval of the current time point. Delete the configuration data used to obtain the corresponding cache space; based on the cache space obtained, the updated configuration data adaptability is stored in the buffer of the centralized configuration data.
综上所述,本发明实施例所提供的配置数据的管理方法,结合处理平台如Zookeeper平台与关系型数据库来管理配置数据,将待更新的配置数据由关系型数据库中的更新缓存写入处理平台节点,以实现关系型数据库到处理平台节点的映射,且处理平台配合更新缓存和集中式配置数据缓存来实现配置数据的动态更新,可以实时、高效地更新配置数据,采用关系型数据库中的数据库表存储关系复杂且数量庞大的配置数据,可以避免配置数据修改出错,保证配置数据的完整性和安全性,并且业务处理系统进程也不需要重新启动,以便于后期的维护与升级。In summary, the configuration data management method provided by the embodiment of the present invention combines a processing platform such as a Zookeeper platform and a relational database to manage the configuration data, and writes the configuration data to be updated into the update cache in the relational database for processing Platform nodes to realize the mapping from relational database to processing platform nodes, and the processing platform cooperates with update cache and centralized configuration data cache to realize dynamic update of configuration data, which can update configuration data in real time and efficiently. The database table stores complex and large amount of configuration data, which can avoid configuration data modification errors, ensure the integrity and security of configuration data, and the business processing system process does not need to be restarted to facilitate later maintenance and upgrades.
本领域技术人员应当理解,本发明实施例所记载的各技术方案之间,在不冲突的情况下,可以任意组合。Those skilled in the art should understand that the technical solutions described in the embodiments of the present invention can be combined arbitrarily without conflict.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或可执行程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的可执行程序产品的形式。Technical personnel in the art should understand that the embodiments of the present invention can provide a method, system, or executable program product. Accordingly, the invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of an executable program product embodied on one or more computer-usable storage media (including but not limited to magnetic disk storage, optical storage, etc.) having computer-usable program code embodied therein.
本发明是参照根据本发明实施例的方法、设备(系统)、和可执行程序产品的流程图和/或方框图来描述的。应理解可由可执行程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些可执行程序指令到通用计算机、专用计算机、嵌入式处理机或参考可编程数据处理设备的处理器以产生一个机器,使得通过计算机或参考可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described by reference to the method, equipment (system), and the flowchart and/or box diagram of the executable program products. It should be understood that the process chart and/or box diagram can be implemented by the executable program instructions and/or boxes in the box diagram. These executable program instructions can be provided to a processor that can be used to generate a machine with general computers, dedicated computers, embedded processing machines or reference programmable data processing devices to generate a machine, so that instructions executed by computers or reference programmable devices perform instructions to generate instructions generated by the processor execution of the processor processing device. It is used to implement a function device specified in a process diagram of a process or multiple processes and/or box diagrams.
这些可执行程序指令也可存储在能引导计算机或参考可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These executable program instructions may also be stored in a computer-readable memory capable of directing a computer or reference programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the The instruction means implements the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些可执行程序指令也可装载到计算机或参考可编程数据处理设备上,使得在计算机或参考可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或参考可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These executable program instructions can also be loaded onto a computer or reference programmable data processing device, causing a series of operational steps to be performed on the computer or reference programmable device to produce a computer-implemented process for execution on the computer or reference programmable device The instructions provide steps for implementing the functions specified in the procedure or procedures of the flowchart and/or the block or blocks of the block diagram.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above description is only a preferred embodiment of the present invention, and is not used to limit the protection scope of the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention shall be included in the Within the protection scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811189519.3A CN109522043B (en) | 2018-10-12 | 2018-10-12 | Method and device for managing configuration data and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811189519.3A CN109522043B (en) | 2018-10-12 | 2018-10-12 | Method and device for managing configuration data and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109522043A true CN109522043A (en) | 2019-03-26 |
CN109522043B CN109522043B (en) | 2021-11-16 |
Family
ID=65772462
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811189519.3A Active CN109522043B (en) | 2018-10-12 | 2018-10-12 | Method and device for managing configuration data and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109522043B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110471884A (en) * | 2019-08-19 | 2019-11-19 | 深圳前海微众银行股份有限公司 | Data managing method, device, equipment, system and computer readable storage medium |
CN111147312A (en) * | 2019-12-31 | 2020-05-12 | 深圳云天励飞技术有限公司 | Resource allocation management method and device, resource allocation cache management method and device, and allocation management system |
CN112055057A (en) * | 2020-08-14 | 2020-12-08 | 青岛海信网络科技股份有限公司 | Method, device and equipment for dynamically expanding Web system |
CN112256700A (en) * | 2020-10-19 | 2021-01-22 | 北京字节跳动网络技术有限公司 | Data storage method and device, electronic equipment and computer readable storage medium |
CN113867763A (en) * | 2021-09-27 | 2021-12-31 | 苏州九宫数字科技有限公司 | A method, system and medium for distributed configuration update management |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104283956A (en) * | 2014-09-30 | 2015-01-14 | 腾讯科技(深圳)有限公司 | Strong consistence distributed data storage method, device and system |
CN106878053A (en) * | 2016-12-22 | 2017-06-20 | 努比亚技术有限公司 | A kind of config update devices and methods therefor based on ZOOKEEPER |
CN107465714A (en) * | 2017-01-23 | 2017-12-12 | 北京思特奇信息技术股份有限公司 | A kind of configuration data dynamic update system and method based on application cluster |
US20180095846A1 (en) * | 2016-09-30 | 2018-04-05 | Commvault Systems, Inc. | Heartbeat monitoring of virtual machines for initiating failover operations in a data storage management system, including operations by a master monitor node |
-
2018
- 2018-10-12 CN CN201811189519.3A patent/CN109522043B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104283956A (en) * | 2014-09-30 | 2015-01-14 | 腾讯科技(深圳)有限公司 | Strong consistence distributed data storage method, device and system |
US20180095846A1 (en) * | 2016-09-30 | 2018-04-05 | Commvault Systems, Inc. | Heartbeat monitoring of virtual machines for initiating failover operations in a data storage management system, including operations by a master monitor node |
CN106878053A (en) * | 2016-12-22 | 2017-06-20 | 努比亚技术有限公司 | A kind of config update devices and methods therefor based on ZOOKEEPER |
CN107465714A (en) * | 2017-01-23 | 2017-12-12 | 北京思特奇信息技术股份有限公司 | A kind of configuration data dynamic update system and method based on application cluster |
Non-Patent Citations (2)
Title |
---|
OUFU: ""ZooKeeper统一配置管理"", 《CSDN博客 公开网址:HTTPS://BLOG.CSDN.NET/OUFUA/ARTICLE/DETAILS/52785339?UTM_SOURCE=BLOGXGWZ5》 * |
李鑫: ""基于共享数据库科研管理系统的设计与实现"", 《中国优秀硕士学位论文全文数据库电子期刊 信息科技辑》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110471884A (en) * | 2019-08-19 | 2019-11-19 | 深圳前海微众银行股份有限公司 | Data managing method, device, equipment, system and computer readable storage medium |
WO2021031905A1 (en) * | 2019-08-19 | 2021-02-25 | 深圳前海微众银行股份有限公司 | Data management method, apparatus, device and system and computer-readable storage medium |
CN111147312A (en) * | 2019-12-31 | 2020-05-12 | 深圳云天励飞技术有限公司 | Resource allocation management method and device, resource allocation cache management method and device, and allocation management system |
CN112055057A (en) * | 2020-08-14 | 2020-12-08 | 青岛海信网络科技股份有限公司 | Method, device and equipment for dynamically expanding Web system |
CN112256700A (en) * | 2020-10-19 | 2021-01-22 | 北京字节跳动网络技术有限公司 | Data storage method and device, electronic equipment and computer readable storage medium |
CN113867763A (en) * | 2021-09-27 | 2021-12-31 | 苏州九宫数字科技有限公司 | A method, system and medium for distributed configuration update management |
Also Published As
Publication number | Publication date |
---|---|
CN109522043B (en) | 2021-11-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3602305B1 (en) | Rule-based modifications in a data storage appliance monitor | |
CN109522043B (en) | Method and device for managing configuration data and storage medium | |
US9031910B2 (en) | System and method for maintaining a cluster setup | |
CN100417081C (en) | Method and system for checking and repairing network configuration | |
CN102576354B (en) | Support that difference disposes the extensible framework of framework | |
US7921189B2 (en) | Single virtual client for multiple client access and equivalency | |
US9253265B2 (en) | Hot pluggable extensions for access management system | |
US10185549B2 (en) | Updating live system with static changes | |
US11249788B2 (en) | Cloud management platform, and virtual machine management method and system | |
US10097659B1 (en) | High performance geographically distributed data storage, retrieval and update | |
CN105723363B (en) | Method for maintaining and upgrading tenant database in ERP system and server thereof | |
US11210277B2 (en) | Distributing and processing streams over one or more networks for on-the-fly schema evolution | |
US10230567B2 (en) | Management of a plurality of system control networks | |
CN103475721B (en) | A kind of digital asset updates the digital asset update method of system | |
US11516070B1 (en) | Method and system for diagnosing and remediating service failures | |
KR102665749B1 (en) | Method and apparatus for ensuring continued device operational reliability in cloud-degraded mode | |
CN106685729A (en) | Method and system for service configuration management | |
US20130024859A1 (en) | Control computer and data accessing method | |
US11281550B2 (en) | Disaster recovery specific configurations, management, and application | |
CN110674153B (en) | Data consistency detection method and device and electronic equipment | |
US20190384493A1 (en) | Method, device, and computer program prouct for managing virtual machines | |
CN107506144A (en) | A kind of cluster storage system cabinet Explore of Unified Management Ideas and system | |
US20160274813A1 (en) | Storage system management and representation methods and apparatus | |
US12073263B1 (en) | Dynamic processing of API requests | |
US11740807B2 (en) | Method and system for mapping data protection policies to data clusters |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |