CN109358869A - Configuration file amending method, device, computer equipment and storage medium - Google Patents

Configuration file amending method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN109358869A
CN109358869A CN201811020750.XA CN201811020750A CN109358869A CN 109358869 A CN109358869 A CN 109358869A CN 201811020750 A CN201811020750 A CN 201811020750A CN 109358869 A CN109358869 A CN 109358869A
Authority
CN
China
Prior art keywords
configuration
configuration file
file
replacement
local profile
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811020750.XA
Other languages
Chinese (zh)
Inventor
阳尚英
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN201811020750.XA priority Critical patent/CN109358869A/en
Publication of CN109358869A publication Critical patent/CN109358869A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

This application involves a kind of configuration file amending method, device, computer equipment and storage medium based on data resource.The described method includes: reading multiple configuration files;Plug-in unit is updated using configuration and scans multiple configuration files, obtains the current state of multiple configuration files;When judging that corresponding configuration file needs to be implemented update operation according to current state, local profile is obtained;Local profile is parsed, and extracts content to be updated from local profile;Replacement configuration file is obtained, and extracts replacement content corresponding with content to be updated from replacement configuration file;The content to be updated in content replacement local profile will be replaced, obtains updated local profile.Directly the configuration file being updated will can be needed to replace with existing replacement configuration file using this method, it is not necessary that by program interrupt, the artificial modification for carrying out configuration file avoids interruption service and provides, improves work efficiency.

Description

