TWI738719B - Setting file verification method and device based on serialization format - Google Patents

Setting file verification method and device based on serialization format Download PDF

Info

Publication number
TWI738719B
TWI738719B TW106104937A TW106104937A TWI738719B TW I738719 B TWI738719 B TW I738719B TW 106104937 A TW106104937 A TW 106104937A TW 106104937 A TW106104937 A TW 106104937A TW I738719 B TWI738719 B TW I738719B
Authority
TW
Taiwan
Prior art keywords
configuration file
rule
content
file
profile
Prior art date
Application number
TW106104937A
Other languages
Chinese (zh)
Other versions
TW201737082A (en
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 TW201737082A publication Critical patent/TW201737082A/en
Application granted granted Critical
Publication of TWI738719B publication Critical patent/TWI738719B/en

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
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • 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

Landscapes

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

Abstract

本發明提出一種基於序列化格式的設定檔校驗方法和裝置。其中,該設定檔校驗方法包括:獲取設定檔中源設定檔的源表項的資料內容和目標設定檔的目標表項的資料內容;根據預設的匹配規則對源表項的資料內容和目標表項的資料內容進行匹配;以及根據匹配結果產生設定檔的校檢結果。本發明實施例的設定檔校驗方法,可以對多個設定檔相互間的內容進行校檢,判斷多個設定檔中的變數之間的相互關係是否符合預期,豐富了對設定檔內部進行校檢的校檢方案,同時減少了用戶提交設定檔時出現提交錯誤的狀況。 The present invention provides a configuration file verification method and device based on a serialized format. Wherein, the configuration file verification method includes: obtaining the data content of the source table entry of the source configuration file and the data content of the target table entry of the target configuration file in the configuration file; The data content of the target table item is matched; and the verification result of the configuration file is generated according to the matching result. The configuration file verification method of the embodiment of the present invention can check the content of multiple configuration files to determine whether the relationship between the variables in the multiple configuration files meets expectations, which enriches the internal calibration of the configuration files. The inspection plan of the inspection, at the same time, reduces the situation of submission errors when the user submits the configuration file.

Description

基於序列化格式的設定檔校驗方法和裝置 Setting file verification method and device based on serialization format

本發明關於互聯網技術領域,尤其關於一種基於序列化格式的設定檔校驗方法和裝置。 The present invention relates to the field of Internet technology, and in particular to a method and device for checking a configuration file based on a serialized format.

序列化是將物件轉換為位元組流以將其保存在記憶體、資料庫或檔中的過程,其主要目的是保存物件的狀態,以便在需要時重新創建物件,常見的序列化格式包括xml,json,yaml格式等。 Serialization is the process of converting an object into a byte stream to save 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格式(JavaScript Object Notation,是一種羽量級的資料交換格式)的設定檔而言,可通過json範本校檢該設定檔的合法性,json範本定義變數名稱和取值的對應關係,如果設定檔中的變數和取值符合對應關係,則認為設定檔是合法的,反之認為設定檔不合法。 At present, when users submit configuration files, some serializable standard formats need to be checked for legality to avoid user submission errors. For example, for a configuration file in json format (JavaScript Object Notation, a featherweight data exchange format), the legality of the configuration file can be verified through the json template, which defines the correspondence between variable names and values , If the variables and values in the configuration file match the corresponding relationship, the configuration file is considered legal, otherwise the configuration file is considered illegal.

然而,目前存在的問題是,json範本只能校檢json格式的設定檔,對於不是json格式的設定檔而言並不能進行合法性校檢。並且,json範本只能校檢單個設定檔中 的變數和取值是否符合預定義的格式,校檢的內容並不豐富。 However, the current problem is that the json template can only be checked for configuration files in the json format, and the legality check cannot be performed for the configuration files that are not in the json format. In addition, the json template can only be checked in a single configuration file Whether the variable and the value of is in accordance with the predefined format, the content of the verification is not rich.

本發明旨在至少在一定程度上解決相關技術中的技術問題之一。 The present invention aims to solve one of the technical problems in the related art at least to a certain extent.

為此,本發明的第一個目的在於提出一種基於序列化格式的設定檔校驗方法,該設定檔校驗方法可以對多個設定檔相互間的內容進行校檢,判斷多個設定檔中的變數之間的相互關係是否符合預期,豐富了對設定檔內部進行校檢的校檢方案,同時減少了用戶提交設定檔時出現提交錯誤的狀況。 To this end, the first objective of the present invention is to propose a configuration file verification method based on a serialized format. The configuration file verification method can verify the content of multiple configuration files and determine whether the multiple configuration files are Whether the interrelationship between the variables meets expectations, enriches the verification plan for the internal verification of the profile, and reduces the situation of submission errors when the user submits the profile.

本發明的第二個目的在於提出一種基於序列化格式的設定檔校驗裝置。 The second objective of the present invention is to provide a configuration file verification device based on a serialized format.

為達上述目的,本發明第一態樣實施例提出了一種基於序列化格式的設定檔校驗方法,包括:獲取設定檔中源設定檔的源表項的資料內容和目標設定檔的目標表項的資料內容;根據預設的匹配規則對所述源表項的資料內容和所述目標表項的資料內容進行匹配;以及根據匹配結果產生所述設定檔的校檢結果。 In order to achieve the above objective, the first aspect of the present invention proposes a configuration file verification method based on a serialization format, including: obtaining the data content of the source table entry of the source configuration file and the target table of the target configuration file in the configuration file The data content of the item; the data content of the source entry and the data content of the target entry are matched according to a preset matching rule; and the verification result of the configuration file is generated according to the matching result.

本發明實施例的設定檔校驗方法,根據預設的匹配規則對設定檔中源設定檔的源表項的資料內容和目標設定檔的目標表項的資料內容進行匹配,從而可以對多個設定檔相互間的內容進行校檢,判斷多個設定檔中的變數之間的 相互關係是否符合預期,豐富了對設定檔內部進行校檢的校檢方案,同時減少了用戶提交設定檔時出現提交錯誤的狀況。 According to the configuration file verification method of the embodiment of the present invention, the data content of the source entry of the source profile and the data content of the target entry of the target profile in the profile are matched according to a preset matching rule, so that multiple Check the content between the configuration files to determine the difference between the variables in multiple configuration files Whether the relationship is in line with expectations, enriches the verification plan for the internal verification of the configuration file, and reduces the submission errors when the user submits the configuration file.

為達上述目的,本發明第二態樣實施例提出了一種基於序列化格式的設定檔校驗裝置,包括:獲取模組,用於獲取設定檔中源設定檔的源表項的資料內容和目標設定檔的目標表項的資料內容;匹配模組,用於根據預設的匹配規則對所述源表項的資料內容和所述目標表項的資料內容進行匹配;以及產生模組,用於根據匹配結果產生所述設定檔的校檢結果。本發明實施例的設定檔校驗裝置,根據預設的匹配規則對設定檔中源設定檔的源表項的資料內容和目標設定檔的目標表項的資料內容進行匹配,從而可以對多個設定檔相互間的內容進行校檢,判斷多個設定檔中的變數之間的相互關係是否符合預期,豐富了對設定檔內部進行校檢的校檢方案,同時減少了用戶提交設定檔時出現提交錯誤的狀況。 In order to achieve the above objective, the second aspect of the present invention provides a configuration file verification device based on a serialization format, including: an acquisition module for acquiring the data content and the source entry of the source configuration file in the configuration file The data content of the target entry of the target profile; a matching module for matching the data content of the source entry with the data content of the target entry according to a preset matching rule; and a generation module, using Based on the matching result, the verification result of the profile is generated. The configuration file verification device of the embodiment of the present invention matches the data content of the source entry of the source profile and the data content of the target entry of the target profile in the profile according to a preset matching rule, so that multiple The content of each configuration file is checked to determine whether the relationship between the variables in multiple configuration files is in line with expectations, which enriches the check plan for checking the internal configuration files, and reduces the occurrence of users when submitting configuration files. Submit the wrong status.

本發明附加的態樣和優點將在下面的描述中部分給出,部分將從下面的描述中變得明顯,或通過本發明的實踐瞭解到。 The additional aspects and advantages of the present invention will be partially given in the following description, and some will become obvious from the following description, or be understood through the practice of the present invention.

S101、S102、S103‧‧‧方法步驟 S101, S102, S103‧‧‧Method steps

S301、S302、S303、S304‧‧‧方法步驟 S301, S302, S303, S304‧‧‧Method steps

S701、S702、S703、S704、S705‧‧‧方法步驟 S701, S702, S703, S704, S705‧‧‧Method steps

100‧‧‧獲取模組 100‧‧‧Get Module

200‧‧‧匹配模組 200‧‧‧Matching Module

300‧‧‧產生模組 300‧‧‧Generate Module

400‧‧‧第一判斷模組 400‧‧‧First Judgment Module

500‧‧‧第二判斷模組 500‧‧‧Second Judgment Module

本發明上述的和/或附加的態樣和優點從下面結合附圖對實施例的描述中將變得明顯和容易理解,其中:圖1是本發明一個實施例的基於序列化格式的設定檔 校驗方法的流程圖;圖2是本發明一個實施例的設定檔的匹配規則的示意圖;圖3是本發明一個具體實施例的基於序列化格式的設定檔校驗方法的流程圖;圖4是本發明一個實施例的結構規則的示意圖;圖5是本發明一個實施例的設定檔的檔目錄的格式規範的示意圖;圖6是本發明一個實施例的設定檔約束規則的示意圖;圖7是本發明另一個具體實施例的基於序列化格式的設定檔校驗方法的流程圖;圖8是本發明一個實施例的基於序列化格式的設定檔校驗裝置的結構示意圖;圖9是本發明一個具體實施例的基於序列化格式的設定檔校驗裝置的結構示意圖;以及圖10是本發明另一個具體實施例的基於序列化格式的設定檔校驗裝置的結構示意圖。 The above and/or additional aspects and advantages of the present invention will become obvious and easy to understand from the following description of the embodiments in conjunction with the accompanying drawings, in which: Figure 1 is a serialized format-based configuration file of an embodiment of the present invention Flowchart of the verification method; Figure 2 is a schematic diagram of a configuration file matching rule according to an embodiment of the present invention; Figure 3 is a flowchart of a configuration file verification method based on a serialized format in a specific embodiment of the present invention; Figure 4 Fig. 5 is a schematic diagram of the format specification of a profile directory of an embodiment of the present invention; Fig. 6 is a schematic diagram of a configuration file restriction rule of an embodiment of the present invention; Fig. 7 Is a flowchart of a configuration file verification method based on a serialized format in another specific embodiment of the present invention; FIG. 8 is a schematic structural diagram of a configuration file verification device based on a serialized format in an embodiment of the present invention; FIG. 9 is the present invention A schematic structural diagram of a configuration file verification device based on a serialized format according to a specific embodiment of the invention; and FIG. 10 is a schematic structural diagram of a configuration file verification device based on a serialized format according to another specific embodiment of the present invention.

下面詳細描述本發明的實施例,所述實施例的示例在附圖中示出,其中自始至終相同或類似的標號表示相同或類似的元件或具有相同或類似功能的元件。下面通過參考附圖描述的實施例是示例性的,旨在用於解釋本發明,而 不能理解為對本發明的限制。 The embodiments of the present invention are described in detail below. Examples of the embodiments are shown in the accompanying drawings, in which the same or similar reference numerals indicate the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the drawings are exemplary and are intended to explain the present invention. It cannot be understood as a limitation to the present invention.

此外,術語“第一”、“第二”僅用於描述目的,而不能理解為指示或暗示相對重要性或者隱含指明所指示的技術特徵的數量。由此,限定有“第一”、“第二”的特徵可以明示或者隱含地包括一個或者更多個該特徵。在本發明的描述中,“多個”的含義是兩個或兩個以上,除非另有明確具體的限定。 In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of these features. In the description of the present invention, "plurality" means two or more than two, unless otherwise specifically defined.

流程圖中或在此以其他方式描述的任何過程或方法描述可以被理解為,表示包括一個或更多個用於實現特定邏輯功能或過程的步驟的可執行指令的代碼的模組、片段或部分,並且本發明的較佳實施例的範圍包括另外的實現,其中可以不按所示出或討論的順序,包括根據所關於的功能按基本同時的方式或按相反的順序,來執行功能,這應被本發明的實施例所屬技術領域的技術人員所理解。 Any process or method description described in the flowchart or described in other ways herein can be understood as a module, segment, or code that includes one or more executable instructions for implementing specific logical functions or steps of the process. Part, and the scope of the preferred embodiment of the present invention includes additional implementations, which may not be in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order according to the functions in question, This should be understood by those skilled in the art to which the embodiments of the present invention belong.

圖1是本發明一個實施例的基於序列化格式的設定檔校驗方法的流程圖。 Fig. 1 is a flowchart of a configuration file verification method based on a serialized format according to an embodiment of the present invention.

如圖1所示,設定檔校驗方法包括: As shown in Figure 1, the configuration file verification method includes:

S101,獲取設定檔中源設定檔的源表項的資料內容和目標設定檔的目標表項的資料內容。 S101: Obtain data content of a source entry in the source profile and data content of a target entry in the target profile in the profile.

具體地,在用戶提交設定檔後,先讀取設定檔中原始檔案的源表項中的資料內容,再讀取設定檔中目的檔案的目標表項的資料內容。 Specifically, after the user submits the configuration file, the data content in the source entry of the original file in the configuration file is read first, and then the data content in the target entry of the target file in the configuration file is read.

S102,根據預設的匹配規則對源表項的資料內容和目標表項的資料內容進行匹配。 S102: Match the data content of the source entry and the data content of the target entry according to a preset matching rule.

具體地,不同的匹配規則以不同的規則編號進行區分並進行排序。圖2示出了本發明一個實施例的設定檔的匹配規則的示意圖,如圖2所示,源設定檔定義匹配源的檔案名,可包含萬用字元表示一組檔。源表項定義原始檔案中的具體表項名稱,可用萬用字元匹配一組表項。 Specifically, different matching rules are distinguished and sorted by different rule numbers. FIG. 2 shows a schematic diagram of a matching rule of a configuration file according to an embodiment of the present invention. As shown in FIG. 2, the source configuration file defines the file name of the matching source, which may include wildcards to represent a group of files. The source entry defines the name of the specific entry in the original file, and wildcards can be used to match a group of entries.

匹配規則定義了4種常用的規則關係,包括相等規則、包含規則、互斥規則和唯一規則。其中,相等規則表示源表項中的資料內容和目標表項中的資料內容完全相同;包含規則表示源表項中的資料內容包含目標表項中的資料內容;互斥規則表示源表項中的資料內容和目標表項中的資料內容不能有交集;唯一規則表示源表項中的資料內容之間不能有交集,在根據唯一規則對資料內容進行校檢時,僅對源表項中的資料內容進行校檢,對目標表項中的資料內容不進行校檢,因此可以忽略目的檔案和目標表項。 Matching rules define four commonly used rule relationships, including equality rules, containment rules, mutual exclusion rules, and unique rules. Among them, the equality rule means that the data content in the source entry is exactly the same as the data content in the target entry; the inclusion rule means that the data content in the source entry includes the data content in the target entry; the mutually exclusive rule means that the data content in the source entry The data content of and the data content in the target entry cannot have an intersection; the unique rule means that there can be no intersection between the data content in the source entry. When the data content is checked according to the unique rule, only the data in the source entry The data content is checked, and the data content in the target table item is not checked, so the target file and the target table item can be ignored.

目標設定檔定義匹配目標的檔案名,可包含萬用字元表示一組檔。目標表項定義目的檔案中的具體表項名稱,可用萬用字元匹配一組表項。 The target profile defines the file name that matches the target, and can contain wildcard characters to indicate a set of files. The target entry defines the name of a specific entry in the target file, and wildcards can be used to match a group of entries.

進而,根據匹配規則將可序列化的設定檔的內容轉換為一組集合資料,在讀取設定檔中原始檔案的源表項中的資料內容,和目的檔案的目標表項的資料內容後,利用匹配規則中定義的運算關係計算源表項中的資料內容和目標表項的資料內容是否滿足要求。 Furthermore, the content of the serializable configuration file is converted into a set of collection data according to the matching rules. After reading the data content of the source entry of the original file in the configuration file and the data content of the target entry of the destination file, The calculation relationship defined in the matching rules is used to calculate whether the data content in the source entry and the data content in the target entry meet the requirements.

S103,根據匹配結果產生設定檔的校檢結果。 S103: Generate a check result of the configuration file according to the matching result.

具體地,若源表項的資料內容和目標表項的資料內容滿足預設的匹配規則,則產生設定檔校檢正確的校檢結果。 Specifically, if the data content of the source entry and the data content of the target entry meet the preset matching rules, a verification result that is correct for the configuration file verification is generated.

若源表項的資料內容和目標表項的資料內容不滿足預設的匹配規則,則產生設定檔產生校檢錯誤的校檢結果,同時產生設定檔校檢錯誤的提示資訊回饋給使用者。 If the data content of the source table entry and the data content of the target table entry do not meet the preset matching rules, the configuration file generates a check result of a check error, and a prompt message of the configuration file check error is generated to feedback to the user.

本發明實施例的設定檔校驗方法,根據預設的匹配規則對設定檔中源設定檔的源表項的資料內容和目標設定檔的目標表項的資料內容進行匹配,從而可以對多個設定檔相互間的內容進行校檢,判斷多個設定檔中的變數之間的相互關係是否符合預期,豐富了對設定檔內部進行校檢的校檢方案,同時減少了用戶提交設定檔時出現提交錯誤的狀況。 According to the configuration file verification method of the embodiment of the present invention, the data content of the source entry of the source profile and the data content of the target entry of the target profile in the profile are matched according to a preset matching rule, so that multiple The content of each configuration file is checked to determine whether the relationship between the variables in multiple configuration files is in line with expectations, which enriches the check plan for checking the internal configuration files, and reduces the occurrence of users when submitting configuration files. Submit the wrong status.

圖3是本發明一個具體實施例的基於序列化格式的設定檔校驗方法的流程圖。 Fig. 3 is a flowchart of a configuration file verification method based on a serialized format according to a specific embodiment of the present invention.

如圖3所示,設定檔校驗方法包括: As shown in Figure 3, the configuration file verification method includes:

S301,根據預設的結構規則判斷設定檔的檔目錄是否滿足結構規則。 S301: Determine whether the file directory of the profile meets the structure rule according to the preset structure rule.

具體地,檢查設定檔的格式是否符合預期,對設定檔的檔目錄格式進行校檢。 Specifically, it is checked whether the format of the configuration file meets expectations, and the file directory format of the configuration file is checked.

在本發明的一個實施例中,預設的結構規則包括類型規則和內容規則,判斷檔目錄的類型是否滿足類型規則,若檔目錄的類型不滿足類型規則,則產生設定檔校檢錯誤的提示資訊,若檔目錄的類型滿足類型規則,則進一步判 斷檔目錄的內容是否滿足內容規則,若檔目錄的內容不滿足內容規則,則產生設定檔校檢錯誤的提示資訊。具體而言,圖4是本發明一個實施例的結構規則的示意圖,如圖4所示,結構規則中定義需要檢查的每個檔的檔案類型和內容規則,對於目錄而言,定義檔案類型為目錄後,需要定義目錄內容,目錄內容下可繼續定義目錄內的子目錄或者檔。對於檔而言,定義類型為檔後,然後定義檔的內容,用於進行下一步的檔內容的檢查。如果設定檔的檔目錄不符合結構規則,例如檔目錄的內容中需要有的檔沒有、需要有的目錄沒有,產生設定檔校檢錯誤的提示資訊回饋給使用者,或者檔目錄的類型不匹配,也產生設定檔校檢錯誤的提示資訊回饋給使用者。 In an embodiment of the present invention, the preset structure rules include type rules and content rules, to determine whether the type of the file directory meets the type rules, and if the type of the file directory does not meet the type rules, a prompt of configuration file verification error is generated Information, if the type of the file directory meets the type rules, further judgment Whether the content of the file directory meets the content rules, if the content of the file directory does not meet the content rules, a prompt message of configuration file verification errors will be generated. Specifically, FIG. 4 is a schematic diagram of the structure rule of an embodiment of the present invention. As shown in FIG. 4, the structure rule defines the file type and content rule of each file that needs to be checked. For a directory, the file type is defined as After the catalog, you need to define the contents of the catalog, and you can continue to define the sub-directories or files in the catalog under the contents of the catalog. For files, after defining the type as a file, define the content of the file and use it to check the content of the file in the next step. If the file directory of the configuration file does not conform to the structural rules, for example, the content of the file directory does not contain required files and the required directory does not exist, a configuration file verification error prompt information is generated to feedback to the user, or the type of the file directory does not match , And also generate prompt information about configuration file verification errors to give back to the user.

例如,圖5是本發明一個實施例的設定檔的檔目錄的格式規範的示意圖,如圖5所示,頂級目錄包括集群設定檔、系統設定檔和服務清單目錄。服務清單目錄下每個服務均有自己的服務目錄、設定檔目錄和服務設定目錄,在服務目錄裡放置該服務用到的設定檔,其中,設定檔包括部署設定檔和版本設定檔。設定目錄包括服務升級設定檔,服務設定目錄則包括使用者設定檔。進而,根據上述格式規範檢查設定檔的檔目錄結構是否滿足要求。 For example, FIG. 5 is a schematic diagram of the format specification of the file directory of the configuration file according to an embodiment of the present invention. As shown in FIG. 5, the top-level directory includes a cluster configuration file, a system configuration file, and a service list directory. Each service under the service list directory has its own service directory, configuration file directory, and service configuration directory. The configuration files used by the service are placed in the service directory. The configuration files include deployment configuration files and version configuration files. The configuration directory includes service upgrade configuration files, and the service configuration directory includes user configuration files. Furthermore, it is checked whether the file directory structure of the profile meets the requirements according to the above-mentioned format specification.

在本發明的一個實施例中,預設的結構規則還包括約束規則,判斷檔目錄的內容之間是否滿足約束規則,若檔目錄的內容之間不滿足約束規則,則產生設定檔校檢錯誤的提示資訊。具體而言,除了對設定檔的檔目錄格式進行 檢查之外,還對設定檔的檔目錄的內容間的約束進行檢查。例如,圖6是本發明一個實施例的設定檔約束規則的示意圖,如圖6所示,如集群設定檔中定義了機器列表,在部署設定檔中同樣包含機器列表,並且部署設定檔中的機器列表要包含於集群設定檔中的機器列表內。再如部署設定檔中定義了服務的角色清單,版本設定檔中同樣包含角色列表,升級設定檔中也要包含角色列表。進而,根據不同應用的需求,可以定義多種不同的約束規則,根據這些約束規則對設定檔的檔目錄的內容進行檢查。 In an embodiment of the present invention, the preset structure rules also include constraint rules, which determine whether the content of the file directory meets the constraint rules. If the content of the file directory does not meet the constraint rules, a configuration file verification error is generated. Reminder information. Specifically, in addition to the file directory format of the configuration file In addition to checking, it also checks the constraints between the contents of the file directory of the configuration file. For example, Figure 6 is a schematic diagram of a profile constraint rule of an embodiment of the present invention. As shown in Figure 6, if a machine list is defined in the cluster profile, the deployment profile also contains the machine list, and the configuration file in the deployment profile The machine list should be included in the machine list in the cluster configuration file. Another example is the role list of the service defined in the deployment profile, the version profile also contains the role list, and the upgrade profile also contains the role list. Furthermore, according to the requirements of different applications, a variety of different constraint rules can be defined, and the content of the file directory of the profile can be checked according to these constraint rules.

S302,獲取設定檔中源設定檔的源表項的資料內容和目標設定檔的目標表項的資料內容。 S302: Acquire the data content of the source entry of the source profile and the data content of the target entry of the target profile in the profile.

具體地,在用戶提交設定檔後,先讀取設定檔中原始檔案的源表項中的資料內容,再讀取設定檔中目的檔案的目標表項的資料內容。 Specifically, after the user submits the configuration file, the data content in the source entry of the original file in the configuration file is read first, and then the data content in the target entry of the target file in the configuration file is read.

S303,根據預設的匹配規則對源表項的資料內容和目標表項的資料內容進行匹配。 S303: Match the data content of the source entry and the data content of the target entry according to a preset matching rule.

具體地,不同的匹配規則以不同的規則編號進行區分並進行排序。圖2示出了本發明一個實施例的設定檔的匹配規則的示意圖,如圖2所示,源設定檔定義匹配源的檔案名,可包含萬用字元表示一組檔。源表項定義原始檔案中的具體表項名稱,可用萬用字元匹配一組表項。 Specifically, different matching rules are distinguished and sorted by different rule numbers. FIG. 2 shows a schematic diagram of a matching rule of a configuration file according to an embodiment of the present invention. As shown in FIG. 2, the source configuration file defines the file name of the matching source, which may include wildcards to represent a group of files. The source entry defines the name of the specific entry in the original file, and wildcards can be used to match a group of entries.

匹配規則定義了4種常用的規則關係,包括相等規則、包含規則、互斥規則和唯一規則。其中,相等規則表示源表項中的資料內容和目標表項中的資料內容完全相 同;包含規則表示源表項中的資料內容包含目標表項中的資料內容;互斥規則表示源表項中的資料內容和目標表項中的資料內容不能有交集;唯一規則表示源表項中的資料內容之間不能有交集,在根據唯一規則對資料內容進行檢查時,僅對源表項中的資料內容進行檢查,對目標表項中的資料內容不進行檢查,因此可以忽略目的檔案和目標表項。 Matching rules define four commonly used rule relationships, including equality rules, containment rules, mutual exclusion rules, and unique rules. Among them, the equality rule means that the data content in the source entry is completely the same as the data content in the target entry. Same; containment rules indicate that the data content in the source entry includes the data content in the target entry; mutually exclusive rules indicate that the data content in the source entry and the data content in the target entry cannot overlap; the only rule indicates that the source entry There can be no intersection between the data content in the data content. When the data content is checked according to the unique rule, only the data content in the source table item is checked, and the data content in the target table item is not checked, so the destination file can be ignored And the target table entry.

目標設定檔定義匹配目標的檔案名,可包含萬用字元表示一組檔。目標表項定義目的檔案中的具體表項名稱,可用萬用字元匹配一組表項。 The target profile defines the file name that matches the target, and can contain wildcard characters to indicate a set of files. The target entry defines the name of a specific entry in the target file, and wildcards can be used to match a group of entries.

進而,根據匹配規則將可序列化的設定檔的內容轉換為一組集合資料,在讀取設定檔中原始檔案的源表項中的資料內容,和目的檔案的目標表項的資料內容後,利用匹配規則中定義的運算關係計算源表項中的資料內容和目標表項的資料內容是否滿足要求。 Furthermore, the content of the serializable configuration file is converted into a set of collection data according to the matching rules. After reading the data content of the source entry of the original file in the configuration file and the data content of the target entry of the destination file, The calculation relationship defined in the matching rules is used to calculate whether the data content in the source entry and the data content in the target entry meet the requirements.

S304,根據匹配結果產生設定檔的校檢結果。 S304: Generate a check result of the configuration file according to the matching result.

具體地,若源表項的資料內容和目標表項的資料內容滿足預設的匹配規則,則產生設定檔校檢正確的校檢結果。 Specifically, if the data content of the source entry and the data content of the target entry meet the preset matching rules, a verification result that is correct for the configuration file verification is generated.

若源表項的資料內容和目標表項的資料內容不滿足預設的匹配規則,則產生設定檔產生校檢錯誤的校檢結果,同時產生設定檔校檢錯誤的提示資訊回饋給使用者。 If the data content of the source table entry and the data content of the target table entry do not meet the preset matching rules, the configuration file generates a check result of a check error, and a prompt message of the configuration file check error is generated to feedback to the user.

本發明實施例的設定檔校驗方法,根據預設的結構規則判斷設定檔的檔目錄是否滿足結構規則,從而可以對多 個設定檔的檔目錄結構進行校檢,檢查設定檔的結構是否符合預期,進一步豐富了對單個設定檔內部進行校檢的校檢方案。 The configuration file verification method of the embodiment of the present invention judges whether the file directory of the configuration file satisfies the structure rule according to the preset structure rule, so that multiple The file directory structure of each configuration file is checked to check whether the structure of the configuration file meets expectations, which further enriches the check plan for checking the inside of a single configuration file.

圖7是本發明另一個具體實施例的基於序列化格式的設定檔校驗方法的流程圖。 FIG. 7 is a flowchart of a configuration file verification method based on a serialized format according to another specific embodiment of the present invention.

如圖7所示,設定檔校驗方法包括: As shown in Figure 7, the configuration file verification method includes:

S701,根據預設的結構規則判斷設定檔的檔目錄是否滿足結構規則。 S701: Determine whether the file directory of the profile meets the structure rule according to the preset structure rule.

具體地,檢查設定檔的格式是否符合預期,對設定檔的檔目錄格式進行檢查。 Specifically, it is checked whether the format of the configuration file meets expectations, and the file directory format of the configuration file is checked.

在本發明的一個實施例中,預設的結構規則包括類型規則和內容規則,判斷檔目錄的類型是否滿足類型規則,若檔目錄的類型不滿足類型規則,則產生設定檔校檢錯誤的提示資訊,若檔目錄的類型滿足類型規則,則進一步判斷檔目錄的內容是否滿足內容規則,若檔目錄的內容不滿足內容規則,則產生設定檔校檢錯誤的提示資訊。具體而言,圖4是本發明一個實施例的結構規則的示意圖,如圖4所示,結構規則中定義需要檢查的每個檔的檔案類型和內容規則,對於目錄而言,定義檔案類型為目錄後,需要定義目錄內容,目錄內容下可繼續定義目錄內的子目錄或者檔。對於檔而言,定義類型為檔後,然後定義檔的內容,用於進行下一步的檔內容的檢查。如果設定檔的檔目錄不符合結構規則,例如檔目錄的內容中需要有的檔沒有、需要有的目錄沒有,產生設定檔校檢錯誤的提示資訊 回饋給使用者,或者檔目錄的類型不匹配,也產生設定檔校檢錯誤的提示資訊回饋給使用者。 In an embodiment of the present invention, the preset structure rules include type rules and content rules, to determine whether the type of the file directory meets the type rules, and if the type of the file directory does not meet the type rules, a prompt of configuration file verification error is generated Information, if the type of the file directory meets the type rule, it is further determined whether the content of the file directory meets the content rule, and if the content of the file directory does not meet the content rule, a prompt message of configuration file verification error is generated. Specifically, FIG. 4 is a schematic diagram of the structure rule of an embodiment of the present invention. As shown in FIG. 4, the structure rule defines the file type and content rule of each file that needs to be checked. For a directory, the file type is defined as After the catalog, you need to define the contents of the catalog, and you can continue to define the sub-directories or files in the catalog under the contents of the catalog. For files, after defining the type as a file, define the content of the file and use it to check the content of the file in the next step. If the file directory of the configuration file does not conform to the structural rules, for example, the content of the file directory does not contain the required files and the required directory does not exist, a prompt message of configuration file verification errors will be generated Feedback to the user, or the type of the file directory does not match, and a prompt message of configuration file verification error is also generated to feedback to the user.

例如,圖5是本發明一個實施例的設定檔的檔目錄的格式規範的示意圖,如圖5所示,頂級目錄包括集群設定檔、系統設定檔和服務清單目錄。服務清單目錄下每個服務均有自己的服務目錄、設定檔目錄和服務設定目錄,在服務目錄裡放置該服務用到的設定檔,其中,設定檔包括部署設定檔和版本設定檔。設定目錄包括服務升級設定檔,服務設定目錄則包括使用者設定檔。進而,根據上述格式規範檢查設定檔的檔目錄結構是否滿足要求。 For example, FIG. 5 is a schematic diagram of the format specification of the file directory of the configuration file according to an embodiment of the present invention. As shown in FIG. 5, the top-level directory includes a cluster configuration file, a system configuration file, and a service list directory. Each service under the service list directory has its own service directory, configuration file directory, and service configuration directory. The configuration files used by the service are placed in the service directory. The configuration files include deployment configuration files and version configuration files. The configuration directory includes service upgrade configuration files, and the service configuration directory includes user configuration files. Furthermore, it is checked whether the file directory structure of the profile meets the requirements according to the above-mentioned format specification.

在本發明的一個實施例中,預設的結構規則還包括約束規則,判斷檔目錄的內容之間是否滿足約束規則,若檔目錄的內容之間不滿足約束規則,則產生設定檔校檢錯誤的提示資訊。具體而言,除了對設定檔的檔目錄格式進行檢查之外,還對設定檔的檔目錄的內容間的約束進行檢查。例如,圖6時本發明一個實施例的設定檔約束規則的示意圖,如圖6所示,如集群設定檔中定義了機器列表,在部署設定檔中同樣包含機器列表,並且部署設定檔中的機器列表要包含於集群設定檔中的機器列表內。再如部署設定檔中定義了服務的角色清單,版本設定檔中同樣包含角色列表,升級設定檔中也要包含角色列表。進而,根據不同應用的需求,可以定義多種不同的約束規則,根據這些約束規則對設定檔的檔目錄的內容進行檢查。 In an embodiment of the present invention, the preset structure rules also include constraint rules, which determine whether the content of the file directory meets the constraint rules. If the content of the file directory does not meet the constraint rules, a configuration file verification error is generated. Reminder information. Specifically, in addition to checking the file directory format of the profile, it also checks the constraints between the contents of the file directory of the profile. For example, Figure 6 is a schematic diagram of the configuration file constraint rules of an embodiment of the present invention. The machine list should be included in the machine list in the cluster configuration file. Another example is the role list of the service defined in the deployment profile, the version profile also contains the role list, and the upgrade profile also contains the role list. Furthermore, according to the requirements of different applications, a variety of different constraint rules can be defined, and the content of the file directory of the profile can be checked according to these constraint rules.

S702,根據預設的序列化檔範本判斷設定檔的內容是 否符合規範。 S702: Determine whether the content of the configuration file is based on the preset serialized file template Whether it meets the specifications.

具體地,對單個設定檔的內容進行檢查,例如,採用通用的json序列化檔範本對設定和檔的內容進行檢查,其中json檔範本可以實現較為豐富的單檔內部的內容檢查,檢查過程可以使互動式或非互動式的,例如應用程式使用json範本進行使用者輸入的檢查,確保輸入的內容符合應用程式的規範。 Specifically, the content of a single configuration file is checked. For example, a general json serialized file template is used to check the content of the configuration and files. The json file template can achieve a richer content check within a single file, and the inspection process can be Make it interactive or non-interactive. For example, the application uses the json template to check user input to ensure that the input content meets the application's specifications.

若設定檔的內容不符合規範,則產生設定檔校檢錯誤的提示資訊。 If the content of the configuration file does not conform to the specification, a prompt message of configuration file verification error will be generated.

S703,獲取設定檔中源設定檔的源表項的資料內容和目標設定檔的目標表項的資料內容。 S703: Acquire the data content of the source entry of the source profile and the data content of the target entry of the target profile in the profile.

具體地,在用戶提交設定檔後,先讀取設定檔中原始檔案的源表項中的資料內容,再讀取設定檔中目的檔案的目標表項的資料內容。 Specifically, after the user submits the configuration file, the data content in the source entry of the original file in the configuration file is read first, and then the data content in the target entry of the target file in the configuration file is read.

S704,根據預設的匹配規則對源表項的資料內容和目標表項的資料內容進行匹配。 S704: Match the data content of the source entry and the data content of the target entry according to a preset matching rule.

具體地,不同的匹配規則以不同的規則編號進行區分並進行排序。圖2示出了本發明一個實施例的設定檔的匹配規則的示意圖,如圖2所示,源設定檔定義匹配源的檔案名,可包含萬用字元表示一組檔。源表項定義原始檔案中的具體表項名稱,可用萬用字元匹配一組表項。 Specifically, different matching rules are distinguished and sorted by different rule numbers. FIG. 2 shows a schematic diagram of a matching rule of a configuration file according to an embodiment of the present invention. As shown in FIG. 2, the source configuration file defines the file name of the matching source, which may include wildcards to represent a group of files. The source entry defines the name of the specific entry in the original file, and wildcards can be used to match a group of entries.

匹配規則定義了4種常用的規則關係,包括相等規則、包含規則、互斥規則和唯一規則。其中,相等規則表示源表項中的資料內容和目標表項中的資料內容完全相 同;包含規則表示源表項中的資料內容包含目標表項中的資料內容;互斥規則表示源表項中的資料內容和目標表項中的資料內容不能有交集;唯一規則表示源表項中的資料內容之間不能有交集,在根據唯一規則對資料內容進行檢查時,僅對源表項中的資料內容進行檢查,對目標表項中的資料內容不進行檢查,因此可以忽略目的檔案和目標表項。 Matching rules define four commonly used rule relationships, including equality rules, containment rules, mutual exclusion rules, and unique rules. Among them, the equality rule means that the data content in the source entry is completely the same as the data content in the target entry. Same; containment rules indicate that the data content in the source entry includes the data content in the target entry; mutually exclusive rules indicate that the data content in the source entry and the data content in the target entry cannot overlap; the only rule indicates that the source entry There can be no intersection between the data content in the data content. When the data content is checked according to the unique rule, only the data content in the source table item is checked, and the data content in the target table item is not checked, so the destination file can be ignored And the target table entry.

目標設定檔定義匹配目標的檔案名,可包含萬用字元表示一組檔。目標表項定義目的檔案中的具體表項名稱,可用萬用字元匹配一組表項。 The target profile defines the file name that matches the target, and can contain wildcard characters to indicate a set of files. The target entry defines the name of a specific entry in the target file, and wildcards can be used to match a group of entries.

進而,根據匹配規則將可序列化的設定檔的內容轉換為一組集合資料,在讀取設定檔中原始檔案的源表項中的資料內容,和目的檔案的目標表項的資料內容後,利用匹配規則中定義的運算關係計算源表項中的資料內容和目標表項的資料內容是否滿足要求。 Furthermore, the content of the serializable configuration file is converted into a set of collection data according to the matching rules. After reading the data content of the source entry of the original file in the configuration file and the data content of the target entry of the destination file, The calculation relationship defined in the matching rules is used to calculate whether the data content in the source entry and the data content in the target entry meet the requirements.

S705,根據匹配結果產生設定檔的校檢結果。 S705: Generate a check result of the configuration file according to the matching result.

具體地,若源表項的資料內容和目標表項的資料內容滿足預設的匹配規則,則產生設定檔校檢正確的校檢結果。 Specifically, if the data content of the source entry and the data content of the target entry meet the preset matching rules, a verification result that is correct for the configuration file verification is generated.

若源表項的資料內容和目標表項的資料內容不滿足預設的匹配規則,則產生設定檔產生校檢錯誤的校檢結果,同時產生設定檔校檢錯誤的提示資訊回饋給使用者。 If the data content of the source table entry and the data content of the target table entry do not meet the preset matching rules, the configuration file generates a check result of a check error, and a prompt message of the configuration file check error is generated to feedback to the user.

本發明實施例的設定檔校驗方法,為了確保用戶提交的設定檔符合預期,對設定檔進行三項校檢,首先對設定 檔的檔目錄格式進行校檢,其次對單個設定檔的內容進行校檢,最後對多個設定檔相互間內容關聯進行校檢,不僅可以豐富對設定檔進行校檢的校檢方案,而且可以大大提高對設定檔校檢的準確性,減少了用戶提交設定檔時出現提交錯誤的狀況。 In 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 verifications are performed on the configuration file. Check the file directory format of the file, check the content of a single configuration file, and check the content association between multiple configuration files. This not only enriches the check plan for checking the configuration file, but also Greatly improve the accuracy of the configuration file verification, and reduce the submission errors when the user submits the configuration file.

為了實現上述實施例,本發明還提出一種基於序列化格式的設定檔校驗裝置。 In order to implement the above embodiments, the present invention also provides a configuration file verification device based on a serialized format.

圖8是本發明一個實施例的基於序列化格式的設定檔校驗裝置的結構示意圖。 FIG. 8 is a schematic structural diagram of a configuration file verification device based on a serialized format according to an embodiment of the present invention.

如圖8所示,設定檔校驗裝置包括:獲取模組100、匹配模組200和產生模組300。 As shown in FIG. 8, the configuration file verification device includes: an acquisition module 100, a matching module 200 and a generation module 300.

具體地,獲取模組100用於獲取設定檔中源設定檔的源表項的資料內容和目標設定檔的目標表項的資料內容。 Specifically, the acquisition module 100 is used to acquire the data content of the source entry of the source profile and the data content of the target entry of the target profile in the profile.

匹配模組200用於根據預設的匹配規則對所述源表項的資料內容和所述目標表項的資料內容進行匹配。其中,預設的匹配規則包括相等規則、包含規則、互斥規則和唯一規則。 The matching module 200 is configured to match the data content of the source entry with the data content of the target entry according to a preset matching rule. Among them, the preset matching rules include equality rules, containment rules, mutual exclusion rules, and unique rules.

產生模組300用於根據匹配結果產生所述設定檔的校檢結果。其中,產生模組300還用於在源表項的資料內容和目標表項的資料內容不滿足預設的匹配規則時,產生設定檔校檢錯誤的提示資訊。 The generating module 300 is used for generating the verification result of the profile according to the matching result. Wherein, the generating module 300 is also used to generate a prompt message of a configuration file verification error when the data content of the source entry and the data content of the target entry do not meet the preset matching rules.

需要說明的是,前述對設定檔校驗方法的實施例的解釋說明也適用於該實施例的設定檔校驗裝置,其實現原理類似,此處不再贅述。 It should be noted that the foregoing explanation of the embodiment of the configuration file verification method is also applicable to the configuration file verification device of this embodiment, and the implementation principle is similar, and will not be repeated here.

本發明實施例的設定檔校驗裝置,根據預設的匹配規則對設定檔中源設定檔的源表項的資料內容和目標設定檔的目標表項的資料內容進行匹配,從而可以對多個設定檔相互間的內容進行校檢,判斷多個設定檔中的變數之間的相互關係是否符合預期,豐富了對設定檔內部進行校檢的校檢方案,同時減少了用戶提交設定檔時出現提交錯誤的狀況。 The configuration file verification device of the embodiment of the present invention matches the data content of the source entry of the source profile and the data content of the target entry of the target profile in the profile according to a preset matching rule, so that multiple The content of each configuration file is checked to determine whether the relationship between the variables in multiple configuration files is in line with expectations, which enriches the check plan for checking the internal configuration files, and reduces the occurrence of users when submitting configuration files. Submit the wrong status.

圖9是本發明一個具體實施例的基於序列化格式的設定檔校驗裝置的結構示意圖。 FIG. 9 is a schematic structural diagram of a configuration file verification device based on a serialized format according to a specific embodiment of the present invention.

如圖9所示,設定檔校驗裝置包括:獲取模組100、匹配模組200、產生模組300和第一判斷模組400。 As shown in FIG. 9, the configuration file verification device includes: an acquisition module 100, a matching module 200, a generation module 300, and a first judgment module 400.

具體地,第一判斷模組400用於根據預設的結構規則判斷設定檔的檔目錄是否滿足結構規則。 Specifically, the first judging module 400 is used to judge whether the file directory of the profile meets the structure rule according to a preset structure rule.

其中,當預設的結構規則包括類型規則和內容規則時,第一判斷模組400還用於判斷檔目錄的類型是否滿足類型規則,產生模組300還用於在檔目錄的類型不滿足類型規則時,產生設定檔校檢錯誤的提示資訊,第一判斷模組400還用於在檔目錄的類型滿足類型規則時,進一步判斷檔目錄的內容是否滿足內容規則,產生模組300還用於在檔目錄的內容不滿足內容規則時,產生設定檔校檢錯誤的提示資訊。 Wherein, when the preset structure rules include type rules and content rules, the first judging module 400 is also used to judge whether the type of the file directory meets the type rules, and the generation module 300 is also used to determine whether the type of the file directory does not meet the type. When the rule is set, the prompt information of the configuration file verification error is generated. The first judgment module 400 is also used for further judging whether the content of the file directory meets the content rule when the type of the file directory meets the type rule, and the generation module 300 is also used for When the content of the file directory does not meet the content rules, a prompt message of configuration file verification error is generated.

其中,當預設的結構規則還包括約束規則時,第一判斷模組400還用於判斷檔目錄的內容之間是否滿足約束規則,產生模組300還用於在檔目錄的內容之間不滿足約束 規則時,產生設定檔校檢錯誤的提示資訊。 Wherein, when the preset structural rules also include constraint rules, the first judgment module 400 is also used to judge whether the content of the file directory meets the constraint rules, and the generation module 300 is also used to determine whether the content of the file directory meets the constraint rules. Satisfy constraints When setting rules, a prompt message for configuration file verification errors is generated.

需要說明的是,前述對設定檔校驗方法的實施例的解釋說明也適用於該實施例的設定檔校驗裝置,其實現原理類似,此處不再贅述。 It should be noted that the foregoing explanation of the embodiment of the configuration file verification method is also applicable to the configuration file verification device of this embodiment, and the implementation principle is similar, and will not be repeated here.

本發明實施例的設定檔校驗裝置,根據預設的結構規則判斷設定檔的檔目錄是否滿足結構規則,從而可以對多個設定檔的檔目錄結構進行校檢,檢查設定檔的結構是否符合預期,進一步豐富了對單個設定檔內部進行校檢的校檢方案。 The configuration file verification device of the embodiment of the present invention judges whether the file directory of the configuration file meets the structure rules according to the preset structure rules, so that the file directory structure of multiple configuration files can be verified to check whether the structure of the configuration files conforms to the structure rules. It is expected that the verification plan for the verification of a single profile will be further enriched.

圖10是本發明另一個具體實施例的基於序列化格式的設定檔校驗裝置的結構示意圖。 FIG. 10 is a schematic structural diagram of a configuration file verification device based on a serialized format according to another specific embodiment of the present invention.

如圖10所示,設定檔校驗裝置包括:獲取模組100、匹配模組200、產生模組300、第一判斷模組400和第二判斷模組500。 As shown in FIG. 10, the configuration file verification device includes: an acquisition module 100, a matching module 200, a generation module 300, a first judgment module 400, and a second judgment module 500.

具體地,第二判斷模組500用於根據預設的序列化檔範本判斷設定檔的內容是否符合規範。 Specifically, the second judgment module 500 is used for judging whether the content of the configuration file meets the specification according to a preset serialized file template.

產生模組300還用於在設定檔的內容不符合規範時,產生設定檔校檢錯誤的提示資訊。 The generating module 300 is also used to generate a prompt message of a configuration file verification error when the content of the configuration file does not conform to the specification.

需要說明的是,前述對設定檔校驗方法的實施例的解釋說明也適用於該實施例的設定檔校驗裝置,其實現原理類似,此處不再贅述。 It should be noted that the foregoing explanation of the embodiment of the configuration file verification method is also applicable to the configuration file verification device of this embodiment, and the implementation principle is similar, and will not be repeated here.

本發明實施例的設定檔校驗裝置,為了確保使用者提交的設定檔符合預期,對設定檔進行三項校檢,首先對設定檔的檔目錄格式進行校檢,其次對單個設定檔的內容進 行校檢,最後對多個設定檔相互間內容關聯進行校檢,不僅可以豐富對設定檔進行校檢的校檢方案,而且可以大大提高對設定檔校檢的準確性,減少了用戶提交設定檔時出現提交錯誤的狀況。 In the configuration file verification device of the embodiment of the present invention, in order to ensure that the configuration file submitted by the user meets expectations, three verifications are performed on the configuration file. Enter Perform a check, and finally check the content association between multiple configuration files, which not only enriches the check plan for checking the configuration file, but also greatly improves the accuracy of the configuration file check and reduces the number of users submitting settings. There was a submission error while filing.

應當理解,本發明的各部分可以用硬體、軟體、韌體或它們的組合來實現。在上述實施例中,多個步驟或方法可以用儲存在記憶體中且由合適的指令執行系統執行的軟體或韌體來實現。例如,如果用硬體來實現,和在另一實施例中一樣,可用本領域公知的下列技術中的任一項或他們的組合來實現:具有用於對資料信號實現邏輯功能的邏輯閘電路的離散邏輯電路,具有合適的組合邏輯閘電路的專用積體電路,可程式設計柵陣列(PGA),現場可程式設計柵陣列(FPGA)等。 It should be understood that each part of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in memory and executed by a suitable instruction execution system. For example, if it is implemented by hardware, as in another embodiment, it can be implemented by any one or a combination of the following technologies known in the art: having a logic gate circuit for implementing logic functions on data signals Discrete logic circuit, dedicated integrated circuit with suitable combinational logic gate circuit, programmable grid array (PGA), field programmable grid array (FPGA), etc.

在本說明書的描述中,參考術語“一個實施例”、“一些實施例”、“示例”、“具體示例”、或“一些示例”等的描述意指結合該實施例或示例描述的具體特徵、結構、材料或者特點包含於本發明的至少一個實施例或示例中。在本說明書中,對上述術語的示意性表述不必須針對的是相同的實施例或示例。而且,描述的具體特徵、結構、材料或者特點可以在任一個或多個實施例或示例中以合適的方式結合。此外,在不相互矛盾的情況下,本領域的技術人員可以將本說明書中描述的不同實施例或示例以及不同實施例或示例的特徵進行結合和組合。 In the description of this specification, descriptions with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" etc. mean specific features described in conjunction with the embodiment or example , Structures, materials or features are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the described specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples and the features of the different embodiments or examples described in this specification without contradicting each other.

儘管上面已經示出和描述了本發明的實施例,可以理 解的是,上述實施例是示例性的,不能理解為對本發明的限制,本領域的普通技術人員在本發明的範圍內可以對上述實施例進行變化、修改、替換和變型。 Although the embodiments of the present invention have been shown and described above, it can be understood It is understood that the above-mentioned embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions and modifications to the above-mentioned embodiments within the scope of the present invention.

Claims (14)

一種基於序列化格式的設定檔校驗方法,其特徵在於,該設定檔校驗方法包括以下步驟:獲取設定檔中源設定檔的源表項的資料內容和目標設定檔的目標表項的資料內容;根據預設的匹配規則對該源表項的資料內容和該目標表項的資料內容進行匹配;以及根據匹配結果產生該設定檔的校檢結果,其中,若滿足該預設的匹配結果,則判斷多個設定檔中的變數之間的相互關係符合預期,確定該設定檔具備合法性,反之,則判斷多個設定檔中的變數之間的相互關係不符合預期,確定該設定檔的格式不具備合法性。 A configuration file verification method based on a serialized format, characterized in that the configuration file verification method includes the following steps: obtaining data content of the source entry of the source profile and data of the target entry of the target profile in the profile Content; match the data content of the source entry with the data content of the target entry according to a preset matching rule; and generate a verification result of the profile based on the matching result, where, if the preset matching result is satisfied , It is determined that the relationship between the variables in the multiple configuration files is in line with expectations, and the configuration file is determined to be legal, otherwise, it is determined that the relationship between the variables in the multiple configuration files does not meet expectations, and the configuration file is determined The format of is not legal. 如申請專利範圍第1項所述的設定檔校驗方法,其中,該預設的匹配規則包括相等規則、包含規則、互斥規則和唯一規則。 For example, in the configuration file verification method described in item 1 of the scope of patent application, the preset matching rules include an equality rule, an inclusion rule, a mutual exclusion rule, and a unique rule. 如申請專利範圍第1或2項所述的設定檔校驗方法,其中,該根據匹配結果產生該設定檔的校檢結果,包括:若該源表項的資料內容和該目標表項的資料內容不滿足該預設的匹配規則,則產生該設定檔校檢錯誤的提示資訊。 For example, the configuration file verification method described in item 1 or 2 of the scope of patent application, wherein the verification result of the configuration file is generated according to the matching result, including: if the data content of the source entry and the data of the target entry If the content does not meet the preset matching rules, a prompt message for the verification error of the profile will be generated. 如申請專利範圍第1項所述的設定檔校驗方法,其中,在該獲取設定檔中源設定檔的源表項的資料內容和目標設定檔的目標表項的資料內容之前,還包括: 根據預設的結構規則判斷該設定檔的檔目錄是否滿足該結構規則。 For example, the configuration file verification method described in item 1 of the scope of patent application, wherein, before obtaining the data content of the source table entry of the source configuration file and the data content of the target table entry of the target configuration file in the configuration file, the method further includes: Determine whether the file directory of the profile meets the structure rule according to the preset structure rule. 如申請專利範圍第4項所述的設定檔校驗方法,其中,該預設的結構規則包括類型規則和內容規則,該根據預設的結構規則判斷該設定檔的檔目錄是否滿足該結構規則,包括:判斷該檔目錄的類型是否滿足該類型規則;若該檔目錄的類型不滿足該類型規則,則產生該設定檔校檢錯誤的提示資訊;若該檔目錄的類型滿足該類型規則,則進一步判斷該檔目錄的內容是否滿足該內容規則;以及若該檔目錄的內容不滿足該內容規則,則產生該設定檔校檢錯誤的提示資訊。 For example, the configuration file verification method described in item 4 of the scope of patent application, wherein the preset structure rule includes a type rule and a content rule, and it is determined whether the file directory of the profile meets the structure rule according to the preset structure rule , Including: judging whether the type of the file directory meets the type rule; if the type of the file directory does not meet the type rule, a prompt message of the configuration file verification error is generated; if the type of the file directory meets the type rule, It is further judged whether the content of the file directory meets the content rule; and if the content of the file directory does not meet the content rule, a prompt message of the configuration file verification error is generated. 如申請專利範圍第5項所述的設定檔校驗方法,其中,該預設的結構規則還包括約束規則,該根據預設的結構規則判斷該設定檔的檔目錄是否滿足該結構規則,包括:判斷該檔目錄的內容之間是否滿足該約束規則;以及若該檔目錄的內容之間不滿足該約束規則,則產生該設定檔校檢錯誤的提示資訊。 For example, the configuration file verification method described in item 5 of the scope of patent application, wherein the preset structure rule further includes a constraint rule, and the file directory of the configuration file is determined according to the preset structure rule whether the file directory of the configuration file satisfies the structure rule, including : Determine whether the content of the file directory meets the constraint rule; and if the content of the file directory does not meet the constraint rule, a prompt message of the configuration file verification error will be generated. 如申請專利範圍第1項所述的設定檔校驗方法,其中,在該獲取設定檔中源設定檔的源表項的資料內容和目標設定檔的目標表項的資料內容之前,還包括:根據預設的序列化檔範本判斷該設定檔的內容是否符 合規範;以及若該設定檔的內容不符合規範,則產生該設定檔校檢錯誤的提示資訊。 For example, the configuration file verification method described in item 1 of the scope of patent application, wherein, before acquiring the data content of the source entry of the source profile and the data content of the target entry of the target profile in the profile, the method further includes: Determine whether the content of the profile matches the default serialized file template Compliance; and if the content of the profile does not meet the specifications, a prompt message will be generated that the profile is checked incorrectly. 一種基於序列化格式的設定檔校驗裝置,其特徵在於,該設定檔校驗裝置包括:獲取模組,用於獲取設定檔中源設定檔的源表項的資料內容和目標設定檔的目標表項的資料內容;匹配模組,用於根據預設的匹配規則對該源表項的資料內容和該目標表項的資料內容進行匹配;以及產生模組,用於根據匹配結果產生該設定檔的校檢結果,其中,若滿足該預設的匹配結果,則判斷多個設定檔中的變數之間的相互關係符合預期,確定該設定檔的格式具備合法性,反之,則判斷多個設定檔中的變數之間的相互關係不符合預期,確定該設定檔的格式不具備合法性。 A configuration file verification device based on a serialized format, characterized in that the configuration file verification device includes: an acquisition module for acquiring the data content of the source entry of the source profile and the target of the target profile in the profile The data content of the entry; the matching module is used to match the data content of the source entry and the data content of the target entry according to the preset matching rules; and the generation module is used to generate the setting based on the matching result The check result of the file, where, if the preset matching result is satisfied, it is determined that the relationship between the variables in the multiple configuration files is in accordance with the expectation, and the format of the configuration file is determined to be legal, otherwise, multiple The relationship between the variables in the configuration file does not meet expectations, and it is determined that the format of the configuration file is not legal. 如申請專利範圍第8項所述的設定檔校驗裝置,其中,該預設的匹配規則包括相等規則、包含規則、互斥規則和唯一規則。 As described in item 8 of the scope of patent application, the preset matching rule includes an equality rule, an inclusion rule, a mutual exclusion rule, and a unique rule. 如申請專利範圍第8或9項所述的設定檔校驗裝置,其中,該產生模組還用於:在該源表項的資料內容和該目標表項的資料內容不滿足該預設的匹配規則時,產生該設定檔校檢錯誤的提示資訊。 For example, the configuration file verification device described in item 8 or 9 of the scope of patent application, wherein the generation module is also used for: when the data content of the source entry and the data content of the target entry do not meet the preset When the rules are matched, a prompt message for the verification error of the profile is generated. 如申請專利範圍第8項所述的設定檔校驗裝置, 其中,還包括:第一判斷模組,用於根據預設的結構規則判斷該設定檔的檔目錄是否滿足該結構規則。 Such as the configuration file verification device described in item 8 of the scope of patent application, Wherein, it further includes: a first judging module for judging whether the file directory of the profile meets the structure rule according to a preset structure rule. 如申請專利範圍第11項所述的設定檔校驗裝置,其中,該預設的結構規則包括類型規則和內容規則,該第一判斷模組還用於:判斷該檔目錄的類型是否滿足該類型規則;該產生模組還用於在該檔目錄的類型不滿足該類型規則時,產生該設定檔校檢錯誤的提示資訊;該第一判斷模組還用於在該檔目錄的類型滿足該類型規則時,進一步判斷該檔目錄的內容是否滿足該內容規則;以及該產生模組還用於在該檔目錄的內容不滿足該內容規則時,產生該設定檔校檢錯誤的提示資訊。 For example, the configuration file verification device described in item 11 of the scope of patent application, wherein the preset structure rule includes a type rule and a content rule, and the first judgment module is also used for judging whether the type of the file directory satisfies the Type rule; the generation module is also used to generate the prompt information of the configuration file verification error when the type of the file directory does not meet the type rule; the first judgment module is also used to indicate that the type of the file directory meets the In the case of this type of rule, it is further determined whether the content of the file directory meets the content rule; and the generation module is also used to generate the prompt information of the configuration file verification error when the content of the file directory does not meet the content rule. 如申請專利範圍第12項所述的設定檔校驗裝置,其中,該預設的結構規則還包括約束規則,該第一判斷模組還用於:判斷該檔目錄的內容之間是否滿足該約束規則;以及該產生模組還用於在該檔目錄的內容之間不滿足該約束規則時,產生該設定檔校檢錯誤的提示資訊。 For example, the configuration file verification device described in item 12 of the scope of patent application, wherein the preset structural rules also include constraint rules, and the first judgment module is also used for judging whether the content of the file directory satisfies the Constraint rules; and the generation module is also used to generate the configuration file verification error prompt information when the content of the file directory does not meet the constraint rules. 如申請專利範圍第8項所述的設定檔校驗裝置,其中,還包括:第二判斷模組,用於根據預設的序列化檔範本判斷該設定檔的內容是否符合規範; 該產生模組還用於在該設定檔的內容不符合規範時,產生該設定檔校檢錯誤的提示資訊。 For example, the configuration file verification device described in item 8 of the scope of patent application further includes: a second judgment module for judging whether the content of the configuration file meets the specification according to the preset serialized file template; The generating module is also used to generate the prompt information of the configuration file verification error when the content of the configuration file does not meet the specifications.
TW106104937A 2016-03-21 2017-02-15 Setting file verification method and device based on serialization format TWI738719B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610160734.5A CN107220072A (en) 2016-03-21 2016-03-21 Configuration file method of calibration and device based on serialization format
CN201610160734.5 2016-03-21

Publications (2)

Publication Number Publication Date
TW201737082A TW201737082A (en) 2017-10-16
TWI738719B true TWI738719B (en) 2021-09-11

Family

ID=59899210

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106104937A TWI738719B (en) 2016-03-21 2017-02-15 Setting file verification method and device based on serialization format

Country Status (3)

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

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020034155A1 (en) * 2018-08-16 2020-02-20 朱小军 Biochemical data protein acting on biomimetic data cell body
CN109815136B (en) * 2019-01-02 2022-03-29 腾讯科技(武汉)有限公司 Data processing method and device for service operation
CN110673888B (en) * 2019-08-27 2023-04-07 贝壳技术有限公司 Verification method and device for configuration file
CN110806823A (en) * 2019-10-30 2020-02-18 中电科仪器仪表有限公司 Method and system for dynamically configuring menu of test instrument
CN111045992B (en) * 2019-12-04 2023-07-25 中盈优创资讯科技有限公司 Configuration file checking method and system based on tree structure
CN111144334B (en) * 2019-12-27 2023-09-26 北京天融信网络安全技术有限公司 File matching method and device, electronic equipment and storage medium
CN111459817B (en) * 2020-03-31 2024-02-02 中国银行股份有限公司 Method and device for checking program execution code
CN111708580B (en) * 2020-05-09 2022-08-23 厦门极致互动网络技术股份有限公司 Processing method and system for static data of configuration software
CN111797095B (en) * 2020-06-10 2024-05-03 阿里巴巴集团控股有限公司 Index construction method and JSON data query method
CN111767350A (en) * 2020-06-30 2020-10-13 平安国际智慧城市科技股份有限公司 Data warehouse testing method and device, terminal equipment and storage medium
CN112035158A (en) * 2020-08-25 2020-12-04 深圳市钱海网络技术有限公司 Method and device for carrying out risk detection on patch package
CN112527270A (en) * 2020-12-18 2021-03-19 政采云有限公司 API result output method, device, equipment and medium
CN113342562A (en) * 2021-06-22 2021-09-03 平安普惠企业管理有限公司 System configuration checking method, device, equipment and storage medium
CN114697368B (en) * 2022-02-25 2023-12-19 青岛海尔科技有限公司 Method and device for determining equipment control file, storage medium and electronic device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102968349A (en) * 2012-09-06 2013-03-13 北京吉威时代软件技术有限公司 Method and system for file completeness verification of remote sensing image data
CN103218398A (en) * 2013-03-13 2013-07-24 江苏省电力公司电力科学研究院 Intelligent substation SCL (substation configuration description language) file difference comparison method
CN103957080A (en) * 2014-04-30 2014-07-30 浙江中控技术股份有限公司 Data integrity checking method and system
CN104391934A (en) * 2014-11-21 2015-03-04 深圳市银雁金融配套服务有限公司 Data calibration method and device

Family Cites Families (7)

* 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
US8200969B2 (en) * 2008-01-31 2012-06-12 Hewlett-Packard Development Company, L.P. Data verification by challenge
CN101788950A (en) * 2010-01-27 2010-07-28 浪潮(山东)电子信息有限公司 Data item calibration method based on JSP page
CN102346692A (en) * 2010-08-03 2012-02-08 深圳Tcl新技术有限公司 Verification method of IPTV (Internet Protocol Television) updating files
CN101963912A (en) * 2010-10-12 2011-02-02 浪潮电子信息产业股份有限公司 Implementation method for storing and checking hardware configuration information of system
CN102880550B (en) * 2011-07-12 2014-12-17 北京东方通科技股份有限公司 Memory formatting method based on constraint verification
CN105335342A (en) * 2015-12-01 2016-02-17 国家电网公司 Method for automatic examination of wiring correctness of intelligent substation SCD configuration file virtual terminator

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102968349A (en) * 2012-09-06 2013-03-13 北京吉威时代软件技术有限公司 Method and system for file completeness verification of remote sensing image data
CN103218398A (en) * 2013-03-13 2013-07-24 江苏省电力公司电力科学研究院 Intelligent substation SCL (substation configuration description language) file difference comparison method
CN103957080A (en) * 2014-04-30 2014-07-30 浙江中控技术股份有限公司 Data integrity checking method and system
CN104391934A (en) * 2014-11-21 2015-03-04 深圳市银雁金融配套服务有限公司 Data calibration method and device

Also Published As

Publication number Publication date
TW201737082A (en) 2017-10-16
CN107220072A (en) 2017-09-29
WO2017162029A1 (en) 2017-09-28

Similar Documents

Publication Publication Date Title
TWI738719B (en) Setting file verification method and device based on serialization format
US10318412B1 (en) Systems, methods, and apparatus for dynamic software generation and testing
US20180198629A1 (en) Verified boot and key rotation
WO2020253106A1 (en) Method and apparatus for proving size relationship of encrypted data, device, and storage medium
US20190197130A1 (en) Ensuring consistency in distributed incremental content publishing
WO2021212661A1 (en) Method and apparatus for constructing running system, and electronic device and storage medium
JP2017509971A (en) Specify and apply logical validation rules to data
Nuijten et al. “statcheck”: Automatically detect statistical reporting inconsistencies to increase reproducibility of meta‐analyses
CN106649457A (en) Data processing frame based on object relation mapping technology
JP6430515B2 (en) Automatic generation of certification documents
CN113888164A (en) Block chain transaction pool implementation method and device, computer equipment and storage medium
CN106033427A (en) A sampling data verification method and device
US20240097919A1 (en) Consensus trusted cluster changing method, computer device and computer-readable storage medium
CN107247614A (en) The method that application message is checked in software translating
Rundgren et al. Json canonicalization scheme (jcs)
US20070100854A1 (en) Method of providing a validatable data structure
CN108170466B (en) A kind of C/C++ bugs self-repairing method based on program synthesis
US20150032489A1 (en) Methods for facilitating the preparation of construction bid documents and devices thereof
CN109753639A (en) Front and back unifies method of calibration, device, storage medium and electronic equipment
TW201250507A (en) System and method for validating design of electronic products
KR102617906B1 (en) Test automation framework system for medical software and method of test automation
US8595263B2 (en) Processing identity constraints in a data store
CN109522595A (en) A kind of functional diagram importing automatic diagnosis method based on nuclear power plant's verification platform
JP2012008660A (en) Software development support device, software development support method and software development support program
EP3617924A1 (en) Authenticated component permissions framework