Movatterモバイル変換


[0]ホーム

URL:


CN116339804A - Method of batch configuration - Google Patents

Method of batch configuration
Download PDF

Info

Publication number
CN116339804A
CN116339804ACN202310055801.7ACN202310055801ACN116339804ACN 116339804 ACN116339804 ACN 116339804ACN 202310055801 ACN202310055801 ACN 202310055801ACN 116339804 ACN116339804 ACN 116339804A
Authority
CN
China
Prior art keywords
data
target system
server
user
redis
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.)
Pending
Application number
CN202310055801.7A
Other languages
Chinese (zh)
Inventor
刘睿智
何龙
庄志勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Rose Tree Technology Co ltd
Original Assignee
Rose Tree Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Rose Tree Technology Co ltdfiledCriticalRose Tree Technology Co ltd
Priority to CN202310055801.7ApriorityCriticalpatent/CN116339804A/en
Publication of CN116339804ApublicationCriticalpatent/CN116339804A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本发明涉及系统配置技术领域,尤其涉及一种批量配置的方法。该批量配置方法包括以下步骤:初始化目标系统;用户通过前端使用在线编辑器进行参数修改,无需用户通过命令行驶输入执行命令,操作简单,降低了对用户的要求。将修改的数据发送给服务端,服务端进行数据处理后发送给Redis模块;Redis模块实现高并发,agent程序通过Redis模块获取目标系统的中间件或配置文件的数据;在目标系统执行相应的命令。本方法不需要事先固定配置文件位置,可以通过自检所有需要修改的文件的路径,前端能够提供所有常用场景模板,只需输入少量必须参数即可,并通过redis提供高并发批量修改,且用户不用一一登陆服务器进行命令行操作,大大缩短了工作时间长,提升了工作效率。

Figure 202310055801

The invention relates to the technical field of system configuration, in particular to a batch configuration method. The batch configuration method includes the following steps: initializing the target system; the user modifies the parameters through the online editor through the front end, without the need for the user to input and execute the command through the command driving, the operation is simple, and the requirements for the user are reduced. Send the modified data to the server, and the server processes the data and sends it to the Redis module; the Redis module achieves high concurrency, and the agent program obtains the data of the middleware or configuration file of the target system through the Redis module; executes the corresponding command on the target system . This method does not need to fix the location of the configuration file in advance. It can self-check the path of all files that need to be modified. The front-end can provide all common scene templates. It only needs to input a small number of necessary parameters, and provides high-concurrency batch modification through redis, and the user There is no need to log in to the server one by one to perform command line operations, which greatly shortens the working hours and improves work efficiency.

Figure 202310055801

Description

Translated fromChinese
批量配置的方法Method of batch configuration

技术领域technical field

本发明涉及服务器管理技术领域,尤其涉及一种批量配置的方法。The invention relates to the technical field of server management, in particular to a batch configuration method.

背景技术Background technique

随着信息网络的发展,随着机房规模越来越大,批量配置文件的难度日益增加。With the development of the information network, as the scale of the computer room becomes larger and larger, it becomes more and more difficult to configure files in batches.

目前,需要批量配置文件有两种方法。一种方法是同一种配置文件进行修改后发送到各个目标系统上,在这一过程中必须统一配置文件存放路径;最后再在一台台的目标系统上重新加载配置文件。另一种方法是最传统的,通过登陆一台台计算机使用linux系统命令(如vim命令)逐一修改完再重新加载。目标系统越多时,这两种方法配置文件的工作量越大,耗时越长。Currently, there are two methods that require bulk configuration files. One method is to modify the same configuration file and send it to each target system. During this process, the storage path of the configuration file must be unified; finally, reload the configuration file on each target system. Another method is the most traditional, by logging into each computer and using linux system commands (such as vim commands) to modify one by one and then reload. When there are more target systems, the workload of these two methods to configure files is greater and the time-consuming is longer.

为解决上述问题,亟待提供一种批量配置的方法,解决以上问题。In order to solve the above problems, it is urgent to provide a batch configuration method to solve the above problems.

发明内容Contents of the invention

