CN113760726A - Method, device, electronic equipment and medium for testing configuration file - Google Patents

Method, device, electronic equipment and medium for testing configuration file Download PDF

Info

Publication number
CN113760726A
CN113760726A CN202110064951.5A CN202110064951A CN113760726A CN 113760726 A CN113760726 A CN 113760726A CN 202110064951 A CN202110064951 A CN 202110064951A CN 113760726 A CN113760726 A CN 113760726A
Authority
CN
China
Prior art keywords
configuration
configuration file
real
configuration item
preset
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
CN202110064951.5A
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110064951.5A priority Critical patent/CN113760726A/en
Publication of CN113760726A publication Critical patent/CN113760726A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method, a device, electronic equipment and a medium for testing configuration files, wherein the method comprises the following steps: capturing the configuration file by using a configuration file capturing engine; analyzing the configuration file by using a preset analysis model to obtain a real configuration item; and comparing the real configuration item with a pre-stored corresponding preset configuration item by using a preset comparison model so as to test whether the real configuration item is abnormal or not. Therefore, various configuration files can be automatically captured and manually configured, and high fidelity test is carried out to compare the actual value of the test configuration file with the preset value of the configuration file, so that abnormality is found, and the stability of the system is ensured; in addition, descriptive grammar analysis and similarity analysis can be carried out on the configuration file, error points which are easy to make mistakes are found out, and the abnormity or the error points of the system configuration file are notified in the modes of mails, short messages and the like, so that the abnormity condition of the system configuration file can be found and fed back in time.

Description

