CN115344301A - Configuration file checking method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN115344301A
CN115344301A CN202211013982.9A CN202211013982A CN115344301A CN 115344301 A CN115344301 A CN 115344301A CN 202211013982 A CN202211013982 A CN 202211013982A CN 115344301 A CN115344301 A CN 115344301A
Authority
CN
China
Prior art keywords
configuration file
verification
target
definition
target configuration
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
CN202211013982.9A
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.)
China Travelsky Technology Co Ltd
Original Assignee
China Travelsky 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 China Travelsky Technology Co Ltd filed Critical China Travelsky Technology Co Ltd
Priority to CN202211013982.9A priority Critical patent/CN115344301A/en
Publication of CN115344301A publication Critical patent/CN115344301A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a configuration file checking method, a device, electronic equipment and a storage medium, firstly acquiring definition information configured in a development stage, wherein the definition information comprises a micro-service application name, a configuration file version, a configuration file format and a configuration file mode definition; further, the micro-service application name, the configuration file version and the uploaded target configuration file which are input in the operation and maintenance stage are received; further, determining a configuration file mode definition matched with the input micro-service application name, the configuration file version and the configuration file format of the uploaded target configuration file through the matching definition information, and carrying out validity check on the target configuration file by using the target configuration file mode definition.

Description

