Method, device and electronic device for batch comparison of server configuration files

By automating the batch comparison of server configuration files through the central control server, and using the difflib.HtmlDiff function for comparison and conversion into HTML format, the problem of time-consuming and labor-intensive manual intervention in existing technologies is solved, and efficient batch comparison and visual result feedback are achieved.

CN112579554BActive Publication Date: 2024-11-01BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN201910936637.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-29
Publication Date
2024-11-01
Estimated Expiration
2039-09-29

AI Technical Summary

Technical Problem

Existing technologies require manual intervention when comparing large numbers of server configuration files, which is time-consuming and labor-intensive, and cannot meet the needs of efficient batch comparison.

Method used

The central control server obtains the address information of the server standard configuration file and the target configuration file sent by the web client, generates the target configuration file to obtain the request and compares them. It uses the difflib.HtmlDiff function of the Python library to perform the comparison, and converts the result into HTML format for storage and feedback.

Benefits of technology

It enables automated batch comparison of server configuration files, improving processing efficiency, saving manpower, and providing visualized results for easy understanding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112579554B_ABST
    Figure CN112579554B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, device and electronic device for batch comparison of server configuration files. The method comprises: obtaining a server standard configuration file sent by a Web client; obtaining address information of multiple target configuration files sent by the Web client; generating a corresponding target configuration file acquisition request according to each address information, and sending the request to the corresponding target server respectively; obtaining multiple target configuration files returned by multiple target servers according to the target configuration file acquisition request; and comparing the server standard configuration file with the multiple target configuration files respectively to obtain corresponding comparison results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and more specifically, to a batch comparison method of server configuration files, a batch comparison device of server configuration files, an electronic device, a batch comparison system of server configuration files, and a machine-readable storage medium. Background Art

[0002] In a distributed system, it is necessary to analyze the configuration information of a large number of servers, which involves batch comparison of configuration files of a large number of servers.

[0003] If you use existing file comparison tools, you need to download the configuration files on the server to the local computer and then compare and analyze them one by one. This method requires manual participation, is time-consuming and labor-intensive, and cannot meet the needs of large-scale file comparison. Summary of the invention

[0004] An object of the present invention is to provide a new technical solution for batch comparison of server configuration files.

[0005] According to a first aspect of the present invention, a method for batch comparison of server configuration files is provided, which is applied to a central control server and includes:

[0006] Get the server standard configuration file sent by the Web client;

[0007] Acquire address information of multiple target configuration files sent by the Web client; wherein each of the target configuration files is stored in a corresponding target server, and each of the address information includes: an IP address and a file storage path of the target server where the target configuration file is located;

[0008] Generate a corresponding target configuration file acquisition request according to each address information, and send it to the corresponding target server respectively;

[0009] Acquire multiple target configuration files returned by the multiple target servers according to the target configuration file acquisition request;

[0010] The server standard configuration file is compared with the multiple target configuration files respectively to obtain corresponding comparison results.

[0011] Optionally, the comparing the server standard configuration file with the multiple target configuration files respectively to obtain corresponding comparison results includes:

[0012] The difflib.HtmlDiff function in the Python library is called to compare the server standard configuration file with the multiple target configuration files respectively to obtain corresponding comparison results.

[0013] Optionally, after obtaining the corresponding comparison result, the method further includes: converting the comparison result into HTML format, and storing the comparison result in HTML format in a preset storage path of the central control server;

[0014] After receiving the request for obtaining the comparison result sent by the Web client, the comparison result in the HTML format is obtained from the preset storage path, and the comparison result in the HTML format is fed back to the Web client.

[0015] According to a second aspect of the present invention, a method for batch comparison of server configuration files is provided, which is applied to a Web client and includes:

[0016] Providing an input entry for inputting address information of multiple target configuration files;

[0017] Acquire address information of multiple target configuration files input through the input entry;

[0018] Provide an upload entry for uploading server standard configuration files;

[0019] Obtaining a server standard configuration file uploaded through the upload entry;

[0020] The address information of the multiple target configuration files and the server standard configuration file are sent to the central control server described in the first aspect of the present invention.

[0021] Optionally, after sending the address information of the multiple target configuration files and the server standard configuration file to the central control server described in the first aspect of the present invention, the method further includes:

[0022] Generate a corresponding hyperlink object based on each comparison result fed back by the central control server;