Method, device, electronic equipment and medium for testing configuration file
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for testing a configuration file, an electronic device, and a medium.
Background
With the rapid development of the internet, the distributed system is widely applied, and in the distributed system, guarantees such as high availability and degradation need to be guaranteed due to the fact that a large number of projects are split. To implement these guarantees, the dynamic configuration system is required to configure various configurations (downgrade switches, dictionary data, business fields, etc.). Therefore, a test method for automatically detecting whether the value of the configuration file is the value that the system needs to configure is needed, so as to ensure the stability and safety of the system and reduce the risk of the system.
Currently, the method of artificial eye observation-local attention configuration is mainly adopted. Modified configuration is provided and maintained to the test list in the research and development stage, the service capability test is carried out according to the test list in the test stage, the configuration file is tested in an auxiliary mode instead of being tested from the global angle, and test blind spots are generated due to the fact that some switches have relevance. In the manual comparison service test process, the switch fusion service is tested, and independent test is not performed.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
the prior art has no functional scheme for testing the configuration file, and the poor functional influence caused by the configuration file cannot be avoided due to the lack of evaluation on the modification range of the configuration file; under the condition of configuration and service convergence test, the scene of configuration file angle test is lost; the modification configuration file of misoperation and the influence caused by the modification configuration file cannot be found; mass configuration files in distributed application cannot be tested quickly and problems cannot be found; and the storage positions of the configuration files are multiple, complicated and disordered.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, an electronic device, and a medium for testing configuration files, which can automatically capture and manually configure various configuration files, perform a high fidelity test to compare a true value of a test configuration file with a preset value of the configuration file, thereby finding an abnormality and ensuring system stability; in addition, descriptive grammar analysis and similarity analysis can be carried out on the configuration file, error points which are easy to make mistakes are found out, and the abnormity or the error points of the system configuration file are notified in the modes of mails, short messages and the like, so that the abnormity condition of the system configuration file can be found and fed back in time.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of testing a configuration file, including:
capturing the configuration file by using a configuration file capturing engine;
analyzing the configuration file by using a preset analysis model to obtain a real configuration item; and
and comparing the real configuration item with a pre-stored corresponding preset configuration item by using a preset comparison model so as to test whether the real configuration item is abnormal or not.
Further, the method further comprises:
and performing key similarity analysis on the real configuration item by using a similarity analysis model, and judging that the real configuration item has an abnormality when the key similarity exceeds a preset threshold value.
Further, the method further comprises:
when the real configuration item has an abnormality, triggering an alarm engine to send an alarm message reflecting the abnormality.
Further, the analysis model analyzes the configuration file by using a conversion mode corresponding to the structure of the configuration file.
Further, the comparison model comprises a bidirectional comparison of configuration items and a comparison of configuration item values to bidirectionally compare the real configuration item with the preset configuration item and to compare the real configuration item value with the corresponding preset configuration item value.
Further, when the real configuration item is inconsistent with the preset configuration item and/or the real configuration item value is inconsistent with the preset configuration item value, it is determined that the real configuration item is abnormal.
Further, the processing of the comparison model is performed based on a timed task engine.
Further, the configuration file grabbing engine grabs the configuration file through an open interface by using a data acquisition plug-in.
According to another aspect of the present invention, there is provided an apparatus for testing a configuration file, including:
the acquisition module is used for capturing the configuration file by using a configuration file capture engine;
the analysis module is used for analyzing the configuration file by using a preset analysis model so as to obtain a real configuration item; and
and the comparison module compares the real configuration item with a pre-stored corresponding preset configuration item by using a preset comparison model so as to test whether the real configuration item is abnormal or not.
Further, the device further comprises a similarity analysis module, which is used for performing key similarity analysis on the real configuration items by using a similarity analysis model, and judging that the real configuration items are abnormal when the analyzed key similarity exceeds a preset threshold value.
According to still another aspect of the present invention, there is provided an electronic device for testing a configuration file, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method as in one aspect above.
According to yet another aspect of the invention, a computer-readable medium is provided, on which a computer program is stored, characterized in that the program, when executed by a processor, implements a method according to the previous aspect.
One embodiment of the above invention has the following advantages or benefits: the system configuration file can be automatically captured and manually configured, and high fidelity test is carried out to compare the actual value of the test configuration file with the preset value of the configuration file, so that abnormality is found, and the stability of the system is ensured; in addition, descriptive grammar analysis, similarity analysis and the like can be carried out on the configuration file, error points which are easy to make mistakes are found out, and the abnormity or the error points of the system configuration file are notified in a mail mode, a short message mode and the like, so that the abnormity condition of the system configuration file can be found and fed back in time.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a main flow of a method of testing a configuration file according to an embodiment of the invention;
FIG. 2 illustrates a specific example of an interface of a platform architecture to which a method of testing configuration files according to an embodiment of the present invention is applied;
FIG. 3 is a data flow diagram of the example shown in FIG. 2;
FIG. 4 is a profile data collection flow diagram of the example shown in FIG. 2;
FIG. 5 is a simplified flow diagram of a profile parsing comparison process for the example shown in FIG. 2;
FIG. 6 is a diagram illustrating an example of an abnormal situation analyzed by the method for testing a configuration file according to the embodiment of the present invention;
FIG. 7 is a schematic diagram of the main modules of an apparatus for testing configuration files according to an embodiment of the present invention;
FIG. 8 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 9 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a method of testing a configuration file according to an embodiment of the present invention, and as shown in fig. 1, the method of testing a configuration file according to an embodiment of the present invention includes: s101, a grabbing step; s102, analyzing; s103, a comparison step; s104, a similarity analyzing step; and S105, an alarm step. The above-described respective steps will be described in detail hereinafter.
Step S101, a grasping step
And capturing the configuration file by using a configuration file capture engine.
Specifically, the configuration file capture engine uses a data collection plug-in (e.g., open-api (application programming interface), data capture, application of the system itself, etc.) to obtain dynamic data (description of key + value + key of configuration file) of configuration file from each dimension of configuration file of configuration system (deployment system, dynamic configuration system, etc.) or configuration file of application through an open interface. After starting, starting the data acquisition plug-in through the project starter to capture the configuration file, uploading the configuration items (such as a switch and service configuration) and storing the configuration items.
The open interface may be an http protocol (hypertext transfer protocol) interface, which provides http services so that control can be performed dynamically. And has security authority verification, thereby improving the reliability of the system.
Step S102, analysis step
And analyzing the configuration file by using a preset analysis model to obtain and store the real configuration item.
Specifically, the analytical model performs the following processing:
the configuration file is analyzed for its structure, for example, List (List), Map (Map), json (JS object profile), String (character String), etc., in a conversion manner corresponding to the structure of the configuration file. Also, parsing rules can be customized for complex configuration file structures, e.g., a combination of List and Map, to parse.
S103, a comparison step
And comparing the real configuration item with a pre-stored corresponding preset configuration item by using a preset comparison model so as to test whether the real configuration item is abnormal or not. For example, when the real configuration item is inconsistent with the corresponding preset configuration item, the comparison model judges that the real configuration item has abnormity.
By utilizing the timing task engine, the comparison between the real configuration item and the pre-stored corresponding preset configuration item can be carried out in real time (real-time task), and the comparison can also be carried out in timing (off-line task). In addition, the comparison may also be triggered manually.
In addition, the comparison model may include a bidirectional comparison (comparing with each other as a reference to obtain different points) configuration item and a comparison configuration item value, so as to perform automatic matching and bidirectional comparison on the real configuration item and the preset configuration item on the premise of iterating all the configuration items, and compare the real configuration item value with the corresponding preset configuration item value.
The types of comparisons performed by the model may include single-value comparisons and complex-value comparisons, among others. The single value comparison mainly comprises character string comparison, and the comparison mode is to directly judge whether the character string comparison is equal or not; the composite value is compared after being sorted.
S104, similarity analyzing step
The key similarity analysis is performed on the real configuration items using the similarity analysis model, and when the key similarity exceeds a predetermined threshold (for example, 60%), it is determined that there is an abnormality in the real configuration items.
Specifically, among the analyzed real configuration items, the higher the similarity of the items is, the more error is prone, for example, the similarity between switch and switch exceeds a predetermined threshold (for example, 60%), an error is prone to be caused, and in order to minimize the risk, it is determined that there may be an abnormality.
It should be noted that the order of step S103 and step S104 is not limited to this, and step S103 may be performed simultaneously or step S104 may be performed first and then step S103 may be performed.
The method for calculating the key similarity according to the embodiment of the present invention may use a word segmentation algorithm to calculate, for example, a forward maximum matching method (FMM) and a backward maximum matching method (BMM). And is not limited and other algorithms may be employed.
Fig. 6 shows a specific example of comparison and similarity analysis using the present invention, wherein, as shown in fig. 6, the following results are obtained by comparing the preset correct configuration (preset configuration item) with the configuration (real configuration item) requiring on-line modification:
modified from report. min. req. true to report. min. req. false (inconsistent values of configuration items), there is an exception of 1.
A new configuration item switch true is added, the similarity between the key of the configuration item and the switch exceeds a predetermined threshold (for example, 60%), there is a risk of confusion, and thus, there is exception 2.
S105, alarming
If there is an abnormality in the comparison step S103 and the similarity analysis step S104, the alarm engine is triggered to send an alarm message reflecting detailed information of the abnormality to the person in charge. For example, a mail or a short message may be used, and the method is not limited thereto, and the alarm notification may be performed in other manners.
For example, the detailed information of the above-described abnormality 1 and abnormality 2 in fig. 6 is sent to the person in charge as an alarm message by mail in real time.
The steps of the method of testing a configuration file of an embodiment of the present invention are described above. A specific example of a platform architecture to which the method of testing a configuration file of the embodiments of the present invention is applied is described below with reference to fig. 2 to 5, which is only one specific example to which the present invention is applied and is not intended to limit the present invention.
A specific example of an interface of the platform architecture as shown in fig. 2 includes a management side, a collection side, and an analysis side.
The management terminal mainly provides related entries for configuration files, test comparison and alarm management, and the related entries comprise system registration, configuration file difference point management, configuration file maintenance, syntax analysis definition and alarm management.
The acquisition end mainly performs automatic acquisition of configuration files and calling and grabbing of api from each configured end, and the figure shows specific examples of two data acquisition plug-ins, namely, file-data-plugin (plug-in name, which may be referred to as file data plug-in) and file-open-api (file development application program interface). Therefore, the data acquisition end can perform File-data-plugin data acquisition plug-in management, File-open-api File development api interface management or plug-in set-based management (not shown).
As shown in the data flow diagram of fig. 3, the configuration file data acquisition flow of fig. 4, and the analysis and comparison process of fig. 5, in the high fidelity test platform architecture, the initiator loads the configuration file, starts the data acquisition plug-in, and communicates with the management end, thereby implementing dynamic control of the data acquisition plug-in by the management end, and controlling the data acquisition plug-in to dynamically capture the configuration file. When capturing a configuration file of an application or a configuration system, capturing can be performed by using a plug-in (e.g., file-data-plug) of a tool kit, which uses zero-intrusion service codes (i.e., service codes are zero-coupled to run through an independent process), and the newly added configuration is collected in a filtering manner. When open-api exists, the capture can be directly performed in the form of an open interface, where the open interface is the http protocol interface described above and can be controlled by the management end. Different configuration data source ends can adopt different plug-ins to capture, and gather and store after capturing. After the configuration file is successfully captured, the data collection plug-in sends the configuration file to the middleware (e.g., kafka shown in fig. 2), and the analysis end acquires a message from the middleware to perform parsing, comparison, similarity analysis, and the like, and stores the processed data to a storage medium (e.g., hbase shown in fig. 2). In the embodiment of the present invention, Kafka may perform message decoupling and data analysis, and may perform multiple message modes in a configuration manner to provide processing capability).
The analysis end comprises analysis rules, high-fidelity comparison test, comparison task scheduling, alarm rules and syntax analysis.
Wherein, the parsing rule executes the parsing step S102 described above. The comparison test is performed with the comparison step S103 described above. The comparison task scheduling utilizes a scheduler to execute tasks (real-time tasks and off-line tasks) through a timing task engine at regular time, and a task method triggers the comparison of configuration files so as to check whether the configuration files have abnormal conditions such as inconsistency and find problems in real time. The alarm rule performs the alarm step S105 described earlier. The parsing includes a configuration key intelligence analysis which performs the similarity analysis step S104 described earlier.
According to the method for testing the configuration file and the specific implementation mode thereof, the system configuration file can be automatically captured and manually configured, and high fidelity test is carried out to compare the actual value of the test configuration file with the preset value of the configuration file so as to find out abnormality and ensure the stability of the system; in addition, descriptive grammar analysis, similarity analysis and the like can be carried out on the configuration file, error points which are easy to make mistakes are found out, and the abnormity or the error points of the system configuration file are notified in a mail mode, a short message mode and the like, so that the abnormity condition of the system configuration file can be found and fed back in time.
According to another aspect of the present invention, an apparatus for testing a configuration file is provided, and as shown in fig. 7, an apparatus 200 for testing a configuration file according to an embodiment of the present invention includes a grabbing module 201, a parsing module 202, a comparing module 203, a similarity analyzing module 204, and an alarm module 205. The above-described respective modules will be described in detail below.
Grabbing module 201
The crawling module 201 is configured to crawl the configuration file by using a configuration file crawling engine.
Specifically, the configuration file capture engine uses a data collection plug-in (e.g., open-api (application programming interface), data capture, application of the system itself, etc.) to obtain dynamic data (description of key + value + key of configuration file) of configuration file from each dimension of configuration file of configuration system (deployment system, dynamic configuration system, etc.) or configuration file of application through an open interface. After starting, starting the data acquisition plug-in through the project starter to capture the configuration file, uploading the configuration items (such as a switch and service configuration) and storing the configuration items.
The open interface may be an http protocol (hypertext transfer protocol) interface, which provides http services so that control can be performed dynamically. And has security authority verification, thereby improving the reliability of the system.
Parsing module 202
The parsing module 202 is configured to parse the configuration file by using a preset parsing model to obtain and store the real configuration item.
Specifically, the analytical model performs the following processing:
the configuration file is analyzed for its structure, for example, List (List), Map (Map), json (JS object profile), String (character String), etc., in a conversion manner corresponding to the structure of the configuration file. Also, parsing rules can be customized for complex configuration file structures, e.g., a combination of List and Map, to parse.
Comparison module 203
The comparison module 203 is configured to compare the real configuration item with a pre-stored corresponding preset configuration item by using a preset comparison model, so as to test whether the real configuration item is abnormal. For example, when the real configuration item is inconsistent with the corresponding preset configuration item, the comparison model judges that the real configuration item has abnormity.
The comparison module 203 may perform the comparison between the real configuration item and the pre-stored corresponding preset configuration item in real time (real-time task) by using the timing task engine, or perform the comparison in timing (off-line task). In addition, the comparison may also be triggered manually.
In addition, the comparison model may include a bidirectional comparison (comparing with each other as a reference to obtain different points) configuration item and a comparison configuration item value, so as to perform automatic matching and bidirectional comparison on the real configuration item and the preset configuration item on the premise of iterating all the configuration items, and compare the real configuration item value with the corresponding preset configuration item value.
The types of comparisons performed by the model may include single-value comparisons and complex-value comparisons, among others. The single value comparison mainly comprises character string comparison, and the comparison mode is to directly judge whether the character string comparison is equal or not; the composite value is compared after being sorted.
Similarity analysis module 204
The similarity analysis module 204 is configured to perform a key similarity analysis on the real configuration items by using the similarity analysis model, and determine that there is an abnormality in the real configuration items when the key similarity exceeds a predetermined threshold (e.g., 60%).
Specifically, among the analyzed real configuration items, the higher the similarity of the items is, the more error is prone, for example, the similarity of switch and switch exceeds a predetermined threshold (for example, 60%), which is prone to cause error, and in order to minimize the risk, the similarity analysis module 204 determines that there may be an abnormality.
The method for calculating the key similarity by the similarity analysis module 204 according to the embodiment of the present invention may use a word segmentation algorithm to calculate, for example, a forward maximum matching method (FMM) and a backward maximum matching method (BMM). And is not limited and other algorithms may be employed.
Fig. 6 shows a specific example of the comparison and similarity analysis performed by the similarity analysis module 204, wherein, as shown in fig. 6, the comparison between the preset correct configuration (preset configuration item) and the configuration (real configuration item) requiring online modification results in the following results:
modified from report. min. req. true to report. min. req. false (inconsistent values of configuration items), there is an exception of 1.
A new configuration item switch true is added, the similarity between the key of the configuration item and the switch exceeds a predetermined threshold (for example, 60%), there is a risk of confusion, and thus, there is exception 2.
Alarm module 205
If the comparison module 203 and the similarity analysis module 204 determine that there is an abnormality, the alarm module 205 triggers an alarm engine to send an alarm message reflecting detailed information of the abnormality to the person in charge. For example, a mail or a short message may be used, and the method is not limited thereto, and the alarm notification may be performed in other manners.
For example, the alarm module 205 sends the detailed information of the above-described abnormality 1 and abnormality 2 in fig. 6 to the person in charge as an alarm message by mail in real time.
The device for testing the configuration file according to the embodiment of the invention is described above, and the device for testing the configuration file according to the embodiment of the invention can automatically capture and manually configure the system configuration file, perform high fidelity test to compare the actual value of the test configuration file with the preset value of the configuration file so as to find abnormality and ensure the stability of the system; in addition, descriptive grammar analysis, similarity analysis and the like can be carried out on the configuration file, error points which are easy to make mistakes are found out, and the abnormity or the error points of the system configuration file are notified in a mail mode, a short message mode and the like, so that the abnormity condition of the system configuration file can be found and fed back in time.
Fig. 8 shows an exemplary system architecture 800 of a method of testing a profile or an apparatus for testing a profile to which embodiments of the present invention may be applied.
As shown in fig. 8, the system architecture 800 may include terminal devices 801, 802, X03, a network 804, and a server 805. The network 804 serves to provide a medium for communication links between the terminal devices 801, 802, 803 and the server 805. Network 804 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 801, 802, 803 to interact with a server 805 over a network 804 to receive or send messages or the like. The terminal devices 801, 802, 803 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 801, 802, 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 805 may be a server that provides various services, such as a back-office management server (for example only) that supports shopping-like websites browsed by users using the terminal devices 801, 802, 803. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for testing configuration files provided by the embodiment of the present invention is generally performed by the server 805, and accordingly, the device for testing configuration files is generally disposed in the server 805.
It should be understood that the number of terminal devices, networks, and servers in fig. 8 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 9, shown is a block diagram of a computer system 900 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU)901 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage section 909 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for the operation of the system 900 are also stored. The CPU 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
The following components are connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. The computer program performs the above-described functions defined in the system of the present invention when executed by the central processing unit (CP U) 901.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises a grabbing module, an analyzing module, a comparing module, a similarity analyzing module and an alarming module. The names of these modules do not in some cases form a limitation on the modules themselves, and for example, the similarity analysis module may also be referred to as a configuration key intelligent analysis module.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
capturing the configuration file by using a configuration file capturing engine;
analyzing the configuration file by using a preset analysis model to obtain a real configuration item; and
and comparing the real configuration item with a pre-stored corresponding preset configuration item by using a preset comparison model so as to test whether the real configuration item is abnormal or not.
According to the technical scheme of the embodiment of the invention, various configuration files can be automatically captured and manually configured, and high fidelity test is carried out to compare the actual value of the test configuration file with the preset value of the configuration file so as to find abnormality and ensure the stability of the system; in addition, descriptive grammar analysis and similarity analysis can be carried out on the configuration file, error points which are easy to make mistakes are found out, and the abnormity or the error points of the system configuration file are notified in the modes of mails, short messages and the like, so that the abnormity condition of the system configuration file can be found and fed back in time.
The above-described embodiments and specific examples should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A method of testing a configuration file, comprising:
capturing the configuration file by using a configuration file capture engine;
analyzing the configuration file by using a preset analysis model to obtain a real configuration item; and
and comparing the real configuration item with a pre-stored corresponding preset configuration item by using a preset comparison model so as to test whether the real configuration item is abnormal or not.
2. The method of claim 1, further comprising:
and performing key similarity analysis on the real configuration item by using a similarity analysis model, and judging that the real configuration item has an abnormality when the key similarity exceeds a preset threshold value.
3. The method of claim 1 or 2, further comprising:
when the real configuration item has an abnormality, triggering an alarm engine to send an alarm message reflecting the abnormality.
4. The method of claim 3, wherein,
and the analysis model analyzes the configuration file by using a conversion mode corresponding to the structure of the configuration file.
5. The method of claim 4, wherein,
the comparison model comprises the steps of comparing configuration items in a bidirectional mode and comparing configuration item values to compare the real configuration items with the preset configuration items in a bidirectional mode and comparing the real configuration item values with the corresponding preset configuration item values.
6. The method of claim 5, wherein,
and when the real configuration item is inconsistent with the preset configuration item and/or the real configuration item value is inconsistent with the preset configuration item value, judging that the real configuration item is abnormal.
7. The method of claim 6,
the processing of the comparison model is performed based on a timed task engine.
8. The method of claim 7, wherein,
and the configuration file grabbing engine grabs the configuration file through an open interface by using a data acquisition plug-in.
9. An apparatus for testing a configuration file, comprising:
the acquisition module is used for capturing the configuration file by using a configuration file capture engine;
the analysis module is used for analyzing the configuration file by using a preset analysis model so as to obtain a real configuration item; and
and the comparison module compares the real configuration item with a pre-stored corresponding preset configuration item by using a preset comparison model so as to test whether the real configuration item is abnormal or not.
10. The apparatus of claim 9, further comprising:
and the similarity analysis module is used for carrying out key similarity analysis on the real configuration items by utilizing a similarity analysis model, and judging that the real configuration items have abnormity when the key similarity exceeds a preset threshold value.
11. An electronic device for testing a configuration file, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
12. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-8.
CN202110064951.5A 2021-01-18 2021-01-18 Method, device, electronic equipment and medium for testing configuration file Pending CN113760726A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110064951.5A CN113760726A (en) 2021-01-18 2021-01-18 Method, device, electronic equipment and medium for testing configuration file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110064951.5A CN113760726A (en) 2021-01-18 2021-01-18 Method, device, electronic equipment and medium for testing configuration file

