CN109976828A - A kind of method and device of configuration file - Google Patents

A kind of method and device of configuration file Download PDF

Info

Publication number
CN109976828A
CN109976828A CN201910185358.9A CN201910185358A CN109976828A CN 109976828 A CN109976828 A CN 109976828A CN 201910185358 A CN201910185358 A CN 201910185358A CN 109976828 A CN109976828 A CN 109976828A
Authority
CN
China
Prior art keywords
file
parameter
modified
stored location
pair
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.)
Granted
Application number
CN201910185358.9A
Other languages
Chinese (zh)
Other versions
CN109976828B (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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201910185358.9A priority Critical patent/CN109976828B/en
Publication of CN109976828A publication Critical patent/CN109976828A/en
Application granted granted Critical
Publication of CN109976828B publication Critical patent/CN109976828B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Abstract

A kind of method and device of configuration file provided in an embodiment of the present invention, method include: to obtain the corresponding reference file of file to be configured when needing the file to be configured to service to be configured to configure;In pre-stored location, detect whether there is the file destination to match with the reference file;If in pre-stored location, there are the file destinations to match with reference file for detection, then judge the parameter to match with the parameter of the reference file whether is stored in pre-stored location, if it is present obtaining the parameter to match with the parameter of reference file from pre-stored location;The parameter that parameter with reference file matches is added in file to be configured, completes to treat the parameter configuration of configuration file, the file to be configured after parameter will have been added as file destination.It is thus possible to improve configuring the allocative efficiency of configuration file under different application environment.

Description

A kind of method and device of configuration file
Technical field
The present invention relates to the field of test technology, more particularly to a kind of method and device of configuration file.
Background technique
Often there are a variety of environment in exploitation in user.Exploitation, test and production need to be matched according to different application environments Set multiple files.The prior art configures the file under different application environment by manual operation, since the process of configuration file walks Rapid complicated and file parameter is more, and artificial configuration has the case where repeating configuration and leakage, and is easy different application ring Parameter mismatch under border, cause to service and do not start normally, therefore the file under prior art arrangement different application environment is matched It is lower to set efficiency.
Summary of the invention
A kind of method and device for being designed to provide configuration file of the embodiment of the present invention improves configuration different application ring The efficiency of configuration file under border.Specific technical solution is as follows:
In a first aspect, a kind of method of configuration file provided in an embodiment of the present invention, comprising:
When needing the file to be configured to service to be configured to configure, the corresponding benchmark text of file to be configured is obtained Part;
In pre-stored location, detect whether there are the file destination to match with the reference file, the clothes of file destination Title of being engaged in is identical as the service name of reference file, and the parameter of file destination and the parameter of reference file correspond, target text The application environment of part and the application environment of reference file are corresponding;
If in pre-stored location, detecting not there are the file destination to match with reference file, then judging pre-stored location In whether store the parameter to match with the parameter of reference file, if it is present obtaining from pre-stored location with reference file The parameter that parameter matches;
The parameter that parameter with reference file matches is added in file to be configured, the ginseng for treating configuration file is completed Number configuration will add the file to be configured after parameter as file destination, the service name and reference file of file to be configured Service name it is identical, the application environment of file to be configured and the application environment of reference file are corresponding.
Optionally, in pre-stored location, detect whether there is the file destination to match with reference file, comprising:
In the file pair of pre-stored location storage, detect whether there is the file destination to match with reference file, file It include environment on test environment and line to the application environment comprising a pair of of file, a pair of file;
Or,
In the file with reference file different application environment of pre-stored location storage, detect whether to exist and reference file The file destination to match.
Optionally, a kind of method for configuration file that first aspect present invention embodiment provides further include:
Whether the parameter of the file pair stored in detection pre-stored location corresponds;
If the parameter of the file pair of pre-stored location storage is not to correspond, the second prompt information is sent to user, Second prompt information for reminding user to determine file to be modified, and the parameter of file to be modified is deleted, increase newly or Modification;
User is received to delete the parameter in file to be modified according to the second prompt information, feedback is received, increase newly Or the operation of modification.
Optionally, if the parameter of the file pair of pre-stored location storage is not to correspond, second is sent to user and is mentioned Show that information includes:
If the parameter of the file pair of pre-stored location storage is not to correspond, third prompt information is sent to user, Third prompt information determines file to be modified for reminding user in file pair;
User is received according to reception third prompt information, the operation of the determination of feedback file to be modified, in file to be modified Parameter more than non-file to be modified parameter in the case of, delete not corresponding with the parameter of non-file to be modified in file to be modified Parameter;
In the case where the parameter of file to be modified is less than the parameter of non-file to be modified, parameter to be configured is determined, wait match Set the parameter that parameter is missing documents to be modified;
Judge whether to store in pre-stored location with parameter to be configured, if it is present obtaining ginseng to be configured from pre-stored location Number, by parameter configuration to be configured into file to be modified, the ginseng of parameter and non-file to be modified with the file to be modified postponed Number corresponds;
If not stored in pre-stored location and parameter to be configured, the 4th prompt information, the 4th prompt letter are sent to user Breath is for reminding user to increase or modify the parameter of file to be modified newly;
It receives user and the parameter in file to be modified is increased newly or repaired according to the 4th prompt information, feedback is received The operation changed.
Optionally, it is added in file to be configured in the parameter that the parameter with reference file matches, ginseng will have been added After the step of file to be configured after number is as file destination, a kind of configuration file that first aspect present invention embodiment provides Method further include:
Using the parameter of file destination and the parameter of reference file as parameter pair;
Using file destination and reference file as file pair;
By file pair and parameter to storing into pre-stored location.
Second aspect, a kind of device of configuration file provided in an embodiment of the present invention, comprising:
File acquisition module, for obtaining to be configured when needing the file to be configured to service to be configured to configure The corresponding reference file of file;
File detection module, in pre-stored location, detecting whether there is the file destination to match with reference file, The service name of file destination and the service name of reference file are identical, and the parameter of the parameter of file destination and reference file is one by one Corresponding, the application environment of file destination and the application environment of reference file are corresponding;
Parameter acquisition module, if there are the target to match with reference file texts for detection in pre-stored location Part then judges the parameter to match with the parameter of reference file whether is stored in pre-stored location, if it is present from pre-stored location Obtain the parameter to match with the parameter of reference file;
File configuration module, the parameter for the parameter with reference file to match is added in file to be configured, complete The parameter configuration of pairs of file to be configured, will add the file to be configured after parameter as file destination, file to be configured Service name is identical as the service name of reference file, the application environment of file to be configured and the application environment pair of reference file It answers.
Optionally, file detection module is specifically used for:
In the file pair of pre-stored location storage, detect whether there is the file destination to match with reference file, file It include environment on test environment and line to the application environment comprising a pair of of file, a pair of file;
Or,
In the file with reference file different application environment of pre-stored location storage, detect whether to exist and reference file The file destination to match.
A kind of device for configuration file that second aspect of the present invention embodiment provides further include:
To lighting module, whether the parameter for detecting the file pair stored in pre-stored location corresponds parameter;
If the parameter of the file pair of pre-stored location storage is not to correspond, the second prompt information is sent to user, Second prompt information for reminding user to determine file to be modified, and the parameter of file to be modified is deleted, increase newly or Modification;
User is received to delete the parameter in file to be modified according to the second prompt information, feedback is received, increase newly Or the operation of modification.
Optionally, parameter is used for lighting module:
If the parameter of the file pair of pre-stored location storage is not to correspond, third prompt information is sent to user, Third prompt information determines file to be modified for reminding user in file pair;
User is received according to reception third prompt information, the operation of the determination of feedback file to be modified, in file to be modified Parameter more than non-file to be modified parameter in the case of, delete not corresponding with the parameter of non-file to be modified in file to be modified Parameter;
In the case where the parameter of file to be modified is less than the parameter of non-file to be modified, parameter to be configured is determined, wait match Set the parameter that parameter is missing documents to be modified;
Judge whether to store in pre-stored location with parameter to be configured, if it is present obtaining ginseng to be configured from pre-stored location Number, by parameter configuration to be configured into file to be modified, the ginseng of parameter and non-file to be modified with the file to be modified postponed Number corresponds;
If not stored in pre-stored location and parameter to be configured, the 4th prompt information, the 4th prompt letter are sent to user Breath is for reminding user to increase or modify the parameter of file to be modified newly;
It receives user and the parameter in file to be modified is increased newly or repaired according to the 4th prompt information, feedback is received The operation changed.
A kind of device for configuration file that second aspect of the present invention embodiment provides further include:
Preserving module, for using the parameter of the parameter of file destination and reference file as parameter pair;
Using file destination and reference file as file pair;
By file pair and parameter to storing into pre-stored location.
At the another aspect that the present invention is implemented, a kind of computer readable storage medium is additionally provided, it is described computer-readable Instruction is stored in storage medium, when run on a computer, so that computer executes any of the above-described described one kind and matches The method for setting file.
At the another aspect that the present invention is implemented, the embodiment of the invention also provides a kind of, and the computer program comprising instruction is produced Product, when run on a computer, so that the method that computer executes a kind of any of the above-described configuration file.
A kind of method and device of configuration file provided in an embodiment of the present invention is being needed to the to be configured of service to be configured When file is configured, the corresponding reference file of file to be configured is obtained;In pre-stored location, detect whether exist and the base The file destination that quasi- file matches;If in pre-stored location, detection not there are the file destination to match with reference file, Then judge the parameter to match with the parameter of the reference file whether is stored in pre-stored location, if it is present from position is prestored Set the parameter that the parameter of acquisition and reference file matches;The parameter that parameter with reference file matches is added to be configured It in file, completes to treat the parameter configuration of configuration file, the file to be configured after parameter will have been added as file destination.It compares In the prior art, whether the embodiment of the present invention stores the parameter to match with the parameter of reference file by detection pre-stored location, The parameter that parameter with reference file matches is added in file to be configured, so that configuration obtains file destination.Avoid by In configuration file process steps, complicated and configuration file parameter is more, and artificial configuration has the case where repeating configuration and leakage, Improve the efficiency of the configuration file under configuration different application environment.Certainly, it implements any of the products of the present invention or method and different It is fixed to need while reaching all the above advantage.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described.
Fig. 1 is a kind of flow chart of the method for configuration file provided in an embodiment of the present invention;
Fig. 2 is a kind of flow chart of parameter for modifying file pair provided in an embodiment of the present invention;
Fig. 3 is the flow chart of the parameter of another modification file pair provided in an embodiment of the present invention;
Fig. 4 is the flow chart of storage file pair provided in an embodiment of the present invention and parameter pair;
Fig. 5 is a kind of structure chart of the device of configuration file provided in an embodiment of the present invention;
Fig. 6 is the structure chart of a kind of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention is described.
A kind of method and device of configuration file provided in an embodiment of the present invention is being needed to the to be configured of service to be configured When file is configured, the corresponding reference file of file to be configured is obtained;In pre-stored location, detect whether exist and the base The file destination that quasi- file matches;If in pre-stored location, detection not there are the file destination to match with reference file, Then judge the parameter to match with the parameter of the reference file whether is stored in pre-stored location, if it is present from position is prestored Set the parameter that the parameter of acquisition and reference file matches;The parameter that parameter with reference file matches is added to be configured It in file, completes to treat the parameter configuration of configuration file, the file to be configured after parameter will have been added as file destination.It compares In the prior art, whether the embodiment of the present invention stores the parameter to match with the parameter of reference file by detection pre-stored location, The parameter that parameter with reference file matches is added in file to be configured, so that configuration obtains file destination.Avoid by In configuration file process steps, complicated and configuration file parameter is more, and artificial configuration has the case where repeating configuration and leakage, Improve the efficiency of the configuration file under configuration different application environment.
A kind of method of configuration file provided in an embodiment of the present invention is applied to electronic equipment, and further electronic equipment can Think mobile phone, computer, server, intelligent mobile terminal equipment, wearable intelligent mobile terminal equipment etc..It does not limit herein It is fixed, it is any that electronic equipment of the invention may be implemented, it all belongs to the scope of protection of the present invention.
Firstly, being described to a kind of method of configuration file provided in an embodiment of the present invention.
As shown in Figure 1, a kind of method of configuration file provided in an embodiment of the present invention includes:
S101 obtains the corresponding base of file to be configured when needing the file to be configured to service to be configured to configure Quasi- file;
In a particular embodiment, the acquisition of reference file depends on needing the application to the file to be configured of service to be configured Environment, if user needs the file to be configured of environment on line, the application environment of file to be configured belongs to environment on line, then benchmark File belongs to test environment.
In order to improve the accuracy rate for obtaining reference file, above-mentioned S102 can be obtained using at least one embodiment wait match Set the corresponding reference file of file:
In a kind of optional embodiment, when needing the file to be configured to service to be configured to configure, receive User inputs the corresponding reference file of file to be configured, to improve the accuracy rate for obtaining reference file.
In another optional embodiment, when needing the file to be configured to service to be configured to configure, connect It receives user and selects the corresponding reference file of file to be configured, to improve the accuracy rate for obtaining reference file.
S102 detects whether there is the file destination to match with reference file in pre-stored location;
Wherein, the service name of file destination and the service name of reference file are identical, the parameter and benchmark of file destination The parameter of file corresponds, and the application environment of file destination and the application environment of reference file are corresponding, service name be based on but It is not limited to the noun that the function, purposes or application of reference file define, is mainly used for distinguishing file.Pre-stored location can With but be not limited to position for file and parameter to be stored in advance, the mode that can be realized storage file and parameter belongs to this The protection scope of inventive embodiments.Illustratively, pre-stored location can be, but not limited to include: caching or storage region.
In order to improve the efficiency of the configuration file under configuration different application environment, above-mentioned S102 can be using at least one real The mode of applying detects whether there is the file destination to match with reference file:
In a kind of optional embodiment, in the file pair of pre-stored location storage, detect whether exist and benchmark text The file destination that part matches, to improve the accuracy rate for determining file destination.
In another optional embodiment, in the file with reference file different application environment of pre-stored location storage In, detect whether there is the file destination to match with reference file, to improve the efficiency of detection file destination.
In another optional embodiment, in pre-stored location, if there is, parameter identical as reference file title It is corresponded with the parameter of reference file, and application environment file corresponding with the application environment of reference file, and if so, This document is determined as file destination, so as to improve the accuracy rate of determining file destination.
In another optional embodiment, in pre-stored location each file assign a key value, search with The identical file of reference file key value, as the file destination to match with reference file, so as to quickly determine target File.
S103, if in pre-stored location, there are the file destinations to match with reference file for detection, then judgement prestores Whether the parameter that with the parameter of reference file matches is stored in position, if it is present obtaining and benchmark text from pre-stored location The parameter that the parameter of part matches;
In order to improve the efficiency of the configuration file under configuration different application environment, above-mentioned S103 can be using at least one real The mode of applying judges the parameter to match with the parameter of reference file whether is stored in pre-stored location:
In a kind of possible embodiment, by judging whether stored in pre-stored location with the parameter of reference file one by one Corresponding parameter, if it is present from pre-stored location obtain with the one-to-one parameter of parameter of reference file, as with benchmark The parameter that the parameter of file matches, to improve the efficiency for the parameter that the parameter of acquisition and reference file matches.
The parameter that parameter with reference file matches is added in file to be configured by S104, is completed to text to be configured The parameter configuration of part will add the file to be configured after parameter as file destination.
Wherein, the service name of file to be configured and the service name of reference file are identical, and file to be configured applies ring Border is corresponding with the application environment of reference file.
Such as: needing the file to be configured to service to be configured is environment on line, and reference file is: username_test, Test, dev, the application environment of reference file are test environment, and application environment corresponding with test environment is environment on line.Benchmark The parameter of file is username_test, test, dev, is distinguished with parameter username_test, test, dev of reference file Corresponding parameter is username_online, online, product.Username_online, online, product are made For the parameter of file to be configured, the application environment of file to be configured is environment on line, and file parameters to be configured are username_ online、online、product。
Compared with the prior art, the embodiment of the present invention is by detecting whether pre-stored location stores the parameter phase with reference file The parameter that parameter with reference file matches is added in file to be configured by matched parameter, so that configuration obtains target File.Avoid since configuration file process steps are complicated and the parameter of configuration file is more, artificial configuration exist repeat configuration and The case where leakage, improves the efficiency of the configuration file under configuration different application environment.
As shown in Fig. 2, in order to improve the accuracy rate of configuration file, the above-mentioned S104 the step of after, the embodiment of the present invention A kind of method of the configuration file provided further include:
Whether S201, the parameter for detecting the file pair stored in pre-stored location correspond;
Wherein, file is to being that application environment is corresponding, service name is identical, parameter a pair of of file correspondingly, a pair The application environment of file includes environment on test environment and line.File is literary comprising the first file and second to can be, but not limited to Part, the first file and the second file form a file pair here, and such as first, second etc relational terms here are only For by " the first file ", " the second file distinguishes, and is not necessarily to or implies " the first file ", " the second file " Between there are any actual relationship or orders.
Such as: in file to { username { username_test, test, dev;username_online,online, Product } } in username_test, test, dev if it is the first file, the application environment of the first file be test environment, Application environment corresponding with test environment is environment on line.The parameter of first file be username_test, test, dev, with The corresponding parameter of parameter username_test, test, dev of first file be username_online, online, product.Username_online, online, product are the parameters of the second file, and the application environment of the second file is line Upper environment, the parameter of the second file are username_online, online, product.The clothes of first file and the second file Title of being engaged in all is username, the service name username of file pair;Or username_test, test, dev.If it is Second file, the application environment of the second file are test environment, and the parameter of the second file under the test environment is username_ Test, test, dev, username_online, online, product are the first files, and the application environment of the first file is line Upper environment, the parameter of the first file are username_online, online, product.The parameter of first file and the second text Parameter of the part under its application environment corresponds.
In a kind of possible embodiment, pass through file centering the i-th row of the first file stored in detection pre-stored location Parameter and the parameter of second the i-th row of file whether correspond, the parameter and the second file for determining the first file can be improved The whether one-to-one accuracy rate of parameter.
Wherein, the value of i is positive integer.
S202 sends the second prompt to user if the parameter of the file pair of pre-stored location storage is not to correspond Information;
Wherein, the second prompt information is carried out for reminding user to determine file to be modified, and to the parameter of file to be modified It deletes, newly-increased perhaps modification file to be modified is to need deletion, newly-increased or modification parameter file.
S203, receives user according to receiving the second prompt information, feedback the parameter in file to be modified is deleted, Newly-increased or modification operation.
In a kind of possible embodiment, receive user according to receiving the second prompt information, feedback to text to be configured The operation that the parameter of full line is deleted, increased newly or modified in part, to improve the efficiency for modifying file to be modified.
Such as: assuming that the first file are as follows: the second file of username, username_test are as follows: username, username_online,password.The application environment of first file is test environment, and the application environment of the second file is line The parameter of upper environment, the parameter of the first file and the second file is not to correspond, then sends the second prompt information to user, is used Family increases this parameter of dev newly in the first file;If the first file are as follows: username, username_test, dev.User This parameter of password is deleted in the second file, then the second file are as follows: username, username_online.
Configuration file can be improved by the parameter of modification and the matched file to be modified of reference file in present embodiment Real-time.
In order to improve the accuracy rate of configuration file, at least one embodiment can be taken in above-mentioned S203, is prestoring position Set the file pair of storage parameter be not one-to-one correspondence in the case of, send the second prompt information to user:
As shown in figure 3, in one embodiment, sending the second prompt information to user as follows:
S301 sends third prompt to user if the parameter of the file pair of pre-stored location storage is not to correspond Information, third prompt information determine file to be modified for reminding user in file pair;
S302 receives user according to reception third prompt information, the operation of the determination of feedback file to be modified, to be modified In the case of the parameter of file is more than the parameter of non-file to be modified, delete in file to be modified with the parameter of non-file to be modified not Corresponding parameter;
S303 determines parameter to be configured in the case where the parameter of file to be modified is less than the parameter of non-file to be modified;
Wherein, parameter to be configured is the parameter of missing documents to be modified.
S304, judge whether to store in pre-stored location with parameter to be configured, if it is present obtaining from pre-stored location wait match Parameter is set, by parameter configuration to be configured into file to be modified;
Wherein, the parameter of parameter and non-file to be modified with the file to be modified postponed corresponds;
S305 sends the 4th prompt information to user if not stored in pre-stored location and parameter to be configured;
Wherein, the 4th prompt information is for reminding user to increase or modify the parameter of file to be modified newly.
S306 receives user and increases newly according to the 4th prompt information, feedback is received to the parameter in file to be modified Or the operation of modification.
It is exemplified below when the parameter of the file pair of pre-stored location storage is not one-to-one correspondence, is sent to user The process of second prompt information.
Such as: assuming that the first file are as follows: the second file of username, username_test, dev are as follows: username, username_online.The application environment of first file is test environment, and the application environment of the second file is environment on line, the The parameter of the parameter of one file and the second file is not to correspond, then sends third prompt information to user, user's selection the One file is file to be modified, then the second file is benchmark file.The parameter of file to be modified is more than the ginseng of reference file at this time Number, then delete parameter dev not corresponding with the parameter of reference file in file to be modified.
Assuming that the first file are as follows: username, username_test;Second file are as follows: username, username_ Online, password, the application environment of the first file are test environment, and the application environment of the second file is environment on line, the The parameter of the parameter of one file and the second file is not to correspond, then sends third prompt information to user, user's selection the Two files are file to be modified, then the first file is benchmark file.The parameter of file to be modified is less than the ginseng of reference file at this time Number, then to user send the 4th prompt information, receive user according to receive the 4th prompt information, feedback to file to be modified In increase newly dev parameter operation.
Present embodiment is by the case where parameter of the parameter of file to be modified for reference file, in text to be modified Parameter not corresponding with the parameter of reference file is deleted in part, improves the efficiency configured to file to be modified.
As shown in figure 4, in order to improve the accuracy rate of configuration file, the above-mentioned S104 the step of after, the embodiment of the present invention A kind of method of the configuration file provided further include:
S401, using the parameter of file destination and the parameter of reference file as parameter pair;
S402, using file destination and reference file as file pair;
S403, by file pair and parameter to storing into pre-stored location.
The embodiment of the present invention is by, to storing into pre-stored location, supplementing the file in pre-stored location for file pair and parameter Pair and parameter pair, be the new file pair and parameter of subsequent detection to providing material.
It continues with and a kind of device of configuration file provided in an embodiment of the present invention is described.
As shown in figure 5, a kind of device of configuration file provided in an embodiment of the present invention, comprising:
File acquisition module 501, for obtaining wait match when needing the file to be configured to service to be configured to configure Set the corresponding reference file of file;
File detection module 502, in pre-stored location, detecting whether there is the target to match with reference file text Part, the service name of file destination and the service name of reference file are identical, the parameter of file destination and the parameter of reference file It corresponds, the application environment of file destination and the application environment of reference file are corresponding;
Parameter acquisition module 503, if there are the targets to match with reference file for detection in pre-stored location File then judges the parameter to match with the parameter of reference file whether is stored in pre-stored location, if it is present from position is prestored Set the parameter that the parameter of acquisition and reference file matches;
File configuration module 504, the parameter for the parameter with reference file to match are added in file to be configured, It completes to treat the parameter configuration of configuration file, the file to be configured after parameter will have been added as file destination, file to be configured Service name it is identical as the service name of reference file, the application environment of file to be configured and the application environment pair of reference file It answers.
Optionally, file detection module is specifically used for:
In the file pair of pre-stored location storage, detect whether there is the file destination to match with reference file, file It include environment on test environment and line to the application environment comprising a pair of of file, a pair of file;
Or,
In the file with reference file different application environment of pre-stored location storage, detect whether to exist and reference file The file destination to match.
A kind of device of configuration file provided in an embodiment of the present invention further include:
To lighting module, whether the parameter for detecting the file pair stored in pre-stored location corresponds parameter;
If the parameter of the file pair of pre-stored location storage is not to correspond, the second prompt information is sent to user, Second prompt information for reminding user to determine file to be modified, and the parameter of file to be modified is deleted, increase newly or Modification;
User is received to delete the parameter in file to be modified according to the second prompt information, feedback is received, increase newly Or the operation of modification.
Optionally, parameter is used for lighting module:
If the parameter of the file pair of pre-stored location storage is not to correspond, third prompt information is sent to user, Third prompt information determines file to be modified for reminding user in file pair;
User is received according to reception third prompt information, the operation of the determination of feedback file to be modified, in file to be modified Parameter more than non-file to be modified parameter in the case of, delete not corresponding with the parameter of non-file to be modified in file to be modified Parameter;
In the case where the parameter of file to be modified is less than the parameter of non-file to be modified, parameter to be configured is determined, wait match Set the parameter that parameter is missing documents to be modified;
Judge whether to store in pre-stored location with parameter to be configured, if it is present obtaining ginseng to be configured from pre-stored location Number, by parameter configuration to be configured into file to be modified, the ginseng of parameter and non-file to be modified with the file to be modified postponed Number corresponds;
If not stored in pre-stored location and parameter to be configured, the 4th prompt information, the 4th prompt letter are sent to user Breath is for reminding user to increase or modify the parameter of file to be modified newly;
It receives user and the parameter in file to be modified is increased newly or repaired according to the 4th prompt information, feedback is received The operation changed.
A kind of device of configuration file provided in an embodiment of the present invention further include:
Preserving module, for using the parameter of the parameter of file destination and reference file as parameter pair;
Using file destination and reference file as file pair;
By file pair and parameter to storing into pre-stored location.
The embodiment of the invention also provides a kind of electronic equipment, as shown in fig. 6, include processor 601, communication interface 602, Memory 603 and communication bus 604, wherein processor 601, communication interface 602, memory 603 are complete by communication bus 604 At mutual communication,
Memory 603, for storing computer program;
Processor 601 when for executing the program stored on memory 603, realizes following steps:
When needing the file to be configured to service to be configured to configure, the corresponding benchmark text of file to be configured is obtained Part;
In pre-stored location, detect whether there is the file destination to match with reference file, the Service name of file destination Claim identical as the service name of reference file;
If in pre-stored location, detecting not there are the file destination to match with reference file, then judging pre-stored location In whether store the parameter to match with the parameter of reference file, if it is present obtaining from pre-stored location with reference file The parameter that parameter matches;
The parameter that parameter with reference file matches is added in file to be configured, the ginseng for treating configuration file is completed Number configuration will add the file to be configured after parameter as file destination.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, abbreviation PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, abbreviation EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc.. Only to be indicated with a thick line in figure, it is not intended that an only bus or a type of bus convenient for indicating.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, abbreviation RAM), also may include Nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.Optionally, memory may be used also To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, Abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (Digital Signal Processing, abbreviation DSP), specific integrated circuit (Application Specific Integrated Circuit, abbreviation ASIC), field programmable gate array (Field-Programmable Gate Array, Abbreviation FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hardware components.
In another embodiment provided by the invention, a kind of computer readable storage medium is additionally provided, which can It reads to be stored with instruction in storage medium, when run on a computer, so that computer executes any institute in above-described embodiment A kind of method for the configuration file stated.
In another embodiment provided by the invention, a kind of computer program product comprising instruction is additionally provided, when it When running on computers, so that the method that computer executes any a kind of configuration file in above-described embodiment.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program Product includes one or more computer instructions.When loading on computers and executing the computer program instructions, all or It partly generates according to process or function described in the embodiment of the present invention.The computer can be general purpose computer, dedicated meter Calculation machine, computer network or other programmable devices.The computer instruction can store in computer readable storage medium In, or from a computer readable storage medium to the transmission of another computer readable storage medium, for example, the computer Instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center User's line (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or Data center is transmitted.The computer readable storage medium can be any usable medium that computer can access or It is comprising data storage devices such as one or more usable mediums integrated server, data centers.The usable medium can be with It is magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or semiconductor medium (such as solid state hard disk Solid State Disk (SSD)) etc..
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device/ For electronic equipment/computer readable storage medium/computer program product embodiments, implement since it is substantially similar to method Example, so being described relatively simple, the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

Claims (11)

1. a kind of method of configuration file, which is characterized in that the described method includes:
When needing the file to be configured to service to be configured to configure, the corresponding benchmark text of the file to be configured is obtained Part;
In pre-stored location, detect whether there are the file destination to match with the reference file, the clothes of the file destination Title of being engaged in is identical as the service name of the reference file, and the parameter of the parameter of the file destination and the reference file is one by one Corresponding, the application environment of the file destination is corresponding with the application environment of the reference file;
If in the pre-stored location, there are the file destinations to match with the reference file for detection, then described in judgement Whether the parameter that with the parameter of the reference file matches is stored in pre-stored location, if it is present from the pre-stored location Obtain the parameter to match with the parameter of the reference file;
The parameter to match with the parameter of the reference file is added in file to be configured, is completed to the file to be configured Parameter configuration, the file to be configured after parameter will have been added as file destination, the service name of the file to be configured with The service name of the reference file is identical, the application environment of the file to be configured and the application environment pair of the reference file It answers.
2. the method according to claim 1, wherein described in pre-stored location, detect whether to exist with it is described The file destination that reference file matches, comprising:
In the file pair of pre-stored location storage, detect whether there is the file destination to match with the reference file, The file includes environment on test environment and line to the application environment comprising a pair of of file, a pair of file;
Or,
The pre-stored location storage the file with the reference file different application environment in, detect whether exist with it is described The file destination that reference file matches.
3. according to the method described in claim 2, it is characterized in that, the method also includes:
Whether the parameter for detecting the file pair stored in the pre-stored location corresponds;
If the parameter of the file pair of the pre-stored location storage is not to correspond, the second prompt information is sent to user, Second prompt information is used to that user to be reminded to determine file to be modified, and the parameter of the file to be modified is deleted, Newly-increased or modification;
User is received according to receiving second prompt information, feedback the parameter in the file to be modified is deleted, Newly-increased or modification operation.
4. if according to the method described in claim 3, the it is characterized in that, ginseng of the file pair of pre-stored location storage Number is not to correspond, then sends the second prompt information to user and include:
If the parameter of the file pair of the pre-stored location storage is not to correspond, third prompt information is sent to user, The third prompt information determines file to be modified for reminding user in the file pair;
User is received according to the reception third prompt information, the operation of the determination of feedback file to be modified, described to be modified In the case of the parameter of file is more than the parameter of non-file to be modified, delete in the file to be modified with the non-file to be modified The not corresponding parameter of parameter;
In the case where the parameter of the file to be modified is less than the parameter of the non-file to be modified, parameter to be configured is determined, The parameter to be configured is the parameter of missing documents to be modified;
Judge whether to store in the pre-stored location with the parameter to be configured, if it is present being obtained from the pre-stored location The parameter to be configured, it is described with the file to be modified postponed by the parameter configuration to be configured into the file to be modified Parameter and the non-file to be modified parameter correspond;
If not stored with the parameter to be configured in the pre-stored location, the 4th prompt information is sent to user, described the Four prompt informations are for reminding user to increase or modify the parameter of the file to be modified newly;
It receives user and the parameter in the file to be modified is increased newly or repaired according to the 4th prompt information, feedback is received The operation changed.
5. method according to any one of claims 1 to 4, which is characterized in that by the parameter phase with the reference file Matched parameter is added in file to be configured, will add the file to be configured after parameter as the step of file destination it Afterwards, the method also includes:
Using the parameter of the file destination and the parameter of the reference file as parameter pair;
Using the file destination and the reference file as file pair;
By the file pair and the parameter to storing into the pre-stored location.
6. a kind of device of configuration file, which is characterized in that described device includes:
File acquisition module, for obtaining described to be configured when needing the file to be configured to service to be configured to configure The corresponding reference file of file;
File detection module, in pre-stored location, detecting whether there is the file destination to match with the reference file, The service name of the file destination is identical as the service name of the reference file, the parameter of the file destination and the base The parameter of quasi- file corresponds, and the application environment of the file destination is corresponding with the application environment of the reference file;
Parameter acquisition module, if there are the mesh to match with the reference file for detection in the pre-stored location File is marked, then judges whether store the parameter to match with the parameter of the reference file in the pre-stored location, if it does, The parameter to match with the parameter of the reference file is then obtained from the pre-stored location;
File configuration module, it is complete for the parameter to match with the parameter of the reference file to be added in file to be configured The parameter configuration of the pairs of file to be configured, will add the file to be configured after parameter as file destination, described wait match The service name for setting file is identical as the service name of the reference file, the application environment of the file to be configured and the base The application environment of quasi- file is corresponding.
7. device according to claim 6, which is characterized in that the file detection module is specifically used for:
In the file pair of pre-stored location storage, detect whether there is the file destination to match with the reference file, The file includes environment on test environment and line to the application environment comprising a pair of of file, a pair of file;
Or,
The pre-stored location storage the file with the reference file different application environment in, detect whether exist with it is described The file destination that reference file matches.
8. device according to claim 7, which is characterized in that described device further include:
To lighting module, whether the parameter for detecting the file pair stored in the pre-stored location corresponds parameter;
If the parameter of the file pair of the pre-stored location storage is not to correspond, the second prompt information is sent to user, Second prompt information is used to that user to be reminded to determine file to be modified, and the parameter of the file to be modified is deleted, Newly-increased or modification;
User is received according to receiving second prompt information, feedback the parameter in the file to be modified is deleted, Newly-increased or modification operation.
9. device according to claim 8, which is characterized in that the parameter is used for lighting module:
If the parameter of the file pair of the pre-stored location storage is not to correspond, third prompt information is sent to user, The third prompt information determines file to be modified for reminding user in the file pair;
User is received according to the reception third prompt information, the operation of the determination of feedback file to be modified, described to be modified In the case of the parameter of file is more than the parameter of non-file to be modified, delete in the file to be modified with the non-file to be modified The not corresponding parameter of parameter;
In the case where the parameter of the file to be modified is less than the parameter of the non-file to be modified, parameter to be configured is determined, The parameter to be configured is the parameter of missing documents to be modified;
Judge whether to store in the pre-stored location with the parameter to be configured, if it is present being obtained from the pre-stored location The parameter to be configured, it is described with the file to be modified postponed by the parameter configuration to be configured into the file to be modified Parameter and the non-file to be modified parameter correspond;
If not stored with the parameter to be configured in the pre-stored location, the 4th prompt information is sent to user, described the Four prompt informations are for reminding user to increase or modify the parameter of the file to be modified newly;
It receives user and the parameter in the file to be modified is increased newly or repaired according to the 4th prompt information, feedback is received The operation changed.
10. according to the described in any item devices of claim 6 to 9, which is characterized in that described device further include:
Preserving module, for using the parameter of the parameter of the file destination and the reference file as parameter pair;
Using the file destination and the reference file as file pair;
By the file pair and the parameter to storing into the pre-stored location.
11. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein processing Device, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any method and step of claim 1-5.
CN201910185358.9A 2019-03-12 2019-03-12 Method and device for configuring file Active CN109976828B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910185358.9A CN109976828B (en) 2019-03-12 2019-03-12 Method and device for configuring file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910185358.9A CN109976828B (en) 2019-03-12 2019-03-12 Method and device for configuring file

Publications (2)

Publication Number Publication Date
CN109976828A true CN109976828A (en) 2019-07-05
CN109976828B CN109976828B (en) 2022-04-22

Family

ID=67078641

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910185358.9A Active CN109976828B (en) 2019-03-12 2019-03-12 Method and device for configuring file

Country Status (1)

Country Link
CN (1) CN109976828B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941460A (en) * 2019-11-22 2020-03-31 北京金山云网络技术有限公司 Application program starting method and device, electronic equipment, system and storage medium
CN112433783A (en) * 2020-11-24 2021-03-02 平安普惠企业管理有限公司 Configuration method and related equipment

Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1049972A1 (en) * 1998-01-30 2000-11-08 Object Technology Licensing Corporation Apparatus and method for modeling behavior of expansion boards in a computer system
CN101588268A (en) * 2009-06-29 2009-11-25 杭州华三通信技术有限公司 Method and device for configuration files of universal extensible management device
US20120159438A1 (en) * 2010-12-21 2012-06-21 Sap Ag Standardized Configuration Checklists For Software Development
WO2014036135A1 (en) * 2012-08-28 2014-03-06 VCE Company LLC Integrated computing platform deployed in an existing computing environment
CN103914370A (en) * 2012-12-31 2014-07-09 百度国际科技(深圳)有限公司 XML (Extensive Markup Language) configuration file based test method and device
CN104331292A (en) * 2014-11-03 2015-02-04 重庆邮电大学 Method for generating configuration for middleware protocol conversion of Internet of vehicles
US20150207682A1 (en) * 2012-05-30 2015-07-23 Caren Moraes Nichele Server profile templates
US20160170712A1 (en) * 2014-12-15 2016-06-16 Beijing Jinher Software Co., Ltd Method for integrally implementing development and release of APP
WO2016102175A1 (en) * 2014-12-22 2016-06-30 Eaton Industries (Netherlands) B.V. Computer implemented method for displaying a user interface
CN106021043A (en) * 2016-05-10 2016-10-12 浪潮电子信息产业股份有限公司 Method and device for acquiring configuration information of server
EP3133491A1 (en) * 2012-03-31 2017-02-22 BMC Software, Inc. Self-evolving computing service template translation
CN107085516A (en) * 2017-03-31 2017-08-22 北京奇艺世纪科技有限公司 A kind of method and device for changing configuration
CN107092502A (en) * 2017-03-20 2017-08-25 国家电网公司 A kind of application method of automatic configuration and device based on cloud operating system
CN107463418A (en) * 2017-09-12 2017-12-12 北京宝兰德软件股份有限公司 The configuration file generation method and device of a kind of server middleware
US20180032354A1 (en) * 2016-07-29 2018-02-01 Fujitsu Limited Information processing apparatus, information processing system, computer-readable non-transitory recording medium having a program stored therein, and information processing method
CN107798459A (en) * 2017-07-27 2018-03-13 平安科技(深圳)有限公司 Parameter values computational methods, device, storage medium and computer equipment
CN107967159A (en) * 2017-11-22 2018-04-27 腾讯科技(深圳)有限公司 The method and server of a kind of profileapplied
CN108259556A (en) * 2017-11-30 2018-07-06 北京九五智驾信息技术股份有限公司 Method for parameter configuration and terminal
US20180285237A1 (en) * 2017-03-29 2018-10-04 Ca, Inc. Validating user interface templates for software probe configuration

Patent Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1049972A1 (en) * 1998-01-30 2000-11-08 Object Technology Licensing Corporation Apparatus and method for modeling behavior of expansion boards in a computer system
CN101588268A (en) * 2009-06-29 2009-11-25 杭州华三通信技术有限公司 Method and device for configuration files of universal extensible management device
US20120159438A1 (en) * 2010-12-21 2012-06-21 Sap Ag Standardized Configuration Checklists For Software Development
EP3133491A1 (en) * 2012-03-31 2017-02-22 BMC Software, Inc. Self-evolving computing service template translation
US20150207682A1 (en) * 2012-05-30 2015-07-23 Caren Moraes Nichele Server profile templates
WO2014036135A1 (en) * 2012-08-28 2014-03-06 VCE Company LLC Integrated computing platform deployed in an existing computing environment
CN103914370A (en) * 2012-12-31 2014-07-09 百度国际科技(深圳)有限公司 XML (Extensive Markup Language) configuration file based test method and device
CN104331292A (en) * 2014-11-03 2015-02-04 重庆邮电大学 Method for generating configuration for middleware protocol conversion of Internet of vehicles
US20160170712A1 (en) * 2014-12-15 2016-06-16 Beijing Jinher Software Co., Ltd Method for integrally implementing development and release of APP
WO2016102175A1 (en) * 2014-12-22 2016-06-30 Eaton Industries (Netherlands) B.V. Computer implemented method for displaying a user interface
CN106021043A (en) * 2016-05-10 2016-10-12 浪潮电子信息产业股份有限公司 Method and device for acquiring configuration information of server
US20180032354A1 (en) * 2016-07-29 2018-02-01 Fujitsu Limited Information processing apparatus, information processing system, computer-readable non-transitory recording medium having a program stored therein, and information processing method
CN107092502A (en) * 2017-03-20 2017-08-25 国家电网公司 A kind of application method of automatic configuration and device based on cloud operating system
US20180285237A1 (en) * 2017-03-29 2018-10-04 Ca, Inc. Validating user interface templates for software probe configuration
CN107085516A (en) * 2017-03-31 2017-08-22 北京奇艺世纪科技有限公司 A kind of method and device for changing configuration
CN107798459A (en) * 2017-07-27 2018-03-13 平安科技(深圳)有限公司 Parameter values computational methods, device, storage medium and computer equipment
CN107463418A (en) * 2017-09-12 2017-12-12 北京宝兰德软件股份有限公司 The configuration file generation method and device of a kind of server middleware
CN107967159A (en) * 2017-11-22 2018-04-27 腾讯科技(深圳)有限公司 The method and server of a kind of profileapplied
CN108259556A (en) * 2017-11-30 2018-07-06 北京九五智驾信息技术股份有限公司 Method for parameter configuration and terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
林惠娟 等: "脚本自动生成测试系统的设计与实现", 《四川大学学报(自然科学版)》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941460A (en) * 2019-11-22 2020-03-31 北京金山云网络技术有限公司 Application program starting method and device, electronic equipment, system and storage medium
CN110941460B (en) * 2019-11-22 2023-09-01 北京金山云网络技术有限公司 Application program starting method and device, electronic equipment, system and storage medium
CN112433783A (en) * 2020-11-24 2021-03-02 平安普惠企业管理有限公司 Configuration method and related equipment
WO2022110646A1 (en) * 2020-11-24 2022-06-02 平安普惠企业管理有限公司 Configuration method and related device

Also Published As

Publication number Publication date
CN109976828B (en) 2022-04-22

Similar Documents

Publication Publication Date Title
US10237295B2 (en) Automated event ID field analysis on heterogeneous logs
US11799732B2 (en) Internet of things device discovery and configuration
US10491548B2 (en) Techniques to configure bot flow
CN105704546A (en) methods and devices for media casting management
CN105630685A (en) Method and device for testing program interface
CN105302710A (en) Method and apparatus for determining test case in need of regression testing
CN107872534B (en) Information pushing method and device, server and readable storage medium
CN103136342B (en) The searching method of application A PP, system and search server
CN108427956A (en) A kind of clustering objects method and apparatus
CN109669717A (en) Data processing method, device, equipment and storage medium based on deployment platform
CN103399748A (en) Equipment configuration standardization detecting device and method
CN109426510A (en) Software processing method, device, electronic equipment and computer readable storage medium
CN109976828A (en) A kind of method and device of configuration file
CN107145562A (en) A kind of method of data synchronization, apparatus and system
CN106209918A (en) The method of a kind of internet security management and terminal
CN107168832A (en) The method of automatic detection, device
CN109254868A (en) A kind of file test method and device
US9471297B2 (en) Methods and apparatus for uninstalling a software application
CN106302519A (en) The method of a kind of internet security management and terminal
CN106293851A (en) A kind of firmware upgrade method and equipment
CN109597823B (en) Data source configuration method, device, computer equipment and storage medium
CN104980452A (en) Document sharing method, device, and system
CN106790160B (en) Security level identification and method of calibration and device
CN102984229B (en) For configuring the method and system of trust machine
US20140244719A1 (en) Techniques To Manage Platform Migrations

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