Configuration file amending method, device, computer equipment and storage medium
Technical field
This application involves field of computer technology, set more particularly to a kind of configuration file amending method, device, computer Standby and storage medium.
Background technique
Life insurance EDI platform is needed for being provided out data, and when platform needs to be implemented update operation or modification operation The support of configuration file, configuration file, which refers to, logs in computer or user when using software in user, and software systems are user institute The setting of required environment and the set of file are loaded, it includes the dedicated configuration setting of all users.
And in the prior art, EDI platform is when needing to change configuration file, after needing technical staff to restart program, When reading corresponding configuration file, then directly modify, but using the method for directly modifying configuration file, platform can restart Obtain the configuration file of needs afterwards, the moment of starting determines the content of Configuration Values, and the period of entire program be it is fixed, therefore In time before the restart, third-party platform can not obtain required related data, can only modify matching for configuration file After setting value, the function of data transmission is provided again, will lead to service disruption, the problem of reporting and submitting unsuccessfully.
Summary of the invention
Based on this, it is necessary to will lead to service disruption for configuration file is modified in program operation process, report and submit failure Problem provides one kind and is able to maintain that program is run in the case where modifying configuration file, guarantees that servicing continuous configuration file repairs Change method, apparatus, computer equipment and storage medium.
A kind of configuration file amending method, which comprises
Read multiple configuration files;
Plug-in unit is updated using configuration and scans multiple configuration files, obtains the current state of multiple configuration files;
When judging that corresponding configuration file needs to be implemented update operation according to the current state, text is locally configured in acquisition Part;
The local profile is parsed, and extracts content to be updated from the local profile;
Replacement configuration file is obtained, and the extraction replacement corresponding with the content to be updated from the replacement configuration file Content;
The replacement content is replaced into the content to be updated in the local profile, obtains updated be locally configured File.
In one of the embodiments, before the multiple configuration files of reading, comprising:
The configuration rule of data acquisition is defined, and the configuration rule is inserted into description file;
The description file is read, and parses the configuration rule in the description file;
Corresponding processing mode is matched according to the configuration rule, according to the processing mode to the execution pair of corresponding data The operation answered generates multiple configuration files.
It is described in one of the embodiments, to update the multiple configuration files of plug-in unit scanning using configuration, it obtains multiple The current state of the configuration file, comprising:
Multiple configurations update plug-in unit is inserted into described program, and multiple described using configuration update plug-in unit scanning Configuration file;
Obtain the configuration rule information of multiple configuration files and the status indicator of preset configuration file;
The configuration rule information is compared with the status indicator of the preset configuration file, obtains the configuration The current state of file.
Work as described in one of the embodiments, and judges that corresponding configuration file needs to be implemented more according to the current state When new operation, local profile is obtained, comprising:
The current state of the configuration file is compared with the preset state of the configuration file;
When the preset state of the preset state of the configuration file and the configuration file is inconsistent, indicates corresponding and match It sets file and needs to be implemented update operation;
The corresponding configuration file is needed to be implemented into the message for updating and operating and is sent to terminal, and obtains the local of terminal Configuration file.
In one of the embodiments, before the acquisition replacement configuration file, further includes:
It whether there is replacement configuration file corresponding with local profile using SQL statement inquiry database;
When corresponding replacement configuration file is not present in the database, is created and modified according to the local profile Template;
Corresponding replacement configuration file is generated according to the configuration rule information of the modification template and local profile.
A kind of configuration file modification device, described device include:
Configuration file read module, for reading multiple configuration files;
Configuration file current state obtains module, scans multiple configuration files for updating plug-in unit using configuration, obtains Take the current state of multiple configuration files;
Local profile obtains module, judges that corresponding configuration file needs to be implemented according to the current state for working as When updating operation, local profile is obtained;
Content extraction module to be updated is mentioned for parsing the local profile, and from the local profile Take content to be updated;
Content extraction module is replaced, for obtaining replacement configuration file, and extraction and institute from the replacement configuration file State the corresponding replacement content of content to be updated;
Configuration file update module, it is to be updated interior in the local profile for replacing the replacement content Hold, obtains updated local profile.
It in one of the embodiments, further include configuration file generation module, for defining the configuration rule of data acquisition, And the configuration rule is inserted into description file;
The description file is read, and parses the configuration rule in the description file;
Corresponding processing mode is matched according to the configuration rule, according to the processing mode to the execution pair of corresponding data The operation answered generates multiple configuration files.
Described device further includes replacement configuration file generation module in one of the embodiments, for utilizing SQL statement Inquiring database whether there is replacement configuration file corresponding with local profile;
When corresponding replacement configuration file is not present in the database, is created and modified according to the local profile Template;
Corresponding replacement configuration file is generated according to the configuration rule information of the modification template and local profile.
A kind of computer equipment, including memory and processor, the memory are stored with computer program, the processing Device performs the steps of when executing the computer program
Read multiple configuration files;
Plug-in unit is updated using configuration and scans multiple configuration files, obtains the current state of multiple configuration files;
When judging that corresponding configuration file needs to be implemented update operation according to the current state, text is locally configured in acquisition Part;
The local profile is parsed, and extracts content to be updated from the local profile;
Replacement configuration file is obtained, and the extraction replacement corresponding with the content to be updated from the replacement configuration file Content;
The replacement content is replaced into the content to be updated in the local profile, obtains updated be locally configured File.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor It is performed the steps of when row
Read multiple configuration files;
Plug-in unit is updated using configuration and scans multiple configuration files, obtains the current state of multiple configuration files;
When judging that corresponding configuration file needs to be implemented update operation according to the current state, text is locally configured in acquisition Part;
The local profile is parsed, and extracts content to be updated from the local profile;
Replacement configuration file is obtained, and the extraction replacement corresponding with the content to be updated from the replacement configuration file Content;
The replacement content is replaced into the content to be updated in the local profile, obtains updated be locally configured File.
Above-mentioned configuration file amending method, device, computer equipment and storage medium, server read multiple configuration texts Part updates plug-in unit using configuration and scans multiple configuration files, the current state of multiple configuration files obtained, when according to current state When judging that corresponding configuration file needs to be implemented update operation, local profile is obtained, parses local profile, and from originally Extract content to be updated in ground configuration file, obtain replacement configuration file, and extract from replacement configuration file with it is to be updated interior Hold corresponding replacement content, the content to be updated in content replacement local profile will be replaced, obtain updated local and match Set file.To directly the configuration file being updated can be needed to replace with existing replacement configuration file, be not necessarily to program interrupt, The artificial modification for carrying out configuration file avoids interruption service and provides, improves work efficiency.
Detailed description of the invention
Fig. 1 is the application scenario diagram of configuration file amending method in one embodiment;
Fig. 2 is the flow diagram of configuration file amending method in one embodiment;
Fig. 3 is to update plug-in unit using configuration in one embodiment to scan multiple configuration files, obtains multiple configuration files The flow diagram of current state;
Fig. 4 is the structural block diagram that configuration file modifies device in one embodiment;
Fig. 5 is the internal structure chart of computer equipment in one embodiment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, not For limiting the application.
Configuration file amending method provided by the present application, can be applied in application environment as shown in Figure 1.Wherein, eventually End 102 is communicated with server 104 by network by network.Server 104 reads multiple configuration files, more using configuration New plug-in unit scans multiple configuration files, obtains the current state of multiple configuration files, when judging corresponding match according to current state When setting file and needing to be implemented update operation, the local profile of terminal 102 is obtained, parses local profile, and from local Content to be updated is extracted in configuration file, obtains replacement configuration file, and extract and content to be updated from replacement configuration file Corresponding replacement content will replace the content to be updated in content replacement local profile, obtain updated be locally configured File.Wherein, terminal 102 can be, but not limited to be various personal computers, laptop and tablet computer, server 104 It can be realized with the server cluster of the either multiple server compositions of independent server.
In one embodiment, as shown in Fig. 2, providing a kind of configuration file amending method, it is applied to Fig. 1 in this way In server for be illustrated, comprising the following steps:
S202, server read multiple configuration files.
Specifically, server is by calling JDBC (connection of Java DataBase Connectivity, java database) Interface access data library, and obtain the configuration file in database, and when configuration file includes program starting need to program into The information of row configuration, such as when usually starting a software just installed, it may appear that the control of some filling registration informations, and ask Ask whether user will choose the check box for remembeing password, next automated log on etc., these registration informations have just been written into corresponding journey In the configuration file of sequence, when program will read configuration file next time automatically on startup, program is configured, it is corresponding soft Part can directly initiate.
S204, server by utilizing configuration update plug-in unit and scan multiple configuration files, obtain the current shape of multiple configuration files State.
Specifically, configuration updates plug-in unit and can be inserted in application program, and server is available to be inserted into application program Configuration updates multiple configuration files that plug-in unit scans corresponding application program, and configuration updates plug-in unit and is independently of application program, It is integrated in the operation catalogue of application program, called starting, two kinds of forms in the operation of corresponding application program launching Scan operation is executed in program operation process.
Configuration updates plug-in unit by being scanned to database, identifies the file where configuration file, and then right respectively File where multiple configuration files is scanned, and obtains under file the configuration rule information that obtains of multiple configuration files and pre- If configuration file status indicator, configuration rule information is compared with the status indicator of preset configuration file, obtain The current state of the configuration file.
S206, server obtain this when judging that corresponding configuration file needs to be implemented update operation according to current state Ground configuration file.
Specifically, the current state of configuration file is compared server with the preset state of configuration file, works as configuration When the preset state of file is consistent with the status indicator of preset configuration file, indicates that the configuration file does not need to execute and update behaviour Make;And when the preset state of the preset state of configuration file and configuration file is inconsistent, indicate corresponding configuration file needs It executes and updates operation, and then corresponding configuration file is needed to be implemented into the message for updating and operating and is sent to terminal, and obtains terminal Local profile.
S208, server parses local profile, and content to be updated is extracted from local profile.
Specifically, code is stored in local profile, code includes code content and content to be updated, code content For actual code content, belong to fixed part, content to be updated is renewable part in code, for code structure and generation Digital content is updated and modifies.Server obtains the code content in code by the code in parsing local profile With content to be updated, and contents extraction to be updated is come out.
S210, server obtains replacement configuration file, and extraction is corresponding with content to be updated from replacement configuration file Replace content.
Specifically, before obtaining replacement configuration file, judge in database with the presence or absence of corresponding to local profile Replacement configuration file, when there is corresponding replacement configuration file, server reads the replacement configuration file from database, The code in the replacement configuration file is obtained, and parses replacement configuration file, replacement content is extracted from replacement configuration file Out.
S212, server will replace the content to be updated in content replacement local profile, obtain updated local Configuration file.
Specifically, according to replacement content and content to be updated between corresponding relationship, by local profile to more New content replaces with the replacement content in replacement configuration file, realizes the update of local profile, obtain updated local Configuration file.
In above-mentioned configuration file amending method, server reads multiple configuration files, and it is more to update plug-in unit scanning using configuration A configuration file obtains the current state of multiple configuration files, when judging that corresponding configuration file needs are held according to current state When row updates operation, local profile is obtained, parses local profile, and is extracted in be updated from local profile Hold, obtains replacement configuration file, and extract replacement content corresponding with content to be updated from replacement configuration file, it will be in replacement Hold the content to be updated in replacement local profile, obtains updated local profile.It will can directly need to carry out more New configuration file replaces with existing replacement configuration file, it is not necessary that by program interrupt, the artificial modification for carrying out configuration file is kept away Exempt to interrupt service offer, improve work efficiency.
In one embodiment, corresponding configuration file need are judged according to current state as shown in figure 3, providing one kind and working as Execute update operation when, obtain local profile the step of, comprising:
The current state of configuration file is compared with the preset state of configuration file for S302, server.
Specifically, the current state of configuration file is scanned database by updating plug-in unit using configuration, and identification is matched The file where file is set, and then the file where multiple configuration files is scanned respectively, is obtained more under file The status indicator of configuration rule information and preset configuration file that a configuration file obtains matches configuration rule information with preset The status indicator for setting file is compared and obtains.
S304 indicates corresponding configuration when the preset state of the preset state of configuration file and configuration file is inconsistent File needs to be implemented update operation.
Specifically, when the preset state of configuration file is consistent with the status indicator of preset configuration file, indicate that this is matched It sets file and does not need to execute and update operation;And when the preset state of the preset state of configuration file and configuration file is inconsistent, It indicates that corresponding configuration file needs to be implemented update operation, and then corresponding configuration file is needed to be implemented to the message for updating operation It is sent to terminal, and obtains the local profile of terminal.
S306, corresponding configuration file is needed to be implemented the message for updating and operating and is sent to terminal by server, and obtains end The local profile at end.
Specifically, configuration file is needed to be implemented the message for updating and operating and is sent to terminal by server, and terminal receives this and disappears After breath, corresponding local profile is sent to server, after server receives corresponding local profile, obtains and corresponds to Local profile.
In above-mentioned steps, server is by comparing the preset state of the current state of configuration file and configuration file It is right, when judging the current state and inconsistent corresponding preset state of configuration file, obtains the configuration file and need to be implemented more The information newly operated, and when the preset state of configuration file is consistent with the status indicator of preset configuration file, indicate that this is matched It sets file and does not need to execute and update operation.The configuration file for needing to be implemented and updating operation can be prejudged, avoids repeating to being not necessarily to Update operation is performed a plurality of times in the configuration file being updated, and reduces resource consumption, improves the update efficiency of configuration file.
In one embodiment, it provides a kind of utilize and configures the multiple configuration files of update plug-in unit scanning, obtain multiple matches The step of setting the current state of file, comprising: multiple configurations update plug-in unit is inserted into program by server, and more using configuration New plug-in unit scans multiple configuration files;Server obtain multiple configuration files configuration rule information and preset configuration file Status indicator;Configuration rule information is compared server with the status indicator of preset configuration file, obtains configuration file Current state.
Wherein, configuration updates plug-in unit and can be inserted in application program, and server is available to be inserted into matching in application program It sets and updates multiple configuration files that plug-in unit scans corresponding application program, configuration updates plug-in unit and is independently of application program, collects At in the operation catalogue of application program, the called starting in the operation of corresponding application program launching, two kinds of forms can be Scan operation is executed in program operation process.
Specifically, configuration updates plug-in unit by being scanned to database, identifies the file where configuration file, in turn The file where multiple configuration files is scanned respectively, obtains the configuration rule letter that multiple configuration files obtain under file The status indicator of breath and preset configuration file, configuration rule information and the status indicator of preset configuration file are compared It is right, obtain the current state of the configuration file.
In above-mentioned steps, server, which passes through, updates the multiple configuration files of plug-in unit scanning using multiple configurations, and then obtains more The configuration rule information of a configuration file and the status indicator of preset configuration file, by configuration rule information and preset configuration After the status indicator of file is compared, the current state of configuration file is obtained.Using configuration update plug-in unit to configuration file into Row scanning, can be improved the judging efficiency for configuration file current state.
In one embodiment, a kind of configuration file amending method, this method are provided further include:
Server defines the configuration rule of data acquisition, and configuration rule is inserted into description file;Description file is read, And parse the configuration rule in description file;Corresponding processing mode is matched according to configuration rule, according to processing mode to corresponding Data execute corresponding operation, generate multiple configuration files.
Wherein, configuration rule includes: field value rule process, such as the adjustment of custom field default value, field format, word Section desensitization and specific character filtering;After configuration file defines decollator, the field value separator handled is spliced into grade of embarking on journey Character string;Row grade character string rule, handles character string, such as spcial character filtering etc..Description file, which is mounted in, is Plug-in unit corresponding with application program in system, the configuration file for including including the application program and profile rules.
Further, the field desensitization concrete operations in definition rule include: that initial character retains, other characters are all replaced For *, field rule proRule=" 109 " are set in configuration file.When reading the field value, obtaining rule is 109, corresponding method processing character string is found, specific processing method is StringUtils.rightPad (StringUtils.left(str,1),StringUtils.length(str),"*")。
Acquisition documentation requirements data line is stitched together with specific decollator.After configuration file defines decollator, it will handle Complete field value separator splices a grade character string of embarking on journey.The value for such as splicing field A is 2016-10-27, and the value of field B is The value of 69998.4, field C are 0, and separator is |, it is carried after method splices this three field values using StringBuilder class Result be 2016-10-27 | 69998.4 | 0 | 0 | 0.
Specifically, configuration rule is inserted into description file by server, and parses the configuration rule in description file, according to Configuration rule matches corresponding processing mode, including the adjustment of custom field default value, field format, field desensitization and specific word Symbol filtering etc., and corresponding operation is executed to corresponding data to according to processing mode, generate multiple configuration files.
In above-mentioned configuration file amending method, server is by defining the configuration rule of data acquisition, and by configuration rule In insertion description file, description file is read, and parses the configuration rule in description file, and then according to configuration rule matching pair The processing mode answered executes corresponding operation to corresponding data according to the matched processing mode of institute, generates multiple configuration files. Corresponding operation is executed using configuration rule and the corresponding data of configuration rule, realizes the generation of configuration file.
In one embodiment, the step of providing a kind of acquisition replacement configuration file, comprising:
Server by utilizing SQL statement, which inquires database, whether there is replacement configuration file corresponding with local profile; When corresponding replacement configuration file is not present in database, modification template is created according to local profile;According to modification mould The configuration rule information of plate and local profile generates corresponding replacement configuration file.
Specifically, server first judges to whether there is and be locally configured in database before obtaining replacement configuration file File replaces configuration file accordingly, and when there is corresponding replacement configuration file, server reads the replacement from database Configuration file obtains the replacement configuration file, and parses replacement configuration file, and replacement content is extracted from replacement configuration file Out.
When corresponding replacement configuration file is not present in database, according to the newly-built modification template of local profile, obtain The configuration rule information for taking local profile, according to the configuration rule information of local profile and newly-built modification template, Replacement configuration file corresponding with local profile is generated, and obtains the replacement configuration file, and parse replacement configuration file, Replacement content is extracted from replacement configuration file.
Above-mentioned steps, server prejudge database with the presence or absence of replacement corresponding with local profile configuration text Part creates modification template according to local profile, according to modification when corresponding replacement configuration file is not present in database Template and the configuration rule information of local profile generate corresponding replacement configuration file.It can generate and be locally configured in time text Part corresponding replacement configuration file when avoiding the need for executing update operation, causes to update there is no corresponding for configuration file There is the problem of mistake in failure, application program operation.
It should be understood that although each step in the flow chart of Fig. 2-3 is successively shown according to the instruction of arrow, These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps Execution there is no stringent sequences to limit, these steps can execute in other order.Moreover, at least one in Fig. 2-3 Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps Completion is executed, but can be executed at different times, the execution sequence in these sub-steps or stage is also not necessarily successively It carries out, but can be at least part of the sub-step or stage of other steps or other steps in turn or alternately It executes.
In one embodiment, as shown in figure 4, providing a kind of configuration file modification device, comprising: configuration file is read Module 402, configuration file current state obtain module 404, and local profile obtains module 406, contents extraction mould to be updated Block 408 replaces content extraction module 410 and configuration file update module 412, in which:
Configuration file read module 402, for reading multiple configuration files.
Configuration file current state obtains module 404, scans multiple configuration files for updating plug-in unit using configuration, obtains The current state of multiple configuration files.
Local profile obtains module 406, judges that corresponding configuration file needs to be implemented according to current state for working as When updating operation, local profile is obtained.
Content extraction module 408 to be updated is extracted for parsing local profile, and from local profile to more New content.
Content extraction module 410 is replaced, is used to obtain replacement configuration file, and extract in configuration file and to more from replacing The corresponding replacement content of new content.
Configuration file update module 410 is obtained for that will replace the content to be updated in content replacement local profile Updated local profile.
In above-mentioned configuration file modification device, server reads multiple configuration files, and it is more to update plug-in unit scanning using configuration A configuration file obtains the current state of multiple configuration files, when judging that corresponding configuration file needs are held according to current state When row updates operation, local profile is obtained, parses local profile, and is extracted in be updated from local profile Hold, obtains replacement configuration file, and extract replacement content corresponding with content to be updated from replacement configuration file, it will be in replacement Hold the content to be updated in replacement local profile, obtains updated local profile.It will can directly need to carry out more New configuration file replaces with existing replacement configuration file, it is not necessary that by program interrupt, the artificial modification for carrying out configuration file is kept away Exempt to interrupt service offer, improve work efficiency.
In one embodiment, a kind of configuration file modification device is provided, which further includes that configuration file generates mould Block is inserted into description file for defining the configuration rule of data acquisition, and by configuration rule;Description file is read, and is parsed Configuration rule in file is described;Corresponding processing mode is matched according to configuration rule, according to processing mode to corresponding data Corresponding operation is executed, multiple configuration files are generated.
In above-mentioned configuration file modification device, server is by defining the configuration rule of data acquisition, and by configuration rule In insertion description file, description file is read, and parses the configuration rule in description file, and then according to configuration rule matching pair The processing mode answered executes corresponding operation to corresponding data according to the matched processing mode of institute, generates multiple configuration files. Corresponding operation is executed using configuration rule and the corresponding data of configuration rule, realizes the generation of configuration file.
In one embodiment, a kind of configuration file modification device is provided, further includes replacement configuration file generation module, For whether there is replacement configuration file corresponding with local profile using SQL statement inquiry database;When in database There is no when corresponding replacement configuration file, modification template is created according to local profile;Matched according to modification template with local The configuration rule information for setting file generates corresponding replacement configuration file.
In above-mentioned configuration file modification device, server prejudges database with the presence or absence of corresponding with local profile Replacement configuration file, when in database be not present corresponding replacement configuration file when, according to local profile creation modification Template generates corresponding replacement configuration file according to modification template and the configuration rule information of local profile.It can give birth in time At replacement configuration file corresponding with local profile, when avoiding the need for executing update operation, there is no corresponding for configuration File and cause update fail, application program operation occurs mistake problem.
In one embodiment, a kind of configuration file modification device is provided, wherein configuration file current state obtains mould Block is also used to for multiple configurations update plug-in unit being inserted into program, and updates plug-in unit using configuration and scan multiple configuration files;It obtains Take the configuration rule information of multiple configuration files and the status indicator of preset configuration file;By configuration rule information with it is preset The status indicator of configuration file is compared, and obtains the current state of configuration file.
In above-mentioned configuration file modification device, server, which passes through, updates the multiple configuration texts of plug-in unit scanning using multiple configurations Part, and then the configuration rule information of multiple configuration files and the status indicator of preset configuration file are obtained, configuration rule is believed After breath is compared with the status indicator of preset configuration file, the current state of configuration file is obtained.It is updated and is inserted using configuration Part is scanned configuration file, and the judging efficiency for configuration file current state can be improved.
In one embodiment, a kind of configuration file modification device is provided, wherein local profile obtains module also For the current state of configuration file to be compared with the preset state of configuration file;When the preset state of configuration file with match Set file preset state it is inconsistent when, indicate corresponding configuration file need to be implemented update operation;By corresponding configuration file It needs to be implemented the message for updating and operating and is sent to terminal, and obtain the local profile of terminal.
In above-mentioned configuration file modification device, server is by by the default of the current state of configuration file and configuration file State is compared, and when judging the current state and inconsistent corresponding preset state of configuration file, obtains the configuration file The information for updating operation is needed to be implemented, and when the preset state of configuration file is consistent with the status indicator of preset configuration file When, it indicates that the configuration file does not need to execute and updates operation.The configuration file for needing to be implemented and updating operation can be prejudged, is avoided It repeats the configuration file without being updated to be performed a plurality of times update operation, reduces resource consumption, improve configuration file more New efficiency.
Specific about configuration file modification device limits the limit that may refer to above for configuration file amending method Fixed, details are not described herein.Modules in above-mentioned configuration file modification device can fully or partially through software, hardware and its Combination is to realize.Above-mentioned each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also be with It is stored in the memory in computer equipment in a software form, in order to which processor calls the above modules of execution corresponding Operation.
In one embodiment, a kind of computer equipment is provided, which can be server, internal junction Composition can be as shown in Figure 5.The computer equipment include by system bus connect processor, memory, network interface and Database.Wherein, the processor of the computer equipment is for providing calculating and control ability.The memory packet of the computer equipment Include non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system, computer program and data Library.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The calculating The database of machine equipment is used for storage configuration file information data.The network interface of the computer equipment is used for and external terminal It is communicated by network connection.To realize a kind of configuration file amending method when the computer program is executed by processor.
It will be understood by those skilled in the art that structure shown in Fig. 5, only part relevant to application scheme is tied The block diagram of structure does not constitute the restriction for the computer equipment being applied thereon to application scheme, specific computer equipment It may include perhaps combining certain components or with different component layouts than more or fewer components as shown in the figure.
In one embodiment, a kind of computer equipment, including memory and processor are provided, which is stored with Computer program, the processor perform the steps of when executing computer program
Read multiple configuration files;
Plug-in unit is updated using configuration and scans multiple configuration files, obtains the current state of multiple configuration files;
When judging that corresponding configuration file needs to be implemented update operation according to current state, local profile is obtained;
Local profile is parsed, and extracts content to be updated from local profile;
Replacement configuration file is obtained, and extracts replacement content corresponding with content to be updated from replacement configuration file;
The content to be updated in content replacement local profile will be replaced, obtains updated local profile.
In one embodiment, it is also performed the steps of when processor executes computer program
The configuration rule of data acquisition is defined, and configuration rule is inserted into description file;
Description file is read, and parses the configuration rule in description file;
Corresponding processing mode is matched according to configuration rule, corresponding behaviour is executed to corresponding data according to processing mode Make, generates multiple configuration files.
In one embodiment, it is also performed the steps of when processor executes computer program
Multiple configurations update plug-in unit is inserted into program, and updates plug-in unit using configuration and scans multiple configuration files;
Obtain the configuration rule information of multiple configuration files and the status indicator of preset configuration file;
Configuration rule information is compared with the status indicator of preset configuration file, obtains the current shape of configuration file State.
In one embodiment, it is also performed the steps of when processor executes computer program
The current state of configuration file is compared with the preset state of configuration file;
When the preset state of the preset state of configuration file and configuration file is inconsistent, indicate that corresponding configuration file needs Execute update operation;
Corresponding configuration file is needed to be implemented into the message for updating and operating and is sent to terminal, and obtains being locally configured for terminal File.
In one embodiment, it is also performed the steps of when processor executes computer program
It whether there is replacement configuration file corresponding with local profile using SQL statement inquiry database;
When corresponding replacement configuration file is not present in database, modification template is created according to local profile;
Corresponding replacement configuration file is generated according to modification template and the configuration rule information of local profile.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program performs the steps of when being executed by processor
Read multiple configuration files;
Plug-in unit is updated using configuration and scans multiple configuration files, obtains the current state of multiple configuration files;
When judging that corresponding configuration file needs to be implemented update operation according to current state, local profile is obtained;
Local profile is parsed, and extracts content to be updated from local profile;
Replacement configuration file is obtained, and extracts replacement content corresponding with content to be updated from replacement configuration file;
The content to be updated in content replacement local profile will be replaced, obtains updated local profile.
In one embodiment, it is also performed the steps of when computer program is executed by processor
The configuration rule of data acquisition is defined, and configuration rule is inserted into description file;
Description file is read, and parses the configuration rule in description file;
Corresponding processing mode is matched according to configuration rule, corresponding behaviour is executed to corresponding data according to processing mode Make, generates multiple configuration files.
In one embodiment, it is also performed the steps of when computer program is executed by processor
Multiple configurations update plug-in unit is inserted into program, and updates plug-in unit using configuration and scans multiple configuration files;
Obtain the configuration rule information of multiple configuration files and the status indicator of preset configuration file;
Configuration rule information is compared with the status indicator of preset configuration file, obtains the current shape of configuration file State.
In one embodiment, it is also performed the steps of when computer program is executed by processor
The current state of configuration file is compared with the preset state of configuration file;
When the preset state of the preset state of configuration file and configuration file is inconsistent, indicate that corresponding configuration file needs Execute update operation;
Corresponding configuration file is needed to be implemented into the message for updating and operating and is sent to terminal, and obtains being locally configured for terminal File.
In one embodiment, it is also performed the steps of when computer program is executed by processor
It whether there is replacement configuration file corresponding with local profile using SQL statement inquiry database;
When corresponding replacement configuration file is not present in database, modification template is created according to local profile;
Corresponding replacement configuration file is generated according to modification template and the configuration rule information of local profile.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, To any reference of memory, storage, database or other media used in each embodiment provided herein, Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection of the application Range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.