[0023] The hyperlink object is displayed in a preset comparison result list, wherein the comparison result list includes the target server identifier and / or IP address, and also includes a hyperlink object corresponding to each target server.

[0024] Optionally, after displaying the hyperlink object in a preset comparison result list, the method further includes:

[0025] In response to triggering the hyperlink object, generating a comparison result reading request, and sending the comparison result reading request to the central control server;

[0026] Obtain the comparison results in HTML format fed back by the central control server and display them.

[0027] According to a third aspect of the present invention, there is also provided a batch comparison device for server configuration files, which is applied to a central control server and includes:

[0028] The first acquisition module is used to acquire a server standard configuration file sent by a Web client, and acquire address information of multiple target configuration files sent by the Web client; wherein each of the target configuration files is stored in a corresponding target server, and each of the address information includes: an IP address and a file storage path of the target server where the target configuration file is located;

[0029] A request sending module, used to generate a corresponding target configuration file acquisition request according to each address information, and send it to the corresponding target server respectively;

[0030] A second acquisition module, configured to acquire multiple target configuration files returned by the multiple target servers according to the target configuration file acquisition request;

[0031] The comparison module is used to compare the server standard configuration file with the multiple target configuration files respectively to obtain corresponding comparison results.

[0032] Optionally, the comparison module is used to call the difflib.HtmlDiff function in the Python library to compare the server standard configuration file with multiple target configuration files respectively to obtain corresponding comparison results.

[0033] Optionally, the device also includes a format conversion module, a result storage module and a comparison result feedback module. The format conversion module is used to convert the comparison result into HTML format after obtaining the corresponding comparison result. The result storage module is used to store the comparison result in HTML format in a preset storage path of the central control server. The comparison result feedback module is used to obtain the comparison result in HTML format from the preset storage path after receiving a comparison result request sent by the Web client, and feed back the comparison result in HTML format to the Web client.

[0034] According to a fourth aspect of the present invention, there is also provided a batch comparison device for server configuration files, which is applied to a Web client, wherein the Web client includes a Web page and an information sending module;

[0035] The web page includes: an input entry and an upload entry;

[0036] The input entry is used to receive address information of multiple target configuration files input by a user;

[0037] The upload entry is used to receive the server standard configuration file uploaded by the user;

[0038] The information sending module is used to send the address information of the multiple target configuration files and the server standard configuration file to the central control server described in the first aspect of the present invention.

[0039] Optionally, the device also includes a first result processing module, which is used to: after sending the address information of multiple target configuration files and the server standard configuration file to the central control server, generate a corresponding hyperlink object based on each comparison result fed back by the central control server; display the hyperlink object in a preset comparison result list, wherein the comparison result list includes the target server identifier and / or IP address, and also includes a hyperlink object corresponding to each target server.

[0040] Optionally, the device also includes a second result processing module, which is used to: generate a comparison result reading request in response to the triggering of the hyperlink object, and send the comparison result reading request to the central control server; obtain the comparison result in HTML format fed back by the central control server and display it.

[0041] According to a fifth aspect of the present invention, an electronic device is also provided, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the batch comparison method of server configuration files described in the first aspect or the second aspect of the present invention.

[0042] According to a sixth aspect of the present invention, a batch comparison system for server configuration files is also provided, comprising the central control server described in the first aspect of the present invention, the Web client described in the second aspect of the present invention, and a target server, wherein the central control server is communicatively connected to the Web client and the target server respectively; wherein a server for monitoring a set port is deployed in the target server, and the target server obtains the target configuration file acquisition request sent by the central control server through the set port.

[0043] According to a seventh aspect of the present invention, a machine-readable storage medium is further provided, wherein the machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the batch comparison method of server configuration files described in the first aspect or the second aspect of the present invention.

[0044] The file batch comparison method in this embodiment can automatically perform comparison processing of batch files, greatly improving processing efficiency and saving manpower.

[0045] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

[0047] Figure 1 A schematic diagram of the hardware configuration of a batch comparison system of server configuration files that can be used to implement an embodiment of the present invention is shown.

[0048] Figure 2 A flow chart of a method for batch comparison of server configuration files according to an embodiment of the present invention is shown.

[0049] Figure 3 A schematic diagram showing a comparison result list according to an embodiment of the present invention is shown.

[0050] Figure 4 A schematic diagram of a comparison result interface according to an embodiment of the present invention is shown.

[0051] Figure 5 A schematic diagram of an interface for acquiring target file information according to an embodiment of the present invention is shown.

[0052] Figure 6 A flow chart showing an example of an embodiment of the present invention. DETAILED DESCRIPTION

[0053] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.

[0054] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.

[0055] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.

[0056] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0057] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0058] <Hardware Configuration>

[0059] Figure 1 The figure shows the hardware configuration of a system for batch comparison of target server configuration files that can be used to implement the embodiment of the present invention.

[0060] like Figure 1 As shown, the target server configuration file batch comparison system 1000 of this embodiment includes a target server 1100 , a central control server 1200 , a network 1400 and a Web client 1100 .

[0061] The target server 1100 may be, for example, a blade server, a rack server, etc. The target server 1100 may also be a server cluster deployed in the cloud, which is not limited here. Figure 1 As shown, the target server 1100 may include a processor 1110, a memory 1120, an interface device 1130, a communication device 1140, a display device 1150, and an input device 1160. The processor 1110 may be, for example, a central processing unit CPU, etc. The memory 1120 may include, for example, a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, etc. The interface device 1130 may include, for example, a USB interface, a serial interface, etc. The communication device 1140 may be capable of wired or wireless communication, for example. The display device 1150 may be, for example, a liquid crystal display screen. The input device 1160 may include, for example, a touch screen, a keyboard, etc.

[0062] In this embodiment, a server for implementing batch file comparison is deployed in the target server 1100, and the server can monitor a specific protocol port.

[0063] It should be understood by those skilled in the art that although Figure 1 , multiple devices of the target server 1100 are shown; however, the target server 1100 of the embodiment of this specification may only involve some of the devices, for example, only the processor 1110, the memory 1120 and the communication device 1140.

[0064] In this embodiment, the target server 1100 includes multiple target servers, for example, Figure 1 The target server 1100 shown includes target server I, target server II, and target server III. The structure and function of each target server in the plurality of target servers can refer to the above description of the structure and function of the target server 1100.

[0065] like Figure 1As shown, the central control server 1200 may include a processor 1210, a memory 1220, an interface device 1230, a communication device 1240, a display device 1250, an input device 1260, an audio output device 1270, an audio input device 1280, and the like. The processor 1210 may be a central processing unit CPU, a microprocessor MCU, and the like. The memory 1220 may include, for example, a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, and the like. The interface device 1230 may include, for example, a USB interface, an earphone interface, and the like. The communication device 1240 may, for example, be capable of wired or wireless communication. The display device 1250 may be, for example, a liquid crystal display screen, a touch display screen, and the like. The input device 1260 may include, for example, a touch screen, a keyboard, and the like. The central control server 1200 may output audio information through an audio output device 1270, and the audio output device 1270 may include, for example, a speaker. The central control server 1200 may pick up voice information input by a user through an audio pickup device 1280, and the audio pickup device 1280 may include, for example, a microphone.

[0066] It should be understood by those skilled in the art that although Figure 1 Multiple devices of the central control server 1200 are shown in the figure, but the central control server 1200 of the embodiment of this specification may only involve some of the devices, for example, only the processor 1210, the memory 1220, the display device 1250, the input device 1260, etc.

[0067] The communication network 1400 may be a wireless network or a wired network, a local area network or a wide area network. The central control server 1200 may communicate with the target server 1100 via the communication network 1400 .

[0068] The web client can be connected to the central control server 1200. The web client can be a smart phone, a portable computer, a desktop computer, a tablet computer, etc.

[0069] Figure 1 The illustrated batch comparison system 1000 of server configuration files is illustrative only and is in no way intended to limit the present description, its application, or uses.

[0070] <Method Example>

[0071] This embodiment provides a method for batch comparison of server configuration files, which is applied to Figure 1 The central control device 1200 in FIG. Figure 2 As shown, the method includes the following steps S1100-S1500:

[0072] Step S1100, obtaining a server standard configuration file sent by a Web client.

[0073] In this embodiment, the server standard configuration file is a file that can provide standard configuration information for reference. In one example, the standard configuration file is a file that includes server standard configuration parameters.

[0074] Step S1200, obtaining address information of multiple target configuration files sent by the Web client; wherein each target configuration file is stored in a corresponding target server, and each address information includes: an IP address and a file storage path of the target server where the target configuration file is located.

[0075] In this embodiment, the target configuration file is a configuration file of a certain server.

[0076] In this embodiment, the target configuration file may be compared with the server standard configuration file to find out the difference between the two.

[0077] In this embodiment, there may be multiple target configuration files, and each target file is stored on a corresponding server. The address information of each target configuration file includes: the IP address of the server where the target configuration file is located and the storage path of the target configuration file on the server. It is easy to understand that the storage location of the target file can be located according to the address information of the target configuration file.

[0078] Step S1300: Generate a corresponding target configuration file acquisition request according to each address information, and send it to the corresponding target server respectively.

[0079] In this embodiment, the central control server sends a target configuration file acquisition request to each server storing the target configuration file according to the server IP address in the address information. Each server finds the target configuration file according to the storage path of the target configuration file on the server included in the request, and sends it to the central control server.

[0080] In one embodiment of the present invention, for each server storing the target configuration file, a server for file comparison is pre-deployed on the server based on the Remote Procedure Call (RPC) technology. The server can listen to the protocol port set in the server, for example, the port of port=6767. The server can obtain the request sent by the central control server through the protocol port.

[0081] Step S1400: obtaining multiple target configuration files returned by multiple target servers according to a target configuration file obtaining request.

[0082] In this embodiment, after receiving the target configuration file sent by the server, the central control server may store it locally in a persistent or non-persistent manner.

[0083] Step S1500: Compare the server standard configuration file with a plurality of target configuration files respectively to obtain corresponding comparison results.

[0084] In this embodiment, each target configuration file is compared with the standard configuration file to obtain a comparison result between each target configuration file and the standard configuration file.

[0085] In one embodiment of the present invention, step S1500 includes: calling the difflib.HtmlDiff function in the Python library to compare the server standard configuration file with multiple target configuration files respectively to obtain corresponding comparison results.

[0086] The difflib.HtmlDiff function can be used to create an HTML table (or an HTML file containing a table) and compare the differences between the two sides or line by line.

[0087] In one embodiment of the present invention, after obtaining the corresponding comparison result, the method further includes: converting the comparison result into HTML format, and storing the comparison result in HTML format in a preset storage path of the central control server;

[0088] After receiving the comparison result acquisition request sent by the Web client, the comparison result in HTML format is acquired from the preset storage path, and the comparison result in HTML format is fed back to the Web client.

[0089] In this embodiment, the comparison result of each target configuration file and the server standard configuration file includes the similarities and differences between the two. The differences between the target configuration file and the server standard configuration file can be marked, for example, the content in the target configuration file that is different from the standard configuration file is highlighted.

[0090] The file batch comparison method in this embodiment can automatically perform comparison processing of batch files, greatly improving processing efficiency and saving manpower.

[0091] This embodiment also provides a batch comparison method for server configuration files, which is applied to Figure 1 The method comprises the following steps S2100-S2500:

[0092] Step S2100: providing an input entry for inputting address information of multiple target configuration files.

[0093] In one embodiment of the present invention, a method for batch comparison of server configuration files includes the step of providing an input entry for inputting target configuration file information in response to a request for batch comparison. The request for batch comparison is triggered, for example, by a user clicking a related button. In response to the request for batch comparison, the Web client provides an input entry for inputting address information of the target configuration file in a user interface, and obtains the address information input by the user in the input entry.

[0094] As an example, Figure 5 The user interface for inputting the address information of the target configuration file provided by the Web user terminal is shown. In this example, the user is supported to input the address information by directly filling in and uploading files. The upper part of the user interface is the entrance for filling in the address information, including prompt text and input button. The user can enter the sub-interface for filling in the address information by clicking the fill-in button. The user can directly fill in the address information in the sub-interface, such as filling in the IP address of the server corresponding to the target configuration file and the storage location of the target configuration file on the corresponding server. The lower part of the user interface is the entrance for uploading the address information, including prompt text and upload button. The user can enter the sub-interface for uploading the address information by clicking the upload button. The user can select or enter the path of the address information file stored in the sub-interface, such as selecting or entering the path of the file storing the IP address of the server corresponding to the target configuration file and the storage location of the target configuration file on the corresponding server, and the address information can be input in batches by uploading the file.

[0095] Step S2200, obtaining address information of multiple target configuration files input through an input entry.

[0096] Step S2300: providing an upload entry for uploading a server standard configuration file.

[0097] In this embodiment, the Web client responds to the request for batch comparison and further provides an upload entry for uploading the server standard configuration file, and obtains and saves the server standard configuration file uploaded by the user in the upload entry. Figure 5 The entry for uploading the target configuration file information is similar, and also includes a prompt text and an upload button. By clicking the upload button, the user can enter the sub-interface for uploading the server standard configuration file. In this sub-interface, the user can select or enter the path of the server standard configuration file to complete the upload of the server standard configuration file.

[0098] In one example, the request for batch comparison is a request for loading a web interface for batch comparison. In response to the request, the central control server loads the web interface for batch comparison. The web interface provides the input entry and the upload entry, for example Figure 5 The interface shown.

[0099] Step S2400, obtaining the server standard configuration file uploaded through the upload entry.

[0100] Step S2500 : sending address information of multiple target configuration files and a server standard configuration file to the central control server 1200 .

[0101] In one embodiment of the present invention, after step S2500, it also includes: generating a corresponding hyperlink object based on each comparison result fed back by the central control server; displaying the hyperlink object in a preset comparison result list, wherein the comparison result list includes the target server identifier and / or IP address, and also includes a hyperlink object corresponding to each target server.

[0102] In one embodiment of the present invention, the comparison results may be displayed in the form of columns, wherein the comparison result list reflects the mapping relationship between each server and each comparison result.

[0103] In the step of displaying the comparison result list, a corresponding hyperlink object may be displayed for each comparison result. When a user triggers the hyperlink object by clicking, the Web client displays the corresponding comparison result in response to the user's triggering of the hyperlink object.

[0104] As an example, Figure 3 FIG. 2 is a schematic diagram showing a comparison result list of an embodiment of the present invention. Figure 3 As shown, the comparison result list includes the IP of each server and the comparison result between the target configuration file corresponding to the server and the standard file. Each comparison result corresponds to a hyperlink object. By clicking the hyperlink object, the user can enter the sub-interface showing the comparison result and browse the detailed information of the comparison result.

[0105] In one embodiment of the present invention, after displaying the hyperlink object in a preset comparison result list, it also includes: generating a comparison result reading request in response to the triggering of the hyperlink object, and sending the comparison result reading request to the central control server; obtaining the comparison result in HTML format fed back by the central control server and displaying it.

[0106] As an example, Figure 4 FIG. 4 is a schematic diagram showing a comparison result interface of an embodiment of the present invention. Figure 4 As shown, in this example, the comparison result is displayed visually, the target configuration file and the standard file are displayed accordingly, and the content in the target configuration file that is different from the standard configuration file is marked by highlighting, etc., so that the comparison result has strong readability.

[0107] The following is a specific example of the implementation of the batch comparison method of server configuration files in this embodiment. The hardware devices involved in this example include a Web client, a central control server, and multiple target servers. Figure 6 As shown in the flowchart, first, the user triggers the batch file comparison process through relevant operations, and the Web client responds to the trigger instruction to provide the user with an input entry for inputting address information and standard configuration files, that is, executing step S101. The Web client obtains the standard configuration file of the server uploaded by the user in the input entry and the address information file containing the target server IP address and the corresponding configuration file storage path, that is, executing step S102. After that, the Web client sends the address information file and the standard configuration file to the central control server, that is, executing step S103. The central control server generates a target configuration file acquisition request according to the address information file, and sends the target configuration file acquisition request to each target server according to the IP address of the target server, that is, executing steps S104 and S105. Before step S104, a server for file comparison is pre-arranged in each target server, and the server can monitor the set communication protocol port, that is, executing step S201. By monitoring the port, the target server can obtain the target configuration file acquisition request sent by the central control server. The target server returns the configuration file stored in itself to the central control server, that is, executing step S106. Afterwards, the central control server compares the target configuration file with the standard configuration file, obtains the comparison result and returns the comparison result to the Web client, that is, executing steps S107 and S108. The Web client generates a comparison link according to the comparison result and displays it in a list form, that is, executing step S109.

[0108] <Device Example>

[0109] This embodiment provides a batch comparison device for server configuration files, which is applied to a central control server and includes a first acquisition module, a request sending module, a second acquisition module and a comparison module.

