Configuration file detection method, system and equipment and storage medium
By checking the configuration files during the software testing phase, and using the inspection rules and parsed information stored in the database for detection, the problem that traditional inspection methods cannot detect configuration problems in advance is solved, and the effect of improving production safety and stability is achieved.
Patent Information
- Application Number
- CN202411856581.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-11
AI Technical Summary
The traditional configuration file inspection method cannot be carried out during the software testing stage, which leads to configuration problems being discovered in the production environment, affecting the safety and stability of production.
By obtaining the inspection rules stored in the database and the parsing information of the configuration files to be checked, the parsing information is detected, whether it is compliant, and when it is not compliant, it generates prompt information and displays non-compliant parsing information.
It realizes the checking of configuration files during the software testing phase, and the configuration problems are discovered and corrected in advance, so as to ensure that problems are fixed before going online, avoid problems being brought to production, and improve production safety and stability.
Smart Images

Figure CN119807042A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer application technology, and more specifically, to a configuration file detection method, system, device and storage medium. Background Art
[0002] During the software testing process, it is necessary to check the configuration files for service startup to improve the security and stability of the service in production. The traditional inspection method is to solve the problem after the problem is found. It is impossible to check the configuration files during the software testing stage to find configuration problems in advance and correct them in time. Summary of the invention
[0003] In order to solve the problems existing in the above-mentioned prior art or at least part of the problems, the embodiments of the present invention provide a configuration file detection method, system, storage medium, device and computer program product, which performs parsing information detection according to the inspection rules stored in the database and the parsing information corresponding to the configuration file to be checked, and can realize configuration file inspection in the software testing stage, so as to discover problems in the configuration before production and correct them in time, thereby ensuring the safety and stability of production.
[0004] According to a first aspect of the present invention, an embodiment of the present invention provides a method for detecting a configuration file, which includes: obtaining inspection rules of the configuration file and storing the inspection rules in a database, the inspection rules including key inspection rules and value inspection rules; obtaining the configuration file, parsing the configuration file to generate parsing information, and storing the parsing information in the database, the parsing information including: key prefix, key key, value value; obtaining the inspection rules in the database and the parsing information corresponding to the configuration file to be checked; detecting the parsing information according to the inspection rules to determine whether the parsing information is compliant; generating a prompt message when the parsing information is not compliant, and displaying the non-compliant parsing information.
[0005] According to the above-mentioned embodiment of the present invention, by obtaining the inspection rules, parsing the configuration file to generate parsing information, and checking the parsing information according to the inspection rules stored in the database and the parsing information corresponding to the configuration file to be checked, to determine whether the parsing information is compliant, the configuration file can be checked in the software testing stage, and problems in the configuration can be discovered in advance and corrected in time. Therefore, it can be ensured that the problem has been fixed before going online to avoid the problem from being brought to production, thereby improving the safety and stability of production.
[0006] In some embodiments of the present invention, the checking rules include at least one of the following: key exists, key does not exist, key value contains keyword, key value does not contain keyword, dependent checking rules, value exists, value does not exist, value value contains keyword, value value does not contain keyword, value value is equal to keyword.
[0007] In some embodiments of the present invention, the configuration file includes a yaml file; obtaining the configuration file, parsing the configuration file to generate parsing information includes: reading the yaml file, parsing the content of the yaml file and converting it into dictionary type data; traversing the dictionary type data to generate the parsing information.
[0008] In some embodiments of the present invention, when the inspection rule is a dependent inspection rule, obtaining the inspection rule in the database and the parsing information corresponding to the configuration file to be inspected, and detecting the parsing information according to the inspection rule includes: obtaining the first parsing information to be detected in the database; obtaining the second parsing information that the first parsing information depends on according to the key prefix in the first parsing information and the dependent inspection rule; obtaining the second inspection rule corresponding to the second parsing information; and detecting the first parsing information and the second parsing information according to the dependent inspection rule and the second inspection rule.
[0009] According to the above-mentioned embodiment of the present invention, the second resolution information on which the first resolution information depends is obtained according to the dependency check rule and the key prefix in the first resolution information to be checked, so that the accuracy of the dependency check can be ensured.
[0010] According to the second aspect of the present invention, an embodiment of the present invention provides a configuration file detection system, which includes: a rule acquisition module, used to obtain the inspection rules of the configuration file and store the inspection rules in a database, the inspection rules include key inspection rules and value inspection rules; a file acquisition and parsing module, used to obtain the configuration file, parse the configuration file to generate parsing information, and store the parsing information in the database, the parsing information includes: key prefix, key, value; a file detection module, used to obtain the inspection rules in the database and the parsing information corresponding to the configuration file to be checked, detect the parsing information according to the inspection rules, and determine whether the parsing information is compliant; a detection result display module, used to generate a prompt message when the parsing information is not compliant, and display the non-compliant parsing information.
[0011] According to the above-mentioned embodiment of the present invention, by obtaining the inspection rules, parsing the configuration file to generate parsing information, and checking the parsing information according to the inspection rules stored in the database and the parsing information corresponding to the configuration file to be checked, to determine whether the parsing information is compliant, the configuration file can be checked in the software testing stage, and problems in the configuration can be discovered in advance and corrected in time. Therefore, it can be ensured that the problem has been fixed before going online to avoid the problem from being brought to production, thereby improving the safety and stability of production.
[0012] In some embodiments of the present invention, the checking rules include at least one of the following: key exists, key does not exist, key value contains keyword, key value does not contain keyword, dependent checking rules, value exists, value does not exist, value value contains keyword, value value does not contain keyword, value value is equal to keyword.
[0013] In some embodiments of the present invention, the configuration file includes a yaml file; obtaining the configuration file, parsing the configuration file to generate parsing information includes: reading the yaml file, parsing the content of the yaml file and converting it into dictionary type data; traversing the dictionary type data to generate the parsing information.
[0014] In some embodiments of the present invention, when the inspection rule is a dependent inspection rule, obtaining the inspection rule in the database and the parsing information corresponding to the configuration file to be inspected, and detecting the parsing information according to the inspection rule includes: obtaining the first parsing information to be detected in the database; obtaining the second parsing information that the first parsing information depends on according to the key prefix in the first parsing information and the dependent inspection rule; obtaining the second inspection rule corresponding to the second parsing information; and detecting the first parsing information and the second parsing information according to the dependent inspection rule and the second inspection rule.
[0015] According to the above-mentioned embodiment of the present invention, the second resolution information on which the first resolution information depends is obtained according to the dependency check rule and the key prefix in the first resolution information to be checked, so that the accuracy of the dependency check can be ensured.
[0016] According to the third aspect of the present invention, an embodiment of the present invention provides a computer-readable storage medium having computer-readable instructions stored thereon. When the computer-readable instructions are executed by a processor, the computer performs the following operations: the operations include the steps included in the method for detecting a configuration file as described in any one of the above embodiments.
[0017] According to a fourth aspect of the present invention, an embodiment of the present invention provides a computer device comprising a memory and a processor, wherein the memory is used to store one or more computer-readable instructions, wherein the one or more computer-readable instructions, when executed by the processor, can implement the configuration file detection method described in any one of the above embodiments.
[0018] According to a fifth aspect of the present invention, an embodiment of the present invention provides a computer program product including a computer program, and when the computer program is executed by a processor, the method for detecting a configuration file as described in any one of the above embodiments is implemented.
[0019] From the above, it can be seen that the configuration file detection method, system, storage medium, device and computer program product provided in the embodiments of the present invention obtain inspection rules, parse the configuration file to generate parsing information, and detect the parsing information according to the inspection rules stored in the database and the parsing information corresponding to the configuration file to be checked to determine whether the parsing information is compliant. It can perform configuration file inspection in the software testing stage, discover problems in the configuration in advance and correct them in time. Therefore, it can ensure that the problem has been fixed before going online to avoid the problem from being brought to production, thereby improving the safety and stability of production. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a schematic flow chart of a configuration file detection method according to Embodiment 1 of the present invention;
[0021] Figure 2 is a schematic flow chart of a configuration file detection method according to Embodiment 2 of the present invention;
[0022] Figure 3 2 is a schematic diagram of the architecture of a configuration file detection system according to Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0023] The various aspects of the present invention are described in detail below in conjunction with the accompanying drawings and specific embodiments. Among them, well-known modules, units and their connections, links, communications or operations are not shown or described in detail. In addition, the described features, architectures or functions can be combined in any way in one or more embodiments. It should be understood by those skilled in the art that the various embodiments described below are only used for illustration and are not intended to limit the scope of protection of the present invention. It can also be easily understood that the modules or units or processing methods in each embodiment described herein and shown in the accompanying drawings can be combined and designed in various different configurations.
[0024] [Example 1]
[0025] Figure 14 is a flow chart of a configuration file detection method according to Embodiment 1 of the present invention.
[0026] like Figure 1 As shown, in Embodiment 1 of the present invention, the configuration file detection method may include: step S11, step S12, step S13, step S14 and step S15, and the above steps are described in detail below.
[0027] In step S11, the check rules of the configuration file are obtained and stored in a database, wherein the check rules include key check rules and value check rules.
[0028] In some implementations, the check rule includes but is not limited to at least one of the following: key exists, key does not exist, key value contains keyword, key value does not contain keyword, dependent check rule, value exists, value does not exist, value value contains keyword, value value does not contain keyword, value value equals keyword. The dependent check rule is: when performing a key or value check, other key or value values are required to meet the conditions.
[0029] In this embodiment, by setting the inspection rules between key and value and saving them in the database, it is convenient to query and obtain the corresponding detection rules during subsequent inspections. Among them, the inspection rules between key and value include but are not limited to: contain, not contain, equal, not exist, exist, as well as the dependency relationship between rules and the validity of rules.
[0030] In step S12, the configuration file is obtained, the configuration file is parsed to generate parsing information, and the parsing information is stored in the database, wherein the parsing information includes: a key prefix prefix_key, a key key, and a value value. By parsing the obtained configuration file content and saving the corresponding parsing information in the database, subsequent queries can be facilitated.
[0031] In some implementations, the configuration file includes a YAML format file and a properties format file. Wherein, when the configuration file is a YAML file, obtaining the configuration file and parsing the configuration file to generate parsing information includes: reading the YAML file, parsing the content of the YAML file and converting it into dictionary type data; and traversing the dictionary type data to generate the parsing information.
[0032] In this embodiment, parsing the properties configuration file includes: reading the configuration items by line (key=value), and splitting the configuration items to obtain the configuration information. The part before the last "." in the key is the key prefix prefix_key. For example, for the data "spring.datasource.username=hcfc" in the properties configuration file, the parsed information containing prefix_key, key, and value is: spring.datasource, spring.datasource.username, hcfc, and prefix_key, key, value, and file name are saved in the database.
[0033] Parsing the yaml configuration file includes: first, after reading the content of the yaml configuration file, converting the file content into dictionary type data, the dictionary structure data includes dictionary key and dictionary value; second, recursively traversing the dictionary type data, recording each layer of dictionary key during traversal, if the dictionary value is a list object, traversing the list object, if the dictionary value is a dictionary, recursively traversing the dictionary, if the dictionary value is neither a list object nor a dictionary, the parent node of the dictionary, the dictionary, and the value are saved in the database as prefix_key, key, and value respectively.
[0034] In step S13, the checking rules in the database and the parsing information corresponding to the configuration file to be checked are obtained. In this embodiment, the checking rules in the database and the corresponding parsing information are dynamically read.
[0035] In step S14, the parsed information is checked according to the checking rule to determine whether the parsed information is compliant.
[0036] In some embodiments, when the inspection rule is a dependent inspection rule, obtaining the inspection rule in the database and the parsing information corresponding to the configuration file to be inspected, and detecting the parsing information according to the inspection rule includes: obtaining the first parsing information to be detected in the database; obtaining the second parsing information that the first parsing information depends on according to the key prefix in the first parsing information and the dependent inspection rule; obtaining the second inspection rule corresponding to the second parsing information; and detecting the first parsing information and the second parsing information according to the dependent inspection rule and the second inspection rule.
[0037] In a further embodiment, when the second parsed information fails the check according to the second check rule, the first parsed information is no longer tested, and the test result is directly determined to be failed / non-compliant.
[0038] Among them, when a check rule depends on another check rule, the two rules are in the same parent node. For example, key1 is spring.datasource.test.drive and key2 is spring.datasource.test.url, then the parent nodes of key1 and key2 are the same. When it is necessary to determine whether the value of spring.datasource.test.drive (key1) matches the value of spring.datasource.test.url (key2), since there may be multiple databases in a configuration file (such as spring.datasource.test or spring.datasource.auto), the execution of the dependency check rule needs to be checked in the parent node spring.datasource.test determined by the key prefix, so as to ensure the accuracy of the dependency check and avoid checking the dependent rules incorrectly.
[0039] In step S15, when the parsed information is not compliant, a prompt message is generated, and the non-compliant parsed information is displayed.
[0040] In a further implementation manner, non-compliant parsing information is deleted or modified to improve the security and stability of the service in production.
[0041] The above-mentioned configuration file detection method of Example 1 of the present invention is adopted, by obtaining the inspection rules, parsing the configuration file to generate parsing information, and checking the parsing information according to the inspection rules stored in the database and the parsing information corresponding to the configuration file to be checked, so as to determine whether the parsing information is compliant. The configuration file can be checked in the software testing stage, and problems in the configuration can be discovered in advance and corrected in time. Therefore, it can be ensured that the problem has been fixed before going online to avoid the problem from being brought to production, thereby improving the safety and stability of production, and helping testers to reduce configuration file testing.
[0042] [Example 2]
[0043] Figure 2 4 is a flow chart of a configuration file detection method according to Embodiment 2 of the present invention.
[0044] like Figure 2 As shown, in Embodiment 2 of the present invention, the configuration file detection method may include the following steps:
[0045] (1) Setting the check rules of the configuration file through the web page and storing the check rules in the database. The check rules include but are not limited to at least one of the following: key exists, key does not exist, key value contains the keyword, key value does not contain the keyword, dependent check rules, value exists, value does not exist, value value contains the keyword, value value does not contain the keyword, value value is equal to the keyword.
[0046] (2) Reading a configuration file to be checked, parsing the configuration file to generate parsing information, and storing the parsing information in the database.
[0047] (3) When checking the configuration file, the parsing information (configuration items) and the check rules stored in the database are read out in real time, the check rules are traversed, and the configuration items are compared with the setting rules to check whether the configuration items comply with the rules. For example, if the rule checks the key, then check whether the key exists in the configuration item and whether the key value matches the check rule. The configuration items that do not comply with the rule are saved in the database. If the check rule has dependent rules, the dependent rules are matched first. If the match fails, the rule is no longer checked and the next rule is checked.
[0048] Exemplarily, the test configuration file is in properties format or yaml format, and the file content is parsed in the form of key=value, for example: prefix.key1=value2, prefix.key2=value2, and check whether the value is set correctly according to the keyword key, or when the key1 value is value1, whether the key2 value is set correctly.
[0049] (4) When the check is completed, the database is checked to see whether there are any configuration items that do not comply with the rules. If so, a prompt is given that the configuration file check has failed, and information about the non-compliant configuration items is displayed on a web page.
[0050] By adopting the above-mentioned configuration file detection method of Example 2 of the present invention, it is possible to perform configuration file inspection in the software testing stage, discover problems in the configuration in advance and correct them in time. Therefore, it is possible to ensure that the problems have been fixed before going online, avoid problems from being brought to production, thereby improving the safety and stability of production, and helping testers reduce configuration file testing.
[0051] [Example 3]
[0052] Figure 3 2 is a schematic diagram of the architecture of a configuration file detection system according to Embodiment 3 of the present invention.
[0053] like Figure 3As shown, the configuration file detection system includes: a rule acquisition module 310, a file acquisition and parsing module 320, a file detection module 330, and a detection result display module 340.
[0054] The rule acquisition module 310 is used to acquire the inspection rules of the configuration file and store the inspection rules in a database, wherein the inspection rules include key inspection rules and value inspection rules.
[0055] In some implementations, the check rule includes but is not limited to at least one of the following: key exists, key does not exist, key value contains keyword, key value does not contain keyword, dependent check rule, value exists, value does not exist, value value contains keyword, value value does not contain keyword, value value equals keyword. The dependent check rule is: when performing a key or value check, other key or value values are required to meet the conditions.
[0056] The file acquisition and parsing module 320 is used to acquire the configuration file, parse the configuration file to generate parsing information, and store the parsing information in the database. The parsing information includes: key prefix, key, and value.
[0057] In some implementations, the configuration file includes a YAML format file and a properties format file. Wherein, when the configuration file is a YAML file, obtaining the configuration file and parsing the configuration file to generate parsing information includes: reading the YAML file, parsing the content of the YAML file and converting it into dictionary type data; and traversing the dictionary type data to generate the parsing information.
[0058] The file detection module 330 is used to obtain the inspection rules in the database and the parsing information corresponding to the configuration file to be checked, detect the parsing information according to the inspection rules, and determine whether the parsing information is compliant.
[0059] In some embodiments, when the inspection rule is a dependent inspection rule, obtaining the inspection rule in the database and the parsing information corresponding to the configuration file to be inspected, and detecting the parsing information according to the inspection rule includes: obtaining the first parsing information to be detected in the database; obtaining the second parsing information that the first parsing information depends on according to the key prefix in the first parsing information and the dependent inspection rule; obtaining the second inspection rule corresponding to the second parsing information; and detecting the first parsing information and the second parsing information according to the dependent inspection rule and the second inspection rule.
[0060] In a further embodiment, when the second parsed information fails the check according to the second check rule, the first parsed information is no longer tested, and the test result is directly determined to be failed / non-compliant.
[0061] The detection result display module 340 is used to generate prompt information when the parsing information is not compliant, and to display the non-compliant parsing information.
[0062] In a further implementation manner, non-compliant parsing information is deleted or modified to improve the security and stability of the service in production.
[0063] The detection system of the above-mentioned configuration file of Example 3 of the present invention obtains the inspection rules, parses the configuration file to generate parsing information, and detects the parsing information according to the inspection rules stored in the database and the parsing information corresponding to the configuration file to be checked to determine whether the parsing information is compliant. The configuration file can be checked in the software testing stage, and problems in the configuration can be discovered in advance and corrected in time. Therefore, it can be ensured that the problem has been fixed before going online to avoid the problem being brought to production, thereby improving the safety and stability of production, and helping testers reduce configuration file testing.
[0064] Through the description of the above implementation modes, those skilled in the art can clearly understand that the present invention can be implemented by combining software with a hardware platform. Based on such an understanding, all or part of the contribution of the technical solution of the present invention to the background technology can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various implementation modes of the present invention or some parts of the implementation modes.
[0065] Correspondingly, an embodiment of the present invention further provides a computer-readable storage medium on which computer-readable instructions or programs are stored. When the computer-readable instructions or programs are executed by a processor, the computer performs the following operations: the operations include the steps included in the configuration file detection method described in any of the above embodiments, which are not repeated here. The storage medium may include, for example, a CD, a hard disk, a floppy disk, a flash memory, a magnetic tape, etc.
[0066] In addition, an embodiment of the present invention further provides a computer device including a memory and a processor, wherein the memory is used to store one or more computer-readable instructions or programs, wherein the one or more computer-readable instructions or programs can implement the configuration file detection method described in any of the above embodiments when executed by the processor. The computer device can be, for example, a server, a desktop computer, a notebook computer, a tablet computer, etc.
[0067] The present invention also provides a computer program product including a computer program, wherein the computer program includes program code for executing the configuration file detection method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the configuration file detection method provided by the embodiment of the present disclosure.
[0068] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0069] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention is described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention. Therefore, the protection scope of the present invention shall be subject to the claims.
Claims
1. A configuration file detection method, characterized in that: The detection method comprises: Obtaining the inspection rules of the configuration file and storing the inspection rules in a database, wherein the inspection rules include key inspection rules and value inspection rules; Obtain the configuration file, parse the configuration file to generate parsing information, and store the parsing information in the database, wherein the parsing information includes: a key prefix, a key key, and a value value; Obtaining parsing information corresponding to the inspection rules and the configuration file to be inspected in the database; Detecting the parsed information according to the inspection rules to determine whether the parsed information is compliant; When the parsed information is not compliant, a prompt message is generated, and the non-compliant parsed information is displayed.
2. The detection method according to claim 1, characterized in that The checking rules include at least one of the following: key exists, key does not exist, key value contains keyword, key value does not contain keyword, dependent checking rules, value exists, value does not exist, value value contains keyword, value value does not contain keyword, value value is equal to keyword.
3. The detection method according to claim 1, characterized in that The configuration file includes a yaml file. Obtaining the configuration file, parsing the configuration file to generate parsing information includes: Read the yaml file, parse the content of the yaml file and convert it into dictionary type data; The dictionary type data is traversed to generate the parsing information.
4. The detection method according to claim 2, characterized in that When the check rule is a dependent check rule, Obtaining the parsing information corresponding to the inspection rule and the configuration file to be inspected in the database, and detecting the parsing information according to the inspection rule includes: Acquire first parsed information to be detected from the database; Acquire second parsing information that the first parsing information depends on according to the key prefix in the first parsing information and the dependency checking rule; Obtaining a second checking rule corresponding to the second parsing information; The first parsing information and the second parsing information are checked according to the dependency checking rule and the second checking rule.
5. A configuration file detection system, characterized in that: The detection system comprises: A rule acquisition module, used to acquire the inspection rules of the configuration file and store the inspection rules in a database, wherein the inspection rules include key inspection rules and value inspection rules; A file acquisition and parsing module, used for acquiring the configuration file, parsing the configuration file to generate parsing information, and storing the parsing information in the database, wherein the parsing information includes: a key prefix, a key, and a value; A file detection module, used to obtain the inspection rules in the database and the parsing information corresponding to the configuration file to be checked, and detect the parsing information according to the inspection rules to determine whether the parsing information is compliant; The detection result display module is used to generate prompt information when the parsing information is not compliant and display the non-compliant parsing information.
6. The detection system according to claim 5, characterized in that: The configuration file includes a yaml file. Obtaining the configuration file, parsing the configuration file to generate parsing information includes: Read the yaml file, parse the content of the yaml file and convert it into dictionary type data; The dictionary type data is traversed to generate the parsing information.
7. The detection system according to claim 5, characterized in that: When the check rule is a dependent check rule, Obtaining the parsing information corresponding to the inspection rule and the configuration file to be inspected in the database, and detecting the parsing information according to the inspection rule includes: Acquire first parsed information to be detected from the database; Acquire second parsing information that the first parsing information depends on according to the key prefix in the first parsing information and the dependency checking rule; Obtaining a second checking rule corresponding to the second parsing information; The first parsing information and the second parsing information are checked according to the dependency checking rule and the second checking rule.
8. A computer-readable storage medium storing computer-readable instructions, characterized in that: The computer readable instructions are executed by a processor to implement the detection method according to any one of claims 1 to 4.
9. A computer device comprising a memory and a processor, The memory stores computer-readable instructions, characterized in that: The processor executes the computer-readable instructions to implement the detection method according to any one of claims 1 to 4.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the detection method according to any one of claims 1 to 4 is implemented.