Publications (1)

Publication Number Publication Date
CN113760726A true CN113760726A (en) 2021-12-07

Family

ID=78786358

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110064951.5A Pending CN113760726A (en) 2021-01-18 2021-01-18 Method, device, electronic equipment and medium for testing configuration file

Country Status (1)

Country Link
CN (1) CN113760726A (en)

Similar Documents

Publication Publication Date Title
CN107809331B (en) Method and device for identifying abnormal flow
CN113900834B (en) Data processing method, device, equipment and storage medium based on Internet of things technology
CN112988485A (en) Simulation test method and device for power Internet of things equipment
CN113704065A (en) Monitoring method, device, equipment and computer storage medium
CN114328132A (en) Method, device, equipment and medium for monitoring state of external data source
CN115329170A (en) Webpage crawling method, device, equipment and storage medium
CN114465741B (en) Abnormality detection method, abnormality detection device, computer equipment and storage medium
CN113312321A (en) Abnormal monitoring method for traffic and related equipment
CN116450176A (en) Version updating method and device, electronic equipment and storage medium
CN113760726A (en) Method, device, electronic equipment and medium for testing configuration file
CN113590447B (en) Buried point processing method and device
CN115130112A (en) Quick start-stop method, device, equipment and storage medium
CN115495740A (en) Virus detection method and device
CN114756301A (en) Log processing method, device and system
CN114090397A (en) Alarm information processing method and device
CN113595886A (en) Instant messaging message processing method and device, electronic equipment and storage medium
CN113946816A (en) Cloud service-based authentication method and device, electronic equipment and storage medium
CN113656239A (en) Monitoring method and device for middleware and computer program product
CN109327433B (en) Threat perception method and system based on operation scene analysis
CN112988441A (en) Exception handling method and device
CN112883816A (en) Information pushing method and device
CN112965844A (en) CPU surge accident processing method and device
CN111611131A (en) Saltstack-based operation and maintenance method, device, system and storage medium
CN112214500A (en) Data comparison method and device, electronic equipment and storage medium
CN115378746B (en) Network intrusion detection rule generation method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination