Static identification method and device for application configuration file and computer equipment

By acquiring the data source file in a non-run state, determining the target identity and associated feature identity, combining static scanning and multi-identification feature scanning, the problem of low accuracy in application configuration file recognition is solved, and static analysis with high accuracy is achieved.

CN120540694APending Publication Date: 2025-08-26GUANGZHOU PINWEI SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510699845.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-28
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

In the prior art, the accuracy of application configuration file recognition is low, especially in microservice architecture and containerization technology, and it is difficult to accurately identify application configuration files.

Method used

By acquiring the data source file, determining the target identifier and associated feature identifier when the target application is in a non-run state, traversing the structured data file, matching the target application configuration file based on the data identifier, using static scan and multi-identification feature scan, and combining verification conditions to ensure the accuracy of identification.

Benefits of technology

It improves the accuracy of identification of application configuration files, avoids noise data interference in dynamic analysis, and can fully cover and capture hidden identification configuration files, achieving high accuracy of static analysis of code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120540694A_ABST
    Figure CN120540694A_ABST
Patent Text Reader

Abstract

The invention relates to a static recognition method and device for an application configuration file and computer equipment, and the method comprises the steps: obtaining a to-be-analyzed data source file corresponding to a target application under the condition that the to-be-recognized target application is in a non-running state; determining a target identifier corresponding to a to-be-identified target application configuration file, and extracting an associated feature identifier corresponding to the target identifier; traversing a structured data file contained in the data source file, and determining a data identifier carried by the structured data file; and if the data identifier accords with the target identifier or the associated feature identifier, determining a target application configuration file corresponding to the identification result based on a structured data file corresponding to the data identifier. By adopting the scheme, the identification accuracy of the application configuration file can be greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data file identification, and in particular to a static identification method, apparatus, and computer equipment for application configuration files. Background Art

[0002] With the widespread adoption of microservice architectures and containerization technologies, the number of application instances is growing at a rapid pace. Faced with the high density of application instances deployed within a cluster, implementing application configuration files or code analysis, as well as visualizing code analysis, is a necessary requirement for cluster management applications.

[0003] Code analysis generally refers to analyzing code semantics and behavior, thereby identifying abnormal program semantics or undefined behavior caused by incorrect coding. Before implementing code analysis, it is necessary to identify the code configuration file.

[0004] However, during the implementation of application profile identification, the applicant discovered that there was at least a problem of low accuracy in identifying application profiles. Summary of the Invention

[0005] Based on this, the purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defect of low accuracy in application profile recognition in the prior art. This application provides a static recognition method, device and computer equipment for application profiles.

[0006] In a first aspect, the present application provides a method for statically identifying an application configuration file, the method comprising:

[0007] When the target application to be identified and processed is in a non-running state, obtaining a data source file to be parsed corresponding to the target application;

[0008] Determine the target identifier corresponding to the target application configuration file to be identified, and extract the associated feature identifier corresponding to the target identifier;

[0009] Traversing the structured data files contained in the data source file and determining the data identifiers carried by the structured data files;

[0010] If the data identifier matches the target identifier or the associated feature identifier, the target application configuration file corresponding to the recognition result is determined based on the structured data file corresponding to the data identifier.

[0011] In one embodiment, extracting the associated feature identifier corresponding to the target identifier includes:

[0012] Obtain the name identification information corresponding to the target application configuration file to be obtained from the data source file;

[0013] Determine the file type identifier of the name identification information;

[0014] A preset number of segments of text data preceding and adjacent to the file type identifier are extracted to obtain an associated feature identifier.

[0015] In one embodiment, determining a target application configuration file corresponding to the recognition result based on the structured data file corresponding to the data identifier includes:

[0016] Determine the structured data file corresponding to the data identifier as a candidate application configuration file;

[0017] Get the verification conditions for the target application profile;

[0018] If the candidate application profile meets the verification conditions, the candidate application profile is used as the target application profile;

[0019] If the candidate application profile does not meet the verification conditions, the candidate application profile is eliminated.

[0020] In one embodiment, obtaining verification conditions for a target application configuration file includes:

[0021] Determine the historical backup file identifier corresponding to the structured data file;

[0022] If the data identifier does not match the historical backup file identifier, the verification result is determined as the candidate application configuration file meeting the verification condition;

[0023] If the data identifier matches the historical backup file identifier, the verification result is determined to be that the candidate application configuration file does not meet the verification condition.

[0024] In one embodiment, obtaining verification conditions for a target application configuration file includes:

[0025] Get the interface binding status of the candidate application profile;

[0026] If the interface binding state indicates that the candidate application profile is bound to an available interface, the verification result is determined as the candidate application profile meeting the verification condition;

[0027] If the interface binding status indicates that the candidate application profile is not bound to an available interface, the verification result is determined as the candidate application profile not meeting the verification condition.

[0028] In one embodiment, obtaining verification conditions for a target application configuration file includes:

[0029] Determine the framework file identifier of the persistence layer data framework corresponding to the structured data file;

[0030] If the data identifier matches the framework file identifier, the verification result is determined to be that the candidate application configuration file meets the verification conditions;

[0031] If the data identifier does not match the framework file identifier, the verification result is determined to be that the candidate application configuration file does not meet the verification conditions.

[0032] In one embodiment, after determining the target application configuration file corresponding to the recognition result, the method further includes:

[0033] Displaying the target application profile on a visual interface of the device terminal, and displaying confirmation controls and editing controls set for the target application profile;

[0034] In response to an operation instruction that triggers the editing control, obtaining editing information for the target application configuration file, and updating the target application configuration file based on the editing information;

[0035] Based on the updated target application configuration file, the target identifier and / or the associated feature identifier are updated.

[0036] In a second aspect, the present application provides a static identification device for an application configuration file, the device comprising:

[0037] The data source acquisition module is used to obtain the data source file to be parsed corresponding to the target application when the target application to be identified and processed is in a non-running state;

[0038] An identification determination module is used to determine the target identification corresponding to the target application configuration file to be identified, and extract the associated feature identification corresponding to the target identification;

[0039] A data traversal module is used to traverse the structured data files contained in the data source file and determine the data identifiers carried by the structured data files;

[0040] The target file determination module is used to determine the target application configuration file corresponding to the recognition result based on the structured data file corresponding to the data identifier if the data identifier meets the target identifier or the associated feature identifier.

[0041] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0042] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when the computer program is executed by a processor.

[0043] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0044] The static identification method, device and computer equipment of the application configuration file provided in the present application can realize static scanning of the configuration file code by obtaining the data source file to be parsed corresponding to the target application when the target application to be identified and processed is in a non-running state, avoiding the interference of noise data generated by the running code injection in the dynamic analysis, which is beneficial to improving the accuracy of the static analysis of the code. In addition, by determining the target identifier corresponding to the target application configuration file to be identified and extracting the associated feature identifier corresponding to the target identifier, there can be multiple associated feature identifiers, which can fully cover the application configuration files that need to be scanned and identified, and can capture application configuration files with hidden identifiers. In this way, if the data identifier meets the target identifier or the associated feature identifier, then the target application configuration file to be identified can be determined based on the structured data file corresponding to the data identifier, thereby reflecting that the present application can greatly improve the accuracy of application configuration file identification through static scanning and multi-identification feature scanning reference. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0046] Figure 1 A schematic diagram of a flow chart of a static identification method for an application configuration file provided in an embodiment of the present application;

[0047] Figure 2 A flowchart of the steps for extracting associated feature identifiers provided in an embodiment of the present application;

[0048] Figure 3 A flowchart illustrating the steps of determining a target application configuration file according to an embodiment of the present application;

[0049] Figure 4 A flowchart of another static identification method for application configuration files provided in an embodiment of the present application;

[0050] Figure 5 A schematic diagram of the structure of a static identification device for an application configuration file provided in an embodiment of the present application;

[0051] Figure 6 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0053] With the widespread adoption of microservice architectures and containerization technologies, the number of application instances is growing at a rapid pace. Faced with the high density of application instances deployed within a cluster, implementing application configuration files or code analysis, as well as visualizing code analysis, is a necessary requirement for cluster management applications.

[0054] Code analysis generally refers to analyzing code semantics and behavior, thereby identifying abnormal program semantics or undefined behavior caused by incorrect coding. Before implementing code analysis, it is necessary to identify the code configuration file.

[0055] Specifically for the application scenario of Mybatis, the applicant encountered obstacles in the process of identifying the Mapper file and found that the identification of the application configuration file had at least a low accuracy problem.

[0056] Based on this, the present application provides a method, apparatus, and computer device for statically identifying application configuration files, which can greatly improve the accuracy of application configuration file identification through static scanning and multi-identification feature scanning reference.

[0057] In an exemplary embodiment, Figure 1 A schematic diagram of a static identification method for an application configuration file provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, a static identification method for an application profile is provided. The method is applied to a terminal as an example. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, laptops, smart phones, and tablet computers. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. In this embodiment, the method includes the following S101 to S104. Among them:

