WO2017162029A1 - 基于序列化格式的配置文件校验方法和装置 - Google Patents

基于序列化格式的配置文件校验方法和装置 Download PDF

Info

Publication number
WO2017162029A1
WO2017162029A1 PCT/CN2017/075950 CN2017075950W WO2017162029A1 WO 2017162029 A1 WO2017162029 A1 WO 2017162029A1 CN 2017075950 W CN2017075950 W CN 2017075950W WO 2017162029 A1 WO2017162029 A1 WO 2017162029A1
Authority
WO
WIPO (PCT)
Prior art keywords
configuration file
rule
file
content
data content
Prior art date
Application number
PCT/CN2017/075950
Other languages
English (en)
French (fr)
Inventor
张跃
李闪
Original Assignee
阿里巴巴集团控股有限公司
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 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2017162029A1 publication Critical patent/WO2017162029A1/zh

Links

Images

Classifications

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

Definitions

  • the present invention relates to the field of Internet technologies, and in particular, to a method and apparatus for verifying a profile based on a serialized format.
  • Serialization is the process of converting an object into a byte stream to store it in memory, a database, or a file. Its main purpose is to save the state of the object so that it can be recreated when needed.
  • Common serialization formats include xml, json , yaml format, etc.
  • json format JavaScript Object Notation, which is a lightweight data exchange format
  • the validity of the configuration file can be checked by the json template, and the json template defines the correspondence between the variable name and the value. Relationship: If the variable and the value in the configuration file match the corresponding relationship, the configuration file is considered legal, and the configuration file is considered invalid.
  • the current problem is that the json template can only check the json format configuration file, and the legality check cannot be performed for the configuration file that is not in the json format. Moreover, the json template can only check whether the variables and values in a single configuration file conform to the predefined format, and the content of the check is not rich.
  • the present invention aims to solve at least one of the technical problems in the related art to some extent.
  • the first object of the present invention is to provide a configuration file verification method based on a serialization format, which can perform check on a plurality of configuration files and determine a plurality of configuration files. Whether the relationship between the variables in the expected ones is in line with expectations, enriches the checksum scheme for checking the internals of the configuration file, and reduces the situation of submission errors when the user submits the configuration file.
  • a second object of the present invention is to provide a configuration file verification apparatus based on a serialization format.
  • the first aspect of the present invention provides a configuration file verification based on a serialization format.
  • the method includes: obtaining data content of a source entry of a source configuration file in a configuration file and a data content of a target entry of a target configuration file; and data content of the source entry and the target table according to a preset matching rule Matching the data content of the item; and generating a check result of the configuration file according to the matching result.
  • the configuration file verification method of the embodiment of the present invention matches the data content of the source entry of the source configuration file in the configuration file with the data content of the target entry of the target configuration file according to a preset matching rule, so that multiple The content of the configuration files is checked to determine whether the relationship between the variables in the multiple configuration files meets the expectations, enriching the checksum scheme for checking the internal configuration files, and reducing the appearance of the user when submitting the configuration file. Submit the wrong status.
  • the second aspect of the present invention provides a configuration file verification apparatus based on a serialization format, including: an obtaining module, configured to acquire data content and a target of a source entry of a source configuration file in a configuration file.
  • the data content of the target entry of the configuration file; the matching module is configured to match the data content of the source entry and the data content of the target entry according to a preset matching rule; and generate a module, configured to match
  • the result is a check result of the configuration file.
  • the configuration file verification apparatus of the embodiment of the present invention matches the data content of the source entry of the source configuration file in the configuration file with the data content of the target entry of the target configuration file according to a preset matching rule, so that multiple The content of the configuration files is checked to determine whether the relationship between the variables in the multiple configuration files meets the expectations, enriching the checksum scheme for checking the internal configuration files, and reducing the appearance of the user when submitting the configuration file. Submit the wrong status.
  • FIG. 1 is a flowchart of a method for verifying a configuration file based on a serialized format according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a matching rule of a configuration file according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of a method for verifying a configuration file based on a serialized format according to an embodiment of the present invention
  • Figure 4 is a schematic illustration of the structural rules of one embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a format specification of a file directory of a configuration file according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of a configuration file constraint rule according to an embodiment of the present invention.
  • FIG. 7 is a flowchart of a method for verifying a configuration file based on a serialized format according to another embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a configuration file verification apparatus based on a serialization format according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a configuration file verification apparatus based on a serialization format according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of a configuration file verification apparatus based on a serialization format according to another embodiment of the present invention.
  • first and second are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated.
  • features defining “first” and “second” may include one or more of the features either explicitly or implicitly.
  • the meaning of "a plurality” is two or more unless specifically and specifically defined otherwise.
  • FIG. 1 is a flow chart of a method for verifying a configuration file based on a serialized format according to an embodiment of the present invention.
  • the configuration file verification method includes:
  • the data content in the source entry of the source file in the configuration file is read, and then the data content of the target entry of the target file in the configuration file is read.
  • FIG. 2 is a schematic diagram showing a matching rule of a configuration file according to an embodiment of the present invention.
  • the source configuration file defines a file name of a matching source, and may include a wildcard character to represent a group of files.
  • the source entry defines the specific entry name in the source file. You can use a wildcard to match a set of entries.
  • Matching rules define four common rule relationships, including equality rules, inclusion rules, mutual exclusion rules, and unique rules.
  • the equality rule indicates that the data content in the source entry is identical to the data content in the target entry;
  • the inclusion rule indicates that the data content in the source entry contains the data content in the target entry;
  • the mutual exclusion rule indicates the source entry in the source entry.
  • the data content and the data content in the target entry cannot have an intersection;
  • the unique rule indicates that there is no intersection between the data contents in the source entry, and when the data content is checked according to the unique rule, only in the source entry The data content is checked, and the data content in the target entry is not checked, so the target file and the target entry can be ignored.
  • the target profile defines the file name of the matching target and can include a wildcard to represent a set of files.
  • the target entry defines the specific entry name in the target file, and a wildcard can be used to match a set of entries.
  • the content of the serializable configuration file is converted into a set of aggregate data according to the matching rule, and after reading the data content in the source entry of the source file in the configuration file and the data content of the target entry of the target file, The data content in the source entry and the data content of the target entry are calculated according to the operation relationship defined in the matching rule.
  • the correct check result of the configuration file check is generated.
  • the configuration file If the data content of the source entry and the data content of the target entry do not meet the preset matching rule, the configuration file generates a check result of the check check error, and the prompt information of the configuration file check error is generated and fed back to the user.
  • the configuration file verification method of the embodiment of the present invention matches the data content of the source entry of the source configuration file in the configuration file with the data content of the target entry of the target configuration file according to a preset matching rule, so that multiple The content of the configuration files is checked to determine whether the relationship between the variables in the multiple configuration files meets the expectations, enriching the checksum scheme for checking the internal configuration files, and reducing the appearance of the user when submitting the configuration file. Submit the wrong status.
  • FIG. 3 is a flow chart of a method for verifying a configuration file based on a serialized format according to an embodiment of the present invention.
  • the configuration file verification method includes:
  • S301 Determine, according to a preset structural rule, whether a file directory of the configuration file satisfies a structural rule.
  • the preset structure rule includes a type rule and a content rule, and determines whether the type of the file directory satisfies the type rule. If the type of the file directory does not satisfy the type rule, a prompt for generating a configuration file check error is generated. If the type of the file directory satisfies the type rule, it further determines whether the content of the file directory satisfies the content rule. If the content of the file directory does not satisfy the content rule, a prompt message for generating a configuration file check error is generated. interest.
  • FIG. 4 is a schematic diagram of a structure rule according to an embodiment of the present invention. As shown in FIG. 4, a structure rule defines a file type and a content rule of each file to be checked.
  • the definition file type is After the directory, you need to define the contents of the directory. Under the contents of the directory, you can continue to define subdirectories or files in the directory. For a file, after defining the type as a file, then defining the contents of the file for checking the contents of the next file. If the file directory of the configuration file does not meet the structural rules, for example, the file in the content of the file directory does not have a file, and the required directory does not exist. The prompt information for generating the configuration file check error is fed back to the user, or the file directory type does not match. The prompt information of the configuration file check error is also generated and fed back to the user.
  • FIG. 5 is a schematic diagram of a format specification of a file directory of a configuration file according to an embodiment of the present invention.
  • the top level directory includes a cluster configuration file, a system configuration file, and a service list directory.
  • Each service in the service list directory has its own service directory, configuration file directory, and service configuration directory.
  • the configuration file used by the service is placed in the service directory.
  • the configuration file includes the deployment configuration file and the version configuration file.
  • the configuration directory includes the service upgrade configuration file, and the service configuration directory includes the user configuration file. Further, it is checked according to the above format specification whether the file directory structure of the configuration file satisfies the requirements.
  • the preset structure rule further includes a constraint rule, determining whether the content of the file directory meets the constraint rule, and if the content of the file directory does not satisfy the constraint rule, generating a configuration file check error Tip message.
  • a constraint rule determining whether the content of the file directory meets the constraint rule, and if the content of the file directory does not satisfy the constraint rule, generating a configuration file check error Tip message.
  • the constraints between the contents of the file directory of the configuration file are checked.
  • FIG. 6 is a schematic diagram of a configuration file constraint rule according to an embodiment of the present invention. As shown in FIG. 6, a machine list is defined in a cluster configuration file, and a machine list is also included in the deployment configuration file, and the configuration file is deployed. The list of machines is to be included in the list of machines in the cluster configuration file.
  • the role list of the service is defined in the deployment configuration file.
  • the version configuration file also contains the role list.
  • the upgrade configuration file also contains the role list. Furthermore, according to the requirements of different applications, a plurality of different constraint rules can be defined, and the contents of the file directory of the configuration file are checked according to the constraint rules.
  • the data content in the source entry of the source file in the configuration file is read, and then the data content of the target entry of the target file in the configuration file is read.
  • FIG. 2 is a schematic diagram showing a matching rule of a configuration file according to an embodiment of the present invention.
  • the source configuration file defines a file name of a matching source, and may include a wildcard character to represent a group of files.
  • the source entry defines the specific entry name in the source file. Matches a set of entries.
  • Matching rules define four common rule relationships, including equality rules, inclusion rules, mutual exclusion rules, and unique rules.
  • the equality rule indicates that the data content in the source entry is identical to the data content in the target entry;
  • the inclusion rule indicates that the data content in the source entry contains the data content in the target entry;
  • the mutual exclusion rule indicates the source entry in the source entry.
  • the data content and the data content in the target table cannot have an intersection;
  • the unique rule indicates that there is no intersection between the data contents in the source entry, and when the data content is checked according to the unique rule, only the data in the source entry is The content is checked, and the data content in the target entry is not checked, so the target file and the target entry can be ignored.
  • the target profile defines the file name of the matching target and can include a wildcard to represent a set of files.
  • the target entry defines the specific entry name in the target file, and a wildcard can be used to match a set of entries.
  • the content of the serializable configuration file is converted into a set of aggregate data according to the matching rule, and after reading the data content in the source entry of the source file in the configuration file and the data content of the target entry of the target file, The data content in the source entry and the data content of the target entry are calculated according to the operation relationship defined in the matching rule.
  • the correct check result of the configuration file check is generated.
  • the configuration file If the data content of the source entry and the data content of the target entry do not meet the preset matching rule, the configuration file generates a check result of the check check error, and the prompt information of the configuration file check error is generated and fed back to the user.
  • the configuration file verification method of the embodiment of the present invention determines whether the file directory of the configuration file satisfies the structural rule according to a preset structural rule, so that the file directory structure of the multiple configuration files can be checked, and the structure of the configuration file is checked. It is expected to further enrich the inspection plan for the internal inspection of individual profiles.
  • FIG. 7 is a flow chart of a method for verifying a configuration file based on a serialized format according to another embodiment of the present invention.
  • the configuration file verification method includes:
  • the preset structure rule includes a type rule and a content rule, and determines whether the type of the file directory satisfies the type rule. If the type of the file directory does not satisfy the type rule, a prompt for generating a configuration file check error is generated. If the type of the file directory satisfies the type rule, it further determines whether the content of the file directory satisfies the content rule. If the content of the file directory does not satisfy the content rule, the prompt information of the configuration file check error is generated.
  • FIG. 4 is a schematic diagram of a structural rule according to an embodiment of the present invention, as shown in FIG. Define the file type and content rules of each file to be checked.
  • For the directory after defining the file type as the directory, you need to define the directory contents. Under the directory contents, you can continue to define subdirectories or files in the directory. For a file, after defining the type as a file, then defining the contents of the file for checking the contents of the next file. If the file directory of the configuration file does not meet the structural rules, for example, the file in the content of the file directory does not have a file, and the required directory does not exist. The prompt information for generating the configuration file check error is fed back to the user, or the file directory type does not match. The prompt information of the configuration file check error is also generated and fed back to the user.
  • FIG. 5 is a schematic diagram of a format specification of a file directory of a configuration file according to an embodiment of the present invention.
  • the top level directory includes a cluster configuration file, a system configuration file, and a service list directory.
  • Each service in the service list directory has its own service directory, configuration file directory, and service configuration directory.
  • the configuration file used by the service is placed in the service directory.
  • the configuration file includes the deployment configuration file and the version configuration file.
  • the configuration directory includes the service upgrade configuration file, and the service configuration directory includes the user configuration file. Further, it is checked according to the above format specification whether the file directory structure of the configuration file satisfies the requirements.
  • the preset structure rule further includes a constraint rule, determining whether the content of the file directory meets the constraint rule, and if the content of the file directory does not satisfy the constraint rule, generating a configuration file check error Tip message.
  • a constraint rule determining whether the content of the file directory meets the constraint rule, and if the content of the file directory does not satisfy the constraint rule, generating a configuration file check error Tip message.
  • the constraints between the contents of the file directory of the configuration file are checked.
  • FIG. 6 is a schematic diagram of a configuration file constraint rule according to an embodiment of the present invention. As shown in FIG. 6, a machine list is defined in a cluster configuration file, and a machine list is also included in the deployment configuration file, and the configuration file is deployed. The list of machines is to be included in the list of machines in the cluster configuration file.
  • the role list of the service is defined in the deployment configuration file.
  • the version configuration file also contains the role list.
  • the upgrade configuration file also contains the role list. Furthermore, according to the requirements of different applications, a plurality of different constraint rules can be defined, and the contents of the file directory of the configuration file are checked according to the constraint rules.
  • the content of the single configuration file is checked.
  • the configuration of the configuration and the file is checked by using a common json serialization file template, wherein the json file template can implement a rich content inspection of the single file, and the checking process can be performed.
  • the data content in the source entry of the source file in the configuration file is read first. Then read the data content of the target entry of the target file in the configuration file.
  • FIG. 2 is a schematic diagram showing a matching rule of a configuration file according to an embodiment of the present invention.
  • the source configuration file defines a file name of a matching source, and may include a wildcard character to represent a group of files.
  • the source entry defines the specific entry name in the source file. You can use a wildcard to match a set of entries.
  • Matching rules define four common rule relationships, including equality rules, inclusion rules, mutual exclusion rules, and unique rules.
  • the equality rule indicates that the data content in the source entry is identical to the data content in the target entry;
  • the inclusion rule indicates that the data content in the source entry contains the data content in the target entry;
  • the mutual exclusion rule indicates the source entry in the source entry.
  • the data content and the data content in the target table cannot have an intersection;
  • the unique rule indicates that there is no intersection between the data contents in the source entry, and when the data content is checked according to the unique rule, only the data in the source entry is The content is checked, and the data content in the target entry is not checked, so the target file and the target entry can be ignored.
  • the target profile defines the file name of the matching target and can include a wildcard to represent a set of files.
  • the target entry defines the specific entry name in the target file, and a wildcard can be used to match a set of entries.
  • the content of the serializable configuration file is converted into a set of aggregate data according to the matching rule, and after reading the data content in the source entry of the source file in the configuration file and the data content of the target entry of the target file, The data content in the source entry and the data content of the target entry are calculated according to the operation relationship defined in the matching rule.
  • the correct check result of the configuration file check is generated.
  • the configuration file If the data content of the source entry and the data content of the target entry do not meet the preset matching rule, the configuration file generates a check result of the check check error, and the prompt information of the configuration file check error is generated and fed back to the user.
  • the configuration file verification method of the embodiment of the present invention in order to ensure that the configuration file submitted by the user meets expectations, three checksums are performed on the configuration file, first, the file directory format of the configuration file is checked, and then the content of the single configuration file is performed. The school check, finally check the content association between multiple configuration files, which not only enriches the inspection plan for checking the configuration file, but also greatly improves the accuracy of the configuration file check and reduces the user submission configuration file. A condition of submitting an error occurred.
  • the present invention also proposes a configuration file verification apparatus based on a serialization format.
  • FIG. 8 is a schematic structural diagram of a configuration file verification apparatus based on a serialization format according to an embodiment of the present invention.
  • the profile verification device includes an acquisition module 100, a matching module 200, and a generation module 300.
  • the obtaining module 100 is configured to obtain the data content of the source entry of the source configuration file in the configuration file and the data content of the target entry of the target configuration file.
  • the matching module 200 is configured to match the data content of the source entry and the data content of the target entry according to a preset matching rule.
  • the preset matching rules include equal rules, inclusion rules, mutual exclusion rules, and unique rules.
  • the generating module 300 is configured to generate a check result of the configuration file according to the matching result.
  • the generating module 300 is further configured to generate, when the data content of the source entry and the data content of the target entry do not meet the preset matching rule, generate prompt information of the configuration file checking error.
  • the configuration file verification apparatus of the embodiment of the present invention matches the data content of the source entry of the source configuration file in the configuration file with the data content of the target entry of the target configuration file according to a preset matching rule, so that multiple The content of the configuration files is checked to determine whether the relationship between the variables in the multiple configuration files meets the expectations, enriching the checksum scheme for checking the internal configuration files, and reducing the appearance of the user when submitting the configuration file. Submit the wrong status.
  • FIG. 9 is a schematic structural diagram of a configuration file verification apparatus based on a serialization format according to an embodiment of the present invention.
  • the configuration file verification apparatus includes: an acquisition module 100, a matching module 200, a generation module 300, and a first determination module 400.
  • the first determining module 400 is configured to determine, according to the preset structural rule, whether the file directory of the configuration file satisfies the structural rule.
  • the first determining module 400 is further configured to determine whether the type of the file directory satisfies the type rule, and the generating module 300 is further configured to: when the type of the file directory does not satisfy the type rule, when the preset structure rule includes the type rule and the content rule.
  • the first determining module 400 is further configured to: when the type of the file directory satisfies the type rule, further determine whether the content of the file directory satisfies the content rule, and the generating module 300 is further configured to be in the file directory.
  • a prompt message for the configuration file check error is generated.
  • the first determining module 400 is further configured to determine whether the content of the file directory meets the constraint rule, and the generating module 300 is further configured to not satisfy the constraint between the contents of the file directory.
  • the rule is generated, a prompt message for the configuration file check error is generated.
  • the configuration file verification apparatus of the embodiment of the present invention determines whether the file directory of the configuration file satisfies the structural rule according to a preset structural rule, so that the file directory structure of the multiple configuration files can be checked, and the structure of the configuration file is checked. It is expected to further enrich the inspection plan for the internal inspection of individual profiles.
  • FIG. 10 is a schematic structural diagram of a configuration file verification apparatus based on a serialization format according to another embodiment of the present invention.
  • the configuration file verification apparatus includes: an acquisition module 100, a matching module 200, a generation module 300, a first determination module 400, and a second determination module 500.
  • the second determining module 500 is configured to determine, according to the preset serialized file template, whether the content of the configuration file conforms to the specification.
  • the generating module 300 is further configured to generate prompt information of the configuration file checking error when the content of the configuration file does not conform to the specification.
  • the configuration file verification apparatus in order to ensure that the configuration file submitted by the user meets expectations, three check items are performed on the configuration file, first, the file directory format of the configuration file is checked, and then the content of the single configuration file is performed. The school check, finally check the content association between multiple configuration files, which not only enriches the inspection plan for checking the configuration file, but also greatly improves the accuracy of the configuration file check and reduces the user submission configuration file. A condition of submitting an error occurred.
  • portions of the invention may be implemented in hardware, software, firmware or a combination thereof.
  • multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
  • a suitable instruction execution system For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals. Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.

