CN112256577A - Configuration file difference checking method, device, equipment and storage medium - Google Patents

Configuration file difference checking method, device, equipment and storage medium Download PDF

Info

Publication number
CN112256577A
CN112256577A CN202011141161.4A CN202011141161A CN112256577A CN 112256577 A CN112256577 A CN 112256577A CN 202011141161 A CN202011141161 A CN 202011141161A CN 112256577 A CN112256577 A CN 112256577A
Authority
CN
China
Prior art keywords
check
unstructured
check object
difference
verification
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
CN202011141161.4A
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.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202011141161.4A priority Critical patent/CN112256577A/en
Publication of CN112256577A publication Critical patent/CN112256577A/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/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to the technical field of pedestal operation and maintenance, and discloses a configuration file difference checking method, device, equipment and storage medium. The method comprises the following steps: acquiring a plurality of first configuration files and a plurality of second configuration files of a software product deployment environment; converting each first configuration file and each second configuration file into a corresponding first check object and a corresponding second check object; comparing each first check object with each second check object one by adopting a preset difference comparison rule according to the first check object and the second check object with the check identification information to generate difference reports of the first check object and the second check object; and obtaining a verification result of the first configuration file and the second configuration file according to the difference report so as to adjust the deployment environment of the software product. The invention also relates to a blockchain technique, wherein the first configuration file and the second configuration file are stored in a blockchain. The invention realizes the comprehensive verification of the difference between the test environment and the production environment.

Description

