Metadata generation method and device for resource dependency resolution and storage medium

By parsing the node nesting and association relationships of resource files, path mapping metadata is generated, which solves the problem of low generation efficiency in existing technologies and achieves efficient and accurate resource dependency analysis.

CN116028442BActive Publication Date: 2026-04-14NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-27
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing technologies are inefficient in generating path mapping metadata for resource file dependencies, and require significant time and human resources for manual construction to ensure accuracy.

Method used

By obtaining the node nesting relationship of the target resource file, the association between each field and field value under the same analysis node is determined, and path mapping metadata is generated based on the preset path mapping rules to avoid omissions and errors.

Benefits of technology

It improves the efficiency and accuracy of path mapping metadata generation, saves time and human resources, and comprehensively and accurately analyzes the dependencies between resource files in software engineering projects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116028442B_ABST
    Figure CN116028442B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a meta-information generation method and device for resource dependency analysis and a storage medium. A target reference resource file under a target file type in a reference resource file of a reference project is acquired, a node nesting relationship in the target reference resource file is analyzed, nodes with the same node nesting relationship are taken as the same analysis node, a first association relationship between each field and a field value under the same analysis node is determined, a target path mapping rule corresponding to each field in the first association relationship is determined based on a preset at least one path mapping rule and the field value in the first association relationship, the path mapping rule is used for mapping the field value into the form of a path, and path mapping meta-information corresponding to the target file type is generated based on each field and the target path mapping rule corresponding to each field. The generation efficiency and accuracy of the path mapping meta-information required when resource dependency analysis is performed can be improved, and human resources for generating the path mapping meta-information are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet technology, and more specifically to a method, apparatus, and storage medium for generating metadata for resource dependency resolution. Background Technology

[0002] With the rapid development of internet technology, various software engineering projects often contain a wide variety of resource files, such as images, audio, video, and text. These different resource files typically have dependencies on each other. As projects grow, the number of resource files increases, and the dependencies between them become more complex, necessitating dependency analysis for resource file management.

[0003] Currently, when resolving dependencies of resource files, the dependent paths of the resource files can be resolved based on pre-defined path mapping metadata. However, this path mapping metadata is typically generated manually, requiring significant time and manpower to ensure its accuracy, resulting in low generation efficiency. Summary of the Invention

[0004] This invention provides a method, apparatus, and storage medium for generating metadata for resource dependency resolution, which can improve the efficiency and accuracy of generating path mapping metadata required for resource dependency resolution, and save the time and human resources required to generate path mapping metadata.

[0005] This invention provides a method for generating metadata for resource dependency resolution, comprising:

[0006] Retrieve the target reference resource file under the target file type from the reference resource files of the reference project;

[0007] Analyze the node nesting relationship in the target reference resource file, and treat nodes with the same node nesting relationship in the target reference resource file as the same analysis node;

[0008] Determine the first association relationship between each field and field value under the same analysis node;

[0009] Based on at least one preset path mapping rule and the field values ​​in the first association relationship, a target path mapping rule corresponding to each field in the first association relationship is determined, wherein the path mapping rule is used to map the field values ​​into the form of a path;

[0010] Based on each of the fields and the target path mapping rules corresponding to each field, path mapping metadata corresponding to the target file type is generated.

[0011] Accordingly, embodiments of the present invention also provide a metadata generation apparatus for resource dependency resolution, comprising:

[0012] The file acquisition unit is used to acquire the target reference resource file of the target file type in the reference resource file of the reference project;

[0013] The file parsing unit is used to parse the node nesting relationship in the target reference resource file and to treat nodes with the same node nesting relationship in the target reference resource file as the same analysis node.

[0014] A relationship determination unit is used to determine the first association relationship between each field and field value under the same analysis node;

[0015] The rule determination unit is used to determine the target path mapping rule corresponding to each field in the first association relationship based on at least one preset path mapping rule and the field value in the first association relationship, wherein the path mapping rule is used to map the field value into the form of a path;

[0016] The information generation unit is used to generate path mapping metadata corresponding to the target file type based on each of the fields and the target path mapping rules corresponding to each of the fields.

[0017] Accordingly, embodiments of the present invention also provide a computer device, including a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to perform the steps in any of the metadata generation methods for resource dependency resolution provided in the embodiments of the present invention.

[0018] Accordingly, embodiments of the present invention also provide a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the metadata generation methods for resource dependency resolution provided in embodiments of the present invention.

[0019] Furthermore, embodiments of the present invention also provide a computer program product, including a computer program or instructions, wherein when the computer program or instructions are executed by a processor, they implement the steps in any of the metadata generation methods for resource dependency resolution provided in embodiments of the present invention.

[0020] Using the solution of this embodiment of the invention, a target reference resource file of the target file type in the reference resource file of the reference project can be obtained. The node nesting relationship in the target reference resource file can be parsed, and nodes with the same node nesting relationship in the target reference resource file can be taken as the same analysis node. A first association relationship between each field and field value under the same analysis node can be determined. Based on at least one preset path mapping rule and the field value in the first association relationship, a target path mapping rule corresponding to each field in the first association relationship can be determined. This path mapping rule is used to map the field value into a path form. Based on each field and the target path mapping rule corresponding to each field... This process generates path mapping metadata corresponding to the target file type. In this embodiment of the invention, for nodes with various nested relationships in the target reference resource file, the association between each field and its value is determined. When determining the target path mapping rules, the field values ​​in the first association relationship are mapped, thus avoiding omissions. Furthermore, mapping each field value through path mapping rules prevents the erroneous use of certain field values ​​as path information. Therefore, this embodiment of the invention can improve the efficiency and accuracy of generating path mapping metadata needed for resource dependency resolution, saving time and human resources required for generating path mapping metadata. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a schematic diagram of a scenario for a method for generating metadata for resource dependency resolution provided in an embodiment of the present invention;

[0023] Figure 2 This is a flowchart of a method for generating metadata for resource dependency resolution provided in an embodiment of the present invention;

[0024] Figure 3 This is a schematic diagram illustrating the generation process of the first and second association relationships provided in an embodiment of the present invention;

[0025] Figure 4 This is another flowchart of the metadata generation method for resource dependency resolution provided in this embodiment of the invention;

[0026] Figure 5 This is a schematic diagram of the structure of the metadata generation device for resource dependency resolution provided in an embodiment of the present invention;

[0027] Figure 6 This is another structural schematic diagram of the metadata generation device for resource dependency resolution provided in an embodiment of the present invention;

[0028] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0029] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0030] This invention provides a method, apparatus, computer device, and computer-readable storage medium for generating metadata for resource dependency resolution. Specifically, this invention provides a method for generating metadata for resource dependency resolution using an apparatus suitable for such an apparatus, which can be integrated into a computer device.

[0031] The computer device can be a terminal or other device, including but not limited to mobile terminals and fixed terminals. For example, mobile terminals include but are not limited to smartphones, smartwatches, tablets, laptops, smart vehicles, etc., while fixed terminals include but are not limited to desktop computers, smart TVs, etc.

[0032] The computer device can also be a server or other similar device. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, but it is not limited to these.

[0033] The metadata generation method for resource dependency resolution in this embodiment of the invention can be implemented by a server or by a terminal.

[0034] The following example uses a computer device to implement this method for generating metadata for resource dependency resolution to illustrate the method.

[0035] like Figure 1 As shown, the metadata generation system for resource dependency resolution provided in this embodiment of the invention includes a terminal device 10, which stores reference resource files of reference projects.