[0058] S101 : When a target application to be identified and processed is in a non-running state, obtain a data source file to be parsed corresponding to the target application.

[0059] Among them, the target application may refer to an application that requires code analysis, that is, the static identification method of the application configuration file provided in this application may be implemented for any application that requires identification and analysis.

[0060] The data source file can refer to the data file of the target data source that needs to be analyzed. For example, in the Mybatis architecture scenario, it is necessary to identify and analyze the mapper file, and the mapper file is stored in the MapperLocations text path. Then the MapperLocations text can be used as the data source file here.

[0061] For example, the terminal can perform static analysis on applications that are not yet running. For example, the application can exist in the form of code / configuration files on a storage medium (such as a container image, code repository, or local disk), and data can be dynamically generated without being processed. This prevents temporary configuration files generated during application runtime, such as cache files and dynamically generated parameters, from interfering with the recognition of the core configuration file, ensuring that the analysis configuration file object contains the original configuration data to the greatest extent possible, thereby improving the accuracy of application configuration file recognition.

[0062] The terminal can statically scan the target application's file system, such as the container image layer, Git code library, etc., and filter candidate files according to predefined configuration feature rules to obtain the data source file to be parsed.

[0063] As an example, the terminal can identify files that comply with the framework's agreed directory structure through static scanning. For example, a MapperLocations file in XML format can be used as a data source file.

[0064] Indicatively, when identifying the Mapper file of Mybatis, the terminal can first scan the .xml file in the resources / mappers / directory and verify whether it contains the preset tags (such as<mapper namespace> tag) and SQL statement block to confirm whether it is a valid data source file.

[0065] S102: Determine a target identifier corresponding to a target application configuration file to be identified, and extract a correlation feature identifier corresponding to the target identifier.

[0066] Among them, the target application configuration file may refer to the application configuration file that needs to be identified, that is, the identification result file that needs to be obtained. The target identifier may refer to the file identifier corresponding to the target application configuration file, or the most common file identifier of the target application configuration file. For example, the file name of the Mapper file generally contains a mapper field, so the mapper field can be used as the target file identifier. The associated feature identifier may refer to other file identifiers corresponding to the target application configuration file, or a non-common file identifier or a hidden file identifier of the target application configuration file, but the application configuration file corresponding to the associated feature identifier may also be the target application configuration file; for example, the file name of the Mapper file may not contain a mapper field, but contains a DAO field, so the DAO field can be used as an associated feature identifier.

[0067] For example, the terminal can determine an explicit feature identifier corresponding to the target application profile to be identified. This identifier, as a target identifier, is highly distinctive and conforms to common naming conventions within the industry or framework. This target identifier can be pre-set by the user and can be set based on actual needs. Furthermore, the terminal can determine an auxiliary implicit identifier that is logically associated with the target application profile to supplement the target identifier, thereby improving the accuracy of target application profile identification. This step can provide standardized input for subsequent matching (step S104).

[0068] As an example, when the target identifier is mapper, the associated feature identifier can be set to DAO to identify XML files whose file names contain mapper or DAO (such as UserDAO.xml, Usermapper.xml, etc.).

[0069] S103: traverse the structured data files contained in the data source file, and determine the data identifiers carried by the structured data files.

[0070] The structured data file may refer to a data file included in the data source file, for example, an .xml file. The data identifier may refer to a file identifier, for example, a file name may be used as the data identifier.

[0071] Exemplarily, the terminal may traverse structured data files in a data source file that conform to predefined format standards, and may extract unique or characteristic tags from the structured data files to quickly locate and classify the files, thereby obtaining data identifiers carried by the structured data files.

[0072] Optionally, the terminal can scan all files hierarchically (e.g., recursively from the root directory / config to the subdirectory / config / db) and, based on the file type, invoke a corresponding parser to parse the structured data file, extracting identifiers from the file content, such as XML tag names. Furthermore, the extracted data identifiers can be matched against the target identifiers (defined in step S102), and the matching results recorded. This step can provide the input basis for subsequent matching (step S104).

[0073] S104: If the data identifier matches the target identifier or the associated feature identifier, determine the target application configuration file corresponding to the recognition result based on the structured data file corresponding to the data identifier.

[0074] For example, the recognition result may refer to the result required for recognition. The terminal may compare the data identifier extracted in step S103 with the target identifier and associated feature identifier defined in step S102 to determine whether they comply with preset rules. If the data identifier matches the target identifier or associated feature identifier (data identifier match is successful), the target application configuration file corresponding to the recognition result may be obtained based on the structured data file corresponding to the data identifier.

[0075] Optionally, the terminal can achieve exact matching, for example, it can accurately match the data identifier and the target identifier to be completely consistent, such as the mapper in the file name user-mapper.xml; the terminal can also achieve fuzzy matching, for example, it can fuzzily match the data identifier to contain a subset of the target identifier, such as the file name may contain an abbreviation of the associated feature identifier. As an example, db can be matched to the associated feature identifier database, that is, db is the abbreviation of the associated feature identifier database.

[0076] For example, when identifying the Mybatis Mapper file, if the target identifier "mapper" is not matched, a secondary match can be performed using associated features (such as *DAO), ultimately identifying UserDao.xml as the target configuration file. Furthermore, it is also possible to identify whether the file name contains "mapper" or "DAO".

[0077] As an example, the terminal can traverse the resources / mappers / directory of the Mybatis project, find the UserDao.xml file, and extract the root tag after parsing its XML structure. <mapper namespace="com.example.UserDao">Thus, Dao contained in the file name is an associated feature identifier. Combined with step S102, it can be determined that the file can be a target application configuration file.

[0078] In this embodiment, through steps S101 to S104, static scanning of the configuration file code can be achieved, avoiding the interference of noise data generated by running code injection during dynamic analysis, which is conducive to improving the accuracy of static analysis of the code, and can fully cover the application configuration files that need to be scanned and identified, and can capture application configuration files with hidden identifiers. In this way, if the data identifier meets the target identifier or the associated feature identifier, then the target application configuration file that needs to be identified can be determined based on the structured data file corresponding to the data identifier, thereby reflecting that the present application can greatly improve the accuracy of application configuration file identification through static scanning and multi-identification feature scanning reference.

[0079] In an exemplary embodiment, Figure 2 A flow chart of the steps of extracting associated feature identifiers provided in the embodiment of the present application is shown as follows: Figure 2 As shown, in Figure 1 Based on the above, the steps of the static identification method of the application configuration file are further exemplified. In step S102, the associated feature identifier corresponding to the target identifier is extracted, which may specifically include S201 to S203, wherein:

[0080] S201: Obtain name identification information corresponding to the target application configuration file to be obtained from the data source file.

[0081] S202: Determine the file type identifier of the name identification information.

[0082] S203: extracting a preset number of segments of text data that are before the file type identifier and adjacent to the file type identifier to obtain an associated feature identifier.

[0083] The name identification information may refer to a file name. The file type identification information may indicate a file type or a file extension. For example, the file type identification information of an XML file is xml.

[0084] For example, the terminal can extract a core semantic segment from the full file name of the target application configuration file as the name identifier of the target application configuration file. The terminal can further identify the file format type from this name identifier, typically by using the file extension (e.g., .xml) or content signature. Furthermore, the terminal can extract several text segments immediately preceding the file type identifier (i.e., a "preset number of segments") from the file name as supplementary associated feature identifiers.

[0085] Alternatively, the terminal can extract the suffix from the file name to obtain the file type identifier. If the extension is missing or conflicting, the file header content can be parsed to determine the format and obtain the file type identifier.

[0086] The terminal can extract the associated feature identifier based on a preset number of segments (the number of adjacent segments to be extracted, such as 1 or 2 segments) and a preset interception direction, such as tracing back from the file type identifier (intercepting to the left).

[0087] As an example, the terminal can split the file name and extension into an array by delimiter. For example, example.dao.mybatis.XXXMapper.xml can be split into ["example", "dao", "mybatis", "XXXMapper"]. Furthermore, the terminal can locate the file type identifier, that is, the last fragment index before the extension (such as XXXMapper before .xml). Finally, the terminal can intercept N segments to the left according to the preset requirements. If the preset number of segments is 1, the XXXMapper field is extracted. If the preset number of segments is 2, the XXXMapper and mybatis fields are extracted.

[0088] In this embodiment, by deconstructing the semantics of the file name and intercepting adjacent fragments of the file type identifier, the unstructured file name can be converted into identification data that can be quantified and analyzed. Features can be extracted without parsing the file content, and static scanning and recognition can be achieved, thereby providing underlying support for the accurate identification of microservice and containerized application configuration files.

[0089] In an exemplary embodiment, Figure 3 A flow chart of the steps for determining a target application configuration file provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, in Figure 1 Based on the above, the steps of the static identification method of the application configuration file are further exemplified. In step S104, based on the structured data file corresponding to the data identifier, the target application configuration file corresponding to the identification result is determined. Specifically, the steps may include S301 to S304, wherein:

[0090] S301: Determine a structured data file corresponding to a data identifier as a candidate application configuration file.

[0091] S302: Obtain verification conditions for the target application configuration file.

[0092] S303: If the candidate application configuration file meets the verification condition, the candidate application configuration file is used as the target application configuration file.

[0093] S304: If the candidate application configuration file does not meet the verification condition, the candidate application configuration file is eliminated.

[0094] The candidate application configuration file refers to the structured data file corresponding to the data identifier that meets the target identifier or the associated feature identifier in step S104. The verification condition may refer to a condition for verifying whether the target application configuration file is valid.

[0095] For example, the terminal may preliminarily mark the structured data file that successfully matches the data identifier extracted in step S103 with the target identifier or associated feature identifier in step S102 as a candidate application profile. Furthermore, the terminal may determine a predefined set of validity rules to verify whether the candidate application profile is authentic and valid, thereby determining the verification conditions for the target application profile; for example, the verification dimensions may include format legality, content integrity, semantic compliance, etc.

[0096] Furthermore, the terminal may perform a verification pass determination process. If the candidate application configuration file passes the verification, the candidate application configuration file may be used as the target application configuration file. If the candidate application configuration file fails the verification and is verified as an invalid file, the invalid candidate application configuration file may be eliminated.

[0097] In this embodiment, the closed-loop process of candidate file generation, verification, and dynamic elimination of invalid files can greatly improve the accuracy of application configuration file recognition.

[0098] In an exemplary embodiment, in step S302, obtaining the verification conditions for the target application configuration file may specifically include:

[0099] Determine the historical backup file identifier corresponding to the structured data file.

[0100] If the data identifier does not match the historical backup file identifier, the verification result is determined to be that the candidate application configuration file meets the verification condition.

[0101] If the data identifier matches the historical backup file identifier, the verification result is determined to be that the candidate application configuration file does not meet the verification condition.

[0102] The historical backup file identifier may refer to an identifier corresponding to a historical backup file, which may be used to indicate that the file is a historical backup file. The historical backup file identifier may be used to identify a file as a backup version. For example, it may be reflected in the file name, path, or metadata to distinguish the currently valid configuration from a historical or temporary backup.

[0103] For example, the terminal can obtain predefined common backup identifiers, such as fields like "bak" and "backup." The terminal can determine whether the data identifier (e.g., file name, key fields) of the candidate application configuration file matches any backup identification rules. If no backup identification rules are matched, the candidate application configuration file can be used as the target application configuration file. If the data identifier of the application configuration file matches at least one backup identification rule, the candidate application configuration file can be marked as invalid and removed.

[0104] In this embodiment, by filtering by backup identifiers, it is possible to prevent outdated and invalid configuration files from interfering with the operating environment, exclude ineffective configurations such as historical backups and temporary files, and accurately filter application configuration files, thereby further improving the accuracy of application configuration file identification.

[0105] In an exemplary embodiment, in step S302, obtaining the verification condition for the target application configuration file may further include:

[0106] Get the interface binding status of the candidate application profile.

[0107] If the interface binding state indicates that the candidate application profile is bound to an available interface, the verification result is determined as the candidate application profile meeting the verification condition.

[0108] If the interface binding status indicates that the candidate application profile is not bound to an available interface, the verification result is determined as the candidate application profile not meeting the verification condition.

[0109] The interface binding status may indicate whether a specified available interface is bound, for example, whether the mapper has a valid namespace attribute.

[0110] For example, the terminal can extract a binding identifier from a structured data file, such as an XML namespace attribute, and verify whether the identifier complies with naming conventions, such as the Java package name format com.xx.xx. The terminal can determine whether the configuration identifier format is legal and whether a corresponding code or service entity exists. If the format is incorrect, such as namespace="UserDao" not including the complete package name, the interface binding status indicates that the candidate application configuration file is not bound to an available interface, or if the interface, class, or service pointed to by the configuration does not exist, the interface binding status also indicates that the candidate application configuration file is not bound to an available interface.

[0111] As an example, the terminal can determine<mapper namespace> Whether the attribute points to a valid Java interface, such as namespace="com.example.UserMapper", can indicate the available interface for binding to the candidate application configuration file.

[0112] In this embodiment, by verifying the interface binding status, application configuration files can be accurately filtered, thereby further improving the accuracy of application configuration file identification.

[0113] In an exemplary embodiment, in step S302, obtaining the verification condition for the target application configuration file may further include:

[0114] Determine the framework file identifier of the persistence layer data framework corresponding to the structured data file.

[0115] If the data identifier matches the framework file identifier, the verification result is determined to be that the candidate application configuration file meets the verification condition.

[0116] If the data identifier does not match the framework file identifier, the verification result is determined to be that the candidate application configuration file does not meet the verification conditions.

[0117] The persistence layer data framework may refer to a MyBatis framework, and the framework file identifier may refer to a MyBatis file identifier. The framework file identifier may be used to determine whether the candidate application configuration file needs to be correctly configured in the MyBatis loading path.

[0118] For example, the terminal can determine the framework file identifier of a framework such as MyBatis, determine whether the data identifier matches the framework file identifier, and if both the file path and content match the framework file identifier, the terminal can determine that the candidate application configuration file is a valid configuration file (the target configuration file). If either the path or content of the data identifier does not match, the candidate application configuration file can be marked as invalid and discarded.

[0119] In this embodiment, if the application configuration file is not stored or written according to the framework rules, the framework will not be able to load it. By matching the framework file identifier, the application configuration file can be accurately filtered, thereby further improving the accuracy of application configuration file recognition.

[0120] In an exemplary embodiment, in step S104, after determining the target application configuration file corresponding to the recognition result, the following steps are further included:

[0121] The target application configuration file is displayed on a visual interface of the device terminal, and confirmation controls and editing controls set for the target application configuration file are displayed.

[0122] In response to an operation instruction that triggers the editing control, editing information for the target application configuration file is acquired, and the target application configuration file is updated based on the editing information.

[0123] Based on the updated target application configuration file, the target identifier and / or the associated feature identifier are updated.

[0124] The visual interface may refer to a terminal interface that can be used to display recognized files.

[0125] For example, the terminal may display the target application configuration file identified by scanning, and the confirmation control and the editing control pre-set in the application configuration file.

[0126] If the user determines that the target application profile is accurately scanned and identified, the confirmation control instruction can be triggered to confirm the scan result of the target application profile. If the user determines that the target application profile is incorrectly scanned and identified, the editing control can be triggered to edit and modify the target application profile to correct the target application profile.

[0127] For example, if a user deletes a target application configuration file, it indicates that the target application configuration file may have been misidentified. The terminal can update the target application configuration file based on the deletion information and re-determine the target identifier and / or associated feature identifier based on the updated target application configuration file, such as deleting the data identifier corresponding to the deleted target application configuration file.

[0128] In this embodiment, by scanning and identifying the target application profile and then displaying it, the target application profile and the corresponding target identifier and / or associated feature identifier can be modified based on human-computer interaction, which is beneficial to improving the recognition accuracy when the application profile scanning and identification is performed again.

[0129] In some exemplary embodiments, Figure 4 A flow chart of another static identification method for an application configuration file provided in an embodiment of the present application is shown as follows: Figure 4 As shown, based on the various embodiments of the above method, a detailed exemplary description of the static identification method of the application configuration file is given, wherein the Mybatis data source and the Mapper file are used as examples. The method may specifically include S401 to S403:

[0130] S401, traverse the data source information set S, process the MapperLocations text, and obtain the Mapper feature set N;

[0131] S402. Scan the .xml file. If the file name contains Mapper or the file name contains a feature of Mapper feature set N, it is considered to be a Mapper file.

[0132] S403: Obtain Mapper file set M.

[0133] The Mapper feature set N includes associated feature identifiers. Mapper file identification cannot simply assume that all .xml files in an application whose file names contain "Mapper" are Mapper files. This is because some configuration files, such as applicationContext.xml, are not Mapper files, and some XXXDAO.xml files are XML files. This can introduce noise into Mapper file identification.

[0134] This embodiment provides a partial and illustrative explanation and summary of the above embodiments. For this embodiment, reference may be made to the above definitions of the various embodiments of the static identification method for application configuration files.

[0135] For example, all Mybatis data sources of the application are obtained through static scanning. The data source information will contain mapperLocations information. The text of MapperLocations is scanned and identified to obtain the last paragraph of text. For example, through the following preset instruction: mapperLocations= classpath:* / mapper / *DAO.xml, the DAO string is obtained, where DAO can be considered as a feature identifier (associated feature identifier) ​​of the Mapper file name. When scanning all .xml files, the associated feature identifier can be used as a reference to identify all Mapper files.

[0136] Optionally, for example, if the mapper file name is: com.vip.example.dao.mybatis.XXXMapper.xml, for this Mapper path, follow the mapperLocations instruction similar to classpath*:com / vip / example / dao / ** / mybatis / *.xml to find all XML files with the file name containing Mapper under the corresponding path and confirm that they are Mapper files. For example, for a Mapper path with a file name like com.vip.example.dao.mybatis.XXXDAO.xml, extract the text feature value, that is, "DAO", through the mapperLocations instruction such as classpath*:com / vip / example / dao / ** / mybatis / * DAO.xml, and determine that all XML files with the file name containing DAO under the package of the prefix path of mapperLocations are Mapper files; in this way, all Mybatis files can be identified by associating feature identifiers, and the possibility of introducing noise files in this application is very small, thereby improving the accuracy of identifying application configuration files.

[0137] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0138] The following describes the static identification device for application profiles provided in an embodiment of the present application. The static identification device for application profiles and the above-mentioned static identification method for application profiles have the same inventive concept, and the implementation solution for solving the problem provided by the device is similar to the implementation solution described in the above-mentioned method. Therefore, the specific limitations in the embodiments of the static identification device for application profiles provided below can refer to the limitations on the static identification method for application profiles above. The static identification device for application profiles described below and the static identification method for application profiles described above can be referenced to each other and will not be repeated here.

[0139] In an exemplary embodiment, Figure 5 A schematic diagram of a static identification device for an application configuration file provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the device includes: a data source acquisition module 510, an identification determination module 520, a data traversal module 530, and a target file determination module 540, wherein:

[0140] The data source acquisition module 510 is configured to acquire a data source file to be parsed corresponding to the target application when the target application to be identified and processed is in a non-running state.

[0141] The identifier determination module 520 is configured to determine a target identifier corresponding to a target application configuration file to be identified, and extract an associated feature identifier corresponding to the target identifier.

[0142] The data traversal module 530 is used to traverse the structured data files contained in the data source file and determine the data identifiers carried by the structured data files.

[0143] The target file determination module 540 is configured to determine a target application configuration file corresponding to the recognition result based on the structured data file corresponding to the data identifier if the data identifier matches the target identifier or the associated feature identifier.

[0144] In an exemplary embodiment, the identification determination module is used to obtain the name identification information corresponding to the target application configuration file to be obtained in the data source file; determine the file type identification of the name identification information; extract a preset number of segments of text data before and adjacent to the file type identification to obtain an associated feature identification.

[0145] In an exemplary embodiment, the target file determination module is used to determine the structured data file corresponding to the data identifier as a candidate application configuration file; obtain verification conditions for the target application configuration file; if the candidate application configuration file meets the verification conditions, the candidate application configuration file is used as the target application configuration file; if the candidate application configuration file does not meet the verification conditions, the candidate application configuration file is eliminated.

[0146] In an exemplary embodiment, the target file determination module is used to determine the historical backup file identifier corresponding to the structured data file; if the data identifier does not match the historical backup file identifier, the verification result is determined as the candidate application configuration file meets the verification conditions; if the data identifier matches the historical backup file identifier, the verification result is determined as the candidate application configuration file does not meet the verification conditions.

[0147] In an exemplary embodiment, the target file determination module is used to obtain the interface binding status of the candidate application profile; if the interface binding status indicates that the candidate application profile is bound to an available interface, the verification result is determined as the candidate application profile meets the verification conditions; if the interface binding status indicates that the candidate application profile is not bound to an available interface, the verification result is determined as the candidate application profile does not meet the verification conditions.

[0148] In an exemplary embodiment, the target file determination module is used to determine the framework file identifier of the persistence layer data framework corresponding to the structured data file; if the data identifier matches the framework file identifier, the verification result is determined as the candidate application configuration file meets the verification conditions; if the data identifier does not match the framework file identifier, the verification result is determined as the candidate application configuration file does not meet the verification conditions.

[0149] In an exemplary embodiment, the target file determination module is also used to display the target application configuration file on the visual interface of the device terminal, and to display the determination control and editing control set for the target application configuration file; in response to the operation instruction that triggers the editing control, obtain the editing information for the target application configuration file, and update the target application configuration file based on the editing information; based on the updated target application configuration file, update the target identifier and / or associated feature identifier.

[0150] In an exemplary embodiment, the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by one or more processors, the one or more processors perform the steps of the static identification method of the application profile as described in any of the above embodiments.

[0151] In an exemplary embodiment, the present application also provides a computer device having a computer program stored therein, wherein when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the static identification method of the application profile as described in any of the above embodiments.

[0152] In an exemplary embodiment, the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the static identification method of an application configuration file in any of the above embodiments.

[0153] Schematically, as Figure 6 As shown, Figure 6 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. The computer device 600 can be provided as a server. Figure 6 Computer device 600 includes a processing component 602, which further includes one or more processors, and a memory resource represented by memory 601 for storing instructions executable by processing component 602, such as an application. The application stored in memory 601 may include one or more modules, each corresponding to a set of instructions. In addition, processing component 602 is configured to execute the instructions to perform the text recognition method of any of the above embodiments.

[0154] The computer device 600 may further include a power supply component 603 configured to perform power management of the computer device 600, a wired or wireless network interface 604 configured to connect the computer device 600 to a network, and an input / output (I / O) interface 605. The computer device 600 may operate based on an operating system stored in the memory 601, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or the like.

[0155] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0156] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0157] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprise," "include," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a set of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.

[0158] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referenced to each other.

[0159] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.< / mapper>

Claims

1. A static identification method for an application configuration file, characterized in that: The method comprises: When the target application to be identified and processed is in a non-running state, obtaining a data source file to be parsed corresponding to the target application; Determine the target identifier corresponding to the target application configuration file to be identified, and extract the associated feature identifier corresponding to the target identifier; Traversing the structured data files contained in the data source file, and determining the data identifiers carried by the structured data files; If the data identifier matches the target identifier or the associated feature identifier, a target application configuration file corresponding to the recognition result is determined based on the structured data file corresponding to the data identifier.

2. The method according to claim 1, characterized in that The extracting the associated feature identifier corresponding to the target identifier includes: Obtain name identification information corresponding to the target application configuration file to be obtained from the data source file; Determine the file type identifier of the name identification information; A preset number of segments of text data preceding and adjacent to the file type identifier are extracted to obtain the associated feature identifier.

3. The method according to claim 1, characterized in that The determining, based on the structured data file corresponding to the data identifier, a target application configuration file corresponding to the recognition result, includes: Determining the structured data file corresponding to the data identifier as a candidate application configuration file; Get the verification conditions for the target application profile; If the candidate application configuration file meets the verification condition, the candidate application configuration file is used as the target application configuration file; If the candidate application configuration file does not meet the verification condition, the candidate application configuration file is eliminated.

4. The method according to claim 3, characterized in that The obtaining of the verification condition for the target application configuration file includes: Determine the historical backup file identifier corresponding to the structured data file; If the data identifier does not match the historical backup file identifier, determining the verification result as that the candidate application configuration file meets the verification condition; If the data identifier matches the historical backup file identifier, the verification result is determined as the candidate application configuration file not meeting the verification condition.

5. The method according to claim 3, characterized in that The obtaining of the verification condition for the target application configuration file includes: Obtaining the interface binding status of the candidate application configuration file; If the interface binding state indicates that the candidate application configuration file is bound to an available interface, determining the verification result as that the candidate application configuration file satisfies the verification condition; If the interface binding status indicates that the candidate application configuration file is not bound to an available interface, the verification result is determined as the candidate application configuration file does not meet the verification condition.

6. The method according to claim 3, characterized in that The obtaining of the verification condition for the target application configuration file includes: Determine the framework file identifier of the persistence layer data framework corresponding to the structured data file; If the data identifier matches the framework file identifier, determining the verification result as that the candidate application configuration file meets the verification condition; If the data identifier does not match the framework file identifier, the verification result is determined as the candidate application configuration file does not meet the verification condition.

7. The method according to any one of claims 1 to 6, characterized in that After determining the target application configuration file corresponding to the recognition result, the method further includes: Displaying the target application configuration file on a visual interface of the device terminal, and displaying a confirmation control and an editing control set for the target application configuration file; In response to an operation instruction that triggers the editing control, acquiring editing information for the target application configuration file, and updating the target application configuration file based on the editing information; Based on the updated target application configuration file, the target identifier and / or the associated feature identifier are updated.

8. A static identification device for an application configuration file, characterized in that: The device comprises: A data source acquisition module is used to acquire a data source file to be parsed corresponding to a target application when the target application to be identified and processed is in a non-running state; An identification determination module is used to determine a target identification corresponding to a target application configuration file to be identified, and to extract an associated feature identification corresponding to the target identification; A data traversal module, configured to traverse the structured data files contained in the data source file and determine the data identifiers carried by the structured data files; The target file determination module is configured to determine a target application configuration file corresponding to the recognition result based on the structured data file corresponding to the data identifier if the data identifier matches the target identifier or the associated feature identifier.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.