[0110] The first acquisition module is used to acquire a server standard configuration file sent by a Web client, and to acquire address information of multiple target configuration files sent by a Web client; wherein each target configuration file is stored in a corresponding target server, and each address information includes: an IP address and a file storage path of the target server where the target configuration file is located.

[0111] The request sending module is used to generate a corresponding target configuration file acquisition request according to each address information, and send it to the corresponding target server respectively.

[0112] The second acquisition module is used to acquire multiple target configuration files returned by multiple target servers according to the target configuration file acquisition request.

[0113] The comparison module is used to compare the server standard configuration file with multiple target configuration files respectively to obtain corresponding comparison results.

[0114] In one embodiment of the present invention, when the comparison module compares the server standard configuration file with multiple target configuration files respectively to obtain corresponding comparison results, it is also used to: call the difflib.HtmlDiff function in the Python library to compare the server standard configuration file with multiple target configuration files respectively to obtain corresponding comparison results.

[0115] In one embodiment of the present invention, the above-mentioned device also includes a result storage module, which is used to convert the comparison results into HTML format after obtaining the corresponding comparison results, and store the comparison results in HTML format in a preset storage path of the central control server, and after receiving a comparison result request sent by the Web user terminal, obtain the comparison results in HTML format from the preset storage path, and feed back the comparison results in HTML format to the Web user terminal.

[0116] This embodiment also provides a batch comparison device for server configuration files, which is applied to a Web client and includes a Web page and an information sending module.

[0117] The web page includes: an input entry and an upload entry, the input entry is used to receive address information of multiple target configuration files input by a user, and the upload entry is used to receive a server standard configuration file uploaded by a user.

[0118] The information sending module is used to send the address information of multiple target configuration files and the server standard configuration file to the central control server.

[0119] In one embodiment of the present invention, the above-mentioned device also includes a first result processing module, which is used to: after sending the address information of multiple target configuration files and the server standard configuration file to the central control server, generate a corresponding hyperlink object based on each comparison result fed back by the central control server; display the hyperlink object in a preset comparison result list, wherein the comparison result list includes the target server identifier and / or IP address, and also includes a hyperlink object corresponding to each target server.

[0120] In one embodiment of the present invention, the above-mentioned device also includes a second result processing module, which is used to: generate a comparison result reading request in response to the triggering of a hyperlink object, and send the comparison result reading request to the central control server; obtain the comparison result in HTML format fed back by the central control server and display it.

[0121] <Electronic Equipment Embodiment>

[0122] This embodiment provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the batch comparison method of server configuration files described in the method embodiment of the present invention.

[0123] <Implementation Example of a Batch Comparison System for Server Configuration Files>

[0124] This embodiment provides a batch comparison system for server configuration files, including the central control server, the Web client, and the target server described above, wherein the central control server is connected to the Web client and the target server in communication, wherein the target server is deployed with a server for monitoring a set port, and the target server obtains a target configuration file acquisition request sent by the central control server through the set port.

[0125] <Machine-readable storage medium embodiment>

[0126] This embodiment provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the batch comparison method of server configuration files described in the method embodiment of the present invention.

[0127] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.

[0128] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0129] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0130] The computer program instructions for performing the operation of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.

[0131] Various aspects of the present invention are described herein with reference to the flow charts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flow chart and / or block diagram and the combination of each box in the flow chart and / or block diagram can be implemented by computer-readable program instructions.

[0132] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0133] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0134] The flowchart and block diagram in the accompanying drawings show the possible architecture, functions and operations of the system, method and computer program product according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of an instruction, and a part of a module, a program segment or an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.

[0135] Embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.

Claims

1. A method for batch comparison of server configuration files, applied to a central control server, comprising: Acquire a server standard configuration file sent by a Web client, wherein the server standard configuration file is a file that can provide standard configuration information for reference; Acquire address information of multiple target configuration files sent by the Web client; wherein each of the target configuration files is stored in a corresponding target server, and each of the address information includes: an IP address and a file storage path of the target server where the target configuration file is located; Generate a corresponding target configuration file acquisition request according to each address information, and send it to the corresponding target server respectively; Acquire multiple target configuration files returned by the multiple target servers according to the target configuration file acquisition request; Comparing the server standard configuration file with the multiple target configuration files respectively to obtain corresponding comparison results, wherein the comparison results include similarities and differences between the server standard configuration file and the target configuration files; The step of comparing the server standard configuration file with the multiple target configuration files to obtain corresponding comparison results includes: The difflib.HtmlDiff function in the Python library is called to compare the server standard configuration file with the multiple target configuration files respectively to obtain corresponding comparison results.