Configuration file checking method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of software technologies, and in particular, to a method and an apparatus for checking a configuration file, an electronic device, and a storage medium.
Background
In the distributed architecture of the microservice, the configuration center is a core component for uniformly managing all configuration files of microservice applications in the distributed system. Compared with an application configuration file management mode in the traditional monomer architecture, the micro-service configuration center has the following advantages: the method has the advantages that the configuration files common to the microservice applications in the centralized management distributed scene support dynamic updating of the configuration files during operation, isolation of the configuration files according to the deployment environment and updating and auditing of the configuration files, and therefore the method is widely used in the industry.
The configuration files in the configuration center store structured configuration data, typically in the format of: JSON, YAML and XML, when the micro-service application is started or the configuration file is changed, the configuration file can be read and analyzed by the application, and the configuration file is used by the application after being analyzed.
Therefore, how to check the validity of the configuration file in the microservice configuration center is an urgent problem to be solved at the present stage.
Disclosure of Invention
In view of the above, to solve the above problems, the present disclosure provides a method and an apparatus for checking a configuration file, an electronic device, and a storage medium, where the technical scheme is as follows:
a method of profile verification, the method comprising:
acquiring definition information configured in a development stage, wherein the definition information comprises a microservice application name, a configuration file version, a configuration file format and a configuration file mode definition;
receiving a micro-service application name, a configuration file version and an uploaded target configuration file which are input in an operation and maintenance stage;
and determining a target configuration file mode definition matched with the input micro-service application name, the configuration file version and the configuration file format of the uploaded target configuration file by matching the definition information, and performing validity check on the target configuration file by using the target configuration file mode definition.
Optionally, the target configuration file includes: the application starts the required configuration file or updates the configured configuration file.
Optionally, the method further includes:
and outputting a validity check result of the target configuration file.
Optionally, the method further includes:
and if the validity check result of the target configuration file is check failure, outputting check error information.
Optionally, the method further includes:
and if the target configuration file is the configured configuration file after being updated, inquiring the verification failure log at regular time, and outputting an alarm notice under the condition that a newly added verification failure record exists in the verification failure log.
A profile verification apparatus, the apparatus comprising:
the system comprises a definition configuration module, a configuration module and a configuration module, wherein the definition configuration module is used for acquiring definition information configured in a development stage, and the definition information comprises a microservice application name, a configuration file version, a configuration file format and a configuration file mode definition;
the file checking module is used for receiving the micro-service application name, the configuration file version and the uploaded target configuration file which are input in the operation and maintenance stage; and determining a target configuration file mode definition matched with the input micro-service application name, the configuration file version and the configuration file format of the uploaded target configuration file by matching the definition information, and carrying out validity check on the target configuration file by using the target configuration file mode definition.
Optionally, the file checking module is further configured to:
and outputting the validity check result of the target configuration file.
Optionally, the file checking module is further configured to:
and if the validity verification result of the target configuration file is verification failure, outputting verification error information.
An electronic device, the electronic device comprising: at least one memory and at least one processor; the memory stores an application program, the processor calls the application program stored in the memory, and the application program is used for realizing the configuration file checking method.
A storage medium storing computer program code which, when executed, implements the profile verification method.
Compared with the prior art, the beneficial effects realized by the present disclosure are:
the disclosure provides a configuration file checking method, a device, an electronic device and a storage medium, firstly obtaining definition information configured in a development stage, wherein the definition information comprises a micro-service application name, a configuration file version, a configuration file format and a configuration file mode definition; further, the name and the version of the configuration file of the micro-service application and the uploaded target configuration file which are input in the operation and maintenance stage are received; further, determining a configuration file mode definition matched with the input micro-service application name, the configuration file version and the configuration file format of the uploaded target configuration file through matching definition information, and performing validity check on the target configuration file by using the target configuration file mode definition. The method and the device can realize validity check on the configuration file in the micro-service configuration center, ensure that the micro-service application can be started normally and the configuration file can be updated successfully when the application runs, and ensure that the configuration meets the service requirement.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is a diagram illustrating a problem in the prior art of configuration center configuration effectiveness in a micro-service startup scenario;
FIG. 2 is a diagram illustrating a prior art problem of configuration validity of a configuration center in a configuration update scenario;
fig. 3 is a flowchart of a method of a configuration file verification method according to an embodiment of the present disclosure;
fig. 4 is a schematic flowchart of developer configuration definition information provided in the embodiment of the present disclosure;
fig. 5 is a schematic flowchart of an operation and maintenance staff deployment verification configuration file according to an embodiment of the present disclosure;
fig. 6 is a schematic flowchart illustrating a process of checking validity of a configuration file after an operation and maintenance worker starts a microservice application according to an embodiment of the present disclosure;
fig. 7 is a schematic flowchart of a process of verifying the validity of the configuration file after the configuration file is updated by the operation and maintenance staff according to the embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a configuration file verification apparatus according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The inventor finds that the existing technical scheme of the microservice configuration center has the following problems:
1) When the configuration file format has errors, the configuration analysis process fails, which may cause failure in starting the application and causing production failure on the one hand, and cause failure in executing the expected business process due to failure in updating the configuration file during running the application on the other hand.
2) When the configuration file content does not meet the business requirements (if the numbers need to be configured, but the operation and maintenance personnel configure the character strings containing the letters), the configuration and analysis process may be successful, but the expected business logic cannot be guaranteed to be normally executed, so that the service is abnormal.
3) When the configuration file is invalid, clear configuration error reasons cannot be provided, so that operation and maintenance personnel are difficult to analyze and solve problems.
4) When the configuration file is invalid and application faults are caused, operation and maintenance personnel cannot timely sense and repair the configuration file, and the influence range of online problems is enlarged.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating the existing problem of configuration validity of a configuration center in a micro-service startup scenario. In the operation and maintenance stage, after the operation and maintenance personnel start the micro service application, the micro service application reads the configuration according to the configuration file name, the configuration center inquires the configuration character string according to the configuration file name and returns the configuration character string to the micro service application, and the micro service application analyzes the configuration character string. When the configuration file format has errors, the problem of format analysis failure can occur, so that the application is failed to start; when the content of the configuration file conforms to the service requirement, the problem that the format analysis is successful but the configuration does not conform to the service logic occurs, and at the moment, operation and maintenance personnel cannot be notified in time, so that the execution of the service process fails.
Referring to fig. 2, fig. 2 is a schematic diagram illustrating the existing problem of configuration effectiveness of a configuration center in a configuration update scenario. In the operation and maintenance stage, after the operation and maintenance personnel update the configuration file, the configuration center updates the configuration file character string, pushes the updated configuration to the micro-service application, and the micro-service application analyzes the configuration character string. When the configuration file format has errors, the problem of 'format analysis failure' occurs, and at the moment, an operator cannot be notified in time, so that configuration updating is not effective; when the content of the configuration file conforms to the service requirement, the problem that the format analysis is successful but the configuration does not conform to the service logic occurs, and at the moment, operation and maintenance personnel cannot be informed in time, so that the configuration updating is not effective.
To solve the above problem, the present disclosure provides a method for checking a configuration file, which performs validity checking on the configuration file in a micro service configuration center, ensures that a micro service application can be started normally and the configuration file can be updated successfully when the application runs, ensures that the configuration meets the service requirement, and ensures that a real-time alarm can be given when the configuration file fails to be checked.
Referring to fig. 3, fig. 3 is a flowchart of a method of a configuration file verification method according to an embodiment of the present disclosure, where the method includes the following steps:
s10, obtaining definition information configured in a development stage, wherein the definition information comprises a microservice application name, a configuration file version, a configuration file format and a configuration file mode definition.
In the embodiment of the disclosure, a developer can define a configuration mode of a structured configuration file in a development phase, and the definition items include a micro-service application name, a configuration file version, a configuration file format and a configuration file mode definition, and are used in a subsequent configuration file validity verification phase.
Referring to fig. 4, fig. 4 is a schematic flowchart of developer configuration definition information provided in the embodiment of the present disclosure. With continued reference to fig. 4, in the development phase, the developer accesses the page provided by the profile verification service (i.e., the profile verification front-end page in fig. 4), creates a profile schema definition, fills in definition information (including the microservice application name, the profile version, the profile format, and the profile schema definition), and clicks the create button, thereby invoking the backend service (i.e., the profile verification backend service in fig. 4). The configuration file verification back-end service receives the configuration file mode definition creating request, executes the saving operation, saves the configuration file mode definition, and returns information prompting the successful creation of the configuration file mode definition to the configuration file verification front-end page.
It should be noted that, for a configuration file with a configuration file format of JSON or YAML, the configuration file mode definition format is JSON schema; for the configuration file with the configuration file format of XML format, the configuration file mode definition format is XML schema. The configuration file mode definition needs to be written according to the service requirement, and the verification scene for configuration validity in the service requirement is covered.
And S20, receiving the name, the name and the version of the configuration file of the micro-service application and the uploaded target configuration file which are input in the operation and maintenance stage.
In the embodiment of the disclosure, in the operation and maintenance stage, an operation and maintenance person may input the microservice application name, the configuration file name, and the configuration file version based on the HTTP request, and upload the configuration file to be verified, that is, the target configuration file.
And S30, determining a target configuration file mode definition matched with the input micro-service application name, the configuration file version and the configuration file format of the uploaded target configuration file through the matching definition information, and carrying out validity check on the target configuration file by using the target configuration file mode definition.
In the embodiment of the present disclosure, a configuration file format of the target configuration file is determined, and then the definition information configured in step S10 is used to match the input micro-service application name, configuration file version, and configuration file format of the target configuration file to determine a corresponding configuration file mode definition, that is, a target configuration file mode definition, and further the target configuration file mode definition is used to perform validity check on the target configuration file, so as to obtain a validity check result of the target configuration file.
In some embodiments, in order to enable an operation and maintenance worker to obtain a validity check result in time, the configuration file checking method provided in the embodiments of the present disclosure may further include the following steps:
and outputting the validity check result of the target configuration file.
Referring to fig. 5, fig. 5 is a schematic flowchart of an operation and maintenance staff deploying and verifying configuration file according to an embodiment of the present disclosure. Continuing to refer to fig. 5, in the operation and maintenance stage, before starting the micro-service application or updating the configuration, the operation and maintenance staff accesses the page provided by the configuration file verification service (i.e., the configuration file verification front-end page in fig. 5), sequentially selects the application name, the configuration file name, and the configuration file version, uploads the configuration file required by starting the application or the configuration file after the configuration is updated (i.e., the target configuration file), and clicks the verification button, thereby invoking the back-end service (i.e., the configuration file verification back-end service in fig. 5). The configuration file verification back-end service can determine a matched configuration file mode definition (namely a target configuration file mode definition) according to the application name, the configuration file version and the configuration file format of the target configuration file selected by the operation and maintenance personnel, use the configuration file mode definition to perform verification operation on the target configuration file, and return a verification result to a configuration file verification front-end page. And the configuration file verification front-end page displays a configuration file verification result returned by the configuration file verification back-end service, namely a verification result of the target configuration file. If the validity check of the configuration file is successful, the step is ended, and the start of the micro-service application or the configuration update can be normally executed. If the verification of the validity of the configuration file fails, the operation and maintenance personnel need to change the content of the configuration file with errors and verify the configuration file again until the verification is successful.
In some embodiments, in order to enable the operation and maintenance staff to obtain a specific reason for the verification failure in time, the configuration file verification method provided in the embodiments of the present disclosure further includes the following steps:
and if the validity verification result of the target configuration file is verification failure, outputting verification error information.
In the embodiment of the disclosure, when the configuration file verification back-end service feeds back the validity verification result of the target configuration file, for the case that the validity verification result is verification failure, a specific reason of the verification failure may also be output to form verification error information, where the verification error information includes a configuration file name, a configuration item positioning expression that makes an error, and a specific error reason of the configuration item.
Therefore, if the verification of the validity of the configuration file fails, operation and maintenance personnel need to modify the content of the configuration file with errors according to the reasons for the verification errors displayed on the front-end page of the verification of the configuration file and verify the content again until the verification is successful.
On this basis, in order to implement a timely alarm notification to operation and maintenance personnel, the configuration file verification method provided by the embodiment of the disclosure further includes the following steps:
and if the target configuration file is the configured configuration file after the updating, inquiring the verification failure log at regular time, and outputting an alarm notice under the condition that a newly added verification failure record exists in the verification failure log.
In the embodiment of the present disclosure, the target configuration file may be a configuration file required for starting an application, and may also be a configuration file after being configured by an update. If the target configuration file is the configured configuration file after being updated, the configuration file verification back-end service can regularly inquire whether the target configuration file in the microservice application log storage data source is a verification failure log, and if newly-added validity verification failure records are found, alarm notifications can be provided for operation and maintenance personnel through various notification channels.
Referring to fig. 6, fig. 6 is a schematic flowchart illustrating a process that an operation and maintenance worker checks validity of a configuration file after starting a microservice application according to an embodiment of the present disclosure. With reference to fig. 6, the target configuration file is a configuration file required by application start, in the operation and maintenance stage, after the operation and maintenance personnel start the micro service application, the micro service application reads configuration according to the name of the configuration file, and the configuration center queries the configuration character string according to the name of the configuration file and returns the configuration character string to the micro service application. The micro-service application calls a configuration file verification back-end service before analyzing the configuration character string, inputs a micro-service application name, a configuration file name and a configuration file version and uploads a target configuration file, and the configuration file verification back-end service performs validity verification on the target configuration file and returns a result of the validity verification to the micro-service application. If the verification is successful, the micro-service application can parse the configuration string to be successfully started, and the service logic can be normally executed. If the verification fails, the micro-service application prints specific verification error information in the start log, the operation and maintenance personnel update the configuration file in the configuration center according to the verification error information (the configuration file can be updated by the aid of the verification page in fig. 5), and the start steps are repeated until the micro-service application is started successfully.
Referring to fig. 7, fig. 7 is a schematic flowchart illustrating a process of verifying the validity of the configuration file after the configuration file is updated by the operation and maintenance staff according to the embodiment of the present disclosure. Continuing to refer to fig. 7, the target configuration file is the configuration file after the configuration is updated, in the operation and maintenance stage, the configuration center updates the configuration file character string after the configuration file is updated by the operation and maintenance personnel, pushes the updated configuration file to the micro-service application, calls the configuration file verification back-end service before the micro-service application analyzes the configuration character string, inputs the name of the micro-service application, the name of the configuration file, the version of the configuration file and uploads the target configuration file, and the configuration file verification back-end service performs validity verification on the target configuration file and returns the result of validity verification of the micro-service application. If the verification is successful, the configuration update takes effect in the micro-service application, and the service logic can be normally executed. If the verification fails, the micro-service application prints specific verification error information in a verification failure log, the configuration file verification back-end service can inquire the verification failure log at regular time, and if newly added verification failure records are found, alarm notification is provided for operation and maintenance personnel through various notification channels. After receiving the alarm notification, the operation and maintenance personnel updates the configuration file in the configuration center according to the verification error information in the alarm notification (the configuration file can be updated by the aid of the verification page in fig. 5), and repeats the starting step until the configuration update becomes effective.
It should be noted that if the operation and maintenance staff can ensure that steps S10 to S30 are completed before the micro service application is started or the configuration is updated, and the micro service application is started or the configuration is updated without fail.
It is to be noted that the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The configuration file verification method provided by the embodiment of the disclosure effectively solves the problems existing in the technical scheme of the existing micro service configuration center, and compared with the scheme that verification is not performed in the current industry, the configuration file verification method has the following advantages:
1) The configuration file format is ensured to be correct, so that the microservice application can be started normally, and the configuration file can be updated successfully when the application runs.
2) Configuration is guaranteed to meet business requirements, expected business logic can be correctly executed, and business stability is guaranteed.
3) When the configuration file is invalid, clear and specific configuration error reasons can be provided, operation and maintenance personnel can analyze and solve problems quickly, and operation and maintenance efficiency is improved.
4) When the configuration file is invalid, the real-time warning can be realized, operation and maintenance personnel can conveniently sense and repair the problems in time, and the influence range of the problems on the line is reduced.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Although the operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
Based on the configuration file verification method provided in the foregoing embodiment, an embodiment of the present disclosure provides a device for executing the configuration file verification method, where a schematic structural diagram of the device is shown in fig. 8, and the device includes:
the definition configuration module 10 is configured to obtain definition information configured in a development phase, where the definition information includes a microservice application name, a configuration file version, a configuration file format, and a configuration file mode definition;
the file checking module 20 is configured to receive a micro-service application name, a configuration file version, and an uploaded target configuration file that are input in an operation and maintenance phase; and determining a target configuration file mode definition matched with the input micro-service application name, the configuration file version and the configuration file format of the uploaded target configuration file through the matching definition information, and performing validity check on the target configuration file by using the target configuration file mode definition.
Optionally, the file checking module 20 is further configured to:
and outputting the validity check result of the target configuration file.
Optionally, the file checking module 20 is further configured to:
and if the validity check result of the target configuration file is a check failure, outputting check error information.
Optionally, the apparatus further comprises:
and the alarm notification module is used for inquiring the verification failure log at regular time if the target configuration file is the configuration file after the configuration is updated, and outputting an alarm notification under the condition that a newly added verification failure record exists in the verification failure log.
It should be noted that, for the detailed functions of each module in the embodiment of the present disclosure, reference may be made to the corresponding disclosure part of the embodiment of the configuration file checking method, and details are not described herein again.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), complex Programmable Logic Devices (CPLDs), and the like.
Based on the configuration file verification method provided in the foregoing embodiment, an embodiment of the present disclosure further provides an electronic device, where the electronic device includes: at least one memory and at least one processor; the memory stores an application program, the processor calls the application program stored in the memory, and the application program is used for realizing the configuration file verification method.
Referring now to FIG. 9, shown is a schematic diagram of an electronic device 900 suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 9, the electronic device 900 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 901 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage means 909 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for the operation of the electronic apparatus 900 are also stored. The processing apparatus 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
Generally, the following devices may be connected to the I/O interface 905: input devices 906 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 907 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 908 including, for example, magnetic tape, hard disk, etc.; and a communication device 909. The communication means 909 may allow the electronic apparatus 900 to communicate with other apparatuses wirelessly or by wire to exchange data. While fig. 9 illustrates an electronic device 900 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
Based on the configuration file verification method provided by the above embodiment, an embodiment of the present disclosure further provides a storage medium, where the storage medium stores a computer program code, and the computer program code implements the configuration file verification method when executed.
In the context of this disclosure, a storage medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The storage medium may be a machine-readable signal medium or a machine-readable storage medium. A storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
It should be noted that the storage media described above in this disclosure can be computer readable signal media or computer readable storage media or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any storage medium that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a storage medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The storage medium may be included in the electronic device; or may be separate and not incorporated into the electronic device.
According to one or more embodiments of the present disclosure, there is provided a profile verification method, including:
acquiring definition information configured in a development stage, wherein the definition information comprises a micro-service application name, a configuration file version, a configuration file format and a configuration file mode definition;
receiving the micro-service application name, the configuration file version and the uploaded target configuration file which are input in the operation and maintenance stage;
and determining a target configuration file mode definition matched with the input micro-service application name, the configuration file version and the configuration file format of the uploaded target configuration file through the matching definition information, and carrying out validity check on the target configuration file by using the target configuration file mode definition.
According to one or more embodiments of the present disclosure, there is provided a configuration file verification method, where a target configuration file includes: the application starts the required configuration file or updates the configured configuration file.
According to one or more embodiments of the present disclosure, there is provided a configuration file verification method, further including:
and outputting the validity check result of the target configuration file.
According to one or more embodiments of the present disclosure, there is provided a configuration file verification method, further including:
and if the validity check result of the target configuration file is a check failure, outputting check error information.
According to one or more embodiments of the present disclosure, there is provided a configuration file verification method, further including:
and if the target configuration file is the configured configuration file after the updating, inquiring the verification failure log at regular time, and outputting an alarm notice under the condition that a newly added verification failure record exists in the verification failure log.
According to one or more embodiments of the present disclosure, there is provided a profile checking apparatus including:
the system comprises a definition configuration module, a configuration module and a configuration module, wherein the definition configuration module is used for acquiring definition information configured in a development stage, and the definition information comprises a micro-service application name, a configuration file version, a configuration file format and a configuration file mode definition;
the file checking module is used for receiving the micro-service application name, the configuration file version and the uploaded target configuration file which are input in the operation and maintenance stage; and determining a target configuration file mode definition matched with the input micro-service application name, the configuration file version and the configuration file format of the uploaded target configuration file through the matching definition information, and carrying out validity check on the target configuration file by using the target configuration file mode definition.
According to one or more embodiments of the present disclosure, there is provided a configuration file checking apparatus, a file checking module, further configured to:
and outputting the validity check result of the target configuration file.
According to one or more embodiments of the present disclosure, there is provided a profile verification apparatus, a profile verification module, further configured to:
and if the validity verification result of the target configuration file is verification failure, outputting verification error information.
According to one or more embodiments of the present disclosure, there is provided a profile verification apparatus, further including:
and the alarm notification module is used for inquiring the verification failure log at regular time if the target configuration file is the configuration file after the configuration is updated, and outputting an alarm notification under the condition that a newly added verification failure record exists in the verification failure log.
According to one or more embodiments of the present disclosure, there is provided an electronic device including: at least one memory and at least one processor; the memory stores an application program, the processor calls the application program stored in the memory, and the application program is used for realizing the configuration file verification method.
According to one or more embodiments of the present disclosure, a storage medium storing computer program code that, when executed, implements a profile verification method is provided.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
While several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other combinations of features described above or equivalents thereof without departing from the spirit of the disclosure. For example, the above features and the technical features disclosed in the present disclosure (but not limited to) having similar functions are replaced with each other to form the technical solution.

