





技术领域technical field
本申请涉及软件通信技术领域,特别是涉及公有配置的共享方法、装置、计算机设备及存储介质。The present application relates to the technical field of software communication, and in particular, to a sharing method, apparatus, computer device and storage medium of a public configuration.
背景技术Background technique
分布式配置中心需要能够集中化管理应用于不同环境、不同集群的配置,对配置参数进行修改后,能够实时将修改后的配置参数推送到应用端,并且对配置参数的修改及推送还需要具备规范的权限、流程治理等特性,目前分布式配置中心中间件如携程Apollo、淘宝内部diamond、spring cloud等,各种配置中心的产品应运而生。The distributed configuration center needs to be able to centrally manage the configuration applied to different environments and different clusters. After modifying the configuration parameters, it can push the modified configuration parameters to the application side in real time, and the modification and push of the configuration parameters also need to have the Standardized permissions, process governance and other features, currently distributed configuration center middleware such as Ctrip Apollo, Taobao internal diamond, spring cloud, etc., various configuration center products came into being.
目前对于配置参数的管理是一体式的统一管理,这种管理方式导致产品本身在同一代码版本、同一集群环境下针对公有配置公有支持不足,导致在多个并行项目实施开发场景下,一些横向切面级的、跨越项目应用级别的、公有的安全、日志等服务的公有配置信息无法公有重用。At present, the management of configuration parameters is an integrated and unified management. This management method leads to the lack of public support for the public configuration of the product itself in the same code version and the same cluster environment, resulting in the implementation and development of multiple parallel projects. The public configuration information of services such as public security, log and other services at the level, across the project application level, cannot be reused publicly.
例如配置信息有10项内容需要配置,有N个项目需要对这些共有配置信息进行配置,则需要在配置中心的N个项目中配置N*10次,造成大量配置信息冗余,同时使得操作人员在UI(User Interface,用户界面)客户管理端的维护成本骤增,在手动对公有配置进行参数设置时,还容易出错、遗漏,更甚的是频繁变更操作这些系统层级的公有配置信息会导致更频繁的变更推动信息到各个应用端,增加各个关联系统的负载。For example, there are 10 items of configuration information that need to be configured, and there are N items that need to configure these shared configuration information, so it is necessary to configure N*10 times in the N items of the configuration center, resulting in a large amount of configuration information redundancy, and at the same time making the operator The maintenance cost of the UI (User Interface, user interface) client management side has increased sharply. When manually setting parameters for the public configuration, it is easy to make mistakes and omissions. What's more, frequent changes to the public configuration information at the system level will lead to more Frequent changes push information to various applications, increasing the load on each associated system.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供公有配置的共享方法、装置、计算机设备及存储介质,可以增加配置信息的重用率、减少配置代码冗余。The embodiments of the present invention provide a public configuration sharing method, apparatus, computer equipment and storage medium, which can increase the reuse rate of configuration information and reduce configuration code redundancy.
根据本发明一个发明提供的一种公有配置的共享方法,所述方法包括:According to an invention of the present invention, a method for sharing a public configuration is provided, and the method includes:
根据接收的指令,创建公有配置的参数以及所述公有配置参数的参数值;Create public configuration parameters and parameter values of the public configuration parameters according to the received instruction;
将公有配置的参数以及所述参数值单独保存在本地缓存列表中;Save the parameters of the public configuration and the parameter values separately in the local cache list;
接收到加载应用客户端的配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值;When receiving the request instruction to load the configuration information of the application client, preferentially load the parameters of the public configuration and the parameter values of the public configuration parameters from the local cache list;
从预先指定的环境信息中加载应用客户端的私有配置的参数及所述私有配置参数的参数值。The parameters of the private configuration of the application client and the parameter values of the private configuration parameters are loaded from the pre-specified environment information.
进一步地,所述根据接收的指令,创建公有配置的参数以及所述公有配置参数的参数值的步骤包括:Further, according to the received instruction, the steps of creating the parameters of the public configuration and the parameter values of the public configuration parameters include:
根据接收的指令,创建配置项目,所述配置项目包含有至少一个公有配置的参数及公有配置参数的参数值;According to the received instruction, a configuration item is created, the configuration item includes at least one public configuration parameter and a parameter value of the public configuration parameter;
为每个所述配置项目创建唯一识别码;creating a unique identification code for each of said configuration items;
创建所述唯一识别码与所述应用客户端的一对一或一对多的映射关系;Create a one-to-one or one-to-many mapping relationship between the unique identifier and the application client;
将所述唯一识别码、所述公有配置的参数、所述公有配置参数的参数值及所述映射关系均保存在所述本地缓存列表中。The unique identification code, the parameter of the public configuration, the parameter value of the public configuration parameter, and the mapping relationship are all stored in the local cache list.
进一步地,所述接收到加载应用客户端的配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值的步骤包括:Further, when the request instruction for loading configuration information of the application client is received, the steps of preferentially loading the public configuration parameters and the parameter values of the public configuration parameters from the local cache list include:
接收到加载应用客户端的配置信息的请求指令时,获取与所述应用客户端相映射的唯一识别码;When receiving the request instruction to load the configuration information of the application client, obtain the unique identification code mapped with the application client;
根据所述唯一识别码与所述配置项目的对应关系,从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值。According to the corresponding relationship between the unique identification code and the configuration item, the parameters of the public configuration and the parameter values of the public configuration parameters are loaded from the local cache list.
进一步地,所述接收到加载应用客户端的配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值的步骤包括:Further, when the request instruction for loading configuration information of the application client is received, the steps of preferentially loading the public configuration parameters and the parameter values of the public configuration parameters from the local cache list include:
接收到应用客户端发送的加载配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值;或When receiving the request instruction for loading configuration information sent by the application client, preferentially load the parameters of the public configuration and the parameter values of the public configuration parameters from the local cache list; or
接收到本地发出的加载应用客户端的配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值。When a request instruction for loading configuration information of an application client sent locally is received, the parameters of the public configuration and the parameter values of the public configuration parameters are preferentially loaded from the local cache list.
进一步地,在所述根据接收的指令,创建公有配置的参数以及所述公有配置参数的参数值的步骤之前,所述方法还包括:Further, before the step of creating public configuration parameters and parameter values of the public configuration parameters according to the received instructions, the method further includes:
根据用户输入的身份验证信息,验证所述用户的身份;Verify the identity of the user according to the authentication information input by the user;
判断验证的所述身份是否具有公有配置参数的管理权限,若是,则接收所述用户输入的指令,创建公有配置的参数以及所述公有配置参数的参数值。It is judged whether the verified identity has the management authority of the public configuration parameter, and if so, the instruction input by the user is received, and the public configuration parameter and the parameter value of the public configuration parameter are created.
进一步地,所述方法还包括:Further, the method also includes:
在从预先指定的环境信息中加载应用客户端的私有配置的参数及所述私有配置参数的参数值时,判断加载的私有配置的参数与在先加载的公有配置的参数是否相同;When loading the parameters of the private configuration of the application client and the parameter values of the private configuration parameters from the pre-specified environment information, determine whether the parameters of the loaded private configuration are the same as the parameters of the previously loaded public configuration;
当加载的私有配置的参数与在先加载的公有配置的参数相同时,判断对应私有配置参数的参数值与在先加载的公有配置参数的参数值是否相同;When the parameters of the loaded private configuration are the same as the parameters of the previously loaded public configuration, determine whether the parameter value of the corresponding private configuration parameter is the same as the parameter value of the previously loaded public configuration parameter;
若对应私有配置参数的参数值与在先加载的公有配置参数的参数值不相同,则以私有配置参数的参数值为准。If the parameter value of the corresponding private configuration parameter is different from the parameter value of the previously loaded public configuration parameter, the parameter value of the private configuration parameter shall prevail.
根据本发明的另一方面提供的一种公有配置的共享装置,所述装置包括:According to another aspect of the present invention, a shared device with a public configuration is provided, the device includes:
公有配置创建模块,用于根据接收的指令,创建公有配置的参数以及所述公有配置参数的参数值;a public configuration creation module, configured to create parameters of the public configuration and parameter values of the public configuration parameters according to the received instruction;
保存模块,用于将公有配置的参数以及所述参数值单独保存在本地缓存列表中;a saving module, which is used to separately save the parameters of the public configuration and the parameter values in the local cache list;
第一加载模块,用于接收到加载应用客户端的配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值;a first loading module, configured to preferentially load the parameters of the public configuration and the parameter values of the public configuration parameters from the local cache list when receiving the request instruction for loading the configuration information of the application client;
第二加载模块,用于从预先指定的环境信息中加载应用客户端的私有配置的参数及所述私有配置参数的参数值。The second loading module is configured to load the parameters of the private configuration of the application client and the parameter values of the private configuration parameters from the pre-specified environment information.
进一步地,所述公有配置创建模块包括:Further, the public configuration creation module includes:
项目创建单元,用于根据接收的指令,创建配置项目,所述配置项目包含有至少一个公有配置的参数及公有配置参数的参数值;a project creation unit, configured to create a configuration project according to the received instruction, the configuration project including at least one public configuration parameter and a parameter value of the public configuration parameter;
识别码创建单元,用于为每个所述配置项目创建唯一识别码;an identification code creation unit for creating a unique identification code for each of the configuration items;
映射关系创建单元,用于创建所述唯一识别码与所述应用客户端的一对一或一对多的映射关系;a mapping relationship creation unit, configured to create a one-to-one or one-to-many mapping relationship between the unique identification code and the application client;
所述保存模块具体用于将所述唯一识别码、所述公有配置的参数、所述公有配置参数的参数值及所述映射关系均保存在所述本地缓存列表中。The saving module is specifically configured to save the unique identification code, the parameters of the public configuration, the parameter values of the public configuration parameters and the mapping relationship in the local cache list.
根据本发明的又一方面提供的一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述公有配置的共享方法。According to another aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the sharing of the above-mentioned public configuration when executing the program method.
根据本发明的还一方面提供的一种计算机可读存储介质,其上存储有计算机程序,所述程序被处理器执行时实现上述公有配置的共享方法中的步骤。According to another aspect of the present invention, a computer-readable storage medium is provided, and a computer program is stored thereon, and when the program is executed by a processor, the steps in the above-mentioned public configuration sharing method are implemented.
本申请通过将配置信息分为公有配置和私有配置两种,将公有配置的优先级定为优先,在加载配置参数时,优先加载公有配置,再加载私有配置,使得配置中心可以高效、快速地应对多项目并发实施场景下公有配置信息集中化管理的需求,可以避免配置中心因为大量冗余信息而愈发笨重且不可扩展,减少运营配置人员人为的出错和遗漏概率,规避因为公有配置信息频繁更改而产生的更频繁的变更推动通知,增加配置信息的重用率、减少配置代码冗余,还可以降低系统之间的访问频率,提升整体系统性能。In this application, the configuration information is divided into two types: public configuration and private configuration, and the priority of public configuration is set as the priority. When loading configuration parameters, the public configuration is loaded first, and then the private configuration is loaded, so that the configuration center can efficiently and quickly In response to the need for centralized management of public configuration information in the multi-project concurrent implementation scenario, it can prevent the configuration center from becoming more cumbersome and unscalable due to a large amount of redundant information, reduce the probability of human errors and omissions by operation configuration personnel, and avoid frequent public configuration information. More frequent change push notifications caused by changes increase the reuse rate of configuration information, reduce configuration code redundancy, and also reduce the frequency of access between systems and improve overall system performance.
附图说明Description of drawings
图1为根据本发明的一个实施例的公有配置的共享方法的流程示意图;1 is a schematic flowchart of a method for sharing a public configuration according to an embodiment of the present invention;
图2为根据本发明的另一实施例的公有配置的共享方法的流程示意图;2 is a schematic flowchart of a method for sharing a public configuration according to another embodiment of the present invention;
图3为根据本发明的又一实施例的公有配置的共享方法的流程示意图;3 is a schematic flowchart of a method for sharing a public configuration according to another embodiment of the present invention;
图4为根据本发明的再一实施例的公有配置的共享方法的流程示意图;4 is a schematic flowchart of a method for sharing a public configuration according to yet another embodiment of the present invention;
图5为根据本发明的一个实施例的公有配置的共享方法的数据流向示意图;5 is a schematic diagram of a data flow of a method for sharing public configuration according to an embodiment of the present invention;
图6为根据本发明的一个实施例的公有配置的共享装置的示范性结构框图;FIG. 6 is a block diagram of an exemplary structure of a sharing apparatus with a public configuration according to an embodiment of the present invention;
图7为根据本发明的一个实施例的计算机设备的内部结构示意图。FIG. 7 is a schematic diagram of the internal structure of a computer device according to an embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.
图1为根据本发明的一个实施例的公有配置的共享方法的流程示意图,根据本发明一个实施例提供的公有配置的共享方法如图1所示,本实施例提供的公有配置的共享方法可以应用于服务器或服务器组,该公有配置的共享方法包括以下步骤S101至S104。FIG. 1 is a schematic flowchart of a method for sharing a public configuration according to an embodiment of the present invention. The method for sharing a public configuration provided by an embodiment of the present invention is shown in FIG. 1 . The method for sharing a public configuration provided by this embodiment may be Applied to a server or a server group, the public configuration sharing method includes the following steps S101 to S104.
S101、根据接收的指令,创建公有配置的参数以及所述公有配置参数的参数值。S101. Create public configuration parameters and parameter values of the public configuration parameters according to the received instruction.
在其中一个实施例中,所述公有配置的参数包括但不限于本端的IP地址、本端的端口号以及本端的服务器地址等等。In one embodiment, the parameters of the public configuration include, but are not limited to, the IP address of the local end, the port number of the local end, the server address of the local end, and the like.
在其中一个实施例中,接收的所述指令是有管理权限的用户输入的管理指令,所述指令用于将之前与运行环境及应用代码版本等紧耦合的系统层级的公有服务配置信息剥离开来,即将公有的配置信息单独指定位置,确保不受运行环境与应用代码等信息影响,所述指定位置例如放在default下。In one embodiment, the received instruction is a management instruction input by a user with management authority, and the instruction is used to separate the public service configuration information at the system level that is tightly coupled with the operating environment and the application code version. Come, that is to say, specify the location of the public configuration information separately to ensure that it is not affected by information such as the running environment and application code. For example, the specified location is placed under default.
S102、将公有配置的参数以及所述参数值单独保存在本地缓存列表中。S102. Store the publicly configured parameter and the parameter value in the local cache list separately.
在本一个实施例中,可以将本地缓存列表中的配置加载优先级设为最高,使得应用系统启动从配置中心获取配置信息时,优先从default目录下获取系统层级的公有配置信息。In this embodiment, the configuration loading priority in the local cache list can be set to the highest, so that when the application system starts to obtain configuration information from the configuration center, it preferentially obtains system-level public configuration information from the default directory.
在其中一个实施例中,所述配置信息的请求指令可以是应用客户端发送的加载请求指令,也可以是本端主动推送的加载请求指令。In one of the embodiments, the request instruction for the configuration information may be a loading request instruction sent by the application client, or may be a loading request instruction actively pushed by the local end.
S103、接收到加载应用客户端的配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值。S103. When receiving the request instruction for loading the configuration information of the application client, preferentially load the parameters of the public configuration and the parameter values of the public configuration parameters from the local cache list.
在其中一个实施例中,所述私有配置参数包括但不限于数据库连接串、用户名及密码,应用超时时间,服务器端口等。In one embodiment, the private configuration parameters include, but are not limited to, a database connection string, a user name and password, an application timeout period, a server port, and the like.
S104、从预先指定的环境信息中加载应用客户端的私有配置的参数及所述私有配置参数的参数值。S104. Load the parameters of the private configuration of the application client and the parameter values of the private configuration parameters from the pre-specified environment information.
在其中一个实施例中,所述接收到加载应用客户端的配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值的步骤包括:In one embodiment, when the request instruction for loading configuration information of the application client is received, the step of preferentially loading the public configuration parameters and the parameter values of the public configuration parameters from the local cache list includes:
接收到应用客户端发送的加载配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值;或When receiving the request instruction for loading configuration information sent by the application client, preferentially load the parameters of the public configuration and the parameter values of the public configuration parameters from the local cache list; or
接收到本地发出的加载应用客户端的配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值。When a request instruction for loading configuration information of an application client sent locally is received, the parameters of the public configuration and the parameter values of the public configuration parameters are preferentially loaded from the local cache list.
本实施例提供了配置信息的两种加载方法,一种是服务器端主动推送,另一种是客户端主动拉取。本实施例使得本申请提供的公有参数的加载方法可以适用的范围更广。This embodiment provides two methods for loading configuration information, one is active push by the server, and the other is active pull by the client. This embodiment makes the method for loading public parameters provided by the present application applicable to a wider range.
根据本实施的一个使用场景例如,当手机淘宝这一应用客户端请求配置时,会优先从本地缓存列表中读取default目录下的系统层级的公有配置信息,例如本端的的IP地址、本端的端口号以及本端的服务器地址等,其次再从应用在配置文件中指定的对应集群环境中获取各自的私有配置信息,例如手机淘宝的数据库连接串、用户名及密码,应用超时时间,手机淘宝的服务器端口等。According to a usage scenario of this implementation, for example, when the mobile Taobao application client requests configuration, it will preferentially read the system-level public configuration information in the default directory from the local cache list, such as the local IP address, local The port number and the server address of the local end, etc., and then obtain the respective private configuration information from the corresponding cluster environment specified by the application in the configuration file, such as the database connection string, user name and password of mobile Taobao, application timeout time, mobile Taobao's server port, etc.
本实施例通过将配置信息分为公有配置和私有配置两种,将公有配置的优先级定为优先,在加载配置参数时,优先加载公有配置,再加载私有配置,使得配置中心可以高效、快速地应对多项目并发实施场景下公有配置信息集中化管理的需求,可以避免配置中心因为大量冗余信息而愈发笨重且不可扩展,减少运营配置人员人为的出错和遗漏概率,规避因为公有配置信息频繁更改而产生的更频繁的变更推动通知,加配置信息的重用率、减少配置代码冗余,还可以降低系统之间的访问频率,提升整体系统性能。In this embodiment, the configuration information is divided into two types: public configuration and private configuration, and the priority of the public configuration is set as the priority. When loading configuration parameters, the public configuration is loaded first, and then the private configuration is loaded, so that the configuration center can be efficient and fast. In response to the need for centralized management of public configuration information in the multi-project concurrent implementation scenario, it can avoid the configuration center becoming more cumbersome and unexpandable due to a large amount of redundant information, reduce the probability of human errors and omissions by operation configuration personnel, and avoid the need for public configuration information. More frequent change push notifications caused by frequent changes, increase the reuse rate of configuration information, reduce configuration code redundancy, reduce the frequency of access between systems, and improve overall system performance.
图2为根据本发明的另一实施例的公有配置的共享方法的流程示意图,如图2所示,在其它实施例中,上述步骤S101进一步包括以下步骤S1011至S1014:FIG. 2 is a schematic flowchart of a method for sharing a public configuration according to another embodiment of the present invention. As shown in FIG. 2 , in other embodiments, the above step S101 further includes the following steps S1011 to S1014:
S1011、根据接收的指令,创建配置项目,所述配置项目包含有至少一个公有配置的参数及公有配置参数的参数值;S1011. Create a configuration item according to the received instruction, where the configuration item includes at least one public configuration parameter and a parameter value of the public configuration parameter;
S1012、为每个所述配置项目创建唯一识别码;S1012, creating a unique identification code for each of the configuration items;
S1013、创建所述唯一识别码与所述应用客户端的一对一或一对多的映射关系;S1013, creating a one-to-one or one-to-many mapping relationship between the unique identifier and the application client;
S1014、将所述唯一识别码、所述公有配置的参数、所述公有配置参数的参数值及所述映射关系均保存在所述本地缓存列表中。S1014. Save the unique identification code, the parameters of the public configuration, the parameter values of the public configuration parameters, and the mapping relationship in the local cache list.
在本实施例中,通过将配置参数以及参数值均相同的应用客户端归为同一类,并用相同的唯一识别码标识,使得对不同类应用客户端的公有配置可以分类管理,对同类应用客户端的公有配置进行一次配置即可,进一步加强公有配置的集中化管理需求。In this embodiment, application clients with the same configuration parameters and parameter values are classified into the same category and identified with the same unique identification code, so that the public configuration of different types of application clients can be managed by classification, and the same type of application clients can be managed by classification. The public configuration can be configured once, which further strengthens the centralized management requirements of the public configuration.
图5为根据本发明的一个实施例的公有配置的共享方法的数据流向示意图,根据本发明的一个实施例的公有配置的共享方法的数据流向如图5所示,当用编码实现上述公有配置的公有方法,运行编码程序时,其数据流向如图5所示,下面根据上述示意图对本实施例的数据流向做详细说明:FIG. 5 is a schematic diagram of a data flow of a method for sharing a public configuration according to an embodiment of the present invention. The data flow of the method for sharing a public configuration according to an embodiment of the present invention is shown in FIG. 5 . When the above-mentioned public configuration is implemented by coding The public method of , when running the encoding program, its data flow is as shown in Figure 5, and the data flow of this embodiment is described in detail below according to the above schematic diagram:
1.具备相应权限管理或运营的用户在用户界面Portal操作配置发布;1. Users who have the corresponding rights to manage or operate will publish the operation configuration on the user interface Portal;
2.用户界面(Portal)通过调用服务管理端(Admin Service)的接口操作发布;2. The user interface (Portal) is released by calling the interface operation of the service management terminal (Admin Service);
3.服务管理端(Admin Service)发布配置后,发送ReleaseMessage消息给各个配置中心(Config Service);3. After the Admin Service publishes the configuration, it sends a ReleaseMessage message to each configuration center (Config Service);
4.配置中心(Config Service)收到ReleaseMessage后,通知对应的客户端(Client)。4. After the configuration center (Config Service) receives the ReleaseMessage, it notifies the corresponding client (Client).
其中,在protal用户界面端指定公有配置信息位置为default并生成所述唯一识别码ID,并依次录入公有配置项信息。在用户界面portal端指定项目的所述私有配置信息地址(如DEV、FAT、UAT、PRO等),并依次录入所述私有配置的每项信息。在服务器主动推送变更配置信息或应用端client客户端主动拉取变更信息时,需要在所述本地缓存列表中新增default内存区域用以保存所述公有配置信息,同时,重构应用端client客户端加载配置信息逻辑,将原先只从指定位置加载配置信息逻辑修改为先从default出处加载所述公有配置信息,完成之后再从指定环境信息中加载所述私有配置信息,如在default与私有配置信息中存在相同数据项配置,则会以私有配置信息中的配置项的value值为准。The location of the public configuration information is designated as default on the portal user interface, the unique identification code ID is generated, and the public configuration item information is sequentially entered. Specify the private configuration information address (such as DEV, FAT, UAT, PRO, etc.) of the project on the portal side of the user interface, and sequentially enter each item of information of the private configuration. When the server actively pushes the changed configuration information or the application client actively pulls the changed information, a default memory area needs to be added to the local cache list to save the public configuration information, and at the same time, the application client is reconstructed The logic of loading configuration information on the client side is modified from the original logic of loading configuration information only from the specified location to firstly loading the public configuration information from the default source, and then loading the private configuration information from the specified environment information after completion. For example, in the default and private configuration If the same data item configuration exists in the information, the value of the configuration item in the private configuration information shall prevail.
图3为根据本发明的又一实施例的公有配置的共享方法的流程示意图,如图3所示,在其它实施例中,上述步骤S103进一步包括以下步骤S1031和S1032。FIG. 3 is a schematic flowchart of a method for sharing public configuration according to another embodiment of the present invention. As shown in FIG. 3 , in other embodiments, the above step S103 further includes the following steps S1031 and S1032.
S1031、接收到应用客户端的加载配置信息的请求指令时,获取与所述应用客户端相映射的唯一识别码;S1031, when receiving the request instruction for loading configuration information of the application client, obtain a unique identification code mapped with the application client;
S1032、根据所述唯一识别码与所述配置项目的对应关系,从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值。S1032. Load the parameters of the public configuration and the parameter values of the public configuration parameters from the local cache list according to the corresponding relationship between the unique identification code and the configuration item.
在本实施例中,所述接收到加载应用客户端的配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值的步骤包括:In this embodiment, when the request instruction for loading configuration information of the application client is received, the step of preferentially loading the public configuration parameters and the parameter values of the public configuration parameters from the local cache list includes:
接收到应用客户端的加载配置信息的请求指令时,获取与所述应用客户端相映射的唯一识别码;When receiving the request instruction for loading configuration information of the application client, obtain the unique identification code mapped with the application client;
根据所述唯一识别码与所述配置项目的对应关系,从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值。According to the corresponding relationship between the unique identification code and the configuration item, the parameters of the public configuration and the parameter values of the public configuration parameters are loaded from the local cache list.
其中,上述唯一识别码为用户自定义编译的字符,可以是纯数字、大写字母、小写字母、特殊符号中的至少一种的组合。The above-mentioned unique identification code is a character compiled by the user, which may be a combination of at least one of pure numbers, uppercase letters, lowercase letters, and special symbols.
图4为根据本发明的再一实施例的公有配置的共享方法的流程示意图,如图4所示,在其它实施例中,在上述步骤S101的步骤之前,所述公有配置的共享方法还包括以下步骤S001和S002:FIG. 4 is a schematic flowchart of a method for sharing a public configuration according to still another embodiment of the present invention. As shown in FIG. 4 , in other embodiments, before the step of the above step S101 , the method for sharing a public configuration further includes: The following steps S001 and S002:
S001、根据用户输入的身份验证信息,验证所述用户的身份;S001, according to the identity verification information input by the user, verify the identity of the user;
S002、判断验证的所述身份是否具有公有配置参数的管理权限,若是,则接收所述用户输入的指令,创建公有配置的参数以及所述公有配置参数的参数值。S002. Determine whether the verified identity has the management authority of a public configuration parameter, and if so, receive an instruction input by the user, and create a public configuration parameter and a parameter value of the public configuration parameter.
由于用户可以直接在用户界面上对公有配置参数进行操作,使得公有配置信息与个性化应用配置信息独立区分,页面更简洁、可视化体验更高。Since the user can directly operate the public configuration parameters on the user interface, the public configuration information and the personalized application configuration information can be independently distinguished, and the page is more concise and the visual experience is higher.
在其中一个实施例中,所述公有配置的共享方法还包括以下步骤:In one of the embodiments, the method for sharing the public configuration further includes the following steps:
在从预先指定的环境信息中加载应用客户端的私有配置的参数及所述私有配置参数的参数值时,判断加载的私有配置的参数与在先加载的公有配置的参数是否相同;When loading the parameters of the private configuration of the application client and the parameter values of the private configuration parameters from the pre-specified environment information, determine whether the parameters of the loaded private configuration are the same as the parameters of the previously loaded public configuration;
当加载的私有配置的参数与在先加载的公有配置的参数相同时,判断对应私有配置参数的参数值与在先加载的公有配置参数的参数值是否相同;When the parameters of the loaded private configuration are the same as the parameters of the previously loaded public configuration, determine whether the parameter value of the corresponding private configuration parameter is the same as the parameter value of the previously loaded public configuration parameter;
若对应私有配置参数的参数值与在先加载的公有配置参数的参数值不相同,则以私有配置参数的参数值为准。If the parameter value of the corresponding private configuration parameter is different from the parameter value of the previously loaded public configuration parameter, the parameter value of the private configuration parameter shall prevail.
本实施例将配置信息分为公有配置和私有配置两种,将公有配置的优先级定为优先,在加载配置参数时,优先加载公有配置,再加载私有配置,并定义当公有配置与私有配置有相同发配置参数时,以私有配置参数为准,通过优先从default目录下获取系统层级的公有配置信息,其次再从应用在配置文件中指定的对应集群环境中获取各自的私有配置信息,使得将同一参数既定义为公有参数又定义为私有参数时,在加载对应的参数时不会出现数据紊乱的情况。In this embodiment, the configuration information is divided into two types: public configuration and private configuration, and the priority of public configuration is set as the priority. When loading configuration parameters, the public configuration is loaded first, then the private configuration is loaded, and the public configuration and the private configuration are defined. When there are the same configuration parameters, the private configuration parameters shall prevail. By first obtaining the public configuration information of the system level from the default directory, and then obtaining the respective private configuration information from the corresponding cluster environment specified by the application in the configuration file, so that When the same parameter is defined as both a public parameter and a private parameter, there will be no data disorder when loading the corresponding parameter.
根据本实施例的一个示例,上述步骤S001~S104的标号并不用于限定本实施例中各个步骤的先后顺序,各个步骤的编号只是为了使得描述各个步骤时可以通用引用该步骤的标号进行便捷的指代,例如上述步骤S1011可以在S1012的步骤之前,也可以在步骤S1012的步骤之后,只要各个步骤执行的顺序不影响本实施例的逻辑关系即可。According to an example of this embodiment, the labels of the above steps S001 to S104 are not used to limit the sequence of each step in this embodiment, and the numbers of each step are only for the convenience of referring to the label of the step when describing each step. Refers to, for example, the above-mentioned step S1011 may be before the step of S1012, or may be after the step of the step S1012, as long as the order in which each step is performed does not affect the logical relationship of this embodiment.
图6为根据本发明的一个实施例的公有配置的共享装置的示范性结构框图,根据本发明的另一实施例提供了一种公有配置的共享装置100,如图6所示,所述装置包括:FIG. 6 is a block diagram of an exemplary structure of a sharing apparatus with a common configuration according to an embodiment of the present invention. According to another embodiment of the present invention, a sharing apparatus 100 with a common configuration is provided. As shown in FIG. 6 , the apparatus include:
公有配置创建模块11,用于根据接收的指令,创建公有配置的参数以及所述公有配置参数的参数值;The public
保存模块12,用于将公有配置的参数以及所述参数值单独保存在本地缓存列表中;The saving
第一加载模块13,用于接收到加载应用客户端的配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值;The
第二加载模块14,用于从预先指定的环境信息中加载应用客户端的私有配置的参数及所述私有配置参数的参数值。The
在其中一个实施例中,所述公有配置创建模块11包括:In one of the embodiments, the public
项目创建单元,用于根据接收的指令,创建配置项目,所述配置项目包含有至少一个公有配置的参数及公有配置参数的参数值;a project creation unit, configured to create a configuration project according to the received instruction, the configuration project including at least one public configuration parameter and a parameter value of the public configuration parameter;
识别码创建单元,用于为每个所述配置项目创建唯一识别码;an identification code creation unit for creating a unique identification code for each of the configuration items;
映射关系创建单元,用于创建所述唯一识别码与所述应用客户端的一对一或一对多的映射关系;a mapping relationship creation unit, configured to create a one-to-one or one-to-many mapping relationship between the unique identification code and the application client;
所述保存模块具体用于将所述唯一识别码、所述公有配置的参数、所述公有配置参数的参数值及所述映射关系均保存在所述本地缓存列表中。The saving module is specifically configured to save the unique identification code, the parameters of the public configuration, the parameter values of the public configuration parameters and the mapping relationship in the local cache list.
在其中一个实施例中,所述第一加载模块13包括:In one embodiment, the
识别码识别单元,用于接收到应用客户端的加载配置信息的请求指令时,获取与所述应用客户端相映射的唯一识别码;an identification code identification unit, configured to obtain a unique identification code mapped to the application client when receiving a request instruction for loading configuration information of the application client;
第一加载单元,用于根据所述唯一识别码与所述配置项目的对应关系,从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值。A first loading unit, configured to load the parameters of the public configuration and the parameter values of the public configuration parameters from the local cache list according to the corresponding relationship between the unique identification code and the configuration item.
在其中一个实施例中,所述第一加载模块13具体用于:收到应用客户端发送的加载配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值;或接收到本地发出的加载应用客户端的配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值。In one embodiment, the
在其中一个实施例中,所述公有配置的共享装置100还包括:In one of the embodiments, the sharing apparatus 100 of the public configuration further includes:
身份验证模块,用于根据用户输入的身份验证信息,验证所述用户的身份;an identity verification module for verifying the identity of the user according to the identity verification information input by the user;
判断模块,用于判断验证的所述身份是否具有公有配置参数的管理权限,若是,则接收所述用户输入的指令,创建公有配置的参数以及所述公有配置参数的参数值。The judgment module is used for judging whether the verified identity has the management authority of the public configuration parameter, and if so, receives the instruction input by the user, and creates the public configuration parameter and the parameter value of the public configuration parameter.
其中上述第一加载模块及第一加载模块中的“第一”和“第二”的意义仅在于将两个加载模块加以区分,并不用于限定哪个预选区域的确定模块的优先级更高或者其它的限定意义。The meanings of "first" and "second" in the above-mentioned first loading module and the first loading module are only to distinguish the two loading modules, and are not used to define which pre-selected area has a higher priority or other limited meanings.
其中,该公有配置的共享装置中包括的各个模块可全部或部分通过软件、硬件或其组合来实现。进一步地,该公有配置的共享装置中的各个模块可以是用于实现对应功能的程序段。Wherein, each module included in the shared device of the public configuration may be implemented in whole or in part by software, hardware or a combination thereof. Further, each module in the shared device of the common configuration may be a program segment for implementing corresponding functions.
上述公有配置的共享装置可以实现为一种计算机程序的形式,计算机程序可以在如图7所示的计算机设备上运行。The above-mentioned public configuration sharing apparatus can be implemented in the form of a computer program, and the computer program can be executed on a computer device as shown in FIG. 7 .
根据本发明的另一实施例提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现以下步骤:According to another embodiment of the present invention, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the program:
根据接收的指令,创建公有配置的参数以及所述公有配置参数的参数值;将公有配置的参数以及所述参数值单独保存在本地缓存列表中;接收到加载应用客户端的配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值;从预先指定的环境信息中加载应用客户端的私有配置的参数及所述私有配置参数的参数值。According to the received instructions, create the parameters of the public configuration and the parameter values of the public configuration parameters; save the parameters of the public configuration and the parameter values in the local cache list separately; when receiving the request instruction to load the configuration information of the application client , the parameters of the public configuration and the parameter values of the public configuration parameters are preferentially loaded from the local cache list; the parameters of the private configuration of the application client and the parameter values of the private configuration parameters are loaded from the pre-specified environment information .
在其中一个实施例中,所述处理器执行所述程序时还实现以下步骤:In one of the embodiments, the processor further implements the following steps when executing the program:
根据接收的指令,创建配置项目,所述配置项目包含有至少一个公有配置的参数及公有配置参数的参数值;为每个所述配置项目创建唯一识别码;创建所述唯一识别码与所述应用客户端的一对一或一对多的映射关系;将所述唯一识别码、所述公有配置的参数、所述公有配置参数的参数值及所述映射关系均保存在所述本地缓存列表中。According to the received instruction, create a configuration item, the configuration item includes at least one public configuration parameter and the parameter value of the public configuration parameter; create a unique identification code for each of the configuration items; create the unique identification code and the Apply the one-to-one or one-to-many mapping relationship of the client; save the unique identification code, the parameters of the public configuration, the parameter values of the public configuration parameters, and the mapping relationship in the local cache list .
在其中一个实施例中,所述处理器执行所述程序时还实现以下步骤:In one of the embodiments, the processor further implements the following steps when executing the program:
接收到应用客户端的加载配置信息的请求指令时,获取与所述应用客户端相映射的唯一识别码;根据所述唯一识别码与所述配置项目的对应关系,从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值。When receiving the request instruction for loading configuration information from the application client, obtain the unique identification code mapped to the application client; load from the local cache list according to the corresponding relationship between the unique identification code and the configuration item Parameters of the public configuration and parameter values of the public configuration parameters.
在其中一个实施例中,所述处理器执行所述程序时还实现以下步骤:In one of the embodiments, the processor further implements the following steps when executing the program:
接收到应用客户端发送的加载配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值;或接收到本地发出的加载应用客户端的配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值。When receiving the request instruction for loading configuration information sent by the application client, preferentially load the parameters of the public configuration and the parameter values of the public configuration parameters from the local cache list; When the configuration information request instruction is used, the parameters of the public configuration and the parameter values of the public configuration parameters are preferentially loaded from the local cache list.
在其中一个实施例中,所述处理器执行所述程序时还实现以下步骤:In one of the embodiments, the processor further implements the following steps when executing the program:
根据用户输入的身份验证信息,验证所述用户的身份;判断验证的所述身份是否具有公有配置参数的管理权限,若是,则接收所述用户输入的指令,创建公有配置的参数以及所述公有配置参数的参数值。According to the identity verification information input by the user, verify the identity of the user; determine whether the verified identity has the management authority of the public configuration parameters, if so, receive the instruction input by the user, and create the parameters of the public configuration and the public configuration parameters. The parameter value of the configuration parameter.
在其中一个实施例中,所述处理器执行所述程序时还实现以下步骤:In one of the embodiments, the processor further implements the following steps when executing the program:
在从预先指定的环境信息中加载应用客户端的私有配置的参数及所述私有配置参数的参数值时,判断加载的私有配置的参数与在先加载的公有配置的参数是否相同;当加载的私有配置的参数与在先加载的公有配置的参数相同时,判断对应私有配置参数的参数值与在先加载的公有配置参数的参数值是否相同;若对应私有配置参数的参数值与在先加载的公有配置参数的参数值不相同,则以私有配置参数的参数值为准。When the parameters of the private configuration of the application client and the parameter values of the private configuration parameters are loaded from the pre-specified environment information, it is judged whether the parameters of the loaded private configuration are the same as the parameters of the previously loaded public configuration; When the configured parameters are the same as the previously loaded public configuration parameters, determine whether the parameter values corresponding to the private configuration parameters are the same as the previously loaded public configuration parameters; If the parameter values of the public configuration parameters are different, the parameter values of the private configuration parameters shall prevail.
图7为一个实施例中计算机设备的内部结构示意图,该计算机设备可以为服务器。参照图7,该计算机设备包括通过系统总线连接的处理器、存储器、输入装置、显示屏和网络接口。其中,该存储器包括非易失性存储介质和内存储器,该计算机设备的非易失性存储介质可存储操作系统和计算机可读指令,该计算机可读指令被执行时,可使得处理器执行本发明各实施例的一种公有配置的共享方法,该方法的具体实现过程可参考图1至5各实施例的具体内容,在此不再赘述。该计算机设备的处理器用于提供计算和控制能力,支撑整个计算机设备的运行。该内存储器中可储存有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器执行一种公有配置的共享方法。计算机设备的输入装置用于各个参数的输入,计算机设备的显示屏用于进行显示,计算机设备的网络接口用于进行网络通信。本领域技术人员可以理解,图7中示出的结构,仅仅是与本发明方案相关的部分结构的框图,并不构成对本发明方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。FIG. 7 is a schematic diagram of the internal structure of a computer device in an embodiment, and the computer device may be a server. Referring to Figure 7, the computer device includes a processor, memory, input device, display screen and network interface connected through a system bus. Wherein, the memory includes a non-volatile storage medium and an internal memory, and the non-volatile storage medium of the computer device can store an operating system and computer-readable instructions, and when the computer-readable instructions are executed, can cause the processor to execute the present invention. A method for sharing a common configuration according to the embodiments of the present invention, for the specific implementation process of the method, reference may be made to the specific contents of the embodiments in FIGS. 1 to 5 , which will not be repeated here. The processor of the computer device is used to provide computing and control capabilities and support the operation of the entire computer device. Computer-readable instructions may be stored in the internal memory, and when executed by the processor, the computer-readable instructions may cause the processor to execute a shared method of a common configuration. The input device of the computer equipment is used for inputting various parameters, the display screen of the computer equipment is used for display, and the network interface of the computer equipment is used for network communication. Those skilled in the art can understand that the structure shown in FIG. 7 is only a block diagram of a partial structure related to the solution of the present invention, and does not constitute a limitation on the computer equipment to which the solution of the present invention is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
通过计算机设备的处理器执行所述公有配置的共享方法的程序时,由于该程序通过将配置信息分为公有配置和私有配置两种,将公有配置的优先级定为优先,在加载配置参数时,优先加载公有配置,再加载私有配置,使得配置中心可以高效、快速地应对多项目并发实施场景下公有配置信息集中化管理的需求,可以避免配置中心因为大量冗余信息而愈发笨重且不可扩展,减少运营配置人员人为的出错和遗漏概率,规避因为公有配置信息频繁更改而产生的更频繁的变更推动通知,加配置信息的重用率、减少配置代码冗余,还可以降低系统之间的访问频率,提升整体系统性能。When the program of the method for sharing the public configuration is executed by the processor of the computer device, because the program divides the configuration information into two types, the public configuration and the private configuration, the priority of the public configuration is set as the priority, when loading the configuration parameters , the public configuration is loaded first, and then the private configuration is loaded, so that the configuration center can efficiently and quickly respond to the needs of centralized management of public configuration information in the multi-project concurrent implementation scenario, which can avoid the configuration center becoming more cumbersome and impossible due to a large amount of redundant information. Expansion, reducing the probability of human errors and omissions by operation configuration personnel, avoiding more frequent change push notifications due to frequent changes in public configuration information, increasing the reuse rate of configuration information, reducing configuration code redundancy, and reducing system-to-system interaction. Access frequency to improve overall system performance.
如此处所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。Any reference to a memory, storage, database or other medium as used herein may include non-volatile and/or volatile memory. Suitable nonvolatile 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), which acts as external cache memory. By way of illustration and not limitation, RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), 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).
本实施例另提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现以下步骤:This embodiment further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the following steps are implemented:
根据接收的指令,创建公有配置的参数以及所述公有配置参数的参数值;将公有配置的参数以及所述参数值单独保存在本地缓存列表中;接收到加载应用客户端的配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值;从预先指定的环境信息中加载应用客户端的私有配置的参数及所述私有配置参数的参数值。According to the received instructions, create the parameters of the public configuration and the parameter values of the public configuration parameters; save the parameters of the public configuration and the parameter values in the local cache list separately; when receiving the request instruction to load the configuration information of the application client , the parameters of the public configuration and the parameter values of the public configuration parameters are preferentially loaded from the local cache list; the parameters of the private configuration of the application client and the parameter values of the private configuration parameters are loaded from the pre-specified environment information .
在其中一个实施例中,该程序被处理器执行时还实现以下步骤:In one of the embodiments, when the program is executed by the processor, the following steps are further implemented:
根据接收的指令,创建配置项目,所述配置项目包含有至少一个公有配置的参数及公有配置参数的参数值;为每个所述配置项目创建唯一识别码;创建所述唯一识别码与所述应用客户端的一对一或一对多的映射关系;将所述唯一识别码、所述公有配置的参数、所述公有配置参数的参数值及所述映射关系均保存在所述本地缓存列表中。According to the received instruction, create a configuration item, the configuration item includes at least one public configuration parameter and the parameter value of the public configuration parameter; create a unique identification code for each of the configuration items; create the unique identification code and the Apply the one-to-one or one-to-many mapping relationship of the client; save the unique identification code, the parameters of the public configuration, the parameter values of the public configuration parameters, and the mapping relationship in the local cache list .
在其中一个实施例中,该程序被处理器执行时还实现以下步骤:In one of the embodiments, when the program is executed by the processor, the following steps are further implemented:
接收到应用客户端的加载配置信息的请求指令时,获取与所述应用客户端相映射的唯一识别码;根据所述唯一识别码与所述配置项目的对应关系,从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值。When receiving the request instruction for loading configuration information from the application client, obtain the unique identification code mapped to the application client; load from the local cache list according to the corresponding relationship between the unique identification code and the configuration item Parameters of the public configuration and parameter values of the public configuration parameters.
在其中一个实施例中,该程序被处理器执行时还实现以下步骤:In one of the embodiments, when the program is executed by the processor, the following steps are further implemented:
接收到应用客户端发送的加载配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值;或接收到本地发出的加载应用客户端的配置信息的请求指令时,优先从所述本地缓存列表中加载所述公有配置的参数以及所述公有配置参数的参数值。When receiving the request instruction for loading configuration information sent by the application client, preferentially load the parameters of the public configuration and the parameter values of the public configuration parameters from the local cache list; When the configuration information request instruction is used, the parameters of the public configuration and the parameter values of the public configuration parameters are preferentially loaded from the local cache list.
在其中一个实施例中,该程序被处理器执行时还实现以下步骤:In one of the embodiments, when the program is executed by the processor, the following steps are further implemented:
根据用户输入的身份验证信息,验证所述用户的身份;判断验证的所述身份是否具有公有配置参数的管理权限,若是,则接收所述用户输入的指令,创建公有配置的参数以及所述公有配置参数的参数值。According to the identity verification information input by the user, verify the identity of the user; determine whether the verified identity has the management authority of the public configuration parameters, if so, receive the instruction input by the user, and create the parameters of the public configuration and the public configuration parameters. The parameter value of the configuration parameter.
在其中一个实施例中,该程序被处理器执行时还实现以下步骤:In one of the embodiments, when the program is executed by the processor, the following steps are further implemented:
在从预先指定的环境信息中加载应用客户端的私有配置的参数及所述私有配置参数的参数值时,判断加载的私有配置的参数与在先加载的公有配置的参数是否相同;当加载的私有配置的参数与在先加载的公有配置的参数相同时,判断对应私有配置参数的参数值与在先加载的公有配置参数的参数值是否相同;若对应私有配置参数的参数值与在先加载的公有配置参数的参数值不相同,则以私有配置参数的参数值为准。When the parameters of the private configuration of the application client and the parameter values of the private configuration parameters are loaded from the pre-specified environment information, it is judged whether the parameters of the loaded private configuration are the same as the parameters of the previously loaded public configuration; When the configured parameters are the same as the previously loaded public configuration parameters, determine whether the parameter values corresponding to the private configuration parameters are the same as the previously loaded public configuration parameters; If the parameter values of the public configuration parameters are different, the parameter values of the private configuration parameters shall prevail.
根据本实施例的一个示例,上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述程序可存储于一计算机可读取存储介质中,如本发明实施例中,该程序可存储于计算机系统的存储介质中,并被该计算机系统中的至少一个处理器执行,以实现包括如上述各方法的实施例的流程。该存储介质包括但不限于磁碟、优盘、光盘、只读存储记忆体(Read-Only Memory,ROM)等。According to an example of this embodiment, all or part of the processes in the method of the above embodiment can be completed by instructing relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, as implemented in the present invention In an example, the program may be stored in a storage medium of a computer system, and executed by at least one processor in the computer system, so as to implement the processes including the embodiments of the above-mentioned methods. The storage medium includes, but is not limited to, a magnetic disk, a USB flash drive, an optical disk, a read-only memory (Read-Only Memory, ROM), and the like.
该存储介质上存储的计算机程序被执行时,由于其中的计算机程序通过将配置信息分为公有配置和私有配置两种,将公有配置的优先级定为优先,在加载配置参数时,优先加载公有配置,再加载私有配置,使得配置中心可以高效、快速地应对多项目并发实施场景下公有配置信息集中化管理的需求,可以避免配置中心因为大量冗余信息而愈发笨重且不可扩展,减少运营配置人员人为的出错和遗漏概率,规避因为公有配置信息频繁更改而产生的更频繁的变更推动通知,加配置信息的重用率、减少配置代码冗余,还可以降低系统之间的访问频率,提升整体系统性能。When the computer program stored on the storage medium is executed, because the computer program in the storage medium divides the configuration information into two types: public configuration and private configuration, the priority of the public configuration is set as priority. When loading configuration parameters, the public configuration is loaded first Configure, and then load the private configuration, so that the configuration center can efficiently and quickly respond to the need for centralized management of public configuration information in the multi-project concurrent implementation scenario, which can avoid the configuration center becoming more cumbersome and unscalable due to a large amount of redundant information, reducing operations. The probability of human errors and omissions by configuration personnel, avoiding more frequent change push notifications due to frequent changes in public configuration information, increasing the reuse rate of configuration information, reducing configuration code redundancy, and reducing the frequency of access between systems, improving overall system performance.
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-described embodiments can be combined arbitrarily. For the sake of brevity, all possible combinations of the technical features in the above-described embodiments are not described. However, as long as there is no contradiction between the combinations of these technical features, All should be regarded as the scope described in this specification.
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present invention, and the descriptions thereof are specific and detailed, but should not be construed as a limitation on the scope of the invention patent. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can also be made, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention should be subject to the appended claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910857832.8ACN110716764A (en) | 2019-09-09 | 2019-09-09 | Public configuration sharing method, apparatus, computer equipment and storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910857832.8ACN110716764A (en) | 2019-09-09 | 2019-09-09 | Public configuration sharing method, apparatus, computer equipment and storage medium |
| Publication Number | Publication Date |
|---|---|
| CN110716764Atrue CN110716764A (en) | 2020-01-21 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910857832.8APendingCN110716764A (en) | 2019-09-09 | 2019-09-09 | Public configuration sharing method, apparatus, computer equipment and storage medium |
| Country | Link |
|---|---|
| CN (1) | CN110716764A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112817719A (en)* | 2021-01-28 | 2021-05-18 | 平安普惠企业管理有限公司 | Method, device and equipment for adjusting parameters of thread pool and readable storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20000034433A (en)* | 1998-11-30 | 2000-06-26 | 강병호 | Processor Loading Method in Small AT Switching System |
| WO2010015175A1 (en)* | 2008-08-04 | 2010-02-11 | 腾讯科技(深圳)有限公司 | Method, device and system for creating window of instant messaging system |
| CN103327084A (en)* | 2013-06-08 | 2013-09-25 | 北京古盘创世科技发展有限公司 | Public and private hybrid distributed cloud storage system and cloud storage method |
| CN103530160A (en)* | 2013-10-21 | 2014-01-22 | 迈普通信技术股份有限公司 | Page loading method and device |
| CN105553738A (en)* | 2015-12-25 | 2016-05-04 | 北京奇虎科技有限公司 | Heat loading method and device of configuration information and distributed cluster system |
| CN105868319A (en)* | 2016-03-25 | 2016-08-17 | 广州酷狗计算机科技有限公司 | Web page loading method and device |
| CN107800781A (en)* | 2017-10-12 | 2018-03-13 | 深圳市买买提乐购金融服务有限公司 | A kind of configuration data processing method and device |
| CN109240762A (en)* | 2018-08-07 | 2019-01-18 | 云南电网有限责任公司曲靖供电局 | The loading method and device of resource in a kind of analogue system |
| CN110147258A (en)* | 2019-04-19 | 2019-08-20 | 平安科技(深圳)有限公司 | Improve method, apparatus, computer equipment and the storage medium of program loading efficiency |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20000034433A (en)* | 1998-11-30 | 2000-06-26 | 강병호 | Processor Loading Method in Small AT Switching System |
| WO2010015175A1 (en)* | 2008-08-04 | 2010-02-11 | 腾讯科技(深圳)有限公司 | Method, device and system for creating window of instant messaging system |
| CN103327084A (en)* | 2013-06-08 | 2013-09-25 | 北京古盘创世科技发展有限公司 | Public and private hybrid distributed cloud storage system and cloud storage method |
| CN103530160A (en)* | 2013-10-21 | 2014-01-22 | 迈普通信技术股份有限公司 | Page loading method and device |
| CN105553738A (en)* | 2015-12-25 | 2016-05-04 | 北京奇虎科技有限公司 | Heat loading method and device of configuration information and distributed cluster system |
| CN105868319A (en)* | 2016-03-25 | 2016-08-17 | 广州酷狗计算机科技有限公司 | Web page loading method and device |
| CN107800781A (en)* | 2017-10-12 | 2018-03-13 | 深圳市买买提乐购金融服务有限公司 | A kind of configuration data processing method and device |
| CN109240762A (en)* | 2018-08-07 | 2019-01-18 | 云南电网有限责任公司曲靖供电局 | The loading method and device of resource in a kind of analogue system |
| CN110147258A (en)* | 2019-04-19 | 2019-08-20 | 平安科技(深圳)有限公司 | Improve method, apparatus, computer equipment and the storage medium of program loading efficiency |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112817719A (en)* | 2021-01-28 | 2021-05-18 | 平安普惠企业管理有限公司 | Method, device and equipment for adjusting parameters of thread pool and readable storage medium |
| Publication | Publication Date | Title |
|---|---|---|
| CN109274731B (en) | Method and device for deploying and calling web service based on multi-tenant technology | |
| US11163791B2 (en) | Transformation configuration in instance data replication with bi-directional replication support | |
| US11216563B1 (en) | Security assessment of virtual computing environment using logical volume image | |
| CN108399101B (en) | Method, apparatus and system for resource scheduling | |
| US9514324B1 (en) | Approaches for restricting access to data | |
| US10754954B2 (en) | Securely exchanging information during application startup | |
| US20160344798A1 (en) | Custom communication channels for application deployment | |
| US20140173720A1 (en) | System and method for controlling the on and off state of features at runtime | |
| US10908971B1 (en) | Method and system for generating a customizable connector | |
| US10324701B1 (en) | Rapid deployment of computing instances | |
| CN108021400B (en) | Data processing method and device, computer storage medium and equipment | |
| US11709801B2 (en) | File-based sharing using content distributions network | |
| US11226943B2 (en) | Assigning access control for flat data structure | |
| US20250036436A1 (en) | Systems and methods for execution in dynamic application runtime environments | |
| CN110716764A (en) | Public configuration sharing method, apparatus, computer equipment and storage medium | |
| US20170091233A1 (en) | Efficient auditing of data in object storage | |
| US12073263B1 (en) | Dynamic processing of API requests | |
| CN116614323B (en) | Cloud storage enterprise network management method and system based on Rclone | |
| CN117435661A (en) | Database connection configuration method, device, computer equipment and storage medium | |
| US11757976B2 (en) | Unified application management for heterogeneous application delivery | |
| CN119278448A (en) | Technologies used to provide safety-related information | |
| US20230102816A1 (en) | Automatic updating of application functionality | |
| US10681113B2 (en) | Geographically distributed highly available mailbox | |
| KR102156656B1 (en) | System and method for creating stack of virtual machine | |
| US20250123829A1 (en) | Expedited update framework |
| 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 | ||
| WD01 | Invention patent application deemed withdrawn after publication | Application publication date:20200121 | |
| WD01 | Invention patent application deemed withdrawn after publication |