2. The method according to claim 1, wherein: After obtaining the corresponding comparison result, the method further includes: converting the comparison result into HTML format, and storing the comparison result in HTML format in a preset storage path of the central control server; After receiving the request for obtaining the comparison result sent by the Web client, the comparison result in the HTML format is obtained from the preset storage path, and the comparison result in the HTML format is fed back to the Web client.

3. A method for batch comparison of server configuration files, applied to a Web client, comprising: Providing an input entry for inputting address information of multiple target configuration files; Acquire address information of multiple target configuration files input through the input entry; Provide an upload entry for uploading server standard configuration files; Obtaining a server standard configuration file uploaded through the upload entry; The address information of the multiple target configuration files and the server standard configuration file are sent to the central control server in the comparison method described in claim 1 or 2.

4. The method according to claim 3, wherein: After sending the address information of the plurality of target configuration files and the server standard configuration file to the central control server according to claim 1 or 2, the method further comprises: Generate a corresponding hyperlink object based on each comparison result fed back by the central control server; The hyperlink object is displayed in a preset comparison result list, wherein the comparison result list includes the target server identifier and / or IP address, and also includes a hyperlink object corresponding to each target server.

5. The method according to claim 4, wherein: After displaying the hyperlink object in a preset comparison result list, the method further includes: In response to triggering the hyperlink object, generating a comparison result reading request, and sending the comparison result reading request to the central control server; Obtain the comparison results in HTML format fed back by the central control server and display them.

6. A batch comparison device for server configuration files, applied to a central control server, comprising: The first acquisition module is used to acquire a server standard configuration file sent by a Web client, and acquire address information of multiple target configuration files sent by the Web client; wherein the server standard configuration file is a file that can provide standard configuration information for reference, each of the target configuration files is stored in a corresponding target server, and each of the address information includes: an IP address and a file storage path of the target server where the target configuration file is located; A request sending module, used to generate a corresponding target configuration file acquisition request according to each address information, and send it to the corresponding target server respectively; A second acquisition module, configured to acquire multiple target configuration files returned by the multiple target servers according to the target configuration file acquisition request; a comparison module, configured to compare the server standard configuration file with the plurality of target configuration files respectively to obtain corresponding comparison results, wherein the comparison results include similarities and differences between the server standard configuration file and the target configuration files; Wherein, when the comparison module compares the server standard configuration file with the multiple target configuration files respectively to obtain corresponding comparison results, it is also used to: The difflib.HtmlDiff function in the Python library is called to compare the server standard configuration file with the multiple target configuration files respectively to obtain corresponding comparison results.

7. A batch comparison device for server configuration files, applied to a Web client, the Web client comprising a Web page and an information sending module; The web page includes: Input entry and upload entry; The input entry is used to receive address information of multiple target configuration files input by a user; The upload entry is used to receive the server standard configuration file uploaded by the user; The information sending module is used to send the address information of the multiple target configuration files and the server standard configuration file to the central control server in the comparison method described in claim 1 or 2.

8. An electronic device, comprising a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the batch comparison method of server configuration files according to any one of claims 1 to 5.

9. A batch comparison system for server configuration files, comprising a central control server in the comparison method according to claim 1 or 2, a Web client in the comparison method according to any one of claims 3 to 5, and a target server, wherein the central control server is respectively connected to the Web client and the target server in communication; wherein: The target server is deployed with a server for monitoring a set port, and the target server obtains the target configuration file acquisition request sent by the central control server through the set port.

10. A machine-readable storage medium storing machine-executable instructions, wherein when the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the method for batch comparison of server configuration files according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Distributed configuration management method and device and system for realization of distributed configuration management

    CN107483250A

  • Server configuration automatic monitoring and alarming method based on SaltStack

    CN107707415A

  • Hardware configuration information batch processing method and apparatus

    CN108345476A

  • Method and devices for processing a configuration file in a multi-distributed file system

    CN109388625A

  • Data Processing Method and Device in Distributed File Storage System

    US20150324371A1