Claims (10)

1. A method for profile verification, the method comprising:
acquiring definition information configured in a development stage, wherein the definition information comprises a microservice application name, a configuration file version, a configuration file format and a configuration file mode definition;
receiving a micro-service application name, a configuration file version and an uploaded target configuration file which are input in an operation and maintenance stage;
and determining a target configuration file mode definition matched with the input micro-service application name, the configuration file version and the configuration file format of the uploaded target configuration file by matching the definition information, and carrying out validity check on the target configuration file by using the target configuration file mode definition.
2. The method of claim 1, wherein the target profile comprises: the application starts the required configuration file or updates the configured configuration file.
3. The method of claim 1, further comprising:
and outputting the validity check result of the target configuration file.
4. The method of claim 3, further comprising:
and if the validity check result of the target configuration file is check failure, outputting check error information.
5. The method of claim 4, further comprising:
and if the target configuration file is the configured configuration file after being updated, inquiring the verification failure log at regular time, and outputting an alarm notice under the condition that a newly added verification failure record exists in the verification failure log.
6. A profile verification apparatus, comprising:
the system comprises a definition configuration module, a configuration module and a configuration module, wherein the definition configuration module is used for acquiring definition information configured in a development stage, and the definition information comprises a microservice application name, a configuration file version, a configuration file format and a configuration file mode definition;
the file checking module is used for receiving the micro-service application name, the configuration file version and the uploaded target configuration file which are input in the operation and maintenance stage; and determining a target configuration file mode definition matched with the input micro-service application name, the configuration file version and the configuration file format of the uploaded target configuration file by matching the definition information, and performing validity check on the target configuration file by using the target configuration file mode definition.
7. The apparatus of claim 6, wherein the file verification module is further configured to:
and outputting the validity check result of the target configuration file.
8. The apparatus of claim 7, wherein the file verification module is further configured to:
and if the validity verification result of the target configuration file is verification failure, outputting verification error information.
9. An electronic device, characterized in that the electronic device comprises: at least one memory and at least one processor; the memory stores an application program, and the processor calls the application program stored in the memory, wherein the application program is used for realizing the configuration file checking method in any one of claims 1-5.
10. A storage medium, characterized in that the storage medium stores computer program code, which when executed implements the profile verification method of any one of claims 1-5.
CN202211013982.9A 2022-08-23 2022-08-23 Configuration file checking method and device, electronic equipment and storage medium Pending CN115344301A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211013982.9A CN115344301A (en) 2022-08-23 2022-08-23 Configuration file checking method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211013982.9A CN115344301A (en) 2022-08-23 2022-08-23 Configuration file checking method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115344301A true CN115344301A (en) 2022-11-15

Family

ID=83953111

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211013982.9A Pending CN115344301A (en) 2022-08-23 2022-08-23 Configuration file checking method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115344301A (en)

Similar Documents

Publication Publication Date Title
CN111679990B (en) Test data generation method and device, readable medium and electronic equipment
CN112597047A (en) Test method, test device, electronic equipment and computer readable medium
CN111338944B (en) Remote Procedure Call (RPC) interface testing method, device, medium and equipment
CN111190657B (en) Activity configuration method and device, readable medium and electronic equipment
CN112954056B (en) Method and device for processing monitoring data, electronic equipment and storage medium
CN112884376A (en) Work order processing method and device, electronic equipment and computer readable storage medium
CN111198853B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN112422648B (en) Data synchronization method and system
CN115344301A (en) Configuration file checking method and device, electronic equipment and storage medium
CN110806967A (en) Unit testing method and device
CN109960659B (en) Method and device for detecting application program
CN113656050B (en) Method and apparatus for generating version number
CN112783903B (en) Method and device for generating update log
CN113760768A (en) Test method, monitoring platform, electronic equipment and storage medium
CN112084114A (en) Method and apparatus for testing an interface
CN113779952B (en) Text processing method and device and electronic equipment
CN111897827B (en) Data updating method and system for data warehouse and electronic equipment
CN115827415B (en) System process performance test method, device, equipment and computer medium
CN117609077A (en) Method and device for rechecking configuration parameters, electronic equipment and storage medium
CN113641587A (en) Operation interface test method, device, terminal and storage medium
CN116126317A (en) Service code, service state flow chart generation method and device
CN115373972A (en) Interface testing method and device, storage medium and electronic equipment
CN116257501A (en) Data processing method, device, electronic equipment and storage medium
CN114461416A (en) Automatic test optimization method and device, electronic equipment and readable storage medium
CN118036561A (en) Lightweight markup language text conversion method, lightweight markup language text conversion device, electronic equipment and 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