[0036] Terminal device 10 can obtain target reference resource files of target file type in the reference resource files of the reference project, parse the node nesting relationship in the target reference resource files, take nodes with the same node nesting relationship as the same analysis node, determine the first association relationship between each field and field value under the same analysis node, and determine the target path mapping rule corresponding to each field in the first association relationship based on at least one preset path mapping rule and the field value in the first association relationship. The path mapping rule is used to map the field value into the form of a path. Based on each field and the target path mapping rule corresponding to each field, path mapping meta-information corresponding to the target file type is generated.

[0037] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0038] The embodiments of the present invention will be described from the perspective of a metadata generation device for resource dependency resolution, which can be integrated into computer devices such as servers or terminals.

[0039] like Figure 2 As shown, the specific process of the metadata generation method for resource dependency resolution in this embodiment can be as follows:

[0040] 201. Obtain the target reference resource file under the target file type in the reference resource file of the reference project.

[0041] The reference project is a project that can be used to analyze the dependencies between resource files in a project. For example, the reference project can be a software engineering project consisting of the program code of a game, or a software engineering project consisting of the program code of a game function in a game, or an animation project consisting of several animation resource files, or an audio project consisting of several audio, audio script and other resource files, and so on.

[0042] Resource files can be any file from which all necessary resources can be read. Specifically, the types of resources in a resource file can be images, audio, video, text resources, or other content that can be displayed on a computer. After being read, the resources in the resource file can be displayed to the user in the application as needed.

[0043] The target file type can refer to the format of the resource file, such as, but not limited to, XML and JSON. When performing resource dependency analysis, different file types can be analyzed separately as target file types. By integrating the path mapping metadata for each target file type, the path mapping metadata of the reference project can be obtained.

[0044] In practical applications, software engineering projects involve a wide variety of resource types, such as 3D models, textures, audio files, and more. These resource files often have complex dependencies. For example, in a game project, a scene might reference multiple prefabs, and these prefabs might depend on multiple models and materials. Furthermore, models might depend on animations, audio tracks, and so on. As the project progresses, resource files accumulate, becoming bloated and difficult to manage.

[0045] If all dependent resources can be parsed from each resource file, then this complex network of resource dependencies can be clearly identified, making it easier to manage these resources. In addition, the benefits of resource dependency parsing include, but are not limited to: resource checking, such as checking for missing resources and incorrect resource references; package body analysis and optimization, such as removing redundant resources and optimizing software package sub-algorithms; resource migration and merging, etc.

[0046] 202. Analyze the node nesting relationship in the target reference resource file, and treat nodes with the same node nesting relationship in the target reference resource file as the same analysis node.

[0047] Understandably, the definition of nodes corresponding to different types of target reference resource files can be different. For example, in an XML file, each tag can be regarded as a node; for a JSON file format, a node is a combination of a dictionary defined by special rules.

[0048] In this context, node nesting refers to the connection relationships between nodes in the target reference resource file. A node in a resource file typically contains several fields, and nesting between nodes is allowed.

[0049] Specifically, the same analysis node refers to nodes in the target reference resource file that have the same nesting relationship.

[0050] For example, in an XML target reference resource file, there exists a tagA, under which tagB is nested. In this case, for the tagB node, there is a nested node relationship of tagA-tagB. If there are other tagB nodes in the target reference resource file with the same nested node relationship of tagA-tagB, then all tagB nodes are the same analysis node.

[0051] It should be noted that if a node does not have any other nodes with the same nesting relationship in the target reference resource file, then the node itself can be used as the same analysis node.

[0052] 203. Determine the first association between each field and field value under the same analysis node.

[0053] Specifically, the first association refers to the correspondence between each field and its value under the same analysis node in the target reference resource file.

[0054] For example, such as Figure 3 As shown, the Node Details section contains a diagram of the first relationship. The node is a single analysis node, Key_1 is a field under the same analysis node, and Value_1_1, etc. are the possible field values ​​of the Key_1 field.

[0055] It is understood that in the first association relationship, there may be one or more fields, and each field may also correspond to one or more field values. This embodiment of the invention does not limit this.

[0056] 204. Based on at least one preset path mapping rule and the field values ​​in the first association relationship, determine the target path mapping rule corresponding to each field in the first association relationship. The path mapping rule is used to map the field values ​​into the form of a path.

[0057] Path mapping rules can be used to map field values ​​to paths. For example, a path mapping rule could be "dependency before the double colon," which treats the information before the double colon in the field value as the path, and so on.

[0058] In some embodiments, a path mapping rule that can map field values ​​to a valid path format can be directly used as the target path mapping rule.

[0059] In some alternative embodiments, since there may be multiple path mapping rules that can map field values ​​to valid path formats, but the mapping result may not be an actual path, etc., in order to improve the accuracy of the target path mapping rule, the paths mapped by each field value can be compared with paths in a preset path library to determine the validity of the path. That is, the step "based on at least one preset path mapping rule and the field values ​​in the first association relationship, determine the target path mapping rule corresponding to each field in the first association relationship" can specifically include:

[0060] Based on at least one preset path mapping rule, for each field, the path mapping is performed on the field value corresponding to the field in the first association relationship to obtain the dependent resource file path corresponding to the field value under each path mapping rule;

[0061] The dependent resource file paths are matched with the candidate dependent resource file paths in the preset set of candidate dependent resource file paths to obtain the path matching results corresponding to each dependent resource file path under each path mapping rule.

[0062] Based on the path matching results, determine the target path mapping rules corresponding to each field in the first association relationship.

[0063] The dependent resource file path is a path in form obtained by mapping the field values ​​according to path mapping rules. However, the dependent resource file path may be a real and valid path, or it may be a path that only conforms to the form of a path but does not actually exist.

[0064] The candidate dependency resource file path set can be a collection of several candidate dependency resource file paths. These candidate dependency resource file paths are actual paths.

[0065] It is understandable that path matching results may be successful or unsuccessful. When determining the target path mapping rule, it can be based on the successful path matching results corresponding to different path mapping rules. That is, the path matching result can include successful path matching results. The step "Based on the path matching result, determine the target path mapping rule corresponding to each field in the first association relationship" can specifically include:

[0066] Based on the number of successful path matching results in the path matching results under each path mapping rule, and the number of path matching results under each path mapping rule, calculate the rule matching degree corresponding to each path mapping rule.

[0067] The path mapping rules corresponding to the matching degree of the rules that meet the preset rule matching conditions will be used as the target path mapping rules for each field in the first association relationship.

[0068] Specifically, the rule matching condition can be at least one of the following: the rule matching degree is not less than a preset rule matching degree threshold, the rule matching degree is the highest, etc. Technical personnel can set it themselves according to actual needs, and the embodiments of the present invention do not limit it.

[0069] Optionally, the rule matching degree can be obtained directly by calculating the ratio between the number of successful matches and the number of results. Path mapping rules can be used to infer the meaning of field values. Specifically, rules can be used during mapping. Reconstruct a character value for Query whether the candidate dependency resource file path set exists If it exists, then the field (key) will be adapted. The count increases. Then, it is sorted according to a custom weight, and the rule with the highest weight and a percentage greater than the threshold is considered to be suitable for that field.

[0070] For example, you can set the rule matching threshold to 0.3, and the values ​​that appear in the field "Name" are: “bear.mtg::Physics” appears 8 times. "monky.mtg:: Physics" appears 3 times. The word "bird" appears twice. (Path mapping rules) Matched and This is a resource reference, with a count of 11; path mapping rules. Matched For resource references, the count is 2; if other rules fail to match, then due to... The count percentage is the highest and exceeds the preset threshold, so it is inferred that this field is compatible with R1, and R1 is used as the target path mapping rule.