本发明的目的是提出一种批量配置的方法,以达到用户只需通过在线编辑器编辑进行参数修改,无需用户自行输入命令,操作简单,效率高,降低了对用户的要求效果,且本方法不需要事先固定配置文件位置,可以自检所有需要修改的文件的路径,提供所有中间件常用场景模板,只需输入少量必须参数即可,并支持批量多种不同种类配置文件修改。The purpose of the present invention is to propose a method for batch configuration, so that users only need to modify parameters through online editor editing, without the need for users to input commands, simple operation, high efficiency, and reduced requirements for users. It does not need to fix the location of the configuration file in advance, it can self-check the path of all files that need to be modified, provide all common scene templates for middleware, only need to enter a few necessary parameters, and support batch modification of various types of configuration files.

为达此目的,本发明采用以下技术方案:For reaching this purpose, the present invention adopts following technical scheme:

一种批量配置方法,包括以下步骤:A batch configuration method, comprising the following steps:

S1,初始化目标系统;S1, initialize the target system;

S2,接收用户输入的参数,通过前端使用在线编辑器进行参数修改;S2, receiving the parameters input by the user, and modifying the parameters through the online editor through the front end;

S3,将修改的数据发送给服务端,服务端进行数据处理后发送给Redis模块;S3, send the modified data to the server, and the server processes the data and sends it to the Redis module;

S4,所述Redis模块实现高并发,agent程序通过所述Redis模块获取所述目标系统的中间件或配置文件的数据;以及S4, the Redis module realizes high concurrency, and the agent program obtains the middleware or configuration file data of the target system through the Redis module; and

S5,在所述目标系统执行相应的命令。S5. Execute a corresponding command on the target system.

作为一种可选方案,步骤S1包括:As an optional solution, step S1 includes:

S11,所述agent程序扫描所述目标系统的相关信息并进行算法加密;以及S11, the agent program scans the relevant information of the target system and performs algorithm encryption; and

S12,所述agent程序把所述相关信息以及所述目标系统时间加入探针内存地址实时监听。S12, the agent program adds the relevant information and the target system time to the memory address of the probe for real-time monitoring.

作为一种可选方案,步骤S12后还包括:As an optional solution, after step S12, it also includes:

S13,所述agent程序把扫描后的数据上传到所述Redis模块;以及S13, the agent program uploads the scanned data to the Redis module; and

S14,所述服务端从所述Redis模块中获取到所述数据后,进行所述数据处理,并通过websocket技术推送给所述前端。S14. After the server obtains the data from the Redis module, it processes the data and pushes it to the front end through websocket technology.

作为一种可选方案,所述目标系统的相关信息为所述目标系统的中间件或所述目标系统的配置文件。As an optional solution, the relevant information of the target system is middleware of the target system or configuration files of the target system.

作为一种可选方案,所述数据处理为持久化操作或洗练操作。As an optional solution, the data processing is a persistence operation or a cleansing operation.

作为一种可选方案,步骤S2包括:As an optional solution, step S2 includes:

S21,所述用户通过所述前端选择需要修改的所述目标系统的IP,并选择修改的所述配置文件类型;S21, the user selects the IP of the target system to be modified through the front end, and selects the configuration file type to be modified;

S22,所述前端根据所述用户的选择发送请求给所述服务端,所述服务端根据请求数据,将对应的所述配置文件场景数据返回给所述前端;以及S22. The front end sends a request to the server according to the user's selection, and the server returns the corresponding configuration file scene data to the front end according to the request data; and

S23,所述用户修改参数。S23, the user modifies the parameters.

作为一种可选方案,步骤S23中,所述用户修改所述参数的方法包括选用所述服务端提供的场景或使用所述前端提供的在线编辑器。As an optional solution, in step S23, the method for the user to modify the parameter includes selecting a scene provided by the server or using an online editor provided by the front end.

作为一种可选方案,步骤S22中,将对应的所述配置文件场景数据返回给所述前端通过模板引擎技术实现。As an optional solution, in step S22, returning the corresponding scene data of the configuration file to the front end is realized by template engine technology.

作为一种可选方案,步骤S3中所述服务端进行数据处理后发送给Redis模块的方法为:As an optional solution, the method for sending the data to the Redis module after the server performs data processing in step S3 is:

通过hash形式,将相应的配置文件路径和配置文件字符串存入所述Redis模块。Store the corresponding configuration file path and configuration file string in the Redis module in the form of hash.

作为一种可选方案,步骤S4包括:As an optional solution, step S4 includes:

S41,定义探针程序再所述Redis模块中存储Key值,对应的Value值写入对应的任务命令;S41, define the probe program and store the Key value in the Redis module, and write the corresponding Value value into the corresponding task command;

S42,所述服务端上的上的所述探针程序根据预设时间不断的从所述Redis模块中获取相应的所述Key值下的数据。S42. The probe program on the server continuously obtains the corresponding data under the Key value from the Redis module according to a preset time.

本发明的有益效果为:The beneficial effects of the present invention are:

本发明提供一种批量配置方法,该批量配置方法包括以下步骤:S1,初始化目标系统;S2,用户通过前端使用在线编辑器进行参数修改;S3,将修改的数据发送给服务端,服务端进行数据处理后发送给Redis模块;S4,Redis模块实现高并发,agent程序通过Redis模块获取目标系统的中间件或配置文件的数据;以及S5,在目标系统执行相应的命令。该方法中用户可以通过在线编辑器进行参数修改,无需用户通过命令行驶输入执行命令,操作简单,效率高,降低了对用户的要求。同时,本方法不需要事先固定配置文件位置,可以通过Redis模块和agent程序自检所有需要修改的文件的路径,前端能够提供所有常用场景模板,只需输入少量必须参数即可,有利于提高批量配置的效率。本方法通过redis提供高并发批量修改,使用户不用通过传统的方式一一登陆服务器进行命令行操作,大大缩短了工作时间长,提升了工作效率。The present invention provides a batch configuration method, the batch configuration method includes the following steps: S1, initialize the target system; S2, the user modifies the parameters through the front end using an online editor; S3, sends the modified data to the server, and the server performs The data is processed and sent to the Redis module; S4, the Redis module achieves high concurrency, and the agent program obtains the data of the middleware or configuration file of the target system through the Redis module; and S5, executes the corresponding command on the target system. In this method, the user can modify the parameters through the online editor, without the need for the user to input and execute the command through command driving, the operation is simple, the efficiency is high, and the requirements for the user are reduced. At the same time, this method does not need to fix the location of the configuration file in advance. The path of all files that need to be modified can be self-checked through the Redis module and the agent program. The front-end can provide all common scene templates, and only need to input a few necessary parameters, which is conducive to improving the batch configuration efficiency. This method provides high-concurrency batch modification through redis, so that users do not need to log in to the server one by one to perform command line operations through traditional methods, which greatly shortens the working time and improves work efficiency.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对本发明实施例描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据本发明实施例的内容和这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments of the present invention. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention , for those skilled in the art, other drawings can also be obtained according to the content of the embodiment of the present invention and these drawings without any creative effort.

图1是本发明实施例提供的批量配置的方法的逻辑图一;FIG. 1 is a logic diagram 1 of a batch configuration method provided by an embodiment of the present invention;

图2是本发明实施例提供的批量配置的方法的逻辑图二。FIG. 2 is the second logic diagram of the batch configuration method provided by the embodiment of the present invention.

具体实施方式Detailed ways

下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分结构而非全结构。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, but not to limit the present invention. It should also be noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings rather than the whole structure.

在本发明的描述中,除非另有明确的规定和限定,术语“相连”、“连接”、“固定”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或成一体;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内结构的连通或两个元件的相互作用关系。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。In the description of the present invention, unless otherwise clearly specified and limited, the terms "connected", "connected" and "fixed" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integrated ; It can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediary, and it can be the communication of the internal structure of two components or the interaction relationship between two components. Those of ordinary skill in the art can understand the specific meanings of the above terms in the present invention in specific situations.

在本发明中,除非另有明确的规定和限定,第一特征在第二特征之“上”或之“下”可以包括第一和第二特征直接接触,也可以包括第一和第二特征不是直接接触而是通过它们之间的另外的特征接触。而且,第一特征在第二特征“之上”、“上方”和“上面”包括第一特征在第二特征正上方和斜上方,或仅仅表示第一特征水平高度高于第二特征。第一特征在第二特征“之下”、“下方”和“下面”包括第一特征在第二特征正下方和斜下方,或仅仅表示第一特征水平高度小于第二特征。In the present invention, unless otherwise clearly specified and limited, a first feature being "on" or "under" a second feature may include direct contact between the first and second features, and may also include the first and second features Not in direct contact but through another characteristic contact between them. Moreover, "above", "above" and "above" the first feature on the second feature include that the first feature is directly above and obliquely above the second feature, or simply means that the first feature is horizontally higher than the second feature. "Below", "beneath" and "under" the first feature to the second feature include that the first feature is directly below and obliquely below the second feature, or simply means that the first feature has a lower level than the second feature.

在本实施例的描述中,术语“上”、“下”、“左”、“右”等方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述和简化操作,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。此外,术语“第一”、“第二”仅仅用于在描述上加以区分,并没有特殊的含义。In the description of this embodiment, the terms "up", "down", "left", "right" and other orientations or positional relationships are based on the orientations or positional relationships shown in the drawings, and are only for the convenience of description and simplification of operations. It is not intended to indicate or imply that the referred device or element must have a particular orientation, be constructed in a particular orientation, and operate in a particular orientation, and thus should not be construed as limiting the invention. In addition, the terms "first" and "second" are only used to distinguish in description, and have no special meaning.

本实施例提供一种批量配置方法,该批量配置方法包括以下步骤:This embodiment provides a batch configuration method, which includes the following steps:

S1,初始化目标系统;S1, initialize the target system;

S2,接收用户输入的参数,通过前端使用在线编辑器进行参数修改;S2, receiving the parameters input by the user, and modifying the parameters through the online editor through the front end;

S3,将修改的数据发送给服务端,服务端进行数据处理后发送给Redis模块;S3, send the modified data to the server, and the server processes the data and sends it to the Redis module;

S4,Redis模块实现高并发,agent程序通过Redis模块获取目标系统的中间件或配置文件的数据;以及S4, the Redis module achieves high concurrency, and the agent program obtains the data of the middleware or configuration file of the target system through the Redis module; and

S5,在目标系统执行相应的命令。S5. Execute a corresponding command on the target system.

该方法中用户可以通过在线编辑器进行参数修改,无需用户通过命令行驶输入执行命令,操作简单,效率高,降低了对用户的要求。同时,本方法不需要事先固定配置文件位置,可以通过Redis模块和agent程序自检所有需要修改的文件的路径,前端能够提供所有常用场景模板,只需输入少量必须参数即可,有利于提高批量配置的效率。本方法通过redis提供高并发批量修改,使用户不用通过传统的方式一一登陆服务器进行命令行操作,大大缩短了工作时间长,提升了工作效率。In this method, the user can modify the parameters through the online editor, without the need for the user to input and execute the command through command driving, the operation is simple, the efficiency is high, and the requirements for the user are reduced. At the same time, this method does not need to fix the location of the configuration file in advance. The path of all files that need to be modified can be self-checked through the Redis module and the agent program. The front-end can provide all common scene templates, and only need to input a few necessary parameters, which is conducive to improving the batch configuration efficiency. This method provides high-concurrency batch modification through redis, so that users do not need to log in to the server one by one to perform command line operations through traditional methods, which greatly shortens the working time and improves work efficiency.

作为一种可选方案,步骤S1包括S11,agent程序扫描目标系统的相关信息并进行算法加密;以及S12,agent程序把相关信息以及目标系统时间加入探针内存地址实时监听。通过算法加密,有利于防止窜改,提高该批量配置方法的稳定性和安全性。与此同时,该方法还具有配置文件感知功能的作用,解决了用户再去服务中找到配置文件后再加入配置管理的问题。As an optional solution, step S1 includes S11, the agent program scans the relevant information of the target system and performs algorithm encryption; and S12, the agent program adds the relevant information and the time of the target system to the memory address of the probe for real-time monitoring. The algorithm encryption is beneficial to prevent tampering and improve the stability and security of the batch configuration method. At the same time, the method also has the function of configuration file awareness, which solves the problem that the user finds the configuration file in the service and then joins the configuration management.

具体而言,本实施例的算法加密使用了MD5算法,MD5以512位分组来处理输入的信息,且每一分组又被划分为16个32位子分组,经过了一系列的处理后,算法的输出由四个32位分组组成,将这四个32位分组级联后将生成一个128位散列值,就是说任意长度的二进制数据经过MD5算法加密算法的计算,将会得到一个128位的二进制数一般转为32位16进制数来表示。且原文不相同算出的MD5一定不相同,原文相同算出MD5一定相同。因此,把agent扫描到的文件数据进行MD5加密可以防止有人私自登录计算机进行修改,提高安全性。Specifically, the algorithm encryption of this embodiment uses the MD5 algorithm. MD5 processes the input information with 512-bit packets, and each packet is divided into 16 32-bit sub-packets. After a series of processing, the algorithm's The output consists of four 32-bit packets. After concatenating these four 32-bit packets, a 128-bit hash value will be generated. That is to say, the binary data of any length will be calculated by the MD5 algorithm encryption algorithm, and a 128-bit hash value will be obtained. Binary numbers are generally converted to 32-bit hexadecimal numbers to represent. And if the original text is different, the calculated MD5 must be different, and if the original text is the same, the calculated MD5 must be the same. Therefore, performing MD5 encryption on the file data scanned by the agent can prevent someone from logging into the computer without permission to modify it, and improve security.

此外,步骤S12后还包括:S13,agent程序把扫描后的数据上传到Redis模块;以及S14,服务端从Redis模块中获取到数据后,进行数据处理,并通过websocket技术推送给前端。通过上述步骤,使目标系统端agent程序与前端相配合,利用websocket技术支持持久连接,服务端主程序使用websocket可以实时的推送消息给web端,web端接收消息后展示。In addition, after step S12, it also includes: S13, the agent program uploads the scanned data to the Redis module; and S14, after the server obtains the data from the Redis module, it processes the data and pushes it to the front end through websocket technology. Through the above steps, the agent program on the target system side is matched with the front end, and the websocket technology is used to support persistent connections. The main program of the server side uses websocket to push messages to the web side in real time, and the web side displays the messages after receiving them.

具体而言,目标系统的相关信息为目标系统的中间件或目标系统的配置文件,从而使用户选择修改配置文件类型时是从已支持的中间件(组件)中选择。Specifically, the relevant information of the target system is the middleware of the target system or the configuration file of the target system, so that when the user chooses to modify the configuration file type, he or she can choose from the supported middleware (components).

可选地,数据处理为持久化操作或洗练操作,从而通过记忆留存实现回溯,当用户操作失误后可以回退,有利于进一步提高该批量配置方法的安全性。示例性地,当用户出现操作失误后,可以选择之前的内容进行覆盖。与此同时,持久化操作还能够用户进行违规操作监控,避免私自登陆服务器修改配置文件不留痕迹的问题。Optionally, the data processing is a persistent operation or a cleaning operation, so as to realize the retrospective through memory retention, and it can be rolled back when the user makes a wrong operation, which is conducive to further improving the security of the batch configuration method. Exemplarily, when the user makes an operation error, the previous content may be selected for overwriting. At the same time, persistent operations can also allow users to monitor illegal operations, avoiding the problem of logging in to the server to modify configuration files without leaving traces.

可选地,步骤S2包括:Optionally, step S2 includes:

S21,用户通过前端选择需要修改的目标系统的IP,并选择修改的配置文件类型;S21, the user selects the IP of the target system to be modified through the front end, and selects the configuration file type to be modified;

S22,前端根据用户的选择发送请求给服务端,服务端根据请求数据,将对应的配置文件场景数据返回给前端;以及S22, the front end sends a request to the server according to the user's selection, and the server returns the corresponding configuration file scene data to the front end according to the request data; and

S23,用户修改参数。S23, the user modifies the parameters.

该步骤能够使目标系统的相关信息为目标系统的中间件或目标系统的配置文件,从而使用户选择修改配置文件类型时是从已支持的中间件(组件)中选择。在agent程序初始化扫描时是扫描操作系统配置文件和支持中间件(组件)配置文件。agent程序读取配置文件时配置文件的格式JSON XML YAML TOML等都可以完成的读取文件数据发送给主程序持久化,有利于扩大该方法的适用范围。This step can make the relevant information of the target system be the middleware of the target system or the configuration file of the target system, so that when the user chooses to modify the configuration file type, he can choose from the supported middleware (components). When the agent program initializes scanning, it scans operating system configuration files and supporting middleware (component) configuration files. When the agent program reads the configuration file, the format of the configuration file, JSON, XML, YAML, TOML, etc., can complete the read file data and send it to the main program for persistence, which is conducive to expanding the scope of application of this method.

用户修改参数的方法包括选用服务端提供的场景或使用前端提供的在线编辑器,这两个修改参数的方法界面简单,易于操作,有利于降低对用户的要求。The method for users to modify parameters includes selecting the scene provided by the server or using the online editor provided by the front end. These two methods for modifying parameters have a simple interface and are easy to operate, which is conducive to reducing the requirements for users.

工作时,数据处理的任务下发到虚拟模块服务状态机上,用户根据配置文件类型参数的不同查找场景模板供以便于选择。如果用户选择使用场景模板,则根据场景模板的参数在在线编辑器上显示,参数工厂是根据不同的配置文件不同场景生成需要的参数提。如果用户不使用场景模板,那么在线编辑器则会显示该服务的配置文件中的全部参数。通讯工厂会根据用户选择的通讯方式(免探针/探针)将信息直接发送给目标系统(免探针)或是把数据发送到redis上由各目标系统上的agent获取后执行(探针)。When working, the task of data processing is sent to the virtual module service state machine, and the user searches for the scene template for selection according to the different parameters of the configuration file type. If the user chooses to use the scene template, the parameters of the scene template will be displayed on the online editor, and the parameter factory will generate the required parameters according to different configuration files and different scenarios. If the user does not use a scene template, the online editor will display all the parameters in the configuration file of the service. The communication factory will send the information directly to the target system (probe-free) or send the data to redis according to the communication method selected by the user (probe-free/probe-free) or send the data to redis to be executed by the agent on each target system (probe-free) ).

步骤S22中,将对应的配置文件场景数据返回给前端通过模板引擎技术实现,通过模板引擎技术提供大量场景供选择,大大降低了配置的复杂和难易度。In step S22, the corresponding configuration file scene data is returned to the front end through the template engine technology, and a large number of scenes are provided for selection through the template engine technology, which greatly reduces the complexity and difficulty of configuration.

进一步地,步骤S3中服务端进行数据处理后发送给Redis模块的方法为:Further, in step S3, the method for the server to process the data and send it to the Redis module is:

由于Redis模块是一个开源的Key-Value数据库,hash数据类型同样是Key-Value的方式来组织的。因此,本实施例中通过hash形式,将相应的配置文件路径和配置文件字符串直接存入Redis模块,有利于提高效率。Since the Redis module is an open source Key-Value database, the hash data type is also organized in the form of Key-Value. Therefore, in this embodiment, the corresponding configuration file path and configuration file string are directly stored in the Redis module in the form of hash, which is beneficial to improve efficiency.

作为一种可选方案,步骤S4包括:As an optional solution, step S4 includes:

S41,定义探针程序再Redis模块中存储Key值,对应的Value值写入对应的任务命令;S41, define the probe program and store the Key value in the Redis module, and write the corresponding Value value into the corresponding task command;

S42,服务端上的上的探针程序根据预设时间不断的从Redis模块中获取相应的Key值下的数据。S42, the probe program on the server continuously obtains the data under the corresponding Key value from the Redis module according to the preset time.

该方法通过Redis模块可以实现大量服务器上的探针程序并行处理下发的命令任务,使在实际场景中的组件和系统为了保证高可用性都会安装部署在多台服务器中,这就使得本方法需要对接的服务器过多,使用Redis模块可以解决短时间内需要和过多的服务器进行通讯,避免出现大量访问导致本程序的瘫痪的问题。Through the Redis module, this method can realize the parallel processing of the command tasks issued by the probe program on a large number of servers, so that the components and systems in the actual scene will be installed and deployed on multiple servers in order to ensure high availability, which makes this method need There are too many connected servers, using the Redis module can solve the need to communicate with too many servers in a short period of time, and avoid the problem of paralysis of the program caused by a large number of visits.

工作时,通过Redis模块和agent程序之间Key值和Value值的信息交互,实现自动感知数据,即通过agent扫描到配置文件的地址后把地址信息存入指定的内存中,并同时把地址信息通过key-value形式发送给redis存储,主程序从redis中获取该地址信息后发生给web端进行展示完成自动感知功能。When working, through the information interaction between the Key value and Value value between the Redis module and the agent program, the automatic perception of data is realized, that is, the address information of the configuration file is scanned through the agent and stored in the specified memory, and the address information is also stored in the specified memory. It is sent to redis storage in the form of key-value, and the main program obtains the address information from redis and sends it to the web terminal for display to complete the automatic sensing function.

本方法中,通过Redis模块消息发布订阅模式发布远程操作指令,发布频道为agent程序的IP地址。In this method, the remote operation command is issued through the Redis module message publishing and subscription mode, and the publishing channel is the IP address of the agent program.

注意,以上显示和描述了本发明的基本原理和主要特征和本发明的优点。本行业的技术人员应该了解,本发明不受上述实施方式的限制,上述实施方式和说明书中描述的只是说明本发明的原理,在不脱离本发明精神和范围的前提下,本发明还会有各种变化和改进,这些变化和改进都落入要求保护的本发明范围内,本发明的要求保护范围由所附的权利要求书及其等效物界定。Note that the basic principles and main features of the present invention and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited by the above-mentioned embodiments, and what is described in the above-mentioned embodiments and the specification only illustrates the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention will also have Various changes and improvements fall within the scope of the claimed invention, which is defined by the appended claims and their equivalents.

Claims (10)

Translated fromChinese
1.一种批量配置方法,其特征在于,包括以下步骤:1. A method for batch configuration, characterized in that, comprising the following steps:S1,初始化目标系统;S1, initialize the target system;S2,接收用户输入的参数,通过前端使用在线编辑器进行参数修改;S2, receiving the parameters input by the user, and modifying the parameters through the online editor through the front end;S3,将修改的数据发送给服务端,服务端进行数据处理后发送给Redis模块;S3, send the modified data to the server, and the server processes the data and sends it to the Redis module;S4,所述Redis模块实现高并发,agent程序通过所述Redis模块获取所述目标系统的中间件或配置文件的数据;以及S4, the Redis module realizes high concurrency, and the agent program obtains the middleware or configuration file data of the target system through the Redis module; andS5,在所述目标系统执行相应的命令。S5. Execute a corresponding command on the target system.2.根据权利要求1所述的批量配置方法,其特征在于,步骤S1包括:2. The batch configuration method according to claim 1, wherein step S1 comprises:S11,所述agent程序扫描所述目标系统的相关信息并进行算法加密;以及S11, the agent program scans the relevant information of the target system and performs algorithm encryption; andS12,所述agent程序把所述相关信息以及所述目标系统时间加入探针内存地址实时监听。S12, the agent program adds the relevant information and the target system time to the memory address of the probe for real-time monitoring.3.根据权利要求2所述的批量配置方法,其特征在于,步骤S12后还包括:3. The batch configuration method according to claim 2, characterized in that, after step S12, it also includes:S13,所述agent程序把扫描后的数据上传到所述Redis模块;以及S13, the agent program uploads the scanned data to the Redis module; andS14,所述服务端从所述Redis模块中获取到所述数据后,进行所述数据处理,并通过websocket技术推送给所述前端。S14. After the server obtains the data from the Redis module, it processes the data and pushes it to the front end through websocket technology.4.根据权利要求2所述的批量配置方法,其特征在于,所述目标系统的相关信息为所述目标系统的中间件或所述目标系统的配置文件。4. The batch configuration method according to claim 2, wherein the relevant information of the target system is middleware of the target system or a configuration file of the target system.5.根据权利要求1所述的批量配置方法,其特征在于,所述数据处理为持久化操作或洗练操作。5. The batch configuration method according to claim 1, wherein the data processing is a persistence operation or a cleaning operation.6.根据权利要求1~5任一项所述的批量配置方法,其特征在于,步骤S2包括:6. The batch configuration method according to any one of claims 1-5, characterized in that step S2 includes:S21,所述用户通过所述前端选择需要修改的所述目标系统的IP,并选择修改的所述配置文件类型;S21, the user selects the IP of the target system to be modified through the front end, and selects the configuration file type to be modified;S22,所述前端根据所述用户的选择发送请求给所述服务端,所述服务端根据请求数据,将对应的所述配置文件场景数据返回给所述前端;以及S22. The front end sends a request to the server according to the user's selection, and the server returns the corresponding configuration file scene data to the front end according to the request data; andS23,所述用户修改参数。S23, the user modifies the parameters.7.根据权利要求6所述的批量配置方法,其特征在于,步骤S23中,所述用户修改所述参数的方法包括选用所述服务端提供的场景或使用所述前端提供的在线编辑器。7. The batch configuration method according to claim 6, characterized in that, in step S23, the method for the user to modify the parameters includes selecting a scene provided by the server or using an online editor provided by the front end.8.根据权利要求6所述的批量配置方法,其特征在于,步骤S22中,将对应的所述配置文件场景数据返回给所述前端通过模板引擎技术实现。8. The batch configuration method according to claim 6, characterized in that, in step S22, returning the corresponding configuration file scene data to the front end is realized by template engine technology.9.根据权利要求1~5任一项所述的批量配置方法,其特征在于,步骤S3中所述服务端进行数据处理后发送给Redis模块的方法为:9. The batch configuration method according to any one of claims 1 to 5, characterized in that, the method of sending the data to the Redis module after the server performs data processing in step S3 is:通过hash形式,将相应的配置文件路径和配置文件字符串存入所述Redis模块。Store the corresponding configuration file path and configuration file string in the Redis module in the form of hash.10.根据权利要求1~5任一项所述的批量配置方法,其特征在于,步骤S4包括:10. The batch configuration method according to any one of claims 1-5, characterized in that step S4 includes:S41,定义探针程序再所述Redis模块中存储Key值,对应的Value值写入对应的任务命令;S41, define the probe program and store the Key value in the Redis module, and write the corresponding Value value into the corresponding task command;S42,所述服务端上的上的所述探针程序根据预设时间不断的从所述Redis模块中获取相应的所述Key值下的数据。S42. The probe program on the server continuously obtains the corresponding data under the Key value from the Redis module according to a preset time.
CN202310055801.7A2023-01-192023-01-19 Method of batch configurationPendingCN116339804A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202310055801.7ACN116339804A (en)2023-01-192023-01-19 Method of batch configuration

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202310055801.7ACN116339804A (en)2023-01-192023-01-19 Method of batch configuration