Configuration file difference checking method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of pedestal operation and maintenance, in particular to a configuration file difference checking method, device, equipment and storage medium.
Background
At present, a software product version is on-line, a configuration of a production environment (namely a test environment) is cloned firstly, whether the software works normally in the test environment is tested, and after the software is tested to be normal by the test environment, the software is put into the production environment (the environment formally provided for customers to use) for users to use. Although the test environment is a clone environment of the production environment, the test environment theoretically simulates the production environment, but the test environment and the production environment are also different, for example, a general test server does not have related services of load balancing of a third party on a Content Delivery Network (CDN) type line, and different Network operators provide different Network communications, which may also result in different operation results of the production environment and the test environment for software.
Configuration refreshing of the current production environment is manually operated, configuration of the test environment and the production environment is usually compared through manual observation or a Beyond company tool, configuration errors in the production environment are difficult to find, the effect of the production environment is possibly inconsistent with the result of test full-scale verification, and even a software production problem occurs. There is not comprehensive enough difference check between the test environment configuration and the production environment configuration.
Disclosure of Invention
The invention mainly aims to solve the problem that the difference check of the test environment configuration and the production environment configuration is not comprehensive enough.
The first aspect of the present invention provides a configuration file difference checking method, including:
acquiring a plurality of first configuration files and a plurality of second configuration files of a software product deployment environment;
converting each first configuration file and each second configuration file into a corresponding first check object and a corresponding second check object respectively, wherein the first check object and the second check object carry check identification information;
comparing each first check object with each second check object one by adopting a preset difference comparison rule according to the check identification information to generate a difference report of the first check object and the second check object;
determining a discrepancy check result for the first profile and the second profile based on the discrepancy report.
Optionally, in a first implementation manner of the first aspect of the present invention, the converting each first configuration file and each second configuration file into a corresponding first check object and a corresponding second check object respectively includes:
analyzing each first configuration file and each second configuration file to obtain a corresponding first configuration character set and a corresponding second configuration character set;
converting the first configuration character set into a plurality of first character strings by adopting a preset check format, and converting the second configuration character set into a plurality of second character strings by adopting the preset check format;
saving the first character string as a first check object, and saving the second character string as a second check object.
Optionally, in a second implementation manner of the first aspect of the present invention, the difference comparison rule includes a first comparison rule and a second comparison rule, and the comparing, according to the verification identification information, the first verification objects and the second verification objects one by using a preset difference comparison rule, and generating the difference report of the first verification objects and the second verification objects includes:
according to the verification identification information, dividing each first verification object into a first structured verification object and a first unstructured verification object, and dividing each second verification object into a second structured verification object and a second unstructured verification object;
comparing the first structured check object with the second structured check object by adopting the first comparison rule to generate a full data comparison report of the first structured check object and the second structured check object;
comparing the first unstructured verification object with the second unstructured verification object by adopting the second comparison rule to generate a difference data comparison report of the first unstructured verification object and the second unstructured verification object;
and obtaining difference reports of the first check objects and the second check objects based on the full data comparison report and the difference data comparison report.
Optionally, in a third implementation manner of the first aspect of the present invention, before comparing the first unstructured check object and the second unstructured check object by using the second comparison rule, the method further includes:
obtaining a configuration filtering list, wherein the configuration filtering list comprises historical deployment configurations and configurations which are irrelevant to the deployment environment of the software product;
and screening out the first unstructured check object and the second unstructured check object corresponding to each configuration in the configuration filtering list.
Optionally, in a fourth implementation manner of the first aspect of the present invention, the comparing, by using the second comparison rule, the first unstructured check object and the second unstructured check object, and generating a difference data comparison report of the first unstructured check object and the second unstructured check object includes:
acquiring configuration splicing logic of the software product deployment environment, and determining splicing nodes in the configuration splicing logic;
splicing the screened first unstructured check objects according to the splicing nodes to obtain corresponding first data dictionaries, and splicing the screened second unstructured check objects according to the splicing nodes to obtain corresponding second data dictionaries;
and comparing the first unstructured verification object and the second unstructured verification object one by one according to the first data dictionary and the second data dictionary to generate a difference data comparison report of the first unstructured verification object and the second unstructured verification object.
Optionally, in a fifth implementation manner of the first aspect of the present invention, after the comparing the first unstructured verification object and the second unstructured verification object one by one according to the first data dictionary and the second data dictionary, and generating a difference data comparison report between the first unstructured verification object and the second unstructured verification object, the method further includes:
judging whether a first unstructured check object or a second unstructured check object which is not compared exists or not;
and if so, writing the first unstructured check object or the second unstructured check object which is not subjected to comparison into the difference data comparison report.
Optionally, in a sixth implementation manner of the first aspect of the present invention, the first configuration file and the plurality of second configuration files are stored in a blockchain.
A second aspect of the present invention provides a configuration file difference checking apparatus, including:
the system comprises an acquisition module, a configuration module and a management module, wherein the acquisition module is used for acquiring a plurality of first configuration files and a plurality of second configuration files of a software product deployment environment;
the conversion module is used for converting each first configuration file and each second configuration file into a corresponding first check object and a corresponding second check object respectively, wherein the first check object and the second check object carry check identification information;
the comparison module is used for comparing each first check object with each second check object one by adopting a preset difference comparison rule according to the check identification information to generate a difference report of the first check object and the second check object;
a generating module for determining a difference check result of the first configuration file and the second configuration file based on the difference report.
Optionally, in a first implementation manner of the second aspect of the present invention, the conversion module includes:
the analysis unit is used for analyzing each first configuration file and each second configuration file to obtain a corresponding first configuration character set and a corresponding second configuration character set;
the conversion unit is used for converting the first configuration character set into a plurality of first character strings by adopting a preset check format and converting the second configuration character set into a plurality of second character strings by adopting a preset check format;
and the storage unit is used for storing the first character string as a first check object and storing the second character string as a second check object.
Optionally, in a second implementation manner of the second aspect of the present invention, the comparing module includes:
the classification unit is used for dividing each first check object into a first structured check object and a first unstructured check object and dividing each second check object into a second structured check object and a second unstructured check object according to the check identification information;
the first comparison unit is used for comparing the first structured check object with the second structured check object by adopting the first comparison rule to generate a full data comparison report of the first structured check object and the second structured check object;
the second comparison unit is used for comparing the first unstructured verification object with the second unstructured verification object by adopting the second comparison rule to generate a difference data comparison report of the first unstructured verification object and the second unstructured verification object;
and the generating unit is used for obtaining the difference report of each first check object and each second check object based on the full data comparison report and the difference data comparison report.
Optionally, in a third implementation manner of the second aspect of the present invention, before the second comparison unit, a filtering unit is further included, where the filtering unit is configured to:
obtaining a configuration filtering list, wherein the configuration filtering list comprises historical deployment configurations and configurations which are irrelevant to the deployment environment of the software product;
and screening out the first unstructured check object and the second unstructured check object corresponding to each configuration in the configuration filtering list.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the second comparing unit includes:
a determining subunit, configured to obtain configuration splicing logic of the software product deployment environment, and determine a splicing node in the configuration splicing logic;
the splicing subunit is configured to splice the screened out first unstructured check objects according to the splicing nodes to obtain corresponding first data dictionaries, and splice the screened out second unstructured check objects according to the splicing nodes to obtain corresponding second data dictionaries;
and the comparison subunit is used for comparing the first unstructured verification object and the second unstructured verification object one by one according to the first data dictionary and the second data dictionary to generate a difference data comparison report of the first unstructured verification object and the second unstructured verification object.
Optionally, in a fifth implementation manner of the second aspect of the present invention, after the comparing subunit, the method further includes:
the judging subunit is used for judging whether a first unstructured verification object or a second unstructured verification object which is not compared exists or not;
and the writing subunit is configured to, if there is a first unstructured check object or a second unstructured check object that is not subjected to comparison, write the first unstructured check object or the second unstructured check object that is not subjected to comparison into the difference data comparison report.
Optionally, in a sixth implementation manner of the second aspect of the present invention, the first configuration file and the plurality of second configuration files are stored in a blockchain.
A third aspect of the present invention provides a configuration file difference checking device, including: a memory and at least one processor, the memory having instructions stored therein; the at least one processor invokes the instructions in the memory to cause the profile delta verification device to perform the profile delta verification method described above.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to execute the above-mentioned profile difference checking method.
In the technical scheme provided by the invention, a plurality of first configuration files and a plurality of second configuration files of a software product deployment environment are converted into a first check object and a second check object which are convenient for difference comparison; then comparing the verification identification information with the verification identification information to generate a difference report of the verification identification information and the verification identification information; and finally, the verification results corresponding to the first configuration file and the second configuration file are represented through the difference report, so that the comprehensive verification of the difference of the configuration files of the software product deployment environment is realized.
Drawings
FIG. 1 is a diagram of a configuration file difference checking method according to a first embodiment of the present invention;
FIG. 2 is a diagram of a configuration file difference checking method according to a second embodiment of the present invention;
FIG. 3 is a diagram of a configuration file difference checking method according to a third embodiment of the present invention;
FIG. 4 is a diagram of a configuration file difference checking method according to a fourth embodiment of the present invention;
FIG. 5 is a schematic diagram of an embodiment of a device for checking configuration file differences according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of another embodiment of a configuration file difference checking apparatus according to an embodiment of the present invention;
fig. 7 is a schematic diagram of an embodiment of a configuration file difference checking device in the embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a configuration file difference checking method, a device, equipment and a storage medium, which are used for acquiring a plurality of first configuration files and a plurality of second configuration files of a software product deployment environment; converting each first configuration file and each second configuration file into a corresponding first check object and a corresponding second check object; comparing each first check object with each second check object one by adopting a preset difference comparison rule according to the first check object and the second check object with the check identification information to generate difference reports of the first check object and the second check object; and obtaining a verification result of the first configuration file and the second configuration file according to the difference report so as to adjust the deployment environment of the software product. The invention also relates to a blockchain technique, wherein the first configuration file and the second configuration file are stored in a blockchain. The invention realizes the comprehensive verification of the difference between the test environment and the production environment.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of understanding, a specific flow of the embodiment of the present invention is described below, and referring to fig. 1, a first embodiment of a configuration file difference checking method according to the embodiment of the present invention includes:
101. acquiring a plurality of first configuration files and a plurality of second configuration files of a software product deployment environment;
it is to be understood that the execution subject of the present invention may be a configuration file difference checking apparatus, and may also be a terminal or a server, which is not limited herein. The embodiment of the present invention is described by taking a server as an execution subject. It is emphasized that, to further ensure the privacy and security of the first and second profiles, the first and second profiles may also be stored in nodes of a blockchain.
In this embodiment, the software product deployment environment includes a test environment and a production environment where the software product is deployed; and the first configuration file and the second configuration file are a configuration file of a test environment and a configuration file of a production environment, respectively.
102. Converting each first configuration file and each second configuration file into a corresponding first check object and a corresponding second check object respectively, wherein the first check object and the second check object carry check identification information;
in this embodiment, the first configuration file and the second configuration file are original files of a test environment and a production environment, and may be recorded in a form of an HTML (HyperText Markup Language) character set. Due to the identification attribute of the HTML, if the first configuration file and the second configuration file are compared by using the HTML, it is difficult to compare the specific parameter contents of the first configuration file and the second configuration file, so that the first configuration file is converted into a first check object, and the second configuration file is converted into a second check object and is represented by a character string.
In addition, the verification identification information may be a filename suffix, and specifically includes: yml, json, properties, ini, conf, txt. Through the verification identification information, the first verification objects and the second verification objects can be classified respectively, so that the first verification objects and the second verification objects of the same type can be compared by using different comparison methods.
103. Comparing each first check object with each second check object one by adopting a preset difference comparison rule according to the check identification information to generate a difference report of the first check object and the second check object;
in this embodiment, the first check object and the second check object are classified according to the check identification information; according to the types of the first check object and the second check object, adopting corresponding preset difference comparison rules to compare the first check object and the second check object one by one to obtain the difference between the first check object and the second check object; and normalizing the difference between the two reports to generate a difference report of the two reports.
For example, for the first check object and the second check object which are in json format, the difference between the first check object and the second check object can be checked directly by using the difffer (). compare () method of the difflib library of python; and for the first check object and the second check object which are both txt format files, the difference between the two can be checked by using a text check tool such as Beyond company.
In addition, the discrepancy report includes a full data comparison report and a discrepancy data comparison report, the latter for presenting the discrepancy of the first profile and the second profile, and the former for assisting in locating the location of the discrepancy of the two.
104. Determining a discrepancy check result for the first profile and the second profile based on the discrepancy report.
In this embodiment, the verification result refers to a difference position and a difference content between the first configuration file and the second configuration file, and may be determined through a difference report.
Preferably, the verification result refers to a difference position and difference content of the second configuration file (production environment) relative to the first configuration file (test environment), so that the second configuration file can be modified based on the difference position and difference content with reference to the first configuration file to adjust the test environment in the software product deployment environment.
In the embodiment of the invention, a plurality of first configuration files and a plurality of second configuration files of a software product deployment environment are converted into a first check object and a second check object which are convenient for difference comparison; then comparing the verification identification information with the verification identification information to generate a difference report of the verification identification information and the verification identification information; and finally, the verification results corresponding to the first configuration file and the second configuration file are represented through the difference report, so that the comprehensive verification of the difference of the configuration files of the software product deployment environment is realized.
Referring to fig. 2, a second embodiment of the method for checking a configuration file according to the embodiment of the present invention includes:
201. acquiring a plurality of first configuration files and a plurality of second configuration files of a software product deployment environment;
202. converting each first configuration file and each second configuration file into a corresponding first check object and a corresponding second check object respectively, wherein the first check object and the second check object carry check identification information;
203. according to the verification identification information, dividing each first verification object into a first structured verification object and a first unstructured verification object, and dividing each second verification object into a second structured verification object and a second unstructured verification object;
in this embodiment, the structured check object means that the file set has a multi-layer structure, and is characterized in that the structure is basically uniform; the unstructured object generally refers to a self-defined special attribute file, and the degree of freedom of structural configuration is high when the unstructured object is characterized by the special attribute file. Where the structured check object includes a first structured check object and a second structured check object; the unstructured check objects include a first unstructured check object and a second unstructured check object.
Preferably, a file suffix is used as verification identification information to distinguish a structured verification object from an unstructured verification object; the file suffix of the structured check object comprises yml, json and the like, and is usually in a data exchange format; the file suffix of the unstructured check object comprises properties, ini, conf and txt.
204. Comparing the first structured check object with the second structured check object by adopting the first comparison rule to generate a full data comparison report of the first structured check object and the second structured check object;
in this embodiment, the structured verification object can directly compare the full data, and when a large number of verification objects are faced, the verification efficiency is increased; the comparison may specifically be performed using the Differ (). compare () method of the difflib library of python. The full data comparison report is represented in an HTML format file for locating the difference position between the first structured check object and the second structured check object.
205. Obtaining a configuration filtering list, wherein the configuration filtering list comprises historical deployment configurations and configurations which are irrelevant to the deployment environment of the software product;
in this embodiment, the configuration of the historical deployment includes:
A. irrelevant rules, such as non-code logic relevant configuration, for example, application relevant files are configured in a springclosed framework and are not changed all the time, and the configuration files do not need to be checked;
B. invalidation rules, such as historical version invalidation configurations.
While configurations that are not relevant to the software product deployment environment may include:
C. irrelevant configuration, such as environment difference configuration, does not need to pay attention to whether matching exists;
D. fault-tolerant rules, such as scenario version numbers, some scenarios have version numbers and some do not have version numbers in the scenario iteration process, and are not used as matching detection necessary conditions.
206. Screening out the first unstructured verification object and the second unstructured verification object corresponding to each configuration in the configuration filtering list;
in this embodiment, the specific screening method for the configuration of the historical deployment is as follows:
A. irrelevant rules are identified by configuring key fields, for example, regarding a relevant file of tfservingHost or tfservingPort, the relevant file can be specifically screened out by EXCEPT _ STR ═ #, tfservingHost, and tfservingPort;
B. the failure rule can be identified by a FILE name key, for example, for an application-related FILE, the failure rule can be specifically screened out by an EXCEPT _ FILE ═ application.
While configurations that are not relevant to the software product deployment environment may include:
C. irrelevant configuration can be identified by configuration keywords, for example, for the internal. scenes.v1 and the internal. scenes class file, the irrelevant configuration can be screened out by INVALID _ CFG ═ internal. scenes.v1 and internal. scenes;
D. fault tolerance rules can be identified by configuration keywords, for example, for some scenario version configuration, they can be screened out by INVALID _ CFG ═ version.
207. Comparing the first unstructured verification object with the second unstructured verification object by adopting the second comparison rule to generate a difference data comparison report of the first unstructured verification object and the second unstructured verification object;
in this embodiment, the unstructured verification object may compare the special attribute data, directly determine the difference content between the first unstructured verification object and the second unstructured verification object, and increase the verification accuracy; specifically, the comparison can be performed in a form of character string one-to-one comparison. And the difference data comparison report is displayed in a txt format file and is used for displaying the difference content of the first unstructured check object and the second unstructured check object.
208. Obtaining difference reports of the first check objects and the second check objects based on the full data comparison report and the difference data comparison report;
in this embodiment, a difference between the test environment and the production environment may be obtained by combining the full data comparison report and the difference data comparison report, where the full data report shows a difference in infrastructure between the test environment and the production environment; the difference data comparison report shows the difference in content between the test environment and the production environment.
209. Determining a discrepancy check result for the first profile and the second profile based on the discrepancy report.
In the embodiment of the invention, the comparison of a first check object and a second check object through a difference comparison rule is described in detail, and the comparison of full data of the first structured check object and the second structured check object is mainly performed through the first rule to obtain a corresponding full data comparison report so as to be used for quickly positioning the difference position of a first configuration file and a second configuration file; and then, carrying out difference data on the first unstructured verification object and the second unstructured verification object through a second rule to obtain a corresponding difference data comparison report so as to compare difference contents of the first configuration file and the second configuration file in detail.
Referring to fig. 3, a third embodiment of the method for checking a configuration file difference according to the embodiment of the present invention includes:
301. acquiring a plurality of first configuration files and a plurality of second configuration files of a software product deployment environment;
302. analyzing each first configuration file and each second configuration file to obtain a corresponding first configuration character set and a corresponding second configuration character set;
303. converting the first configuration character set into a plurality of first character strings by adopting a preset check format, and converting the second configuration character set into a plurality of second character strings by adopting the preset check format;
304. saving the first character string as a first check object and saving the second character string as a second check object, wherein the first check object and the second check object carry check identification information;
in this embodiment, the parsing process of the first configuration file and the second configuration file is as follows: the HTML parsing engine parses and converts the tag data in the HTML into a DOM (Document Object Model) node; then constructing a DOM tree according to the DOM node; a CSS (Cascading Style Sheets) parser parses an HTML Style file through an asynchronous thread to obtain a Style rule; constructing a Render tree through the DOM tree and the style rule; and finally, based on the Render tree, constructing context content through an HTML (hypertext markup language) analysis engine, generating a plurality of character strings from the context content, and storing the character strings in a database.
305. Comparing each first check object with each second check object one by adopting a preset difference comparison rule according to the check identification information to generate a difference report of the first check object and the second check object;
306. determining a discrepancy check result for the first profile and the second profile based on the discrepancy report.
In the embodiment of the invention, the process of converting the first configuration file and the second configuration file into the corresponding first check object and second check object respectively is described in detail, so that the comparison process can be simplified and the comparison range can be expanded.
Referring to fig. 4, a fourth embodiment of the method for checking a configuration file according to the embodiment of the present invention includes:
401. acquiring a plurality of first configuration files and a plurality of second configuration files of a software product deployment environment;
402. converting each first configuration file and each second configuration file into a corresponding first check object and a corresponding second check object respectively, wherein the first check object and the second check object carry check identification information;
403. according to the verification identification information, dividing each first verification object into a first structured verification object and a first unstructured verification object, and dividing each second verification object into a second structured verification object and a second unstructured verification object;
404. comparing the first structured check object with the second structured check object by adopting the first comparison rule to generate a full data comparison report of the first structured check object and the second structured check object;
405. acquiring configuration splicing logic of the software product deployment environment, and determining splicing nodes in the configuration splicing logic;
in this embodiment, configuring the splicing logic means implementing a configuration sequence of properties, ini, conf, txt type files of the software product deployment environment, and includes sequentially splicing multiple levels of subfiles under each type of file, where the subfile at the lowest level is an independent partition, and corresponding splicing nodes are constructed between different independent partitions; and finally, generating a corresponding dictionary template without data through the constructed splicing nodes.
406. Splicing the screened first unstructured check objects according to the splicing nodes to obtain corresponding first data dictionaries, and splicing the screened second unstructured check objects according to the splicing nodes to obtain corresponding second data dictionaries;
in this embodiment, the splicing nodes corresponding to the first unstructured verification object and the second unstructured verification object are the same, and if redundant first unstructured verification objects or second unstructured verification objects appear, the first unstructured verification objects and the second unstructured verification objects are directly used as difference data.
In this embodiment, a Key-Value pair is created according to subfiles of a first unstructured check object and a second unstructured check object pointed by each splicing node, where Key is used for indexing and Value is used for specific data content comparison; and respectively writing the first unstructured verification object and the second unstructured verification object into independent dictionary templates, and then correspondingly generating a corresponding first data dictionary and a corresponding second data dictionary.
407. Comparing the first unstructured verification object and the second unstructured verification object one by one according to the first data dictionary and the second data dictionary to generate a difference data comparison report of the first unstructured verification object and the second unstructured verification object;
in this embodiment, the Key indexes are used to traverse the first data dictionary and the second data dictionary to obtain corresponding data (Value) in the first unstructured check object and the second unstructured check object, and then the values are sequentially compared one by one to obtain difference data between the first unstructured check object and the second unstructured check object, and the difference data is written as a difference data comparison report.
After the difference data comparison report of the two, the method further comprises the following steps:
(1) judging whether a first unstructured check object or a second unstructured check object which is not compared exists or not;
(2) and if so, writing the first unstructured check object or the second unstructured check object which is not subjected to comparison into the difference data comparison report.
In this embodiment, the difference data comparison report includes the redundant first unstructured check object or the second unstructured check object that does not include the same node.
408. Determining a discrepancy check result for the first profile and the second profile based on the discrepancy report.
In the embodiment of the invention, the process of comparing the first unstructured verification object and the second unstructured verification object through the first rule is described in detail, and the detailed data in the first unstructured verification object and the second unstructured verification object are compared more finely and logically by establishing the first data dictionary and the second data dictionary and adopting a Key-Value data storage mode.
The above description of the configuration file difference checking method in the embodiment of the present invention, and the following description of the configuration file difference checking apparatus in the embodiment of the present invention, please refer to fig. 5, where an embodiment of the configuration file difference checking apparatus in the embodiment of the present invention includes:
an obtaining module 501, configured to obtain a plurality of first configuration files and a plurality of second configuration files of a software product deployment environment;
a conversion module 502, configured to convert each first configuration file and each second configuration file into a corresponding first check object and a corresponding second check object, where the first check object and the second check object carry check identification information;
a comparison module 503, configured to compare, according to the verification identification information, the first verification objects and the second verification objects one by using a preset difference comparison rule, and generate difference reports of the first verification objects and the second verification objects;
a generating module 504, configured to determine a difference check result of the first configuration file and the second configuration file based on the difference report.
In the embodiment of the invention, a plurality of first configuration files and a plurality of second configuration files of a software product deployment environment are converted into a first check object and a second check object which are convenient for difference comparison; then comparing the verification identification information with the verification identification information to generate a difference report of the verification identification information and the verification identification information; and finally, the verification results corresponding to the first configuration file and the second configuration file are represented through the difference report, so that the comprehensive verification of the difference of the configuration files of the software product deployment environment is realized.
Referring to fig. 6, another embodiment of the device for checking configuration file differences according to the embodiment of the present invention includes:
an obtaining module 501, configured to obtain a plurality of first configuration files and a plurality of second configuration files of a software product deployment environment;
a conversion module 502, configured to convert each first configuration file and each second configuration file into a corresponding first check object and a corresponding second check object, where the first check object and the second check object carry check identification information;
a comparison module 503, configured to compare, according to the verification identification information, the first verification objects and the second verification objects one by using a preset difference comparison rule, and generate difference reports of the first verification objects and the second verification objects;
a generating module 504, configured to determine a difference check result of the first configuration file and the second configuration file based on the difference report.
Specifically, the conversion module 502 includes:
an analyzing unit 5021, configured to analyze each first configuration file and each second configuration file to obtain a corresponding first configuration character set and a corresponding second configuration character set;
the conversion unit 5022 is configured to convert the first configuration character set into a plurality of first character strings by using a preset check format, and convert the second configuration character set into a plurality of second character strings by using a preset check format;
a saving unit 5023, configured to save the first character string as a first check object, and save the second character string as a second check object.
Specifically, the comparison module 503 includes:
a classifying unit 5031, configured to divide each first check object into a first structured check object and a first unstructured check object and divide each second check object into a second structured check object and a second unstructured check object according to the check identification information;
a first comparing unit 5032, configured to compare the first structured check object and the second structured check object by using the first comparison rule, and generate a full data comparison report of the first structured check object and the second structured check object;
a second comparing unit 5033, configured to compare the first unstructured verification object and the second unstructured verification object by using the second comparison rule, and generate a difference data comparison report between the first unstructured verification object and the second unstructured verification object;
a generating unit 5034, configured to obtain a difference report of each first check object and each second check object based on the full data comparison report and the difference data comparison report.
Specifically, before the second comparison unit 5033, a filter unit 5035 is further included, and the filter unit 5035 is configured to:
obtaining a configuration filtering list, wherein the configuration filtering list comprises historical deployment configurations and configurations which are irrelevant to the deployment environment of the software product;
and screening out the first unstructured check object and the second unstructured check object corresponding to each configuration in the configuration filtering list.
Specifically, the second comparing unit 5033 includes:
determining subunit 50331, configured to obtain configuration splicing logic of the software product deployment environment, and determine a splicing node in the configuration splicing logic;
a splicing subunit 50332, configured to splice, according to the splicing node, each first unstructured check object after being screened out to obtain a corresponding first data dictionary, and splice, according to the splicing node, each second unstructured check object after being screened out to obtain a corresponding second data dictionary;
a comparing subunit 50333, configured to compare the first unstructured verification object and the second unstructured verification object one by one according to the first data dictionary and the second data dictionary, and generate a difference data comparison report between the first unstructured verification object and the second unstructured verification object.
Specifically, after the comparing subunit, the method further includes:
a judging sub-unit 50334, configured to judge whether there is a first unstructured check object or a second unstructured check object that is not compared;
a writing sub-unit 50335, configured to, if there is a first unstructured check object or a second unstructured check object that is not compared, write the first unstructured check object or the second unstructured check object that is not compared into the difference data comparison report.
Specifically, the first configuration file and the plurality of second configuration files are stored in a blockchain.
In the embodiment of the invention, the comparison of a first check object and a second check object through a difference comparison rule is described in detail, and the comparison of full data of the first structured check object and the second structured check object is mainly performed through the first rule to obtain a corresponding full data comparison report so as to be used for quickly positioning the difference position of a first configuration file and a second configuration file; then, performing difference data on the first unstructured verification object and the second unstructured verification object through a second rule to obtain a corresponding difference data comparison report for comparing difference contents of the first configuration file and the second configuration file in detail; the process of converting the first configuration file and the second configuration file into the corresponding first check object and second check object respectively is further described in detail, so that the comparison process can be simplified and the comparison range can be expanded; the process of comparing the first unstructured verification object with the second unstructured verification object through the first rule is also introduced in detail, and the detailed data in the first unstructured verification object and the specific data in the second unstructured verification object are more favorably compared in a more detailed and more logical mode by establishing the first data dictionary and the second data dictionary and adopting a Key-Value data storage mode.
Fig. 5 and fig. 6 describe the configuration file difference checking apparatus in the embodiment of the present invention in detail from the perspective of the modular functional entity, and the configuration file difference checking apparatus in the embodiment of the present invention is described in detail from the perspective of hardware processing.
Fig. 7 is a schematic structural diagram of a profile difference checking apparatus 700 according to an embodiment of the present invention, where the profile difference checking apparatus 700 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 710 (e.g., one or more processors) and a memory 720, one or more storage media 730 (e.g., one or more mass storage devices) storing an application 733 or data 732. Memory 720 and storage medium 730 may be, among other things, transient storage or persistent storage. The program stored on the storage medium 730 may include one or more modules (not shown), each of which may include a sequence of instructions operating on the profile delta verification device 700. Further, the processor 710 may be configured to communicate with the storage medium 730 to execute a series of instruction operations in the storage medium 730 on the profile delta verification device 700.
The profile delta verification apparatus 700 may also include one or more power supplies 740, one or more wired or wireless network interfaces 750, one or more input-output interfaces 760, and/or one or more operating systems 731, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will appreciate that the configuration of the profile delta verification device shown in FIG. 7 does not constitute a limitation of the profile delta verification device and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
The present invention further provides a configuration file difference checking device, where the computer device includes a memory and a processor, where the memory stores computer readable instructions, and the computer readable instructions, when executed by the processor, cause the processor to execute the steps of the configuration file difference checking method in the foregoing embodiments.
The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, and which may also be a volatile computer-readable storage medium, having stored therein instructions, which, when run on a computer, cause the computer to perform the steps of the profile difference checking method.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A configuration file difference checking method is characterized by comprising the following steps:
acquiring a plurality of first configuration files and a plurality of second configuration files of a software product deployment environment;
converting each first configuration file and each second configuration file into a corresponding first check object and a corresponding second check object respectively, wherein the first check object and the second check object carry check identification information;
comparing each first check object with each second check object one by adopting a preset difference comparison rule according to the check identification information to generate a difference report of the first check object and the second check object;
determining a discrepancy check result for the first profile and the second profile based on the discrepancy report.
2. The method for configuration file difference check according to claim 1, wherein said converting each of the first configuration files and the second configuration files into a corresponding first check object and a corresponding second check object respectively comprises:
analyzing each first configuration file and each second configuration file to obtain a corresponding first configuration character set and a corresponding second configuration character set;
converting the first configuration character set into a plurality of first character strings by adopting a preset check format, and converting the second configuration character set into a plurality of second character strings by adopting the preset check format;
saving the first character string as a first check object, and saving the second character string as a second check object.
3. The method for configuration file difference check according to claim 1, wherein the difference comparison rules include a first comparison rule and a second comparison rule, and the comparing the first check objects and the second check objects one by using a preset difference comparison rule according to the check identification information to generate the difference report includes:
according to the verification identification information, dividing each first verification object into a first structured verification object and a first unstructured verification object, and dividing each second verification object into a second structured verification object and a second unstructured verification object;
comparing the first structured check object with the second structured check object by adopting the first comparison rule to generate a full data comparison report of the first structured check object and the second structured check object;
comparing the first unstructured verification object with the second unstructured verification object by adopting the second comparison rule to generate a difference data comparison report of the first unstructured verification object and the second unstructured verification object;
and obtaining difference reports of the first check objects and the second check objects based on the full data comparison report and the difference data comparison report.
4. The method for configuration file difference check according to claim 3, before said comparing the first unstructured check object and the second unstructured check object by using the second comparison rule, further comprising:
obtaining a configuration filtering list, wherein the configuration filtering list comprises historical deployment configurations and configurations which are irrelevant to the deployment environment of the software product;
and screening out the first unstructured check object and the second unstructured check object corresponding to each configuration in the configuration filtering list.
5. The method for configuration file difference check according to claim 3 or 4, wherein the comparing the first unstructured check object and the second unstructured check object by using the second comparison rule, and generating the difference data comparison report comprises:
acquiring configuration splicing logic of the software product deployment environment, and determining splicing nodes in the configuration splicing logic;
splicing the screened first unstructured check objects according to the splicing nodes to obtain corresponding first data dictionaries, and splicing the screened second unstructured check objects according to the splicing nodes to obtain corresponding second data dictionaries;
and comparing the first unstructured verification object and the second unstructured verification object one by one according to the first data dictionary and the second data dictionary to generate a difference data comparison report of the first unstructured verification object and the second unstructured verification object.
6. The method for configuration file difference check according to claim 5, after generating a difference data comparison report by comparing the first unstructured check object and the second unstructured check object one by one according to the first data dictionary and the second data dictionary, further comprising:
judging whether a first unstructured check object or a second unstructured check object which is not compared exists or not;
and if so, writing the first unstructured check object or the second unstructured check object which is not subjected to comparison into the difference data comparison report.
7. The method of claim 1, wherein the first configuration file and the plurality of second configuration files are stored in a blockchain.
8. A profile delta verification apparatus, comprising:
the system comprises an acquisition module, a configuration module and a management module, wherein the acquisition module is used for acquiring a plurality of first configuration files and a plurality of second configuration files of a software product deployment environment;
the conversion module is used for converting each first configuration file and each second configuration file into a corresponding first check object and a corresponding second check object respectively, wherein the first check object and the second check object carry check identification information;
the comparison module is used for comparing each first check object with each second check object one by adopting a preset difference comparison rule according to the check identification information to generate a difference report of the first check object and the second check object;
a generating module for determining a difference check result of the first configuration file and the second configuration file based on the difference report.
9. A profile delta verification device, comprising: a memory and at least one processor, the memory having instructions stored therein; the at least one processor invoking the instructions in the memory to cause the profile delta verification device to perform the profile delta verification method of any of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon, wherein the instructions, when executed by a processor, implement the profile discrepancy checking method as recited in any one of claims 1-7.
CN202011141161.4A 2020-10-22 2020-10-22 Configuration file difference checking method, device, equipment and storage medium Pending CN112256577A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011141161.4A CN112256577A (en) 2020-10-22 2020-10-22 Configuration file difference checking method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011141161.4A CN112256577A (en) 2020-10-22 2020-10-22 Configuration file difference checking method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112256577A true CN112256577A (en) 2021-01-22