[0071] Generally, since rule matching omissions and errors are low-probability events, even if one or more path mapping rules are misjudged, the proportion of problematic successful rules in the final rule reasoning and selection is very low. During the final rule filtering, only the rule with the highest percentage of successful matches is selected, thus avoiding omissions and errors. This ensures the accuracy and reliability of the final path mapping metadata.

[0072] In some optional embodiments, before the step "calculating the rule matching degree corresponding to each path mapping rule based on the number of successful path matching results in the path matching results under each path mapping rule and the number of results of path matching results under each path mapping rule", the resource dependency resolution method provided in this embodiment of the invention may further include:

[0073] Determine the second association between the location identifier of each field value and the field value.

[0074] The location identifier can be the file path of the file containing the field value, the file path of the file containing the field value, or the specific line number of the field value in the file, etc.

[0075] For example, when generating path mapping metadata for a certain file type, you can read the content of all files of that type and merge nodes with the same nesting relationship. For example, for XML nodes, this means merging nodes with the same XPath. The data structure of the merged node is a two-level dictionary (e.g., ...). Figure 3 As shown in the Node Details): The key of the first-level dictionary is all possible fields of the merged node; the key of the second-level dictionary is all possible values ​​of the corresponding field, and the value is a list of strings, with the string representing the position representing all files where the value appears.

[0076] To avoid an excessive number of values ​​for a certain field appearing in the same file, which could significantly impact the rule matching score, the rule matching score can be calculated in conjunction with the position identifier in the second association relationship. The step "Calculate the rule matching score corresponding to each path mapping rule based on the number of successful path matching results in the path matching results under each path mapping rule, and the number of path matching results under each path mapping rule" can specifically include:

[0077] Based on the number of successful path matching results in the path matching results under each path mapping rule, and the number of position identifiers of the field values ​​corresponding to each successful path matching result in the second association, calculate the number of successful path matching results for each path mapping rule.

[0078] Calculate the rule matching degree corresponding to each path mapping rule based on the number of successful path matching results and the number of path matching results under each path mapping rule.

[0079] In some examples, the number of successful path matches can be calculated by merging the number of mergeable location identifiers. For instance, if a field value 'a' appears 10 times in file 1 and 1 time in file 2, and field value 'a' is a successful match, then the number of successful matches for field value 'a' is 11. The location identifier corresponding to field value 'a' is the mergeable location identifier, and after merging the number of successful matches, the number of successful path matches could be 2.

[0080] Optionally, the number of successful merges can be further merged when the number of mergeable location identifiers exceeds a preset threshold, and so on.

[0081] In some optional embodiments, the location identifier may also include a file identifier of the target reference resource file where the field value is located, such as the file name, etc.

[0082] It is understandable that when too many field values ​​lead to excessively long inference times, a smaller number of values ​​can be selected for inference based on the law of large numbers to improve inference speed. In other words, before the step "Based on at least one preset path mapping rule, for each field, perform path mapping on the field values ​​corresponding to the fields in the first association relationship to obtain the dependent resource file paths corresponding to the field values ​​under each path mapping rule," the resource dependency parsing method provided in this embodiment of the invention may further include:

[0083] When the number of field values ​​corresponding to a field in the first association is greater than the preset mapping threshold, several target field values ​​are selected from the field values, and the number of target field values ​​meets the preset field value selection conditions.

[0084] Specifically, the field value selection criteria can be random selection, interval selection, and so on.

[0085] Accordingly, the step "based on at least one preset path mapping rule, for each field, perform path mapping on the field values ​​corresponding to the fields in the first association relationship to obtain the dependent resource file paths corresponding to the field values ​​under each path mapping rule" includes:

[0086] Based on at least one preset path mapping rule, for each field, the path mapping is performed on the target field value corresponding to the field in the first association relationship to obtain the dependent resource file path corresponding to the target field value under each path mapping rule.

[0087] In some optional embodiments, after reasoning, the reasoning results can be manually verified and corrected in case the rule base is incomplete or misjudged.

[0088] 205. Based on each field and the target path mapping rules corresponding to each field, generate path mapping metadata corresponding to the target file type.

[0089] Path mapping metadata describes the correspondence between fields and target path mapping rules. By parsing the path mapping metadata, the paths that a resource file depends on can be obtained. For example, path mapping metadata can be in the form of a Meta file, which may contain descriptive information about a file type structure and indicate the meaning of each text field or byte stream segment in the resource file.

[0090] With the target path mapping rules corresponding to each field, path mapping metadata of any form can be generated. As in the previous example, the path mapping metadata output for the "Name" field could include:

[0091] KeyType: ResourceDependency (resource dependency);

[0092] PathType: REL_FILE (files in a relative path);

[0093] ParserRule: DOUBLE_COLON (the part before the double colon is the dependency).

[0094] Here, KeyType indicates whether the field has resource dependencies. For example, if the value of KeyType is ResrouceDependency, it means that the field has resource dependencies. If the value of KeyType is other than that, it means that the field does not have resource dependencies.

[0095] Here, PathType indicates the type of the mapped path. For example, if the value of PathType is REL_FILE, it means that the dependent resource file is a file under a relative path, that is, the path obtained when mapping is in the form of a relative path. If the value of PathType is other than that, it can indicate that the path mapped by this field is in the form of an absolute path, etc.

[0096] Here, `ParserRule` represents the target path mapping rule corresponding to the field. For example, if the value of `ParserRule` is `DOUBLE_COLON`, it means that the characters before the double colons in the field value are dependencies, that is, when performing path mapping, the characters before the double colons in the field value are used as the path. If the value of `ParserRule` is other, it can represent other target path mapping rules, etc.

[0097] In this embodiment of the invention, the validity of the reasoning result can be manually verified. If the result is considered to be biased, the annotation is modified. That is, before the step "generating path mapping metadata corresponding to the target file type based on each target path mapping rule", the resource dependency resolution method provided in this embodiment of the invention may further include:

[0098] The target path mapping rules corresponding to each field and the first association relationship are sent to the manual confirmation module so that the rule confirmers can confirm the target path mapping rules corresponding to each field in the first association relationship through the manual confirmation module.

[0099] Optionally, to facilitate the identification of rule confirmers, before the step "sending each field and the target path mapping rule corresponding to each field to the manual confirmation module", the resource dependency resolution method provided in this embodiment of the invention may further include:

[0100] Determine the second association between the location identifier of each field value and the field value;

[0101] Accordingly, the step "sending the target path mapping rules corresponding to each field and the first association relationship to the manual confirmation module, so that the rule confirmers can confirm the target path mapping rules corresponding to each field in the first association relationship through the manual confirmation module" can specifically include:

[0102] The target path mapping rules, first association, and second association corresponding to each field are sent to the manual confirmation module so that the rule confirmers can find the field values ​​in the manual confirmation module based on the location identifier in the second association, and confirm the target path mapping rules corresponding to each field in the first association based on the field values.

[0103] For example, the manual confirmation module can locate the field value based on the location identifier in the second relationship, thereby improving the efficiency of manual confirmation.

[0104] Understandably, the manual verification process can serve as a safety net in generating path mapping metadata, allowing for the correction of path mapping metadata and improving its accuracy and reliability.

[0105] In practical applications, the process of resource dependency resolution is as follows: a resource file is input, a general-purpose parser program parses the file content, and outputs the resource paths it depends on based on path mapping metadata. For different resources, there is usually a corresponding path mapping metadata (such as a meta file) to assist the parser program in its work.

[0106] Specifically, a meta file describes the structure of a resource file, helping the parser better "understand" the file content; if the meta file is complete, the information output by the parser will also be complete. The main goal of resource dependency resolution is to find all dependencies, and if there are any problems with resource dependencies, they should also be exposed.

[0107] Therefore, in some optional embodiments, resource dependency resolution can be performed based on path mapping metadata. The resource dependency resolution method provided in this embodiment of the invention may further include:

[0108] Obtain the resource files to be analyzed in the project to be analyzed. Based on the file type of the resource files to be analyzed, obtain the path mapping metadata corresponding to the file type to be analyzed from several different file types of path mapping metadata.

[0109] Parse the resource file to be analyzed to determine the fields to be analyzed contained in the resource file and the corresponding values ​​of each field.

[0110] Based on the fields to be analyzed, determine the target path mapping rules corresponding to each field from the path mapping metadata;

[0111] For the fields to be analyzed corresponding to the target path mapping rules, the path mapping is performed on the values ​​of the fields to be analyzed to obtain the paths of the dependent resource files corresponding to each value of the field to be analyzed.

[0112] It should be noted that the resource files to be analyzed can come from any project, and are not necessarily from the reference project in the embodiments of this invention. In other words, the path mapping metadata obtained by the embodiments of this invention can actually be applied to any project and has universality.

[0113] For example, when parsing the dependent resource file path of a resource file based on the path mapping metadata, you can first traverse each node of the resource file and the fields of each node (i.e., obtain the fields to be analyzed); then, based on the path mapping metadata (such as the Meta file), the nodes and fields in the traversed resource file, and the nodes and fields stored in the Meta file, determine the path mapping rules corresponding to each field in the resource file.

[0114] If a path mapping rule is found, and the mapping rule maps resource paths, then the field value can be converted into a resource path according to the mapping rule, and the resource path can be added to the dependency list of the file. The final dependency list is the final resource dependency result, that is, the dependent resource file path.

[0115] As can be seen from the above, the embodiments of the present invention can obtain the target reference resource file under the target file type to be analyzed in the reference resource file of the reference project, parse the node nesting relationship in the target reference resource file, take the nodes with the same node nesting relationship in the target reference resource file as the same analysis node, determine the first association relationship between each field and field value under the same analysis node, and determine the target path mapping rule corresponding to each field in the first association relationship based on at least one preset path mapping rule and the field value in the first association relationship. The path mapping rule is used to map the field value into the form of a path. Based on each field and the target path mapping rule corresponding to each field, path mapping meta-information corresponding to the target file type is generated. Since the embodiments of the present invention determine the association relationship between each field and field value under the node for the nodes with various node nesting relationships in the target reference resource file, and map each field value in the first association relationship when determining the target path mapping rule, omissions can be avoided. In addition, mapping each field value through the path mapping rule can avoid erroneously taking some field values ​​as path information. Therefore, the embodiments of the present invention can comprehensively and accurately analyze the dependency relationship between each resource file in the software engineering project, improving the efficiency and accuracy of resource dependency analysis.

[0116] Based on the methods described in the preceding embodiments, the following examples will provide further detailed explanations.

[0117] In this embodiment, the combination Figure 1 The system will be explained.

[0118] like Figure 4 As shown in this embodiment, the method for generating metadata for resource dependency resolution can be described in the following steps:

[0119] 401. Obtain the target reference resource file under the target file type in the reference resource file of the reference project.

[0120] In this embodiment of the invention, an RrMiMG (Rule-Reasoning & Manual-Intervention Meta Generator) can be set up. RrMiMG has a rule base to determine whether the value of a certain field is a path, and regards the entire resource base as a database and uses it for rule reasoning.

[0121] 402. Analyze the node nesting relationship in the target reference resource file, and treat nodes with the same node nesting relationship in the target reference resource file as the same analysis node.

[0122] The nodes in the target reference resource file can contain several fields, and nesting between nodes is allowed. For example, for XML file format, a tag can be regarded as a node; for JSON file format, a dictionary with features defined by custom rules can be regarded as a node.

[0123] 403. Determine the first association between each field and field value under the same analysis node, and determine the second association between the location identifier of each field value and the field value.

[0124] When generating a meta file of a specific file type, we read the content of all files of that type and merge nodes at the same location. For example, for XML nodes, we merge nodes with the same XPath. The merged node data structure is a two-level dictionary (e.g., ...). Figure 3 (As shown in Node Details); the key of the first-level dictionary is all possible fields of the node; the key of the second-level dictionary is all possible values ​​of the corresponding field, and the value is a list of strings representing all files that contain that value.

[0125] 404. Based on at least one preset path mapping rule, for each field, perform path mapping on the field value corresponding to the field in the first association relationship to obtain the dependent resource file path corresponding to the field value under each path mapping rule.

[0126] The rule base is used to infer the meaning of fields. Inference rules are rules... Reconstruct a string for Query whether the resource exists in the repository If it exists, then the field (key) will be adapted. The count increases.

[0127] 405. Match the dependent resource file paths with the candidate dependent resource file paths in the preset set of candidate dependent resource file paths to obtain the path matching results corresponding to each dependent resource file path under each path mapping rule.

[0128] Then, the rules are sorted according to custom weights. Rules with the highest weight and a percentage greater than the threshold are considered suitable for that field. When too many values ​​lead to excessive inference time, a smaller number of values ​​can be selected for inference based on the law of large numbers. The inference results are then manually verified and corrected to account for incomplete rules in the rule base and potential misjudgments.

[0129] 406. Based on the number of successful path matching results in the path matching results under each path mapping rule, and the number of results in the path matching results under each path mapping rule, calculate the rule matching degree corresponding to each path mapping rule.

[0130] For example, you can set the rule matching threshold to 0.3, and the values ​​that appear in the field "Name" are: “bear.mtg::Physics” appears 8 times. "monky.mtg:: Physics" appears 3 times. The word "bird" appears twice. (Path mapping rules) Matched and This is a resource reference, with a count of 11; path mapping rules. Matched For resource references, the count is 2; if other rules fail to match, then due to... The count percentage is the highest and exceeds the preset threshold, so it is inferred that this field is compatible with R1, and R1 is used as the target path mapping rule.

[0131] 407. The path mapping rules corresponding to the matching degree of the rules that meet the preset rule matching conditions shall be used as the target path mapping rules for each field in the first association relationship.

[0132] 408. Based on the path mapping rules of each target, generate path mapping metadata corresponding to the target file type.

[0133] With the configuration for each field, we can generate meta files of any format. In the example above, the final output information for the "Name" field includes:

[0134] KeyType: ResourceDependency

[0135] PathType: REL_FILE (files in a relative path)

[0136] ParserRule: DOUBLE_COLON (the part before the double colon is the dependency).

[0137] After obtaining the path mapping metadata, resource dependencies of each file in any project can be parsed based on the path mapping metadata, and the resource dependency relationship network corresponding to the project can be obtained.

[0138] As can be seen from the above, the embodiments of the present invention can obtain the target reference resource file under the target file type to be analyzed in the reference resource file of the reference project, parse the node nesting relationship in the target reference resource file, take the nodes with the same node nesting relationship in the target reference resource file as the same analysis node, determine the first association relationship between each field and field value under the same analysis node, and determine the target path mapping rule corresponding to each field in the first association relationship based on at least one preset path mapping rule and the field value in the first association relationship. The path mapping rule is used to map the field value into the form of a path. Based on each field and the target path mapping rule corresponding to each field, path mapping meta-information corresponding to the target file type is generated. Since the embodiments of the present invention determine the association relationship between each field and field value under the node for the nodes with various node nesting relationships in the target reference resource file, and map each field value in the first association relationship when determining the target path mapping rule, omissions can be avoided. In addition, mapping each field value through the path mapping rule can avoid erroneously taking some field values ​​as path information. Therefore, the embodiments of the present invention can comprehensively and accurately analyze the dependency relationship between each resource file in the software engineering project, improving the efficiency and accuracy of resource dependency analysis.

[0139] To better implement the above methods, this embodiment of the invention also provides a metadata generation device for resource dependency resolution.

[0140] refer to Figure 5 The device may include:

[0141] The file acquisition unit 501 can be used to acquire the target reference resource file of the target file type in the reference resource file of the reference project;

[0142] The file parsing unit 502 can be used to parse the node nesting relationship in the target reference resource file and treat nodes with the same node nesting relationship in the target reference resource file as the same analysis node.

[0143] The relationship determination unit 503 can be used to determine the first association relationship between each field and field value under the same analysis node;

[0144] The rule determination unit 504 can be used to determine the target path mapping rule corresponding to each field in the first association relationship based on at least one preset path mapping rule and the field values ​​in the first association relationship. The path mapping rule can be used to map the field values ​​into the form of a path.

[0145] The information generation unit 505 can be used to generate path mapping metadata corresponding to the target file type based on each field and the target path mapping rules corresponding to each field.

[0146] In some optional embodiments, the rule determination unit 504 can be used to perform path mapping on the field values ​​corresponding to the fields in the first association relationship for each field based on at least one preset path mapping rule, so as to obtain the dependent resource file paths corresponding to the field values ​​under each path mapping rule.

[0147] The dependent resource file paths are matched with the candidate dependent resource file paths in the preset set of candidate dependent resource file paths to obtain the path matching results corresponding to each dependent resource file path under each path mapping rule.

[0148] Based on the path matching results, determine the target path mapping rules corresponding to each field in the first association relationship.

[0149] In some optional embodiments, the path matching result may include the path matching success result. The rule determination unit 504 can be used to calculate the rule matching degree corresponding to each path mapping rule based on the number of successful path matching results in the path matching results under each path mapping rule and the number of results of the path matching results under each path mapping rule.

[0150] The path mapping rules corresponding to the matching degree of the rules that meet the preset rule matching conditions will be used as the target path mapping rules for each field in the first association relationship.

[0151] In some optional embodiments, the metadata generation device for resource dependency resolution provided in this embodiment of the invention may further include a second relation determination unit 506, which can be used to determine a second association relationship between the location identifier of each field value and the field value.

[0152] The rule determination unit 504 can be used to calculate the number of successful path matching results for each path mapping rule based on the number of successful path matching results in the path matching results under each path mapping rule and the number of position identifiers of the field values ​​corresponding to each successful path matching result in the second association relationship.

[0153] Calculate the rule matching degree corresponding to each path mapping rule based on the number of successful path matching results and the number of path matching results under each path mapping rule.

[0154] In some optional embodiments, the rule determination unit 504 can be used to select several target field values ​​from the field values ​​when the number of field values ​​corresponding to the fields in the first association relationship is greater than a preset mapping threshold, and the number of target field values ​​satisfies the preset field value selection condition.

[0155] Based on at least one preset path mapping rule, for each field, the path mapping is performed on the target field value corresponding to the field in the first association relationship to obtain the dependent resource file path corresponding to the target field value under each path mapping rule.

[0156] In some optional embodiments, the metadata generation device for resource dependency resolution provided in this embodiment of the invention may further include a manual confirmation unit 507, which can be used to send the target path mapping rules corresponding to each field and the first association relationship to the manual confirmation module, so that the rule confirmation personnel can confirm the target path mapping rules corresponding to each field in the first association relationship through the manual confirmation module.

[0157] In some optional embodiments, the metadata generation device for resource dependency resolution provided in this embodiment of the invention may further include a second relation determination unit 506, which can be used to determine a second association relationship between the location identifier of each field value and the field value.

[0158] The manual confirmation unit 507 can be used to send the target path mapping rules, the first association relationship, and the second association relationship corresponding to each field to the manual confirmation module.

[0159] In some alternative embodiments, such as Figure 6 As shown, the metadata generation device for resource dependency parsing provided in this embodiment of the invention may further include a dependency parsing unit 508, which can be used to obtain the resource file to be analyzed in the project to be analyzed, and obtain the path mapping metadata corresponding to the file type to be analyzed from a number of different file types of path mapping metadata according to the file type to be analyzed of the resource file to be analyzed.

[0160] Parse the resource file to be analyzed to determine the fields to be analyzed contained in the resource file and the corresponding values ​​of each field.

[0161] Based on the fields to be analyzed, determine the target path mapping rules corresponding to each field from the path mapping metadata;

[0162] For the fields to be analyzed corresponding to the target path mapping rules, the path mapping is performed on the values ​​of the fields to be analyzed to obtain the paths of the dependent resource files corresponding to each value of the field to be analyzed.

[0163] As can be seen from the above, the metadata generation device used for resource dependency resolution can obtain the target reference resource file under the target file type to be analyzed in the reference resource file of the reference project, parse the node nesting relationship in the target reference resource file, take the nodes with the same node nesting relationship as the same analysis node, determine the first association relationship between each field and field value under the same analysis node, and determine the target path mapping rule corresponding to each field in the first association relationship based on at least one preset path mapping rule and the field value in the first association relationship. The path mapping rule is used to map the field value into the form of a path, based on each field and the corresponding path value. The target path mapping rules generate path mapping metadata corresponding to the target file type. In this embodiment of the invention, for nodes with various nested relationships in the target reference resource file, the association between each field and its value under each node is determined. When determining the target path mapping rules, the field values ​​in the first association relationship are mapped, thus avoiding omissions. Furthermore, mapping each field value through path mapping rules avoids incorrectly using certain field values ​​as path information. Therefore, this embodiment of the invention can comprehensively and accurately analyze the dependencies between various resource files in a software engineering project, improving the efficiency and accuracy of resource dependency analysis.

[0164] Furthermore, correspondingly, embodiments of this application also provide a computer device, which can be a terminal. For example... Figure 7 As shown, Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device 700 includes a processor 701 with one or more processing cores, a memory 702 with one or more computer-readable storage media, and a computer program stored on the memory 702 and executable on the processor. The processor 701 and the memory 702 are electrically connected. Those skilled in the art will understand that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0165] The processor 701 is the control center of the computer device 700. It connects various parts of the computer device 700 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 702, and calling data stored in the memory 702, it performs various functions of the computer device 700 and processes data, thereby monitoring the computer device 700 as a whole.

[0166] In this embodiment, the processor 701 in the computer device 700 loads the instructions corresponding to the processes of one or more applications into the memory 702 according to the following steps, and the processor 701 runs the applications stored in the memory 702 to achieve various functions:

[0167] Retrieve the target reference resource file under the target file type from the reference resource files of the reference project;

[0168] Analyze the node nesting relationship in the target reference resource file, and treat nodes with the same node nesting relationship in the target reference resource file as the same analysis node;

[0169] Determine the primary association between each field and its values ​​within the same analysis node;

[0170] Based on at least one preset path mapping rule and the field values ​​in the first association, the target path mapping rule corresponding to each field in the first association is determined. The path mapping rule is used to map the field values ​​into the form of a path.

[0171] Based on each field and the target path mapping rules corresponding to each field, path mapping metadata corresponding to the target file type is generated.

[0172] In some optional embodiments, determining the target path mapping rule corresponding to each field in the first association relationship based on at least one preset path mapping rule and field values ​​in the first association relationship may include:

[0173] Based on at least one preset path mapping rule, for each field, the path mapping is performed on the field value corresponding to the field in the first association relationship to obtain the dependent resource file path corresponding to the field value under each path mapping rule;

[0174] The dependent resource file paths are matched with the candidate dependent resource file paths in the preset set of candidate dependent resource file paths to obtain the path matching results corresponding to each dependent resource file path under each path mapping rule.

[0175] Based on the path matching results, determine the target path mapping rules corresponding to each field in the first association relationship.

[0176] In some optional embodiments, the path matching result may include a successful path matching result. Based on the path matching result, determining the target path mapping rule corresponding to each field in the first association relationship may include:

[0177] Based on the number of successful path matching results in the path matching results under each path mapping rule, and the number of path matching results under each path mapping rule, calculate the rule matching degree corresponding to each path mapping rule.

[0178] The path mapping rules corresponding to the matching degree of the rules that meet the preset rule matching conditions will be used as the target path mapping rules for each field in the first association relationship.

[0179] In some optional embodiments, before calculating the rule matching degree corresponding to each path mapping rule based on the number of successful path matching results in the path matching results under each path mapping rule and the number of results of path matching under each path mapping rule, the metadata generation method for resource dependency resolution provided in this embodiment of the invention may further include:

[0180] Determine the second association between the location identifier of each field value and the field value;

[0181] Based on the number of successful path matches in the path matching results under each path mapping rule, and the number of path matching results under each path mapping rule, the rule matching degree corresponding to each path mapping rule is calculated, which may include:

[0182] Based on the number of successful path matching results in the path matching results under each path mapping rule, and the number of position identifiers of the field values ​​corresponding to each successful path matching result in the second association, calculate the number of successful path matching results for each path mapping rule.

[0183] Calculate the rule matching degree corresponding to each path mapping rule based on the number of successful path matching results and the number of path matching results under each path mapping rule.

[0184] In some optional embodiments, before performing path mapping on the field values ​​corresponding to the fields in the first association relationship for each field based on at least one preset path mapping rule to obtain the dependent resource file paths corresponding to the field values ​​under each path mapping rule, the metadata generation method for resource dependency resolution provided in this embodiment of the invention may further include:

[0185] When the number of field values ​​corresponding to a field in the first association is greater than the preset mapping threshold, several target field values ​​are selected from the field values, and the number of target field values ​​meets the preset field value selection conditions.

[0186] Based on at least one preset path mapping rule, for each field, the field value corresponding to the field in the first association relationship is mapped to a path to obtain the dependent resource file path corresponding to the field value under each path mapping rule, which may include:

[0187] Based on at least one preset path mapping rule, for each field, the path mapping is performed on the target field value corresponding to the field in the first association relationship to obtain the dependent resource file path corresponding to the target field value under each path mapping rule.

[0188] In some optional embodiments, before generating path mapping metadata corresponding to the target file type based on each target path mapping rule, the metadata generation method for resource dependency resolution provided in this embodiment of the invention may further include:

[0189] The target path mapping rules corresponding to each field and the first association relationship are sent to the manual confirmation module so that the rule confirmers can confirm the target path mapping rules corresponding to each field in the first association relationship through the manual confirmation module.

[0190] In some optional embodiments, before sending each field and the target path mapping rule corresponding to each field to the manual confirmation module, the metadata generation method for resource dependency resolution provided in this embodiment of the invention may further include:

[0191] Determine the second association between the location identifier of each field value and the field value;

[0192] Sending the target path mapping rules and the first association relationship corresponding to each field to the manual confirmation module may include:

[0193] Send the target path mapping rules, first association, and second association corresponding to each field to the manual confirmation module.

[0194] In some optional embodiments, the metadata generation method for resource dependency resolution provided in this invention may further include:

[0195] Obtain the resource files to be analyzed in the project to be analyzed. Based on the file type of the resource files to be analyzed, obtain the path mapping metadata corresponding to the file type to be analyzed from several different file types of path mapping metadata.

[0196] Parse the resource file to be analyzed to determine the fields to be analyzed contained in the resource file and the corresponding values ​​of each field.

[0197] Based on the fields to be analyzed, determine the target path mapping rules corresponding to each field from the path mapping metadata;

[0198] For the fields to be analyzed corresponding to the target path mapping rules, the path mapping is performed on the values ​​of the fields to be analyzed to obtain the paths of the dependent resource files corresponding to each value of the field to be analyzed.

[0199] This solution can obtain target reference resource files of the target file type to be analyzed from the reference resource files of the reference project, parse the node nesting relationship in the target reference resource files, take nodes with the same node nesting relationship as the same analysis node, determine the first association relationship between each field and field value under the same analysis node, and determine the target path mapping rule corresponding to each field in the first association relationship based on at least one preset path mapping rule and the field value in the first association relationship. The path mapping rule is used to map the field value to the form of a path. Based on each field and the target path mapping rule corresponding to each field, path mapping meta-information corresponding to the target file type is generated. Since in this embodiment of the invention, the association relationship between each field and field value under the node is determined for nodes with various node nesting relationships in the target reference resource files, and the field values ​​in the first association relationship are mapped when determining the target path mapping rule, omissions can be avoided. In addition, mapping each field value through the path mapping rule can avoid erroneously taking some field values ​​as path information. Therefore, through this embodiment of the invention, the dependency relationship between each resource file in the software engineering project can be analyzed comprehensively and accurately, improving the efficiency and accuracy of resource dependency analysis.

[0200] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0201] Optional, such as Figure 7 As shown, the computer device 700 also includes: a touch screen display 703, a radio frequency circuit 704, an audio circuit 705, an input unit 706, and a power supply 707. The processor 701 is electrically connected to the touch screen display 703, the radio frequency circuit 704, the audio circuit 705, the input unit 706, and the power supply 707. Those skilled in the art will understand that... Figure 7 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0202] The touch display screen 703 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 703 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the computer device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 701. It can also receive and execute commands from the processor 701. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 701 to determine the type of touch event. Subsequently, the processor 701 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the touch display screen 703 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 703 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 703 can also be used as part of the input unit 706 to achieve input functions.

[0203] The radio frequency circuit 704 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other computer devices, and to transmit and receive signals with network devices or other computer devices.

[0204] Audio circuitry 705 can be used to provide an audio interface between a user and a computer device via a speaker and a microphone. Audio circuitry 705 converts received audio data into electrical signals, transmits them to the speaker, and the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 705, converted back into audio data, and then processed by processor 701 before being transmitted via radio frequency circuitry 704 to, for example, another computer device, or output to memory 702 for further processing. Audio circuitry 705 may also include an earphone jack to facilitate communication between peripheral headphones and the computer device.

[0205] The input unit 706 can be used to receive input numbers, characters, or user characteristic information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.

[0206] Power supply 707 is used to supply power to various components of computer device 700. Optionally, power supply 707 can be logically connected to processor 701 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 707 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0207] although Figure 7 As not shown in the diagram, the computer device 700 may also include a camera, sensors, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0208] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0209] As can be seen from the above, the computer device provided in this embodiment can obtain the target reference resource file under the target file type to be analyzed in the reference resource file of the reference project, parse the node nesting relationship in the target reference resource file, take the nodes with the same node nesting relationship in the target reference resource file as the same analysis node, determine the first association relationship between each field and field value under the same analysis node, and determine the target path mapping rule corresponding to each field in the first association relationship based on at least one preset path mapping rule and the field value in the first association relationship. The path mapping rule is used to map the field value into the form of a path. Based on each field and the target path mapping rule corresponding to each field, path mapping meta-information corresponding to the target file type is generated. Since in this embodiment of the invention, the association relationship between each field and field value under the node is determined for the nodes of various node nesting relationships in the target reference resource file, and the field values ​​in the first association relationship are mapped when determining the target path mapping rule, omissions can be avoided. In addition, mapping each field value through the path mapping rule can avoid erroneously taking some field values ​​as path information. Therefore, through this embodiment of the invention, the dependency relationship between each resource file in the software engineering project can be analyzed comprehensively and accurately, improving the efficiency and accuracy of resource dependency analysis.

[0210] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0211] Therefore, embodiments of this application provide a computer-readable storage medium storing multiple computer programs that can be loaded by a processor to execute steps in any of the metadata generation methods for resource dependency resolution provided in embodiments of this application. For example, the computer program can execute the following steps:

[0212] Retrieve the target reference resource file under the target file type from the reference resource files of the reference project;

[0213] Analyze the node nesting relationship in the target reference resource file, and treat nodes with the same node nesting relationship in the target reference resource file as the same analysis node;

[0214] Determine the primary association between each field and its values ​​within the same analysis node;

[0215] Based on at least one preset path mapping rule and the field values ​​in the first association, the target path mapping rule corresponding to each field in the first association is determined. The path mapping rule is used to map the field values ​​into the form of a path.

[0216] Based on each field and the target path mapping rules corresponding to each field, path mapping metadata corresponding to the target file type is generated.

[0217] In some optional embodiments, determining the target path mapping rule corresponding to each field in the first association relationship based on at least one preset path mapping rule and field values ​​in the first association relationship may include:

[0218] Based on at least one preset path mapping rule, for each field, the path mapping is performed on the field value corresponding to the field in the first association relationship to obtain the dependent resource file path corresponding to the field value under each path mapping rule;

[0219] The dependent resource file paths are matched with the candidate dependent resource file paths in the preset set of candidate dependent resource file paths to obtain the path matching results corresponding to each dependent resource file path under each path mapping rule.

[0220] Based on the path matching results, determine the target path mapping rules corresponding to each field in the first association relationship.

[0221] In some optional embodiments, the path matching result may include a successful path matching result. Based on the path matching result, determining the target path mapping rule corresponding to each field in the first association relationship may include:

[0222] Based on the number of successful path matching results in the path matching results under each path mapping rule, and the number of path matching results under each path mapping rule, calculate the rule matching degree corresponding to each path mapping rule.

[0223] The path mapping rules corresponding to the matching degree of the rules that meet the preset rule matching conditions will be used as the target path mapping rules for each field in the first association relationship.

[0224] In some optional embodiments, before calculating the rule matching degree corresponding to each path mapping rule based on the number of successful path matching results in the path matching results under each path mapping rule and the number of results of path matching under each path mapping rule, the metadata generation method for resource dependency resolution provided in this embodiment of the invention may further include:

[0225] Determine the second association between the location identifier of each field value and the field value;

[0226] Based on the number of successful path matches in the path matching results under each path mapping rule, and the number of path matching results under each path mapping rule, the rule matching degree corresponding to each path mapping rule is calculated, which may include:

[0227] Based on the number of successful path matching results in the path matching results under each path mapping rule, and the number of position identifiers of the field values ​​corresponding to each successful path matching result in the second association, calculate the number of successful path matching results for each path mapping rule.

[0228] Calculate the rule matching degree corresponding to each path mapping rule based on the number of successful path matching results and the number of path matching results under each path mapping rule.

[0229] In some optional embodiments, before performing path mapping on the field values ​​corresponding to the fields in the first association relationship for each field based on at least one preset path mapping rule to obtain the dependent resource file paths corresponding to the field values ​​under each path mapping rule, the metadata generation method for resource dependency resolution provided in this embodiment of the invention may further include:

[0230] When the number of field values ​​corresponding to a field in the first association is greater than the preset mapping threshold, several target field values ​​are selected from the field values, and the number of target field values ​​meets the preset field value selection conditions.

[0231] Based on at least one preset path mapping rule, for each field, the field value corresponding to the field in the first association relationship is mapped to a path to obtain the dependent resource file path corresponding to the field value under each path mapping rule, which may include:

[0232] Based on at least one preset path mapping rule, for each field, the path mapping is performed on the target field value corresponding to the field in the first association relationship to obtain the dependent resource file path corresponding to the target field value under each path mapping rule.

[0233] In some optional embodiments, before generating path mapping metadata corresponding to the target file type based on each target path mapping rule, the metadata generation method for resource dependency resolution provided in this embodiment of the invention may further include:

[0234] The target path mapping rules corresponding to each field and the first association relationship are sent to the manual confirmation module so that the rule confirmers can confirm the target path mapping rules corresponding to each field in the first association relationship through the manual confirmation module.

[0235] In some optional embodiments, before sending each field and the target path mapping rule corresponding to each field to the manual confirmation module, the metadata generation method for resource dependency resolution provided in this embodiment of the invention may further include:

[0236] Determine the second association between the location identifier of each field value and the field value;

[0237] Sending the target path mapping rules and the first association relationship corresponding to each field to the manual confirmation module may include:

[0238] Send the target path mapping rules, first association, and second association corresponding to each field to the manual confirmation module.

[0239] In some optional embodiments, the metadata generation method for resource dependency resolution provided in this invention may further include:

[0240] Obtain the resource files to be analyzed in the project to be analyzed. Based on the file type of the resource files to be analyzed, obtain the path mapping metadata corresponding to the file type to be analyzed from several different file types of path mapping metadata.

[0241] Parse the resource file to be analyzed to determine the fields to be analyzed contained in the resource file and the corresponding values ​​of each field.

[0242] Based on the fields to be analyzed, determine the target path mapping rules corresponding to each field from the path mapping metadata;

[0243] For the fields to be analyzed corresponding to the target path mapping rules, the path mapping is performed on the values ​​of the fields to be analyzed to obtain the paths of the dependent resource files corresponding to each value of the field to be analyzed.

[0244] This solution can obtain target reference resource files of the target file type to be analyzed from the reference resource files of the reference project, parse the node nesting relationship in the target reference resource files, take nodes with the same node nesting relationship as the same analysis node, determine the first association relationship between each field and field value under the same analysis node, and determine the target path mapping rule corresponding to each field in the first association relationship based on at least one preset path mapping rule and the field value in the first association relationship. The path mapping rule is used to map the field value to the form of a path. Based on each field and the target path mapping rule corresponding to each field, path mapping meta-information corresponding to the target file type is generated. Since in this embodiment of the invention, the association relationship between each field and field value under the node is determined for nodes with various node nesting relationships in the target reference resource files, and the field values ​​in the first association relationship are mapped when determining the target path mapping rule, omissions can be avoided. In addition, mapping each field value through the path mapping rule can avoid erroneously taking some field values ​​as path information. Therefore, through this embodiment of the invention, the dependency relationship between each resource file in the software engineering project can be analyzed comprehensively and accurately, improving the efficiency and accuracy of resource dependency analysis.

[0245] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0246] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0247] Since the computer program stored in the storage medium can execute the steps in any of the metadata generation methods for resource dependency resolution provided in the embodiments of this application, the beneficial effects that any of the metadata generation methods for resource dependency resolution provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.

[0248] The foregoing has provided a detailed description of the method, apparatus, and storage medium for generating metadata for resource dependency resolution provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for generating metadata for resource dependency resolution, characterized in that, include: Retrieve the target reference resource file under the target file type from the reference resource files of the reference project; Analyze the node nesting relationship in the target reference resource file, and treat nodes with the same node nesting relationship in the target reference resource file as the same analysis node; Determine the first association relationship between each field and field value under the same analysis node; Based on at least one preset path mapping rule and the field values ​​in the first association relationship, a target path mapping rule corresponding to each field in the first association relationship is determined, wherein the path mapping rule is used to map the field values ​​into the form of a path; Based on each of the fields and the target path mapping rules corresponding to each of the fields, path mapping metadata corresponding to the target file type is generated; The step of determining the target path mapping rule corresponding to each field in the first association relationship based on at least one preset path mapping rule and the field values ​​in the first association relationship includes: Based on at least one preset path mapping rule, for each of the fields, the field values ​​corresponding to the fields in the first association relationship are mapped to paths to obtain the dependent resource file paths corresponding to the field values ​​under each path mapping rule; The dependent resource file path is matched with the candidate dependent resource file path in the preset set of candidate dependent resource file paths to obtain the path matching result corresponding to each dependent resource file path under each path mapping rule; Based on the path matching results, the target path mapping rules corresponding to each field in the first association relationship are determined.

2. The method for generating metadata for resource dependency resolution according to claim 1, characterized in that, The path matching result includes a successful path matching result. Based on the path matching result, determining the target path mapping rule corresponding to each field in the first association relationship includes: Based on the number of successful path matching results in the path matching results under each path mapping rule, and the number of results of the path matching results under each path mapping rule, calculate the rule matching degree corresponding to each path mapping rule; The path mapping rule corresponding to the rule matching degree that satisfies the preset rule matching conditions is used as the target path mapping rule corresponding to each field in the first association relationship.

3. The method for generating metadata for resource dependency resolution according to claim 2, characterized in that, Before calculating the rule matching degree corresponding to each path mapping rule based on the number of successful path matching results in the path matching results under each path mapping rule and the number of results of path matching results under each path mapping rule, the method further includes: Determine a second association between the location identifier of each field value and the field value; The calculation of the rule matching degree corresponding to each path mapping rule, based on the number of successful path matching results in the path matching results under each path mapping rule and the number of results in the path matching results under each path mapping rule, includes: Based on the number of successful path matching results in the path matching results under each path mapping rule, and the number of position identifiers of the field values ​​corresponding to each successful path matching result in the second association relationship, calculate the number of successful path matching results corresponding to each path mapping rule; Based on the number of successful path matchings and the number of path matching results under each path mapping rule, the rule matching degree corresponding to each path mapping rule is calculated.

4. The method for generating metadata for resource dependency resolution according to claim 1, characterized in that, Before performing path mapping on the field values ​​corresponding to the fields in the first association relationship for each of the fields based on at least one preset path mapping rule to obtain the dependent resource file paths corresponding to the field values ​​under each path mapping rule, the method further includes: When the number of field values ​​corresponding to the field in the first association relationship is greater than a preset mapping threshold, several target field values ​​are selected from the field values, and the number of target field values ​​satisfies the preset field value selection condition; The method, based on at least one preset path mapping rule, performs path mapping on the field values ​​corresponding to the fields in the first association relationship for each of the aforementioned fields, to obtain the dependent resource file paths corresponding to the field values ​​under each of the aforementioned path mapping rules, including: Based on at least one preset path mapping rule, for each of the fields, the target field value corresponding to the field in the first association relationship is mapped to a path to obtain the dependent resource file path corresponding to the target field value under each path mapping rule.

5. The method for generating metadata for resource dependency resolution according to any one of claims 1-4, characterized in that, Before generating path mapping metadata corresponding to the target file type based on each of the fields and the target path mapping rules corresponding to each field, the method further includes: The target path mapping rules corresponding to each of the fields and the first association relationship are sent to the manual confirmation module so that the rule confirmation personnel can confirm the target path mapping rules corresponding to each of the fields in the first association relationship through the manual confirmation module.

6. The method for generating metadata for resource dependency resolution according to claim 5, characterized in that, Before sending the target path mapping rules corresponding to each of the fields and the first association relationship to the manual confirmation module, the method further includes: Determine a second association between the location identifier of each field value and the field value; The step of sending the target path mapping rules corresponding to each of the fields and the first association relationship to the manual confirmation module, so that the rule confirmer can confirm the target path mapping rules corresponding to each of the fields in the first association relationship through the manual confirmation module, includes: The target path mapping rules corresponding to each of the fields, the first association relationship, and the second association relationship are sent to the manual confirmation module so that the rule confirmer can find the field value in the manual confirmation module according to the location identifier in the second association relationship, and confirm the target path mapping rules corresponding to each of the fields in the first association relationship based on the field value.

7. The method for generating metadata for resource dependency resolution according to any one of claims 1-4, characterized in that, The method further includes: Obtain the resource files to be analyzed in the project to be analyzed, and according to the file type of the resource files to be analyzed, obtain the path mapping metadata corresponding to the file type to be analyzed from several different file types of path mapping metadata; The resource file to be analyzed is parsed to determine the fields to be analyzed contained in the resource file and the values ​​of each field to be analyzed. Based on the fields to be analyzed, determine the target path mapping rules corresponding to each field to be analyzed from the path mapping metadata; For the field to be analyzed corresponding to the target path mapping rule, the path mapping is used to map the value of the field to be analyzed to obtain the path of the dependent resource file corresponding to each value of the field to be analyzed.

8. A metadata generation device for resource dependency resolution, characterized in that, include: The file acquisition unit is used to acquire the target reference resource file of the target file type in the reference resource file of the reference project; The file parsing unit is used to parse the node nesting relationship in the target reference resource file and to treat nodes with the same node nesting relationship in the target reference resource file as the same analysis node. A relationship determination unit is used to determine the first association relationship between each field and field value under the same analysis node; The rule determination unit is used to determine the target path mapping rule corresponding to each field in the first association relationship based on at least one preset path mapping rule and the field value in the first association relationship, wherein the path mapping rule is used to map the field value into the form of a path; An information generation unit is used to generate path mapping metadata corresponding to the target file type based on each of the fields and the target path mapping rules corresponding to each of the fields; The rule determination unit is used for: Based on at least one preset path mapping rule, for each of the fields, the field values ​​corresponding to the fields in the first association relationship are mapped to paths to obtain the dependent resource file paths corresponding to the field values ​​under each path mapping rule; The dependent resource file path is matched with the candidate dependent resource file path in the preset set of candidate dependent resource file paths to obtain the path matching result corresponding to each dependent resource file path under each path mapping rule; Based on the path matching results, the target path mapping rules corresponding to each field in the first association relationship are determined.

9. A computer device, characterized in that, It includes a memory and a processor; the memory stores an application program, and the processor is used to run the application program within the memory to perform the steps in the metadata generation method for resource dependency resolution as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the metadata generation method for resource dependency resolution as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Information association method and device, equipment, storage medium and product

    CN114817312A