Abstract

一种基于序列化格式的配置文件校验方法和装置。其中,该配置文件校验方法包括:获取配置文件中源配置文件的源表项的数据内容和目标配置文件的目标表项的数据内容(S101);根据预设的匹配规则对源表项的数据内容和目标表项的数据内容进行匹配(S102);以及根据匹配结果生成配置文件的校检结果(S103)。所述配置文件校验方法,可以对多个配置文件相互间的内容进行校检,判断多个配置文件中的变量之间的相互关系是否符合预期,丰富了对配置文件内部进行校检的校检方案,同时减少了用户提交配置文件时出现提交错误的状况。

Description

基于序列化格式的配置文件校验方法和装置
本申请要求2016年03月21日递交的申请号为201610160734.5、发明名称为“基于序列化格式的配置文件校验方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及互联网技术领域,尤其涉及一种基于序列化格式的配置文件校验方法和装置。
背景技术
序列化是将对象转换为字节流以将其保存在内存、数据库或文件中的过程,其主要目的是保存对象的状态,以便在需要时重新创建对象,常见的序列化格式包括xml,json,yaml格式等。
目前,用户在提交配置文件时,对于一些可序列化的标准格式,需要进行合法性校检,避免用户的提交错误。例如,对于json格式(JavaScript Object Notation,是一种轻量级的数据交换格式)的配置文件而言,可通过json模板校检该配置文件的合法性,json模板定义变量名称和取值的对应关系,如果配置文件中的变量和取值符合对应关系,则认为配置文件是合法的,反之认为配置文件不合法。
然而,目前存在的问题是,json模板只能校检json格式的配置文件,对于不是json格式的配置文件而言并不能进行合法性校检。并且,json模板只能校检单个配置文件中的变量和取值是否符合预定义的格式,校检的内容并不丰富。
发明内容
本发明旨在至少在一定程度上解决相关技术中的技术问题之一。
为此,本发明的第一个目的在于提出一种基于序列化格式的配置文件校验方法,该配置文件校验方法可以对多个配置文件相互间的内容进行校检,判断多个配置文件中的变量之间的相互关系是否符合预期,丰富了对配置文件内部进行校检的校检方案,同时减少了用户提交配置文件时出现提交错误的状况。
本发明的第二个目的在于提出一种基于序列化格式的配置文件校验装置。
为达上述目的,本发明第一方面实施例提出了一种基于序列化格式的配置文件校验 方法,包括:获取配置文件中源配置文件的源表项的数据内容和目标配置文件的目标表项的数据内容;根据预设的匹配规则对所述源表项的数据内容和所述目标表项的数据内容进行匹配;以及根据匹配结果生成所述配置文件的校检结果。
本发明实施例的配置文件校验方法,根据预设的匹配规则对配置文件中源配置文件的源表项的数据内容和目标配置文件的目标表项的数据内容进行匹配,从而可以对多个配置文件相互间的内容进行校检,判断多个配置文件中的变量之间的相互关系是否符合预期,丰富了对配置文件内部进行校检的校检方案,同时减少了用户提交配置文件时出现提交错误的状况。
为达上述目的,本发明第二方面实施例提出了一种基于序列化格式的配置文件校验装置,包括:获取模块,用于获取配置文件中源配置文件的源表项的数据内容和目标配置文件的目标表项的数据内容;匹配模块,用于根据预设的匹配规则对所述源表项的数据内容和所述目标表项的数据内容进行匹配;以及生成模块,用于根据匹配结果生成所述配置文件的校检结果。本发明实施例的配置文件校验装置,根据预设的匹配规则对配置文件中源配置文件的源表项的数据内容和目标配置文件的目标表项的数据内容进行匹配,从而可以对多个配置文件相互间的内容进行校检,判断多个配置文件中的变量之间的相互关系是否符合预期,丰富了对配置文件内部进行校检的校检方案,同时减少了用户提交配置文件时出现提交错误的状况。
本发明附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。
附图说明
本发明上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:
图1是本发明一个实施例的基于序列化格式的配置文件校验方法的流程图;
图2是本发明一个实施例的配置文件的匹配规则的示意图;
图3是本发明一个具体实施例的基于序列化格式的配置文件校验方法的流程图;
图4是本发明一个实施例的结构规则的示意图;
图5是本发明一个实施例的配置文件的文件目录的格式规范的示意图;
图6是本发明一个实施例的配置文件约束规则的示意图;
图7是本发明另一个具体实施例的基于序列化格式的配置文件校验方法的流程图;
图8是本发明一个实施例的基于序列化格式的配置文件校验装置的结构示意图;
图9是本发明一个具体实施例的基于序列化格式的配置文件校验装置的结构示意图;以及
图10是本发明另一个具体实施例的基于序列化格式的配置文件校验装置的结构示意图。
具体实施方式
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本发明,而不能理解为对本发明的限制。
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本发明的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本发明的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本发明的实施例所属技术领域的技术人员所理解。
图1是本发明一个实施例的基于序列化格式的配置文件校验方法的流程图。
如图1所示,配置文件校验方法包括:
S101,获取配置文件中源配置文件的源表项的数据内容和目标配置文件的目标表项的数据内容。
具体地,在用户提交配置文件后,先读取配置文件中源文件的源表项中的数据内容,再读取配置文件中目标文件的目标表项的数据内容。
S102,根据预设的匹配规则对源表项的数据内容和目标表项的数据内容进行匹配。
具体地,不同的匹配规则以不同的规则编号进行区分并进行排序。图2示出了本发明一个实施例的配置文件的匹配规则的示意图,如图2所示,源配置文件定义匹配源的文件名,可包含通配符表示一组文件。源表项定义源文件中的具体表项名称,可用通配符匹配一组表项。
匹配规则定义了4种常用的规则关系,包括相等规则、包含规则、互斥规则和唯一规则。其中,相等规则表示源表项中的数据内容和目标表项中的数据内容完全相同;包含规则表示源表项中的数据内容包含目标表项中的数据内容;互斥规则表示源表项中的数据内容和目标表项中的数据内容不能有交集;唯一规则表示源表项中的数据内容之间不能有交集,在根据唯一规则对数据内容进行校检时,仅对源表项中的数据内容进行校检,对目标表项中的数据内容不进行校检,因此可以忽略目标文件和目标表项。
目标配置文件定义匹配目标的文件名,可包含通配符表示一组文件。目标表项定义目标文件中的具体表项名称,可用通配符匹配一组表项。
进而,根据匹配规则将可序列化的配置文件的内容转换为一组集合数据,在读取配置文件中源文件的源表项中的数据内容,和目标文件的目标表项的数据内容后,利用匹配规则中定义的运算关系计算源表项中的数据内容和目标表项的数据内容是否满足要求。
S103,根据匹配结果生成配置文件的校检结果。
具体地,若源表项的数据内容和目标表项的数据内容满足预设的匹配规则,则生成配置文件校检正确的校检结果。
若源表项的数据内容和目标表项的数据内容不满足预设的匹配规则,则生成配置文件生成校检错误的校检结果,同时生成配置文件校检错误的提示信息反馈给用户。
本发明实施例的配置文件校验方法,根据预设的匹配规则对配置文件中源配置文件的源表项的数据内容和目标配置文件的目标表项的数据内容进行匹配,从而可以对多个配置文件相互间的内容进行校检,判断多个配置文件中的变量之间的相互关系是否符合预期,丰富了对配置文件内部进行校检的校检方案,同时减少了用户提交配置文件时出现提交错误的状况。
图3是本发明一个具体实施例的基于序列化格式的配置文件校验方法的流程图。
如图3所示,配置文件校验方法包括:
S301,根据预设的结构规则判断配置文件的文件目录是否满足结构规则。
具体地,检查配置文件的格式是否符合预期,对配置文件的文件目录格式进行校检。
在本发明的一个实施例中,预设的结构规则包括类型规则和内容规则,判断文件目录的类型是否满足类型规则,若文件目录的类型不满足类型规则,则生成配置文件校检错误的提示信息,若文件目录的类型满足类型规则,则进一步判断文件目录的内容是否满足内容规则,若文件目录的内容不满足内容规则,则生成配置文件校检错误的提示信 息。具体而言,图4是本发明一个实施例的结构规则的示意图,如图4所示,结构规则中定义需要检查的每个文件的文件类型和内容规则,对于目录而言,定义文件类型为目录后,需要定义目录内容,目录内容下可继续定义目录内的子目录或者文件。对于文件而言,定义类型为文件后,然后定义文件的内容,用于进行下一步的文件内容的检查。如果配置文件的文件目录不符合结构规则,例如文件目录的内容中需要有的文件没有、需要有的目录没有,生成配置文件校检错误的提示信息反馈给用户,或者文件目录的类型不匹配,也生成配置文件校检错误的提示信息反馈给用户。
例如,图5是本发明一个实施例的配置文件的文件目录的格式规范的示意图,如图5所示,顶级目录包括集群配置文件、系统配置文件和服务列表目录。服务列表目录下每个服务均有自己的服务目录、配置文件目录和服务配置目录,在服务目录里放置该服务用到的配置文件,其中,配置文件包括部署配置文件和版本配置文件。配置目录包括服务升级配置文件,服务配置目录则包括用户配置文件。进而,根据上述格式规范检查配置文件的文件目录结构是否满足要求。
在本发明的一个实施例中,预设的结构规则还包括约束规则,判断文件目录的内容之间是否满足约束规则,若文件目录的内容之间不满足约束规则,则生成配置文件校检错误的提示信息。具体而言,除了对配置文件的文件目录格式进行检查之外,还对配置文件的文件目录的内容间的约束进行检查。例如,图6是本发明一个实施例的配置文件约束规则的示意图,如图6所示,如集群配置文件中定义了机器列表,在部署配置文件中同样包含机器列表,并且部署配置文件中的机器列表要包含于集群配置文件中的机器列表内。再如部署配置文件中定义了服务的角色列表,版本配置文件中同样包含角色列表,升级配置文件中也要包含角色列表。进而,根据不同应用的需求,可以定义多种不同的约束规则,根据这些约束规则对配置文件的文件目录的内容进行检查。
S302,获取配置文件中源配置文件的源表项的数据内容和目标配置文件的目标表项的数据内容。
具体地,在用户提交配置文件后,先读取配置文件中源文件的源表项中的数据内容,再读取配置文件中目标文件的目标表项的数据内容。
S303,根据预设的匹配规则对源表项的数据内容和目标表项的数据内容进行匹配。
具体地,不同的匹配规则以不同的规则编号进行区分并进行排序。图2示出了本发明一个实施例的配置文件的匹配规则的示意图,如图2所示,源配置文件定义匹配源的文件名,可包含通配符表示一组文件。源表项定义源文件中的具体表项名称,可用通配 符匹配一组表项。
匹配规则定义了4种常用的规则关系,包括相等规则、包含规则、互斥规则和唯一规则。其中,相等规则表示源表项中的数据内容和目标表项中的数据内容完全相同;包含规则表示源表项中的数据内容包含目标表项中的数据内容;互斥规则表示源表项中的数据内容和目标表项中的数据内容不能有交集;唯一规则表示源表项中的数据内容之间不能有交集,在根据唯一规则对数据内容进行检查时,仅对源表项中的数据内容进行检查,对目标表项中的数据内容不进行检查,因此可以忽略目标文件和目标表项。
目标配置文件定义匹配目标的文件名,可包含通配符表示一组文件。目标表项定义目标文件中的具体表项名称,可用通配符匹配一组表项。
进而,根据匹配规则将可序列化的配置文件的内容转换为一组集合数据,在读取配置文件中源文件的源表项中的数据内容,和目标文件的目标表项的数据内容后,利用匹配规则中定义的运算关系计算源表项中的数据内容和目标表项的数据内容是否满足要求。
S304,根据匹配结果生成配置文件的校检结果。
具体地,若源表项的数据内容和目标表项的数据内容满足预设的匹配规则,则生成配置文件校检正确的校检结果。
若源表项的数据内容和目标表项的数据内容不满足预设的匹配规则,则生成配置文件生成校检错误的校检结果,同时生成配置文件校检错误的提示信息反馈给用户。
本发明实施例的配置文件校验方法,根据预设的结构规则判断配置文件的文件目录是否满足结构规则,从而可以对多个配置文件的文件目录结构进行校检,检查配置文件的结构是否符合预期,进一步丰富了对单个配置文件内部进行校检的校检方案。
图7是本发明另一个具体实施例的基于序列化格式的配置文件校验方法的流程图。
如图7所示,配置文件校验方法包括:
S701,根据预设的结构规则判断配置文件的文件目录是否满足结构规则。
具体地,检查配置文件的格式是否符合预期,对配置文件的文件目录格式进行检查。
在本发明的一个实施例中,预设的结构规则包括类型规则和内容规则,判断文件目录的类型是否满足类型规则,若文件目录的类型不满足类型规则,则生成配置文件校检错误的提示信息,若文件目录的类型满足类型规则,则进一步判断文件目录的内容是否满足内容规则,若文件目录的内容不满足内容规则,则生成配置文件校检错误的提示信息。具体而言,图4是本发明一个实施例的结构规则的示意图,如图4所示,结构规则 中定义需要检查的每个文件的文件类型和内容规则,对于目录而言,定义文件类型为目录后,需要定义目录内容,目录内容下可继续定义目录内的子目录或者文件。对于文件而言,定义类型为文件后,然后定义文件的内容,用于进行下一步的文件内容的检查。如果配置文件的文件目录不符合结构规则,例如文件目录的内容中需要有的文件没有、需要有的目录没有,生成配置文件校检错误的提示信息反馈给用户,或者文件目录的类型不匹配,也生成配置文件校检错误的提示信息反馈给用户。
例如,图5是本发明一个实施例的配置文件的文件目录的格式规范的示意图,如图5所示,顶级目录包括集群配置文件、系统配置文件和服务列表目录。服务列表目录下每个服务均有自己的服务目录、配置文件目录和服务配置目录,在服务目录里放置该服务用到的配置文件,其中,配置文件包括部署配置文件和版本配置文件。配置目录包括服务升级配置文件,服务配置目录则包括用户配置文件。进而,根据上述格式规范检查配置文件的文件目录结构是否满足要求。
在本发明的一个实施例中,预设的结构规则还包括约束规则,判断文件目录的内容之间是否满足约束规则,若文件目录的内容之间不满足约束规则,则生成配置文件校检错误的提示信息。具体而言,除了对配置文件的文件目录格式进行检查之外,还对配置文件的文件目录的内容间的约束进行检查。例如,图6时本发明一个实施例的配置文件约束规则的示意图,如图6所示,如集群配置文件中定义了机器列表,在部署配置文件中同样包含机器列表,并且部署配置文件中的机器列表要包含于集群配置文件中的机器列表内。再如部署配置文件中定义了服务的角色列表,版本配置文件中同样包含角色列表,升级配置文件中也要包含角色列表。进而,根据不同应用的需求,可以定义多种不同的约束规则,根据这些约束规则对配置文件的文件目录的内容进行检查。
S702,根据预设的序列化文件模板判断配置文件的内容是否符合规范。
具体地,对单个配置文件的内容进行检查,例如,采用通用的json序列化文件模板对配置和文件的内容进行检查,其中json文件模板可以实现较为丰富的单文件内部的内容检查,检查过程可以使交互式或非交互式的,例如应用程序使用json模板进行用户输入的检查,确保输入的内容符合应用程序的规范。
若配置文件的内容不符合规范,则生成配置文件校检错误的提示信息。
S703,获取配置文件中源配置文件的源表项的数据内容和目标配置文件的目标表项的数据内容。
具体地,在用户提交配置文件后,先读取配置文件中源文件的源表项中的数据内容, 再读取配置文件中目标文件的目标表项的数据内容。
S704,根据预设的匹配规则对源表项的数据内容和目标表项的数据内容进行匹配。
具体地,不同的匹配规则以不同的规则编号进行区分并进行排序。图2示出了本发明一个实施例的配置文件的匹配规则的示意图,如图2所示,源配置文件定义匹配源的文件名,可包含通配符表示一组文件。源表项定义源文件中的具体表项名称,可用通配符匹配一组表项。
匹配规则定义了4种常用的规则关系,包括相等规则、包含规则、互斥规则和唯一规则。其中,相等规则表示源表项中的数据内容和目标表项中的数据内容完全相同;包含规则表示源表项中的数据内容包含目标表项中的数据内容;互斥规则表示源表项中的数据内容和目标表项中的数据内容不能有交集;唯一规则表示源表项中的数据内容之间不能有交集,在根据唯一规则对数据内容进行检查时,仅对源表项中的数据内容进行检查,对目标表项中的数据内容不进行检查,因此可以忽略目标文件和目标表项。
目标配置文件定义匹配目标的文件名,可包含通配符表示一组文件。目标表项定义目标文件中的具体表项名称,可用通配符匹配一组表项。
进而,根据匹配规则将可序列化的配置文件的内容转换为一组集合数据,在读取配置文件中源文件的源表项中的数据内容,和目标文件的目标表项的数据内容后,利用匹配规则中定义的运算关系计算源表项中的数据内容和目标表项的数据内容是否满足要求。
S705,根据匹配结果生成配置文件的校检结果。
具体地,若源表项的数据内容和目标表项的数据内容满足预设的匹配规则,则生成配置文件校检正确的校检结果。
若源表项的数据内容和目标表项的数据内容不满足预设的匹配规则,则生成配置文件生成校检错误的校检结果,同时生成配置文件校检错误的提示信息反馈给用户。
本发明实施例的配置文件校验方法,为了确保用户提交的配置文件符合预期,对配置文件进行三项校检,首先对配置文件的文件目录格式进行校检,其次对单个配置文件的内容进行校检,最后对多个配置文件相互间内容关联进行校检,不仅可以丰富对配置文件进行校检的校检方案,而且可以大大提高对配置文件校检的准确性,减少了用户提交配置文件时出现提交错误的状况。
为了实现上述实施例,本发明还提出一种基于序列化格式的配置文件校验装置。
图8是本发明一个实施例的基于序列化格式的配置文件校验装置的结构示意图。
如图8所示,配置文件校验装置包括:获取模块100、匹配模块200和生成模块300。
具体地,获取模块100用于获取配置文件中源配置文件的源表项的数据内容和目标配置文件的目标表项的数据内容。
匹配模块200用于根据预设的匹配规则对所述源表项的数据内容和所述目标表项的数据内容进行匹配。其中,预设的匹配规则包括相等规则、包含规则、互斥规则和唯一规则。
生成模块300用于根据匹配结果生成所述配置文件的校检结果。其中,生成模块300还用于在源表项的数据内容和目标表项的数据内容不满足预设的匹配规则时,生成配置文件校检错误的提示信息。
需要说明的是,前述对配置文件校验方法的实施例的解释说明也适用于该实施例的配置文件校验装置,其实现原理类似,此处不再赘述。
本发明实施例的配置文件校验装置,根据预设的匹配规则对配置文件中源配置文件的源表项的数据内容和目标配置文件的目标表项的数据内容进行匹配,从而可以对多个配置文件相互间的内容进行校检,判断多个配置文件中的变量之间的相互关系是否符合预期,丰富了对配置文件内部进行校检的校检方案,同时减少了用户提交配置文件时出现提交错误的状况。
图9是本发明一个具体实施例的基于序列化格式的配置文件校验装置的结构示意图。
如图9所示,配置文件校验装置包括:获取模块100、匹配模块200、生成模块300和第一判断模块400。
具体地,第一判断模块400用于根据预设的结构规则判断配置文件的文件目录是否满足结构规则。
其中,当预设的结构规则包括类型规则和内容规则时,第一判断模块400还用于判断文件目录的类型是否满足类型规则,生成模块300还用于在文件目录的类型不满足类型规则时,生成配置文件校检错误的提示信息,第一判断模块400还用于在文件目录的类型满足类型规则时,进一步判断文件目录的内容是否满足内容规则,生成模块300还用于在文件目录的内容不满足内容规则时,生成配置文件校检错误的提示信息。
其中,当预设的结构规则还包括约束规则时,第一判断模块400还用于判断文件目录的内容之间是否满足约束规则,生成模块300还用于在文件目录的内容之间不满足约束规则时,生成配置文件校检错误的提示信息。
需要说明的是,前述对配置文件校验方法的实施例的解释说明也适用于该实施例的配置文件校验装置,其实现原理类似,此处不再赘述。
本发明实施例的配置文件校验装置,根据预设的结构规则判断配置文件的文件目录是否满足结构规则,从而可以对多个配置文件的文件目录结构进行校检,检查配置文件的结构是否符合预期,进一步丰富了对单个配置文件内部进行校检的校检方案。
图10是本发明另一个具体实施例的基于序列化格式的配置文件校验装置的结构示意图。
如图10所示,配置文件校验装置包括:获取模块100、匹配模块200、生成模块300、第一判断模块400和第二判断模块500。
具体地,第二判断模块500用于根据预设的序列化文件模板判断配置文件的内容是否符合规范。
生成模块300还用于在配置文件的内容不符合规范时,生成配置文件校检错误的提示信息。
需要说明的是,前述对配置文件校验方法的实施例的解释说明也适用于该实施例的配置文件校验装置,其实现原理类似,此处不再赘述。
本发明实施例的配置文件校验装置,为了确保用户提交的配置文件符合预期,对配置文件进行三项校检,首先对配置文件的文件目录格式进行校检,其次对单个配置文件的内容进行校检,最后对多个配置文件相互间内容关联进行校检,不仅可以丰富对配置文件进行校检的校检方案,而且可以大大提高对配置文件校检的准确性,减少了用户提交配置文件时出现提交错误的状况。
应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料 或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。

Claims (14)

  1. 一种基于序列化格式的配置文件校验方法,其特征在于,包括以下步骤:
    获取配置文件中源配置文件的源表项的数据内容和目标配置文件的目标表项的数据内容;
    根据预设的匹配规则对所述源表项的数据内容和所述目标表项的数据内容进行匹配;以及
    根据匹配结果生成所述配置文件的校检结果。
  2. 如权利要求1所述的配置文件校验方法,其特征在于,所述预设的匹配规则包括相等规则、包含规则、互斥规则和唯一规则。
  3. 如权利要求1或2所述的配置文件校验方法,其特征在于,所述根据匹配结果生成所述配置文件的校检结果,包括:
    若所述源表项的数据内容和所述目标表项的数据内容不满足所述预设的匹配规则,则生成所述配置文件校检错误的提示信息。
  4. 如权利要求1所述的配置文件校验方法,其特征在于,在所述获取配置文件中源配置文件的源表项的数据内容和目标配置文件的目标表项的数据内容之前,还包括:
    根据预设的结构规则判断所述配置文件的文件目录是否满足所述结构规则。
  5. 如权利要求4所述的配置文件校验方法,其特征在于,所述预设的结构规则包括类型规则和内容规则,所述根据预设的结构规则判断所述配置文件的文件目录是否满足所述结构规则,包括:
    判断所述文件目录的类型是否满足所述类型规则;
    若所述文件目录的类型不满足所述类型规则,则生成所述配置文件校检错误的提示信息;
    若所述文件目录的类型满足所述类型规则,则进一步判断所述文件目录的内容是否满足所述内容规则;
    若所述文件目录的内容不满足所述内容规则,则生成所述配置文件校检错误的提示信息。
  6. 如权利要求5所述的配置文件校验方法,其特征在于,所述预设的结构规则还包括约束规则,所述根据预设的结构规则判断所述配置文件的文件目录是否满足所述结构规则,包括:
    判断所述文件目录的内容之间是否满足所述约束规则;
    若所述文件目录的内容之间不满足所述约束规则,则生成所述配置文件校检错误的提示信息。
  7. 如权利要求1所述的配置文件校验方法,其特征在于,在所述获取配置文件中源配置文件的源表项的数据内容和目标配置文件的目标表项的数据内容之前,还包括:
    根据预设的序列化文件模板判断所述配置文件的内容是否符合规范;
    若所述配置文件的内容不符合规范,则生成所述配置文件校检错误的提示信息。
  8. 一种基于序列化格式的配置文件校验装置,其特征在于,包括:
    获取模块,用于获取配置文件中源配置文件的源表项的数据内容和目标配置文件的目标表项的数据内容;
    匹配模块,用于根据预设的匹配规则对所述源表项的数据内容和所述目标表项的数据内容进行匹配;以及
    生成模块,用于根据匹配结果生成所述配置文件的校检结果。
  9. 如权利要求8所述的配置文件校验装置,其特征在于,所述预设的匹配规则包括相等规则、包含规则、互斥规则和唯一规则。
  10. 如权利要求8或9所述的配置文件校验装置,其特征在于,所述生成模块还用于:
    在所述源表项的数据内容和所述目标表项的数据内容不满足所述预设的匹配规则时,生成所述配置文件校检错误的提示信息。
  11. 如权利要求8所述的配置文件校验装置,其特征在于,还包括:
    第一判断模块,用于根据预设的结构规则判断所述配置文件的文件目录是否满足所述结构规则。
  12. 如权利要求11所述的配置文件校验装置,其特征在于,所述预设的结构规则包括类型规则和内容规则,所述第一判断模块还用于:
    判断所述文件目录的类型是否满足所述类型规则;
    所述生成模块还用于在所述文件目录的类型不满足所述类型规则时,生成所述配置文件校检错误的提示信息;
    所述第一判断模块还用于在所述文件目录的类型满足所述类型规则时,进一步判断所述文件目录的内容是否满足所述内容规则;
    所述生成模块还用于在所述文件目录的内容不满足所述内容规则时,生成所述配置文件校检错误的提示信息。
  13. 如权利要求12所述的配置文件校验装置,其特征在于,所述预设的结构规则还包括约束规则,所述第一判断模块还用于:
    判断所述文件目录的内容之间是否满足所述约束规则;
    所述生成模块还用于在所述文件目录的内容之间不满足所述约束规则时,生成所述配置文件校检错误的提示信息。
  14. 如权利要求8所述的配置文件校验装置,其特征在于,还包括:
    第二判断模块,用于根据预设的序列化文件模板判断所述配置文件的内容是否符合规范;
    所述生成模块还用于在所述配置文件的内容不符合规范时,生成所述配置文件校检错误的提示信息。
PCT/CN2017/075950 2016-03-21 2017-03-08 基于序列化格式的配置文件校验方法和装置 WO2017162029A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610160734.5A CN107220072A (zh) 2016-03-21 2016-03-21 基于序列化格式的配置文件校验方法和装置
CN201610160734.5 2016-03-21

Publications (1)

Publication Number Publication Date
WO2017162029A1 true WO2017162029A1 (zh) 2017-09-28

Family

ID=59899210

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/075950 WO2017162029A1 (zh) 2016-03-21 2017-03-08 基于序列化格式的配置文件校验方法和装置

Country Status (3)

Country Link
CN (1) CN107220072A (zh)
TW (1) TWI738719B (zh)
WO (1) WO2017162029A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020034155A1 (zh) * 2018-08-16 2020-02-20 朱小军 一种作用于仿生数据细胞体的生化数据蛋白
CN112035158A (zh) * 2020-08-25 2020-12-04 深圳市钱海网络技术有限公司 一种对补丁包进行风险检测的方法及装置
CN113342562A (zh) * 2021-06-22 2021-09-03 平安普惠企业管理有限公司 系统配置的校验方法、装置、设备及存储介质
CN114697368A (zh) * 2022-02-25 2022-07-01 青岛海尔科技有限公司 设备控制文件的确定方法及装置、存储介质、电子装置

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815136B (zh) * 2019-01-02 2022-03-29 腾讯科技(武汉)有限公司 一种业务运营的数据处理方法和装置
CN110673888B (zh) * 2019-08-27 2023-04-07 贝壳技术有限公司 用于配置文件的校验方法及装置
CN110806823A (zh) * 2019-10-30 2020-02-18 中电科仪器仪表有限公司 测试仪器菜单动态配置方法及系统
CN111045992B (zh) * 2019-12-04 2023-07-25 中盈优创资讯科技有限公司 一种基于树形结构的配置文件检查方法及系统
CN111144334B (zh) * 2019-12-27 2023-09-26 北京天融信网络安全技术有限公司 一种文件匹配方法、装置、电子设备及存储介质
CN111459817B (zh) * 2020-03-31 2024-02-02 中国银行股份有限公司 一种程序执行码的检验方法及装置
CN111708580B (zh) * 2020-05-09 2022-08-23 厦门极致互动网络技术股份有限公司 一种配置软件静态数据的处理方法及系统

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090196296A1 (en) * 2008-01-31 2009-08-06 Thomas Vachuska Data verification by challenge
CN101963912A (zh) * 2010-10-12 2011-02-02 浪潮电子信息产业股份有限公司 一种实现保存和校验系统硬件配置信息的方法
CN102346692A (zh) * 2010-08-03 2012-02-08 深圳Tcl新技术有限公司 一种iptv升级文件的校验方法
CN102968349A (zh) * 2012-09-06 2013-03-13 北京吉威时代软件技术有限公司 遥感影像数据文件完备性校验方法及系统
CN103957080A (zh) * 2014-04-30 2014-07-30 浙江中控技术股份有限公司 一种数据完整性校验方法及系统
CN104391934A (zh) * 2014-11-21 2015-03-04 深圳市银雁金融配套服务有限公司 数据校验方法和装置
CN105335342A (zh) * 2015-12-01 2016-02-17 国家电网公司 一种智能变电站scd配置文件虚端子联线正确性自动审查方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2004252837A1 (en) * 2003-06-04 2005-01-06 Fair Isaac Corporation Relational logic management system
CN101788950A (zh) * 2010-01-27 2010-07-28 浪潮(山东)电子信息有限公司 一种基于jsp页面的数据项校验方法
CN102880550B (zh) * 2011-07-12 2014-12-17 北京东方通科技股份有限公司 基于约束校验的内存格式化方法
CN103218398B (zh) * 2013-03-13 2015-02-25 江苏省电力公司电力科学研究院 智能变电站scl文件差异性比较方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090196296A1 (en) * 2008-01-31 2009-08-06 Thomas Vachuska Data verification by challenge
CN102346692A (zh) * 2010-08-03 2012-02-08 深圳Tcl新技术有限公司 一种iptv升级文件的校验方法
CN101963912A (zh) * 2010-10-12 2011-02-02 浪潮电子信息产业股份有限公司 一种实现保存和校验系统硬件配置信息的方法
CN102968349A (zh) * 2012-09-06 2013-03-13 北京吉威时代软件技术有限公司 遥感影像数据文件完备性校验方法及系统
CN103957080A (zh) * 2014-04-30 2014-07-30 浙江中控技术股份有限公司 一种数据完整性校验方法及系统
CN104391934A (zh) * 2014-11-21 2015-03-04 深圳市银雁金融配套服务有限公司 数据校验方法和装置
CN105335342A (zh) * 2015-12-01 2016-02-17 国家电网公司 一种智能变电站scd配置文件虚端子联线正确性自动审查方法

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020034155A1 (zh) * 2018-08-16 2020-02-20 朱小军 一种作用于仿生数据细胞体的生化数据蛋白
CN112035158A (zh) * 2020-08-25 2020-12-04 深圳市钱海网络技术有限公司 一种对补丁包进行风险检测的方法及装置
CN113342562A (zh) * 2021-06-22 2021-09-03 平安普惠企业管理有限公司 系统配置的校验方法、装置、设备及存储介质
CN114697368A (zh) * 2022-02-25 2022-07-01 青岛海尔科技有限公司 设备控制文件的确定方法及装置、存储介质、电子装置
CN114697368B (zh) * 2022-02-25 2023-12-19 青岛海尔科技有限公司 设备控制文件的确定方法及装置、存储介质、电子装置

Also Published As

Publication number Publication date
TW201737082A (zh) 2017-10-16
TWI738719B (zh) 2021-09-11
CN107220072A (zh) 2017-09-29

Similar Documents

Publication Publication Date Title
WO2017162029A1 (zh) 基于序列化格式的配置文件校验方法和装置
US20190197130A1 (en) Ensuring consistency in distributed incremental content publishing
WO2019200757A1 (zh) 数据导入方法、装置、计算机设备和存储介质
US11120434B2 (en) System and method for securing transaction in a blockchain network
US7953744B2 (en) Database change verifier
US9998450B2 (en) Automatically generating certification documents
WO2018176812A1 (zh) 静态资源发布方法及装置
US8707270B2 (en) Method and system for configurable pessimistic static XSL output validation
CN113888164A (zh) 区块链交易池实现方法、装置、计算机设备和存储介质
Kerstan et al. Coalgebraic trace semantics for continuous probabilistic transition systems
CN108170466B (zh) 一种基于程序合成的c/c++程序缺陷自动修复方法
CN107562808A (zh) 一种异构双链自动化数据的验证方法
US20150032489A1 (en) Methods for facilitating the preparation of construction bid documents and devices thereof
US8850606B2 (en) Computer readable medium storing program, information processing apparatus, and information processing method for document security
TW201250507A (en) System and method for validating design of electronic products
US20220284526A1 (en) Protocol Selection and Enforcement During Remote Online Notarization Session
CN109522595A (zh) 一种基于核电厂验证平台的功能图导入自动诊断方法
CN107180020B (zh) 排版文件校验方法和系统
US8954396B2 (en) Validating and enabling validation of package structures
US11900347B2 (en) Computing system for configurable off-chain storage for blockchains
CN106330400A (zh) 一种快速的crc校验方法及装置
CN105653525B (zh) 账套之间数据导入的方法和系统
CN110674114A (zh) 一种分布式协同设计的数据版本控制方法和装置
EP3208758A1 (en) Systems and methods for electronic mail communication based data management
Kevlahan Stochastic differential equation models of vortex merging and reconnection

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17769306

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17769306

Country of ref document: EP

Kind code of ref document: A1