Family

ID=74264009

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011141161.4A Pending CN112256577A (en) 2020-10-22 2020-10-22 Configuration file difference checking method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112256577A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113419739A (en) * 2021-06-22 2021-09-21 网易(杭州)网络有限公司 Node map difference detection method and device, electronic equipment and storage medium
CN113923119A (en) * 2021-10-09 2022-01-11 中国银行股份有限公司 Method and device for checking configuration parameters constructed by Maven project
US20220334953A1 (en) * 2019-12-10 2022-10-20 Hitachi, Ltd. Method and apparatus creating test environments for blockchain systems

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220334953A1 (en) * 2019-12-10 2022-10-20 Hitachi, Ltd. Method and apparatus creating test environments for blockchain systems
US11836071B2 (en) * 2019-12-10 2023-12-05 Hitachi, Ltd. Method and apparatus creating test environments for blockchain systems
CN113419739A (en) * 2021-06-22 2021-09-21 网易(杭州)网络有限公司 Node map difference detection method and device, electronic equipment and storage medium
CN113923119A (en) * 2021-10-09 2022-01-11 中国银行股份有限公司 Method and device for checking configuration parameters constructed by Maven project

Similar Documents

Publication Publication Date Title
US20210049092A1 (en) Analyzing software test failures using natural language processing and machine learning
CN112256577A (en) Configuration file difference checking method, device, equipment and storage medium
CN110309071B (en) Test code generation method and module, and test method and system
Barbour et al. An empirical study of faults in late propagation clone genealogies
CN102968374B (en) A kind of data warehouse method of testing
CN110765639B (en) Electrical simulation modeling method and device and readable storage medium
US20050257086A1 (en) Systems and methods for automated classification and analysis of large volumes of test result data
US20180060415A1 (en) Language tag management on international data storage
JP2012098797A (en) Method for producing rule for classifying structured documents, computer program therefor and computer
CN106059853B (en) A kind of network connectivty test method and device
US20220121562A1 (en) Platform Agnostic Library-Less Intelligent Test Automation by Reverse Engineering Product REST API Specification
CN112241360A (en) Test case generation method, device, equipment and storage medium
CN106570133B (en) A kind of construction method and device of visual webpage information extracting rule
US10121150B2 (en) Compliance as a service for an organization
US11822578B2 (en) Matching machine generated data entries to pattern clusters
CN104298603B (en) A kind of inspection method of the correctness of application system version structure
US11853196B1 (en) Artificial intelligence driven testing
CN117827923A (en) Query demand processing method and device, computer equipment and storage medium
US11526775B2 (en) Automatically evaluating application architecture through architecture-as-code
CN109426576A (en) Fault-tolerance processing method and fault-tolerant component
CN108629012B (en) Intelligent verification method and system for forensic data analysis accuracy
CN112671565A (en) 5G core network topology discovery method and device based on signaling link
Andonov et al. logs2graphs: Data-driven graph representation and visualization of log data
CN117370203B (en) Automatic test method, system, electronic equipment and storage medium
JP2012190284A (en) Ambiguous description automatic detection device and method for the same

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