Publications (1)

Publication NumberPublication Date
CN116339804Atrue CN116339804A (en)2023-06-27

Family

ID=86886582

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202310055801.7APendingCN116339804A (en)2023-01-192023-01-19 Method of batch configuration

Country Status (1)

CountryLink
CN (1)CN116339804A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112685074A (en)*2020-12-282021-04-20紫光云技术有限公司Method for visually modifying redis configuration based on rules
CN114064100A (en)*2021-11-052022-02-18上海浦东发展银行股份有限公司Configuration information processing method, system and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112685074A (en)*2020-12-282021-04-20紫光云技术有限公司Method for visually modifying redis configuration based on rules
CN114064100A (en)*2021-11-052022-02-18上海浦东发展银行股份有限公司Configuration information processing method, system and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
百度开发者中心: "百度开源Server-Agent:一种高性能、高效率的任务调度执行引擎", pages 1 - 3, Retrieved from the Internet <URL:https://zhuanlan.zhihu.com/p/347937836>*

Similar Documents

PublicationPublication DateTitle
US11651571B1 (en)Mesh updates via mesh splitting
CN102497427B (en)Method and device for realizing data acquisition services of renewable energy source monitoring system
CN111190755A (en)Application program function exception handling method and device
CN115118587B (en) A method and device for creating a connector
CN106888264B (en) A data exchange method and device
CN119030891A (en) Test result storage method, device, equipment and computer readable storage medium
CN114185804A (en)Interface testing method and device and terminal equipment
CN116339804A (en) Method of batch configuration
CN111857985A (en) Browser plug-in calling method, device, storage medium and terminal
CN115145794A (en) A method, system, device and medium for testing server energy consumption
CN107301114A (en)A kind of sea of clouds OS monitoring resources and its information adding method and device
CN115967797B (en)Product testing method and device, electronic equipment and storage medium
CN114489866B (en)Data management method and device
CN115033410B (en) Abnormal link tracking method, system, gateway and storage medium
CN111639062B (en)Method, system and storage medium for one-key construction of data warehouse
CN110858171A (en) A system, method, apparatus, terminal device and medium for application testing
CN116737807A (en) A data import method, device, equipment and storage medium
CN118820108A (en) Performance testing method, device, computer equipment and storage medium
CN109725587B (en)Operation record recording method based on human-computer interface
CN118199781A (en)Time synchronization method, apparatus, computer device, storage medium, and program product
TW202304182A (en)Method for accessing remote computer, electronic device, and storage medium
CN114465922A (en)Visual monitoring method, system and device for user access baseline
CN119906619A (en) Automatic message notification system, method, device, equipment, medium and product
CN116627809A (en)Interface test case generation method, device and equipment
CN118921277A (en)Method and device for visual concurrent execution of server custom tasks

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp