CN110263305B - Configuration file comparison method, device, equipment and storage medium - Google Patents

Configuration file comparison method, device, equipment and storage medium Download PDF

Info

Publication number
CN110263305B
CN110263305B CN201910438043.0A CN201910438043A CN110263305B CN 110263305 B CN110263305 B CN 110263305B CN 201910438043 A CN201910438043 A CN 201910438043A CN 110263305 B CN110263305 B CN 110263305B
Authority
CN
China
Prior art keywords
configuration file
target configuration
target
comparison
environment information
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.)
Active
Application number
CN201910438043.0A
Other languages
Chinese (zh)
Other versions
CN110263305A (en
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 Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty 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 Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN201910438043.0A priority Critical patent/CN110263305B/en
Publication of CN110263305A publication Critical patent/CN110263305A/en
Application granted granted Critical
Publication of CN110263305B publication Critical patent/CN110263305B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/194Calculation of difference between files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a configuration file comparison method, a device, equipment and a storage medium, wherein the method comprises the following steps: receiving a configuration file comparison request sent by a user, wherein the configuration file comparison request comprises a comparison time point, a file name, first environment information and second environment information; if the current time reaches the comparison time point, respectively loading a first target configuration file under the first environment information and a second target configuration file under the second environment information, wherein the first configuration file and the second configuration file correspond to the file names; and comparing the first configuration parameters of the first target configuration file with the second configuration parameters of the second target configuration file, and setting out a comparison result. According to the configuration file comparison request, the target configuration files are compared and the comparison result is obtained, so that the efficiency and the success rate of configuration file comparison under different environments are improved.

Description

Configuration file comparison method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for comparing configuration files.
Background
If the content delivery of the configuration file changes while the operating system is being deployed, upgraded, running, or maintained, the developer and/or maintainer needs to check the differences between the numerous relevant configuration files before and after the change to find the problem and resolve it.
However, the current configuration file comparison tool can only compare the configuration files to be compared, which are uploaded by the user in time, and can only compare the configuration files according to the content of the configuration files, so that the comparison efficiency is low, and if the comparison tool is used for comparing the configuration files, the comparison failure is caused by different key values of the configuration files.
Disclosure of Invention
The invention provides a configuration file comparison method, a device, equipment and a storage medium, which aim to improve the efficiency and success rate of configuration file comparison under different environments.
In order to achieve the above object, the present invention provides a profile comparison method, which includes:
receiving a configuration file comparison request sent by a user, wherein the configuration file comparison request comprises a comparison time point, a file name, first environment information and second environment information;
if the current time reaches the comparison time point, respectively loading a first target configuration file under the first environment information and a second target configuration file under the second environment information, wherein the first configuration file and the second configuration file correspond to the file names;
and comparing the first configuration parameters of the first target configuration file with the second configuration parameters of the second target configuration file, and setting out a comparison result.
Preferably, the step of loading the first target configuration file under the first environmental information and the second target configuration file under the second environmental information respectively includes:
setting a first active attribute according to the first environment information, and loading the first target configuration file based on the first active attribute; and
and setting a second active attribute according to the second environment information, and loading the second target configuration file based on the second active attribute.
Preferably, the first configuration parameter includes a first key and a first key value, the second configuration parameter includes a second key and a second key value, the step of comparing the first configuration parameter of the first target configuration file with the second configuration parameter of the second target configuration file, and the step of setting aside the comparison result includes:
extracting a first key in the first target configuration file row by row;
searching a second key which is the same as the first key from the second target configuration file;
comparing a first key value in the first key with a second key value in the second key;
the comparison result of the first key value and the second key value is listed in the form of a table.
Preferably, the step of comparing the first configuration parameter of the first target configuration file with the second configuration parameter of the second target configuration file and setting aside the comparison result further includes:
recording a first delivery time point of the first target configuration file and a second delivery time point of the second target configuration file, wherein the first key value and the second key value are different;
acquiring a corresponding first historical submission record based on the first submission time point and a corresponding second historical submission record based on the second submission time point by using a git or svn tool;
searching a first submitter according to the first historical submission record, and searching a corresponding second submitter according to the second historical submission record;
and sending prompt information to the first submitter and/or the second submitter through a preset prompt path.
Preferably, the step of comparing the first configuration parameter of the first target configuration file with the second configuration parameter of the second target configuration file and setting aside the comparison result further includes:
detecting whether the user is online;
if the user is online, displaying the comparison result on a display interface of a user terminal corresponding to the user;
and if the user is not online, sending the comparison result to a preset receiving address.
Preferably, before the step of loading the first target configuration file under the first environmental information and the second target configuration file under the second environmental information, the method further includes:
searching the corresponding first target configuration file and second target configuration file according to the configuration file comparison request;
judging whether the first target configuration file or the second target configuration file is available;
if both the first target profile and the second target profile are available, performing the steps of: loading a first target configuration file under the first environment information and a second target configuration file under the second environment information respectively;
if one or more of the first target configuration file or the second target configuration file is unavailable, outputting prompt information that the current configuration file is unavailable, and judging whether the first target configuration file or the second target configuration file is available again after a preset time length.
Preferably, the step of determining whether the first target profile or the second target profile is available comprises:
checking whether the first target profile or the second target profile is accessed by an application;
if neither the first target configuration file nor the second target configuration file is accessed by the application program, determining that either the first target configuration file or the second target configuration file is available;
if one or more of the first target profile or the second target profile is accessed by the application, determining that the first target profile or the second target profile is not available.
In order to achieve the above object, the present invention further provides a profile comparison device, where the profile comparison device includes:
the receiving module is used for receiving a configuration file comparison request sent by a user, wherein the configuration file comparison request comprises a comparison time point, a file name, first environment information and second environment information;
the loading module is used for respectively loading a first target configuration file under the first environment information and a second target configuration file under the second environment information if the current time reaches the comparison time point, wherein the first configuration file and the second configuration file correspond to the file name;
and the comparison module is used for comparing the first configuration parameters of the first target configuration file with the second configuration parameters of the second target configuration file and setting aside a comparison result.
In order to achieve the above object, the present invention further provides a profile comparison device, which includes a processor, a memory, and a profile comparison program stored in the memory, wherein the profile comparison program implements the steps of the profile comparison method as described above when executed by the processor.
To achieve the above object, the present invention also provides a computer storage medium having a profile comparison program stored thereon, which when executed by a processor implements the steps of the profile comparison method as described above.
Compared with the prior art, the invention provides a configuration file comparison method, a device, equipment and a storage medium, wherein the method comprises the following steps: receiving a configuration file comparison request sent by a user, wherein the configuration file comparison request comprises a comparison time point, a file name, first environment information and second environment information; if the current time reaches the comparison time point, respectively loading a first target configuration file under the first environment information and a second target configuration file under the second environment information, wherein the first configuration file and the second configuration file correspond to the file names; and comparing the first configuration parameters of the first target configuration file with the second configuration parameters of the second target configuration file, and setting out a comparison result. According to the configuration file comparison request, the target configuration files are compared and the comparison result is obtained, so that the efficiency and the success rate of configuration file comparison under different environments are improved.
Drawings
FIG. 1 is a schematic hardware architecture of a profile comparison device according to various embodiments of the present invention;
FIG. 2 is a flow chart of a first embodiment of the profile comparison method of the present invention;
FIG. 3 is a flow chart of a second embodiment of the profile comparison method of the present invention;
fig. 4 is a schematic functional block diagram of a first embodiment of the profile comparison device according to the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The configuration file comparison device mainly related to the embodiment of the invention refers to network connection device capable of realizing network connection, and the configuration file comparison device can be a server, a cloud platform and the like.
Referring to fig. 1, fig. 1 is a schematic hardware structure of a profile comparison device according to various embodiments of the present invention. In an embodiment of the present invention, the profile comparison device may include a processor 1001 (e.g., a central processing unit Central Processing Unit, a CPU), a communication bus 1002, an input port 1003, an output port 1004, and a memory 1005. Wherein the communication bus 1002 is used to enable connected communications between these components; the input port 1003 is used for data input; the output port 1004 is used for data output, and the memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory, and the memory 1005 may be an optional storage device independent of the processor 1001. Those skilled in the art will appreciate that the hardware configuration shown in fig. 1 is not limiting of the invention and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
With continued reference to FIG. 1, the memory 1005 of FIG. 1, which is a readable storage medium, may include an operating system, a network communication module, an application program module, and a profile comparison program. In fig. 1, the network communication module is mainly used for connecting with a server and performing data communication with the server; and the processor 1001 may call the profile comparison program stored in the memory 1005 and execute the profile comparison method provided in the embodiment of the present invention.
The embodiment of the invention provides a configuration file comparison method.
Referring to fig. 2, fig. 2 is a flowchart of a first embodiment of the profile comparison method of the present invention.
In this embodiment, the profile comparison method is applied to a profile comparison device, and the method includes:
step S101, receiving a configuration file comparison request sent by a user, wherein the configuration file comparison request comprises comparison time points, file names, first environment information and second environment information;
in computer software development and practical applications, it is often necessary to save information of the system into a configuration file. Typically, the configuration file is a plain text file; the configuration file is represented in the form of rows, and the format of each row is as follows: key=value, or key:value, etc.; the key values of different rows are not identical. As system updates or application scales increase, the operating environment changes, configuration parameters of the configuration file may change, e.g., increase, decrease, or modify the configuration parameters.
In the implementation, a configuration file comparison request triggered by clicking a preset control in a configuration interface by a user is received. And acquiring comparison time points, file names, first environment information and second environment information which are set in the configuration file comparison request by a user. It will be appreciated that the comparison time point may be a current time point or a future time point, and that the comparison time point may be one or more. The file names refer to file names of two configuration files to be compared, and the file names of the two configuration files to be compared are generally the same because the configuration files of the same configuration file under different environments are compared in the embodiment. The first environment information includes one of a development environment, a test environment, and a production environment, the second environment information includes one of a development environment, a test environment, and a production environment, and the first environment information is not identical to the second environment information, for example, if the first environment information is a test environment, the second environment information is set as a generation environment.
Further, after the first environmental information and the second environmental information are acquired, comparing whether the first environmental information and the second environmental information are the same or not; if the first environmental information is the same as the second environmental information, judging that the environmental information is unreasonable in setting, and outputting a prompt that the environmental information is unreasonable in setting; and if the first environmental information is different from the second environmental information, judging that the environmental information is reasonably set.
Step S102, if the current time reaches the comparison time point, loading a first target configuration file under the first environment information and a second target configuration file under the second environment information respectively, wherein the first configuration file and the second configuration file correspond to the file names;
in this embodiment, after the configuration file comparison request is received, a preset clock is started, and if the current time reaches the comparison time point, the first target configuration file and the second target configuration file which need to be compared are loaded.
Specifically, the step of loading the first target configuration file under the first environmental information and the second target configuration file under the second environmental information respectively includes: setting a first active attribute according to the first environment information, and loading the first target configuration file based on the first active attribute; and setting a second active attribute according to the second environment information, and loading the second target configuration file based on the second active attribute. The different environments all have corresponding unique default active attributes, and in general, the active attribute of the development environment is dev, the active attribute of the test environment is test, and the active attribute of the production environment is prod. In this embodiment, the application, properties, and the second active attribute are set in the application, properties file, and active attribute, where the first active attribute corresponds to the first environmental information, and the second active attribute corresponds to the second environmental information. After the first environment information and/or the second environment information are set, the configuration file comparison device automatically loads the corresponding configuration file according to the first active attribute and/or the second active attribute, for example, if the first active attribute is test, the configuration file comparison device loads the configuration file of the test environment.
Further, since the file names of the same configuration file under different environments are generally the same, the file name of the first target configuration file is generally the same as the file name of the second target configuration file. For example, the file names are all application01.
Step S103, comparing the first configuration parameter of the first target configuration file with the second configuration parameter of the second target configuration file, and setting aside a comparison result.
Generally, the configuration parameters include keys and key values, the key values include actual configuration information and data used when the system and the application program execute, and the key values include multiple data types to adapt to the use requirements of different environments, and the configuration files manage various information according to the keys and the key values. In this embodiment, the first configuration parameter includes a first key and a first key value, and the second configuration parameter includes a second key and a second key value.
The step of comparing the first configuration parameters of the first target configuration file with the second configuration parameters of the second target configuration file and setting aside a comparison result includes: extracting a first key in the first target configuration file row by row; searching a second key which is the same as the first key from the second target configuration file; comparing a first key value in the first key with a second key value in the second key; the comparison result of the first key value and the second key value is listed in the form of a table. And comparing the first key value in the first key with the second key value in the second key to obtain a comparison result.
Generally, if a second key corresponding to the first key exists in the second target configuration file, and the second key value is the same as the first key value, it is indicated that the second target configuration file has the same configuration parameters as the first target configuration file; if a second key corresponding to the first key exists in the second target configuration file, but the second key value is different from the first key value, the key value is modified; and if the second key corresponding to the first key does not exist in the second target configuration file, deleting the configuration parameters corresponding to the first key.
Further, the step of comparing the first configuration parameter of the first target configuration file with the second configuration parameter of the second target configuration file and setting aside the comparison result further includes: detecting whether the user is online; if the user is online, displaying the comparison result on a display interface of a user terminal corresponding to the user; and if the user is not online, sending the comparison result to a preset receiving address. Thus, if the user sets one or more future time points in the profile comparison request, one or more comparison needs to be performed according to the time points, and a corresponding one or more comparison results are obtained. However, the user may not be online after setting the configuration file comparison request, and after obtaining the comparison result, the comparison result is sent to a receiving address preset by the user for the user to view in time, where the receiving address includes a cloud platform, a mailbox address, and the like.
Further, before the step of loading the first target configuration file under the first environmental information and the second target configuration file under the second environmental information, the method further includes:
step a: searching the corresponding first target configuration file and second target configuration file according to the configuration file comparison request;
typically, the first target profile and/or the second target profile are stored in a database. Firstly, searching a corresponding file according to the file name of the configuration file, then determining the first target configuration file according to the first environment information, and determining the second target configuration file according to the second environment information.
In this embodiment, it is required to determine whether the first target configuration file or the second target configuration file exists in a database according to the file name, the first environmental information, and/or the second environmental information; and if the first target configuration file and the second target configuration file corresponding to the file name, the first environment information and/or the second environment information are configured in the database, judging that the first target configuration file and the second target configuration file are both in the database.
Step b: judging whether the first target configuration file or the second target configuration file is available;
specifically, checking whether the first target profile or the second target profile is accessed by an application; if neither the first target configuration file nor the second target configuration file is accessed by the application program, determining that either the first target configuration file or the second target configuration file is available; if one or more of the first target profile or the second target profile is accessed by the application, determining that the first target profile or the second target profile is not available. Further, if one or more of the first target configuration file or the second target configuration file is accessed by the application program, whether the application program is a disconnectable preset application program is further judged, if the application program is the preset application program, connection between the first target configuration file and/or the second target configuration file and the preset application program is disconnected, and the first target configuration file and/or the second target configuration file is marked as available.
If both the first target profile and the second target profile are available, performing the steps of: loading a first target configuration file under the first environment information and a second target configuration file under the second environment information respectively; if one or more of the first target configuration file or the second target configuration file is unavailable, outputting prompt information that the current configuration file is unavailable, and judging whether the first target configuration file or the second target configuration file is available again after a preset time length.
According to the technical scheme, the configuration file comparison request sent by the user is received, wherein the configuration file comparison request comprises comparison time points, file names, first environment information and second environment information; if the current time reaches the comparison time point, respectively loading a first target configuration file under the first environment information and a second target configuration file under the second environment information, wherein the first configuration file and the second configuration file correspond to the file names; and comparing the first configuration parameters of the first target configuration file with the second configuration parameters of the second target configuration file, and setting out a comparison result. Therefore, the target configuration files are compared according to the configuration file comparison request, and comparison results are listed, so that the efficiency and success rate of configuration file comparison under different environments are improved.
As shown in fig. 3, a second embodiment of the present invention proposes a configuration file comparing method, based on the first embodiment shown in fig. 2, wherein the step of comparing the first configuration parameter of the first target configuration file with the second configuration parameter of the second target configuration file, and setting aside the comparison result further includes:
step S201: recording a first delivery time point of the first target configuration file and a second delivery time point of the second target configuration file, wherein the first key value and the second key value are different;
in this embodiment, when the first key value is different from the second key value, it is indicated that the first key and the second key corresponding to the first key value and the second key value are changed, and in the running process of the system, the reason of the change often needs to be known, and if the change is abnormal, the corresponding submitter needs to be searched for, and correction needs to be performed in time. When the first key value is found to be different from the second key value, recording a first delivery time point of the corresponding first target configuration file and a second delivery time point of the second target configuration file
Step S202: acquiring a corresponding first historical submission record based on the first submission time point and a corresponding second historical submission record based on the second submission time point by using a git or svn tool;
either git or svn are version control tools for managing data that changes over time. These data are placed in a central data repository that records the changes of each file. Thus, the archive can be restored to an old version or the change history of the file can be browsed through the git or svn tool.
In this embodiment, the git or svn tool is used to obtain a corresponding first history submission record based on the first submission time point, and obtain a corresponding second history submission record based on the second submission time point. For example, comparing a.properties configuration file in a test environment and a production environment, adding a configuration item my name=hello World for 11 months and 5 days, triggering a configuration file comparison request for 11 months and 7 days, comparing to find that a first key value of my name in a first target comparison file in the test environment is different from a second key value in a second target comparison file in the production environment, recording the first key value in the first target comparison file in the test environment and the second key value in the second target comparison file in the production environment, and recording the time point of adding the configuration item for 11 months and 5 days into the comparison result.
Step S203: searching a first submitter according to the first historical submission record, and searching a corresponding second submitter according to the second historical submission record;
specifically, based on the obtained first history record and the second history record, a corresponding first presenter or second presenter is searched.
Step S204: and sending prompt information to the first submitter and/or the second submitter through a preset prompt path.
In this embodiment, the prompting path includes mail, short message, etc. And sending prompt information to the first submitter and/or the second submitter so as to enable the first submitter and/or the second submitter to confirm or correct in time.
Further, the priority of the prompt information may be set according to the relationship between the first key value and the second key value. For example, if the relation between the first key value and the second key value is new or deleted, the priority is set to be first level, and if the relation between the first key value and the second key value is modified, the priority is set to be second level. And sequentially sending corresponding prompt information to the first submitter and/or the second submitter according to the priority.
According to the embodiment, through the scheme, the first submitting time point of the first target configuration file and the second submitting time point of the second target configuration file, wherein the first key value and the second key value are different, are recorded; acquiring a corresponding first historical submission record based on the first submission time point and a corresponding second historical submission record based on the second submission time point by using a git or svn tool; searching a first submitter according to the first historical submission record, and searching a corresponding second submitter according to the second historical submission record; and sending prompt information to the first submitter and/or the second submitter through a preset prompt path. Therefore, the corresponding submitters are searched by acquiring the historical submission records, so that the submitters can solve the problems in time, and the efficiency and the success rate of configuration file comparison under different environments are further improved.
In addition, the embodiment also provides a configuration file comparison device. Referring to fig. 4, fig. 4 is a schematic functional block diagram of a first embodiment of a profile comparison apparatus according to the present invention.
The people counting device provided by the invention is a virtual device, which is stored in the memory 1005 of the profile comparison device shown in fig. 1, so as to realize all functions of the profile comparison program: the method comprises the steps of receiving a configuration file comparison request sent by a user, wherein the configuration file comparison request comprises comparison time points, file names, first environment information and second environment information; if the current time reaches the comparison time point, respectively loading a first target configuration file under the first environment information and a second target configuration file under the second environment information, wherein the first configuration file and the second configuration file correspond to the file names;
and the first configuration parameters of the first target configuration file are compared with the second configuration parameters of the second target configuration file, and a comparison result is listed.
Specifically, the configuration file comparing device in this embodiment includes:
the receiving module 10 is configured to receive a profile comparison request sent by a user, where the profile comparison request includes a comparison time point, a file name, first environment information, and second environment information;
the loading module 20 is configured to load a first target configuration file under the first environmental information and a second target configuration file under the second environmental information, respectively, if the current time reaches the comparison time point, where the first configuration file and the second configuration file both correspond to the file name;
and the comparison module 30 is configured to compare the first configuration parameter of the first target configuration file with the second configuration parameter of the second target configuration file, and to set aside a comparison result.
Further, the loading module is further configured to:
setting a first active attribute according to the first environment information, and loading the first target configuration file based on the first active attribute; and
and setting a second active attribute according to the second environment information, and loading the second target configuration file based on the second active attribute.
Further, the comparison module is further configured to:
extracting a first key in the first target configuration file row by row;
searching a second key which is the same as the first key from the second target configuration file;
comparing a first key value in the first key with a second key value in the second key;
the comparison result of the first key value and the second key value is listed in the form of a table.
Further, the comparison module is further configured to:
recording a first delivery time point of the first target configuration file and a second delivery time point of the second target configuration file, wherein the first key value and the second key value are different;
acquiring a corresponding first historical submission record based on the first submission time point and a corresponding second historical submission record based on the second submission time point by using a git or svn tool;
searching a first submitter according to the first historical submission record, and searching a corresponding second submitter according to the second historical submission record;
and sending prompt information to the first submitter and/or the second submitter through a preset prompt path.
Further, the comparison module is further configured to:
detecting whether the user is online;
if the user is online, displaying the comparison result on a display interface of a user terminal corresponding to the user;
and if the user is not online, sending the comparison result to a preset receiving address.
Further, the loading module is further configured to:
searching the corresponding first target configuration file and second target configuration file according to the configuration file comparison request;
judging whether the first target configuration file or the second target configuration file is available;
if both the first target profile and the second target profile are available, performing the steps of: loading a first target configuration file under the first environment information and a second target configuration file under the second environment information respectively;
if one or more of the first target configuration file or the second target configuration file is unavailable, outputting prompt information that the current configuration file is unavailable, and judging whether the first target configuration file or the second target configuration file is available again after a preset time length.
Further, the loading module is further configured to:
checking whether the first target profile or the second target profile is accessed by an application;
if neither the first target configuration file nor the second target configuration file is accessed by the application program, determining that either the first target configuration file or the second target configuration file is available;
if one or more of the first target profile or the second target profile is accessed by the application, determining that the first target profile or the second target profile is not available.
In addition, the present invention further provides a computer storage medium, where a configuration file comparison program is stored, and when the configuration file comparison program is executed by a processor, the steps of the configuration file comparison method described above are implemented, which is not described herein again.
Compared with the prior art, the configuration file comparison method, the device, the equipment and the storage medium provided by the invention comprise the following steps: receiving a configuration file comparison request sent by a user, wherein the configuration file comparison request comprises a comparison time point, a file name, first environment information and second environment information; if the current time reaches the comparison time point, respectively loading a first target configuration file under the first environment information and a second target configuration file under the second environment information, wherein the first configuration file and the second configuration file correspond to the file names; and comparing the first configuration parameters of the first target configuration file with the second configuration parameters of the second target configuration file, and setting out a comparison result. According to the configuration file comparison request, the target configuration files are compared and the comparison result is obtained, so that the efficiency and the success rate of configuration file comparison under different environments are improved.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising several instructions for causing a terminal device to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the invention, and all equivalent structures or modifications in the structures or processes described in the specification and drawings, or the direct or indirect application of the present invention to other related technical fields, are included in the scope of the present invention.

Claims (6)

1. A profile comparison method, the method comprising:
receiving a configuration file comparison request sent by a user, wherein the configuration file comparison request comprises a comparison time point, a file name, first environment information and second environment information;
if the current time reaches the comparison time point, respectively loading a first target configuration file under the first environment information and a second target configuration file under the second environment information, wherein the first target configuration file and the second target configuration file correspond to the file names;
comparing the first configuration parameters of the first target configuration file with the second configuration parameters of the second target configuration file, and setting out a comparison result;
the step of loading the first target configuration file under the first environment information and the second target configuration file under the second environment information respectively comprises the following steps:
setting a first active attribute according to the first environment information, and loading the first target configuration file based on the first active attribute; and
setting a second active attribute according to the second environment information, and loading the second target configuration file based on the second active attribute;
the first configuration parameters comprise a first key and a first key value, the second configuration parameters comprise a second key and a second key value, the step of comparing the first configuration parameters of the first target configuration file with the second configuration parameters of the second target configuration file and setting aside a comparison result comprises the following steps:
extracting a first key in the first target configuration file row by row;
searching a second key which is the same as the first key from the second target configuration file;
comparing a first key value in the first key with a second key value in the second key;
listing the comparison result of the first key value and the second key value in a table form;
the step of comparing the first configuration parameters of the first target configuration file with the second configuration parameters of the second target configuration file and setting aside the comparison result further comprises:
recording a first delivery time point of the first target configuration file and a second delivery time point of the second target configuration file, wherein the first key value and the second key value are different;
acquiring a corresponding first historical submission record based on the first submission time point and a corresponding second historical submission record based on the second submission time point by using a git or svn tool;
searching a first submitter according to the first historical submission record, and searching a corresponding second submitter according to the second historical submission record;
sending prompt information to the first submitter and/or the second submitter through a preset prompt path;
the step of loading the first target configuration file under the first environment information and the second target configuration file under the second environment information respectively further comprises the following steps:
searching the corresponding first target configuration file and second target configuration file according to the configuration file comparison request;
judging whether the first target configuration file or the second target configuration file is available;
if both the first target profile and the second target profile are available, performing the steps of: loading a first target configuration file under the first environment information and a second target configuration file under the second environment information respectively;
if one or more of the first target configuration file or the second target configuration file is unavailable, outputting prompt information that the current configuration file is unavailable, and judging whether the first target configuration file or the second target configuration file is available again after a preset time length.
2. The method of claim 1, wherein comparing the first configuration parameters of the first target configuration file with the second configuration parameters of the second target configuration file, and wherein the step of juxtaposing the comparison result further comprises:
detecting whether the user is online;
if the user is online, displaying the comparison result on a display interface of a user terminal corresponding to the user;
and if the user is not online, sending the comparison result to a preset receiving address.
3. The method of claim 1, wherein the step of determining whether the first target profile or the second target profile is available comprises:
checking whether the first target profile or the second target profile is accessed by an application;
if neither the first target configuration file nor the second target configuration file is accessed by the application program, determining that either the first target configuration file or the second target configuration file is available;
if one or more of the first target profile or the second target profile is accessed by the application, determining that the first target profile or the second target profile is not available.
4. A profile comparison apparatus, the profile comparison apparatus comprising:
the receiving module is used for receiving a configuration file comparison request sent by a user, wherein the configuration file comparison request comprises a comparison time point, a file name, first environment information and second environment information;
the loading module is used for respectively loading a first target configuration file under the first environment information and a second target configuration file under the second environment information if the current time reaches the comparison time point, wherein the first target configuration file and the second target configuration file correspond to the file names;
the comparison module is used for comparing the first configuration parameters of the first target configuration file with the second configuration parameters of the second target configuration file, and obtaining a comparison result;
the loading module is further configured to set a first active attribute according to the first environment information, and load the first target configuration file based on the first active attribute; setting a second active attribute according to the second environment information, and loading the second target configuration file based on the second active attribute;
the comparison module is further used for extracting a first key in the first target configuration file row by row; searching a second key which is the same as the first key from the second target configuration file; comparing a first key value in the first key with a second key value in the second key; listing the comparison result of the first key value and the second key value in a table form;
the comparison module is further configured to record a first delivery time point of the first target configuration file and a second delivery time point of the second target configuration file, where the first key value and the second key value are different; acquiring a corresponding first historical submission record based on the first submission time point and a corresponding second historical submission record based on the second submission time point by using a git or svn tool; searching a first submitter according to the first historical submission record, and searching a corresponding second submitter according to the second historical submission record; sending prompt information to the first submitter and/or the second submitter through a preset prompt path;
the loading module is further configured to search the corresponding first target configuration file and second target configuration file according to the configuration file comparison request; judging whether the first target configuration file or the second target configuration file is available; if both the first target profile and the second target profile are available, performing the steps of: loading a first target configuration file under the first environment information and a second target configuration file under the second environment information respectively; if one or more of the first target configuration file or the second target configuration file is unavailable, outputting prompt information that the current configuration file is unavailable, and judging whether the first target configuration file or the second target configuration file is available again after a preset time length.
5. A profile comparison device, characterized in that it comprises a processor, a memory and a profile comparison program stored in the memory, which, when being executed by the processor, implements the steps of the profile comparison method according to any one of claims 1-3.
6. A computer storage medium, wherein a profile comparison program is stored on the computer storage medium, which profile comparison program, when executed by a processor, implements the steps of the profile comparison method according to any one of claims 1-3.
CN201910438043.0A 2019-05-22 2019-05-22 Configuration file comparison method, device, equipment and storage medium Active CN110263305B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910438043.0A CN110263305B (en) 2019-05-22 2019-05-22 Configuration file comparison method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910438043.0A CN110263305B (en) 2019-05-22 2019-05-22 Configuration file comparison method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110263305A CN110263305A (en) 2019-09-20
CN110263305B true CN110263305B (en) 2023-09-19

Family

ID=67915343

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910438043.0A Active CN110263305B (en) 2019-05-22 2019-05-22 Configuration file comparison method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110263305B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538542B (en) * 2020-03-24 2023-10-24 中国平安人寿保险股份有限公司 System configuration method and related device
CN112579205B (en) * 2020-12-24 2023-02-14 平安普惠企业管理有限公司 Configuration file checking method and device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005250744A (en) * 2004-03-03 2005-09-15 Kddi Corp Personal environment profile server
US7606889B1 (en) * 2006-06-30 2009-10-20 Emc Corporation Methods and systems for comparing storage area network configurations
CN104699508A (en) * 2015-03-25 2015-06-10 南京大学 System and method for quickly arranging and updating virtual environment in cloud computing platform
CN105824792A (en) * 2016-03-18 2016-08-03 ***股份有限公司 Text comparison method and equipment
CN107992409A (en) * 2017-11-21 2018-05-04 平安养老保险股份有限公司 Method for generating test case, device, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9183062B2 (en) * 2013-02-25 2015-11-10 International Business Machines Corporation Automated application reconfiguration

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005250744A (en) * 2004-03-03 2005-09-15 Kddi Corp Personal environment profile server
US7606889B1 (en) * 2006-06-30 2009-10-20 Emc Corporation Methods and systems for comparing storage area network configurations
CN104699508A (en) * 2015-03-25 2015-06-10 南京大学 System and method for quickly arranging and updating virtual environment in cloud computing platform
CN105824792A (en) * 2016-03-18 2016-08-03 ***股份有限公司 Text comparison method and equipment
CN107992409A (en) * 2017-11-21 2018-05-04 平安养老保险股份有限公司 Method for generating test case, device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
配置文件在无操作***保护装置中的应用;张宏波 等;水电自动化与大坝监测(06);第32-35页 *

Also Published As

Publication number Publication date
CN110263305A (en) 2019-09-20

Similar Documents

Publication Publication Date Title
US8214508B2 (en) Support apparatus, program, information processing system and support method
CN110457260B (en) File processing method, device, equipment and computer readable storage medium
KR20130126930A (en) Using text messages to interact with spreadsheets
CN108415998B (en) Application dependency relationship updating method, terminal, device and storage medium
CN110263305B (en) Configuration file comparison method, device, equipment and storage medium
CN106101256A (en) Method and apparatus for synchrodata
CN110766521A (en) Method, device and system for generating purchase order and storage medium
WO2020233351A1 (en) Blockchain-oriented data management method, apparatus and device, and storage medium
CN112765102B (en) File system management method and device
CN113918437A (en) User behavior data analysis method and device, computer equipment and storage medium
CN113221036A (en) Method and device for processing electronic bill mail
US8190559B2 (en) Document management apparatus, storage medium storing program for document management apparatus, and method for managing documents
CN109271431B (en) Data extraction method, device, computer equipment and storage medium
CN107798250B (en) Sensitive information shielding rule issuing method, application server and computer readable storage medium
CN113778950B (en) Method for acquiring trusted file, index server, query server and medium
CN112465612A (en) Receipt information processing method and device, computer equipment and storage medium
CN112579589B (en) Information importing method and device
US11023830B2 (en) Processing a request in accordance with original rules and configurations
CN112417012A (en) Data processing method and system
CN113051376A (en) Information processing apparatus, recording medium, and information processing method
CN113626409B (en) Test data processing method, device, equipment and storage medium
JP2014235583A (en) Data migration system and data migration method
CN111382060A (en) File distribution record processing method, electronic device and computer storage medium
US12032589B2 (en) Bypassing database automations
CN117131114A (en) Customer group list management method, device, terminal 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
GR01 Patent grant
GR01 Patent grant