Claims (10)

1. a kind of configuration file amending method, which comprises
Read multiple configuration files;
Plug-in unit is updated using configuration and scans multiple configuration files, obtains the current state of multiple configuration files;
When judging that corresponding configuration file needs to be implemented update operation according to the current state, local profile is obtained;
The local profile is parsed, and extracts content to be updated from the local profile;
Replacement configuration file is obtained, and out of extraction in the replacement configuration file replacement corresponding with the content to be updated Hold;
The replacement content is replaced into the content to be updated in the local profile, obtains updated text being locally configured Part.
2. the method according to claim 1, wherein before the multiple configuration files of reading, comprising:
The configuration rule of data acquisition is defined, and the configuration rule is inserted into description file;
The description file is read, and parses the configuration rule in the description file;
Corresponding processing mode is matched according to the configuration rule, corresponding data are executed according to the processing mode corresponding Operation, generates multiple configuration files.
3. the method according to claim 1, wherein described update the multiple configurations of plug-in unit scanning using configuration File obtains the current state of multiple configuration files, comprising:
Multiple configurations update plug-in unit is inserted into described program, and updates plug-in unit using the configuration and scans multiple configurations File;
Obtain the configuration rule information of multiple configuration files and the status indicator of preset configuration file;
The configuration rule information is compared with the status indicator of the preset configuration file, obtains the configuration file Current state.
4. according to claim 1 to method described in 3 any one, which is characterized in that described to be sentenced according to the current state When the corresponding configuration file that breaks needs to be implemented update operation, local profile is obtained, comprising:
The current state of the configuration file is compared with the preset state of the configuration file;
When the preset state of the preset state of the configuration file and the configuration file is inconsistent, corresponding configuration text is indicated Part needs to be implemented update operation;
The corresponding configuration file is needed to be implemented into the message for updating and operating and is sent to terminal, and obtains being locally configured for terminal File.
5. method according to any one of claims 1 to 3, which is characterized in that before the acquisition replacement configuration file, also Include:
It whether there is replacement configuration file corresponding with local profile using SQL statement inquiry database;
When corresponding replacement configuration file is not present in the database, modification mould is created according to the local profile Plate;
Corresponding replacement configuration file is generated according to the configuration rule information of the modification template and local profile.
6. a kind of configuration file modifies device, which is characterized in that described device includes:
Configuration file read module, for reading multiple configuration files;
Configuration file current state obtains module, scans multiple configuration files for updating plug-in unit using configuration, obtains more The current state of a configuration file;
Local profile obtains module, judges that corresponding configuration file needs to be implemented update according to the current state for working as When operation, local profile is obtained;
Content extraction module to be updated, for parsing the local profile, and from the local profile extract to More new content;
Replace content extraction module, for obtain replacement configuration file, and from the replacement configuration file extract and it is described to The corresponding replacement content of more new content;
Configuration file update module is obtained for the replacement content to be replaced the content to be updated in the local profile To updated local profile.
7. configuration file according to claim 6 modifies device, which is characterized in that it further include configuration file generation module, It is inserted into description file for defining the configuration rule of data acquisition, and by the configuration rule;
The description file is read, and parses the configuration rule in the description file;
Corresponding processing mode is matched according to the configuration rule, corresponding data are executed according to the processing mode corresponding Operation, generates multiple configuration files.
8. configuration file according to claim 6 modifies device, which is characterized in that described device further includes replacement configuration text Part generation module, for whether there is replacement configuration file corresponding with local profile using SQL statement inquiry database;
When corresponding replacement configuration file is not present in the database, modification mould is created according to the local profile Plate;
Corresponding replacement configuration file is generated according to the configuration rule information of the modification template and local profile.
9. a kind of computer equipment, including memory and processor, the memory are stored with computer program, feature exists In the step of processor realizes any one of claims 1 to 5 the method when executing the computer program.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program The step of method described in any one of claims 1 to 5 is realized when being executed by processor.
CN201811020750.XA 2018-09-03 2018-09-03 Configuration file amending method, device, computer equipment and storage medium Pending CN109358869A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811020750.XA CN109358869A (en) 2018-09-03 2018-09-03 Configuration file amending method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811020750.XA CN109358869A (en) 2018-09-03 2018-09-03 Configuration file amending method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN109358869A true CN109358869A (en) 2019-02-19

Family

ID=65350608

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811020750.XA Pending CN109358869A (en) 2018-09-03 2018-09-03 Configuration file amending method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109358869A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110058870A (en) * 2019-03-16 2019-07-26 平安城市建设科技(深圳)有限公司 Automatic detection upgrade method, device, equipment and storage medium
CN110278480A (en) * 2019-06-11 2019-09-24 晶晨半导体(上海)股份有限公司 TV channel pre-setting method, device, computer equipment and readable storage medium storing program for executing
CN110941530A (en) * 2019-11-11 2020-03-31 南方电网财务有限公司 Method and device for acquiring monitoring data, computer equipment and storage medium
CN111046003A (en) * 2019-12-06 2020-04-21 北京地拓科技发展有限公司 Method and device for updating soil erosion factor data and electronic equipment
CN111258618A (en) * 2020-01-13 2020-06-09 深圳壹账通智能科技有限公司 File configuration method and device, computer equipment and storage medium
CN111949289A (en) * 2020-07-13 2020-11-17 中国长城科技集团股份有限公司 File updating method and device, electronic equipment and storage medium
CN112003731A (en) * 2020-07-27 2020-11-27 新华三技术有限公司 Configuration method and device
CN112035871A (en) * 2020-07-22 2020-12-04 北京中安星云软件技术有限公司 Dynamic desensitization method and system based on database driven proxy
CN112486532A (en) * 2020-11-25 2021-03-12 中移(杭州)信息技术有限公司 Method and device for managing configuration file, electronic equipment and storage medium
CN112925584A (en) * 2021-02-26 2021-06-08 北京百度网讯科技有限公司 Scene-based file configuration method, device, storage medium, and program product
CN116776849A (en) * 2023-06-06 2023-09-19 深圳市平方科技股份有限公司 Template editing method and device for ship EDI, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677821A (en) * 2013-12-05 2014-03-26 金蝶软件(中国)有限公司 Method and device for publishing software development tool code
CN104199666A (en) * 2014-09-09 2014-12-10 北京京东尚科信息技术有限公司 Dynamic configuration method and device for application program
CN105871649A (en) * 2016-06-21 2016-08-17 上海帝联信息科技股份有限公司 Node server, service side and configuration file updating method thereof and updating control method
CN108270609A (en) * 2017-01-04 2018-07-10 武汉斗鱼网络科技有限公司 A kind of method and device for the configuration file for updating Website server
CN108334381A (en) * 2018-01-30 2018-07-27 北京铂阳顶荣光伏科技有限公司 A kind of configuration method and system, filming equipment of filming equipment parameter

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677821A (en) * 2013-12-05 2014-03-26 金蝶软件(中国)有限公司 Method and device for publishing software development tool code
CN104199666A (en) * 2014-09-09 2014-12-10 北京京东尚科信息技术有限公司 Dynamic configuration method and device for application program
CN105871649A (en) * 2016-06-21 2016-08-17 上海帝联信息科技股份有限公司 Node server, service side and configuration file updating method thereof and updating control method
CN108270609A (en) * 2017-01-04 2018-07-10 武汉斗鱼网络科技有限公司 A kind of method and device for the configuration file for updating Website server
CN108334381A (en) * 2018-01-30 2018-07-27 北京铂阳顶荣光伏科技有限公司 A kind of configuration method and system, filming equipment of filming equipment parameter

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110058870A (en) * 2019-03-16 2019-07-26 平安城市建设科技(深圳)有限公司 Automatic detection upgrade method, device, equipment and storage medium
CN110278480A (en) * 2019-06-11 2019-09-24 晶晨半导体(上海)股份有限公司 TV channel pre-setting method, device, computer equipment and readable storage medium storing program for executing
CN110941530B (en) * 2019-11-11 2023-09-26 南方电网财务有限公司 Method, device, computer equipment and storage medium for acquiring monitoring data
CN110941530A (en) * 2019-11-11 2020-03-31 南方电网财务有限公司 Method and device for acquiring monitoring data, computer equipment and storage medium
CN111046003A (en) * 2019-12-06 2020-04-21 北京地拓科技发展有限公司 Method and device for updating soil erosion factor data and electronic equipment
CN111046003B (en) * 2019-12-06 2024-03-01 北京地拓科技发展有限公司 Soil erosion factor data updating method and device and electronic equipment
CN111258618A (en) * 2020-01-13 2020-06-09 深圳壹账通智能科技有限公司 File configuration method and device, computer equipment and storage medium
CN111949289A (en) * 2020-07-13 2020-11-17 中国长城科技集团股份有限公司 File updating method and device, electronic equipment and storage medium
CN112035871A (en) * 2020-07-22 2020-12-04 北京中安星云软件技术有限公司 Dynamic desensitization method and system based on database driven proxy
CN112003731A (en) * 2020-07-27 2020-11-27 新华三技术有限公司 Configuration method and device
CN112003731B (en) * 2020-07-27 2022-07-12 新华三技术有限公司 Configuration method and device
CN112486532A (en) * 2020-11-25 2021-03-12 中移(杭州)信息技术有限公司 Method and device for managing configuration file, electronic equipment and storage medium
CN112486532B (en) * 2020-11-25 2024-04-09 中移(杭州)信息技术有限公司 Configuration file management method and device, electronic equipment and storage medium
CN112925584A (en) * 2021-02-26 2021-06-08 北京百度网讯科技有限公司 Scene-based file configuration method, device, storage medium, and program product
CN116776849A (en) * 2023-06-06 2023-09-19 深圳市平方科技股份有限公司 Template editing method and device for ship EDI, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109358869A (en) Configuration file amending method, device, computer equipment and storage medium
CN110941546A (en) Automatic test method, device, equipment and storage medium for WEB page case
CN109062925B (en) Method, device, computer equipment and storage medium for automatically generating insert sentences
CN107341102B (en) Test case file generation method and device
CN110442378B (en) Method and system for modifying interface document
CN110851159B (en) Business rule updating method and device, computer equipment and storage medium
CN110019566A (en) Data checking, device, computer equipment and storage medium based on data warehouse
CN117077624B (en) Word stock online processing method, device and medium
CN114489950A (en) Component adapting method and device, electronic equipment and storage medium
CN112631908A (en) Browser page testing method and device, computer equipment and storage medium
CN110737426B (en) Program block creating method, program block creating device, computer equipment and storage medium
CN114205423B (en) Method, device, equipment and medium for adapting private protocol based on IPMI protocol
CN113342447B (en) Page generation method, device, equipment and storage medium based on Flutter
CN114116268A (en) Method and device for checking Flink SQL statement, computer equipment and storage medium
CN114371866A (en) Version reconfiguration test method, device and equipment of service system
CN115269402B (en) Test data matching method, device, computer equipment and storage medium
CN114089976B (en) Method, apparatus, and medium for generating database operation statements
CN113778888B (en) Code automatic test method, system, equipment and storage medium
CN116680203B (en) Multi-tenant-oriented SaaS platform testing method, device, equipment and medium
CN112015478B (en) Kernel loading method, server, device, computer device and storage medium
CN112433743B (en) File updating method and device, electronic equipment and storage medium
CN113032332B (en) Label data processing method, apparatus, computer device and storage medium
US20240152387A1 (en) Method, apparatus, electronic device and storage medium for application launch
CN113360178B (en) Method, device and equipment for generating unique software identification code and readable storage medium
WO2020206839A1 (en) Code snippet correction method and apparatus, computer device, 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