File similarity calculation method and device, storage medium and electronic equipment
By parsing animation production files to obtain keywords and converting them into file fingerprints, and calculating their similarity, the problem of animation file similarity analysis is solved, improving the accuracy and efficiency of production files.
Patent Information
- Application Number
- CN202310125479.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-03
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2043-02-03
AI Technical Summary
Existing technologies cannot effectively analyze the similarity between animation production files, leading to errors in transmission and low production efficiency.
By parsing the animation production files to obtain animation keywords, converting them into file fingerprints, and calculating the similarity between file fingerprints, the degree of similarity between the animation production files is determined.
It improves the accuracy of animation production file analysis, avoids error transmission, and increases production efficiency.
Smart Images

Figure CN116152825B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of file information processing, in particular to a file similarity calculation method and device, a computer readable storage medium and an electronic device. BACKGROUND
[0002] A large number of production files will be generated in the process of animation production, and for the same type of production file, there will be special file naming rules. However, with the expansion of the production team and the frequent transfer of production files, some production files that do not comply with the file naming rules will appear, thereby causing the wrong transfer of production files, and therefore, the similarity of the production files needs to be identified to uniformly transfer the production files.
[0003] In the related art, a hash algorithm is usually used to identify files, but this method cannot analyze the similarity between files; in addition, by using word frequency and semantic analysis, the meaning of the file text content can be determined, and then the similarity of the file can be determined, however, the text in the production file does not belong to natural language, and therefore, the similarity between the production files cannot be determined.
[0004] Therefore, there is an urgent need in the art to develop a new file similarity calculation method and device.
[0005] It should be noted that the information disclosed in the above background section is only used to strengthen the understanding of the background of the present disclosure, and therefore can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY
[0006] The purpose of the present disclosure is to provide a file similarity calculation method, a file similarity calculation device, a computer readable storage medium and an electronic device, thereby at least partially overcoming the problem of being unable to analyze the similarity of production files due to related technologies.
[0007] Other characteristics and advantages of the present disclosure will become apparent from the following detailed description, or will be learned by practice of the present disclosure.
[0008] According to a first aspect of the present disclosure, a file similarity calculation method is provided, the method comprising: obtaining animation production files generated in the process of animation production, and analyzing the animation production files to obtain animation keywords included in the animation production files; converting the animation keywords into file fingerprints corresponding to the animation production files, calculating the similarity between the file fingerprints to obtain a similarity calculation result; and determining the similarity between the animation production files according to the similarity calculation result.
[0009] According to a second aspect of the embodiments of the present application, a file similarity calculation device is provided, which comprises: an analysis module configured to acquire animation production files generated in an animation production process, analyze the animation production files to obtain animation keywords included in the animation production files; a fingerprint module configured to convert the animation keywords into file fingerprints corresponding to the animation production files, calculate the similarity between the file fingerprints to obtain a similarity calculation result; and a similarity determination module configured to determine the similarity degree between the animation production files according to the similarity calculation result.
[0010] According to a third aspect of the embodiments of the present application, an electronic device is provided, which comprises a processor and a memory; wherein the memory has computer readable instructions stored thereon, and the computer readable instructions are executed by the processor to implement the file similarity calculation method of any of the above example embodiments.
[0011] According to a fourth aspect of the embodiments of the present application, a computer readable storage medium is provided, which has a computer program stored thereon, and the computer program is executed by a processor to implement the file similarity calculation method in any of the above example embodiments.
[0012] From the above technical solutions, the file similarity calculation method, the file similarity calculation device, the computer storage medium and the electronic device in the example embodiments of the present application at least have the following advantages and positive effects:
[0013] In the method and device provided in the example embodiments of the present application, the animation keywords in the animation production files are converted into file fingerprints corresponding to the animation production files, and the similarity degree between the animation production files is determined based on the similarity calculation result between the file fingerprints. On the one hand, the situation that the similarity degree of the animation production files cannot be analyzed in the prior art is avoided; on the other hand, the analysis of the similarity degree of the animation production files helps to integrate the animation production files subsequently, avoids the situation that the animation production files are transmitted incorrectly, and improves the efficiency of subsequent animation production.
[0014] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0015] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0016] Figure 1 A flowchart schematically showing a file similarity calculation method in an embodiment of the present disclosure is shown;
[0017] Figure 2 A flowchart schematically showing a process of analyzing an animation production file to obtain animation keywords included in the animation production file in a file similarity calculation method in an embodiment of the present disclosure is shown;
[0018] Figure 3 An animation keyword in a target format in a file similarity calculation method in an embodiment of the present disclosure is shown;
[0019] Figure 4 A schematic diagram of a file fingerprint in a file similarity calculation method in an embodiment of the present disclosure is shown;
[0020] Figure 5 A flowchart schematically showing a process of converting an animation keyword into a file fingerprint corresponding to an animation production file in a file similarity calculation method in an embodiment of the present disclosure is shown;
[0021] Figure 6 A string encoding result in a file similarity calculation method in an embodiment of the present disclosure is shown;
[0022] Figure 7 A binary array in a file similarity calculation method in an embodiment of the present disclosure is shown;
[0023] Figure 8 A flowchart schematically showing a process of calculating a plurality of binary arrays to obtain a file fingerprint corresponding to an animation production file in a file similarity calculation method in an embodiment of the present disclosure is shown;
[0024] Figure 9 A flowchart schematically showing a process of determining a similarity degree between animation production files according to a similarity calculation result in a file similarity calculation method in an embodiment of the present disclosure is shown;
[0025] Figure 10 A flowchart schematically showing a process of determining that animation production files have a second similarity degree in a file similarity calculation method in an embodiment of the present disclosure is shown;
[0026] Figure 11 A flowchart schematically showing a process of determining a production link type to which an animation production file belongs in a file similarity calculation method in an embodiment of the present disclosure is shown;
[0027] Figure 12 A device for a file similarity calculation method in an embodiment of the present disclosure is shown;
[0028] Figure 13An electronic device for a file similarity calculation method is illustratively shown in an embodiment of the present disclosure.
[0029] Figure 14 A computer readable storage medium for a file similarity calculation method is illustratively shown in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] Example implementations will now be described more fully with reference to the accompanying drawings. Example implementations may, however, be implemented in many different forms and should not be construed as limited to the implementations set forth herein; rather, these implementations are provided so that this disclosure will be thorough and complete, and will fully convey the scope of example implementations to those skilled in the art. The described features, structures, or characteristics can be combined in one or more implementations. In the following description, numerous specific details are provided, such as examples of programming, software modules, user selections, network transactions, database queries, database structures, hardware modules, hardware- specific details and
[0031] The terms "one", "a", "an", and "the" as used herein mean "at least one" or "one or more" unless expressly specified otherwise. The term "includes" means "includes without limitation" and the term "including" means "including without limitation". The term "coupled" means directly or indirectly connected, without necessarily being in physical contact, and the term "connected" means physically, logically, or communicatively connected. The term "first" and "second" are used as labels, and do not necessarily indicate a specific number or order.
[0032] In addition, the drawings are merely schematic and are not necessarily drawn to scale. Like reference numerals designate like or similar parts throughout the drawings and the detailed description, and thus, repeated description of the same or similar parts can be omitted for the sake of brevity. Some of the block components shown in the drawings can be functional blocks that do not necessarily correspond to physical or logical entities.
[0033] To address the problems in the related art, the present disclosure proposes a file similarity calculation method. Figure 1 A flowchart of the file similarity calculation method is shown, as Figure 1 As shown, the file similarity calculation method includes at least the following steps:
[0034] Step S110. An animation production file generated in an animation production process is acquired, and the animation production file is parsed to obtain animation keywords included in the animation production file.
[0035] Step S120. The animation keywords are converted into file fingerprints corresponding to the animation production files, and similarity between the file fingerprints is calculated to obtain a similarity calculation result.
[0036] Step S130. According to the similarity calculation result, similarity between the animation production files is determined.
[0037] In the method and device provided in the example embodiments of the present disclosure, the animation keywords in the animation production files are converted into file fingerprints corresponding to the animation production files, and the similarity between the file fingerprints is calculated to determine the similarity between the animation production files. On the one hand, the situation that the prior art cannot analyze the similarity between the animation production files is avoided. On the other hand, the analysis of the similarity between the animation production files helps subsequent integration of the animation production files, avoids the situation that the animation production files are incorrectly transmitted, and improves the efficiency of subsequent animation production.
[0038] The steps of the file similarity calculation method are described in detail below.
[0039] In step S110, the animation production files generated in the animation production process are acquired, and the animation keywords included in the animation production files are obtained by analyzing the animation production files.
[0040] In the example embodiments of the present disclosure, a plurality of animation production files are generated in the animation production process, and the animation keywords in the corresponding animation scenes are recorded in these animation production files.
[0041] In order to determine the similarity between the animation production files, the animation production files need to be acquired first, and after the animation production files are acquired, the animation production files are analyzed to obtain the animation keywords included in the animation production files.
[0042] Specifically, the process of analyzing the animation production files can be implemented by using an analyzer corresponding to the animation production files, or by using other algorithms, which are not specially limited in the example embodiments. The animation keywords refer to the key information included in the animation production files that affect the similarity between the animation production files.
[0043] For example, the animation production files are files generated when animation is produced by using Maya software (Autodesk Maya, a three-dimensional animation software). Correspondingly, the animation keywords included in the animation production files can be obtained by analyzing the animation production files by using an analyzer corresponding to the Maya software.
[0044] In the optional embodiments, Figure 2A flowchart of a method for calculating the similarity of files is shown in FIG. 10. The method includes the following steps: in step S210, parsing the animation production file to obtain parsed keywords, identifying the animation reference file, the animation node file, and the hierarchical relationship between the animation node files from the parsed keywords. Figure 2 As shown in FIG. 10, the method includes the following steps: in step S210, parsing the animation production file to obtain parsed keywords, identifying the animation reference file, the animation node file, and the hierarchical relationship between the animation node files from the parsed keywords.
[0045] When the animation production file is parsed, some parsed keywords can be obtained. It should be noted that there can be some stop words in the parsed keywords. At this time, the stop words in the parsed keywords need to be filtered to obtain parsed keywords that do not include stop words. Specifically, the stop words refer to keywords that do not affect the similarity between animation production files. For example, they can be software information corresponding to the animation production file, they can be shot names used in the animation scene, or they can be any keyword that does not affect the similarity between animation production files. The present exemplary embodiment does not make special limitations on this.
[0046] After filtering the stop words in the parsed keywords, keywords that affect the similarity between animation production files need to be extracted from the parsed keywords. These keywords that affect the similarity between animation production files include animation reference files, animation nodes, and hierarchical relationships between animation nodes. The animation reference file refers to a reference file used in the animation scene corresponding to the animation production file. Specifically, the animation reference file can be a file of a referenced scene (a file related to the animation scene), it can be a file of a referenced map (a file related to the animation map), or it can be a referenced cache file. The present exemplary embodiment does not make special limitations on this. In the process of displaying the animation scene, the animation nodes need to be executed according to the hierarchical relationship between the animation nodes.
[0047] For example, the parsed keywords can be obtained by parsing the obtained animation production file. The shot names and software information in the parsed keywords are filtered to obtain parsed keywords that do not include stop words.
[0048] The animation reference file file1, the animation node "main_ctrlShape", the animation node "main_ctrl", and the parent-child relationship (which belongs to one of the hierarchical relationships) between the animation node "main_ctrlShape" and the animation node "main_ctrl" are extracted from the parsed keywords that do not include stop words. Specifically, the animation node "main_ctrl" is the parent node, and the animation node "main_ctrlShape" is the child node.
[0049] In step S220, the animation keywords are determined by using the animation node files and the hierarchical relationships between the animation node files.
[0050] The animation keywords are determined by using the animation node files and the hierarchical relationships between the animation node files extracted from the parsed keywords.
[0051] For example, Figure 3 An animation keyword in a target format in an embodiment of the present disclosure is schematically shown as follows: Figure 3 As shown in the figure, the target format refers to a Json (JavaScript Object Notation) format, each line in the animation keyword represents an animation key string, and the | in each line represents a hierarchical relationship between animation nodes, and the animation node after the | is a child node of the animation node before the |.
[0052] In the present exemplary embodiment, since the animation nodes need to be executed according to the hierarchical relationships between the animation nodes in the process of displaying the animation scene, the animation nodes and the hierarchical relationships between the animation nodes can reflect whether there is similarity between the animation production files to a certain extent, and therefore, determining the animation keywords is helpful for subsequently determining the similarity degrees between the animation production files according to the animation keywords, and also improves the accuracy of the determined similarity degrees between the animation production files.
[0053] In step S120, the animation keywords are converted into file fingerprints corresponding to the animation production files, and the similarity degrees between the file fingerprints are calculated to obtain a similarity calculation result.
[0054] In the exemplary embodiments of the present disclosure, the file fingerprint refers to information that can uniquely identify the animation production file, and the file fingerprint is obtained by converting the animation keywords. Since the file fingerprint can uniquely identify the animation production file, the similarity calculation result can be obtained by calculating the similarity degrees between the file fingerprints, and then the similarity degrees between the animation production files are determined according to the similarity calculation result.
[0055] The process of calculating the similarity of the file fingerprints can be a process of calculating the Hamming distance between the file fingerprints, or a process of calculating the file fingerprints by using a certain similarity algorithm, and the example embodiment does not specially limit this. For example, the file fingerprint A is [1, 0, 0, 0, 0, 1], and the file fingerprint B is [1, 1, 0, 1, 0, 1]. Since the second element in the file fingerprint A is inconsistent with the second element in the file fingerprint B, and the fourth element in the file fingerprint A is inconsistent with the fourth element in the file fingerprint B, the Hamming distance between the file fingerprint A and the file fingerprint B is 2 (that is, the similarity calculation result between the file fingerprint A and the file fingerprint B is 2).
[0056] For example, the animation keywords shown in FIG. 1 are converted to obtain the file fingerprint A-1, and specifically, Figure 3 For example, the animation keywords shown in FIG. 1 are converted to obtain the file fingerprint A-1, and specifically, Figure 4 The schematic diagram of the file fingerprint in the embodiment of the disclosure is schematically shown, as shown in FIG. 2, the file fingerprint can be an array composed of binary elements. Figure 4 The schematic diagram of the file fingerprint in the embodiment of the disclosure is schematically shown, as shown in FIG. 2, the file fingerprint can be an array composed of binary elements.
[0057] The Hamming distance between the file fingerprint A-1 and the file fingerprint B-1 can be calculated to obtain the similarity calculation result between the file fingerprint A-1 and the file fingerprint B-1.
[0058] In an optional embodiment, Figure 5 The flowchart of the process of converting the animation keywords to the file fingerprints corresponding to the animation production files in the file similarity calculation method is shown, the animation keywords include a plurality of animation key strings, as shown in FIG. 3, the method at least includes the following steps: in step S510, each of the plurality of animation key strings is respectively encoded to obtain a plurality of string encoding results. Figure 5
[0059] The animation keywords include a plurality of animation key strings, for example, as shown in FIG. 1, each row of the animation keywords is an animation key string. Figure 3 The animation keywords include a plurality of animation key strings, for example, as shown in FIG. 1, each row of the animation keywords is an animation key string.
[0060] Each of the animation key strings is respectively encoded, and the obtained encoding result is the string encoding result. Specifically, the encoding process can be a process of generating a hash value character by MD5 (MD5 Message-Digest Algorithm, information digest algorithm), and can also be an algorithm of converting the characters in the animation key string to binary hash characters, and the example embodiment does not specially limit this.
[0061] For example, assuming that the first animation key string in the animation key word is "|ShuGuoBing_YiFu_GeoGrp|ShuGuoBuBing_YiFu_AA_Geo", in which the animation node "ShuGuoBing_YiFu_GeoGrp" is the parent node of the animation node "ShuGuoBuBing_YiFu_AA_Geo". After MD5 binary hash coding is performed on this animation key string, the string coding result shown in Figure 6 may be obtained.
[0062] Similarly, if there are 11 animation key strings in the animation key word, the remaining 11 animation key strings can be encoded according to the above steps, and 12 string coding results corresponding to the animation key word can be finally obtained.
[0063] In step S520, the plurality of string coding results are converted to obtain a plurality of binary arrays, and the plurality of binary arrays are calculated to obtain a file fingerprint corresponding to the animation production file.
[0064] After obtaining the plurality of string coding results, the plurality of string coding results are converted respectively to obtain a plurality of binary arrays corresponding to the plurality of string coding results. Specifically, the conversion of the plurality of string coding results can be implemented by using the unpack function in Python (a computer programming language), or can be implemented by using other algorithms that can convert string coding results into binary arrays, and the present exemplary embodiment does not make special limitations.
[0065] After obtaining the plurality of binary arrays, the plurality of binary arrays need to be calculated to obtain a file fingerprint corresponding to the animation production file. Specifically, the calculation can be a summation calculation of the binary arrays, or can be a calculation of the binary arrays by using a certain algorithm, and the present exemplary embodiment does not make special limitations.
[0066] For example, the string coding result shown in Figure 6 may be converted into the binary array shown in Figure 7 by using the unpack function in Python. Similarly, the remaining 11 string coding results can also be converted by using the unpack function in Python, and 12 binary arrays can be obtained.
[0067] It is worth noting that the number of elements in the 12 binary arrays is the same. The first element in the 12 binary arrays is added to obtain the first element in the file fingerprint, the second element in the 12 binary arrays is added to obtain the second element in the file fingerprint, the third element in the 12 binary arrays is added to obtain the third element in the file fingerprint, and so on, until the 12th element in the 12 binary arrays is added to obtain the 12th element in the file fingerprint. Thus, the file fingerprint composed of 12 elements can be obtained.
[0068] In the present exemplary embodiment, the plurality of animation key strings are respectively encoded to obtain a plurality of string encoding results, and the plurality of string encoding results are respectively converted to obtain a plurality of binary arrays. This facilitates subsequent calculation of the plurality of binary arrays to obtain a file fingerprint that can uniquely mark the animation production file.
[0069] In an optional embodiment, Figure 8 A flowchart of a file similarity calculation method for calculating a file fingerprint corresponding to an animation production file from a plurality of binary arrays is shown in FIG. 8, which includes the following steps: Figure 8 As shown in FIG. 8, the method includes the following steps: in step S810, if a preset element exists in the plurality of binary arrays, a preset replacement element is determined.
[0070] The preset element refers to a pre-set element, and the preset replacement element refers to a pre-set element used to replace the preset element.
[0071] The preset element exists because there may be an element in the plurality of binary arrays that causes an error in the similarity calculation result. Therefore, the preset replacement element is used to replace the preset element to ensure that no error in the similarity calculation result occurs subsequently.
[0072] For example, the preset element is 0, and if the preset element 0 exists in the plurality of binary arrays, the preset replacement element -1 is determined.
[0073] In step S820, the preset element in the plurality of binary arrays is replaced by the preset replacement element to obtain a plurality of target binary arrays.
[0074] The preset element in the plurality of binary arrays is replaced by the preset replacement element to obtain a plurality of target binary arrays. It is worth noting that the plurality of target binary arrays obtained at this time will no longer cause an error in the subsequent similarity calculation result.
[0075] For example, the preset element 0 in the plurality of binary arrays is replaced by the preset replacement element -1 to obtain a target binary array corresponding to the plurality of binary arrays.
[0076] In step S830, the plurality of target binary arrays are calculated to obtain the file fingerprint corresponding to the animation production file.
[0077] In the example, after obtaining the plurality of target binary arrays, the plurality of binary arrays are summed to obtain the file fingerprint corresponding to the animation production file.
[0078] In the example, after obtaining the plurality of target binary arrays, the plurality of binary arrays are summed to obtain the file fingerprint corresponding to the animation production file.
[0079] In the example, the preset elements in the plurality of binary arrays are replaced by the preset replacement elements to obtain the plurality of target binary arrays, and then the plurality of target binary arrays are calculated to obtain the file fingerprint, thereby improving the accuracy of the similarity calculation result obtained by subsequently calculating the similarity of the file fingerprint, and further improving the accuracy of the similarity degree between the animation production files analyzed subsequently.
[0080] In step S130, the similarity degree between the animation production files is determined according to the similarity calculation result.
[0081] In the example, the similarity calculation result can reflect the similarity degree between the animation production files, so the similarity degree between the animation production files can be determined according to the similarity calculation result.
[0082] In the example, the similarity calculation result between the file fingerprint A-1 and the file fingerprint B-1 is 2, based on which it can be determined that the similarity degree between the animation production file A0 and the animation production file B0 belongs to the first degree (the first degree is the highest degree in the similarity degree). The animation production file A0 corresponds to the file fingerprint A-1, and the animation production file B0 corresponds to the file fingerprint B-1.
[0083] In the optional embodiment, Figure 9 The flowchart of determining the similarity degree between the animation production files according to the similarity calculation result in the file similarity calculation method is shown in FIG. 10, which includes the following steps: Figure 9 As shown in FIG. 10, the method includes the following steps: in step S1010, a similarity threshold corresponding to the similarity calculation result is obtained.
[0084] The similarity threshold is a critical value for comparing the similarity calculation result to measure the similarity degree between the animation production files.
[0085] In the example, the similarity threshold corresponding to the similarity calculation result is 3.
[0086] In step S1020, if the similarity calculation result is less than or equal to the similarity threshold, it is determined that the animation production files have a first degree of similarity.
[0087] When the similarity calculation result is less than or equal to the similarity threshold, the degree of similarity between the animation production files can be determined as the first degree of similarity, which is the highest degree of similarity.
[0088] For example, if the similarity calculation result is 3, then the similarity calculation result is equal to the similarity threshold, and thus, it is determined that the animation production files have the first degree of similarity.
[0089] In step S1030, if the similarity calculation result is greater than the similarity threshold, it is determined that the animation production files have a second degree of similarity; the second degree of similarity is less than the first degree of similarity.
[0090] If the similarity calculation result is greater than the similarity threshold, it is determined that the animation production files have a second degree of similarity. It is worth noting that the second degree of similarity is less than the first degree of similarity.
[0091] For example, if the similarity calculation result is 4, it is clear that the similarity calculation result is greater than the similarity threshold of 3, which proves that the animation files have a second degree of similarity.
[0092] In this exemplary embodiment, a similarity threshold corresponding to the similarity calculation result is obtained. By comparing the similarity calculation result with the similarity threshold, the degree of similarity between animation production files is determined, providing a basis for measuring the degree of similarity between animation production files.
[0093] In an optional embodiment, Figure 10 The diagram illustrates the process of determining the second degree of similarity between animation production files in the file similarity calculation method, such as... Figure 10 As shown, the method includes at least the following steps: In step S1110, if the difference between the similarity calculation result and the similarity threshold is less than the preset difference threshold, the animation reference file parsed from the animation production file is determined, and the target animation reference file that is repeated among the animation reference files is determined.
[0094] The preset difference threshold refers to the critical value that measures the difference between the similarity calculation result and the similarity threshold. This preset difference threshold is usually set in advance. When the difference between the similarity calculation result and the similarity threshold is less than the preset difference threshold, it indicates that the similarity calculation result has not significantly exceeded the similarity threshold. To avoid mistakenly classifying the similarity between animation files in the above situation as the second level of similarity, an auxiliary method for determining the degree of similarity is needed.
[0095] In the method of assisting in determining the similarity degree, the animation reference file needs to be used. The animation reference file refers to a file parsed from the animation production file. If many animation reference files referenced by two animation production files are repetitive, it can be considered that the two animation production files have a certain similarity degree in the first degree.
[0096] Therefore, when the similarity calculation result is greater than the similarity threshold value, the animation reference file can be used as a basis for further determining the similarity degree between the animation production files. The target animation reference file is an animation reference file that exists in both the animation reference file V-1 and the animation reference file V-2, wherein the animation reference file V-1 corresponds to the animation production file A-3, and the animation reference file V-2 corresponds to the animation production file B-3.
[0097] For example, the similarity calculation result is 4, the similarity threshold value is 3, and the preset difference threshold value is 2. Obviously, the difference 1 between the similarity calculation result and the similarity threshold value is less than the preset difference threshold value. The animation reference file V-2, the animation reference file V-3, the animation reference file V-4, and the animation reference file V-5 are parsed from the animation production file A0. The animation reference file V-3, the animation reference file V-4, the animation reference file V-5, the animation reference file V-6, and the animation reference file V-7 are parsed from the animation production file B0. Obviously, at this time, the target animation reference file is the animation reference file V-3, the animation reference file V-4, and the animation reference file V-5.
[0098] In step S1120, the number of target animation reference files is determined, and a number threshold value corresponding to the number is determined.
[0099] Wherein, after the target animation reference file is determined, the number of animation reference files can be determined. The number threshold value refers to a critical value for comparing with the number to further determine the similarity degree between the animation production files.
[0100] For example, the number of target animation reference files is 3, and the determined number threshold value is 7.
[0101] In step S1130, if the number is greater than the number threshold value, it is determined that the animation production files have a third similarity degree.
[0102] Wherein, when the number is greater than the number threshold value, it proves that there are many repetitive animation reference files referenced between the animation production files, and it can be determined that the animation production files have a third similarity degree, which indicates that the animation production files have a certain correlation.
[0103] For example, the number of target animation reference files is 20, and it is obvious that the number of target animation reference files is greater than the number threshold 7, and it can be determined that the animation production files have the third similarity degree.
[0104] In step S1140, if the number is less than or equal to the number threshold, it is determined that the animation production files have a fourth similarity degree; the fourth similarity degree is less than the third similarity degree.
[0105] Wherein, when the number is less than or equal to the number threshold, it can be determined that the animation production files have a fourth similarity degree, and it is worth noting that the similarity degree represented by the fourth similarity degree is less than the similarity degree represented by the third similarity degree.
[0106] For example, the number of target animation production files is 2, and it is obvious that the number is less than the number threshold, and it is determined that the animation production files have a fourth similarity degree.
[0107] In the present exemplary embodiment, when the difference between the similarity calculation result and the similarity threshold is less than the preset difference threshold, the target animation reference file that is repeated between the animation reference files is determined, and then the number of target animation reference files is compared with the number threshold, so as to avoid the case that the similarity degree between the animation production files is determined as the second similarity degree when the similarity calculation result is greater than the similarity threshold, and the accuracy of the determined similarity degree is increased.
[0108] In an optional embodiment, Figure 11 A flowchart for determining the production link type to which the animation production file belongs in the file similarity calculation method is shown, and the animation production file includes a first animation production file with a known production link type and a second animation production file with an unknown production link type, as shown in Figure 11 The method at least includes the following steps: in step S1210, the target animation production file with the same production link type is determined in the first animation production file.
[0109] Wherein, in the process of generating the animation production file, the animation production file can be divided into asset type animation production file, animation type animation production file, lighting type animation production file and special effect type animation production file according to the animation link applied by the animation production file. The production link type refers to the type of the animation production file determined according to the production link.
[0110] It is worth noting that the animation production file includes the first animation production file and the second animation production file, wherein the first animation production file is an animation production file with a known production link type, and the second animation production file is an animation production file with an unknown production link type.
[0111] In order to determine the production link type to which the second animation production file belongs, target animation production files with the same production link type can be determined in the first animation production file, that is, the first animation production file is classified according to the animation production link.
[0112] For example, the first animation production files include first animation production file F1, first animation production file F2, first animation production file F3, first animation production file F4, first animation production file F5, first animation production file F6, first animation production file F7, first animation production file F8, first animation production file F9 and first animation production file F10. The production link type to which the first animation production file F1 belongs is animation, the production link type to which the first animation production file F2 belongs is lighting, the production link type to which the first animation production file F3 belongs is lighting, the production link type to which the first animation production file F4 belongs is special effect, the production link type to which the first animation production file F5 belongs is animation, the production link type to which the first animation production file F6 belongs is asset, the production link type to which the first animation production file F7 belongs is asset, the production link type to which the first animation production file F8 belongs is asset, the production link type to which the first animation production file F9 belongs is animation special effect, and the production link type to which the first animation production file F10 belongs is animation.
[0113] Based on this, there are four kinds of target animation production files. The first kind of target animation production file (the corresponding production link type is animation) includes the first animation production file F1, the first animation production file F5 and the first animation production file F10; the second kind of target animation production file (the corresponding production link type is lighting) includes the first animation production file F2 and the first animation production file F3; the third kind of target animation production file (the corresponding production link type is asset) includes the first animation production file F6, the first animation production file F7 and the first animation production file F8; and the fourth kind of target animation production file (the corresponding production link type is special effect) includes the first animation production file F4 and the first animation production file F9.
[0114] In step S1220, the target animation production file is parsed to obtain a target animation keyword included in the target animation production file, and the same target animation keyword is counted to obtain a word frequency corresponding to the same target animation keyword.
[0115] The target animation keyword is an animation keyword included in the target animation production file. Specifically, the target animation keyword includes an animation reference file, an animation node and a hierarchical relationship between the animation nodes.
[0116] When the target animation keywords are parsed, the same target animation keyword is counted, and the number of times of the same target animation keyword (i.e., the word frequency corresponding to the same target animation keyword) can be obtained.
[0117] For example, the first target animation production file is parsed to obtain target animation keywords G-1, target animation keywords G-2, target animation keywords G-3, target animation keywords G-1, target animation keywords G-2, target animation keywords G-5, and 10000 target animation keywords.
[0118] Based on this, the number of times of target animation keyword G-1 is counted in the 10000 target animation keywords, which is 200 (i.e., the word frequency corresponding to target animation keyword G-1 is 200). Similarly, the number of times of other target animation keywords in the 10000 target animation keywords is also counted to determine the word frequency corresponding to the same target animation keyword in the first target animation production file. Similarly, the word frequency corresponding to the same target animation keyword in the second target animation production file can also be counted, and the word frequency corresponding to the same target animation keyword in the third target animation production file can also be counted. The word frequency corresponding to the same target animation keyword in the fourth target animation production file can also be counted.
[0119] In step S1230, based on the word frequency, the target word frequency keyword is determined in the target animation keyword, and the type file fingerprint corresponding to the production link type is constructed according to the target word frequency keyword, so as to determine the production link type to which the second animation production file belongs by using the type file fingerprint.
[0120] Among them, the target word frequency keyword refers to the target animation keyword with the largest word frequency. Generally, the number of target word frequency keywords to be determined is determined by the average number of animation keyword strings appearing in multiple animation production files. For example, the number of target word frequency keywords to be determined can be 2000.
[0121] After determining the plurality of target word frequency keywords, the type file fingerprint is constructed by using the plurality of target word frequency keywords. The type file fingerprint is related to the corresponding production link type. Specifically, the process of constructing the type file fingerprint is similar to the process of constructing the file fingerprint, which will not be described here.
[0122] After determining the type file fingerprint, the similarity calculation result between the file fingerprint corresponding to the second animation production file and the type file fingerprint can be calculated, and then the first animation production file with the highest similarity to the second animation production file is determined according to the similarity calculation result. At this time, the production link type of the first animation production file is the production link type to which the second animation production file belongs.
[0123] For example, according to the word frequency of the target animation keyword, the first 2000 target word frequency keywords with the highest word frequency in the target animation keyword are determined. The type file fingerprint W-1 belonging to the production link type of animation is determined by using the target word frequency keyword. Similarly, the type file fingerprint W-2 belonging to the production link type of asset can also be determined, and the type file fingerprint W-3 belonging to the production link type of lighting can also be determined, and the type file fingerprint W-4 belonging to the production link type of special effect can also be determined.
[0124] Based on this, the file fingerprint corresponding to the second animation production file is determined, and the similarity calculation results between the file fingerprint and the type file fingerprint W-1, the type file fingerprint W-2, the type file fingerprint W-3 and the type file fingerprint W-4 are calculated respectively. According to the similarity calculation results, the similarity between the second animation production file and the first animation production file belonging to the production link type of animation, the similarity between the second animation production file and the first animation production file belonging to the production link type of asset, the similarity between the second animation production file and the first animation production file belonging to the production link type of lighting, and the similarity between the second animation production file and the first animation production file belonging to the production link type of special effect are determined.
[0125] If the similarity between the second animation production file and the first animation production file belonging to the production link type of animation is the highest, it can be determined that the second animation production file belongs to the production link type of animation.
[0126] In the example embodiment, based on the word frequency, the target word frequency keyword is determined in the target animation keyword, and the type file fingerprint corresponding to the production link type is constructed based on the target word frequency keyword, and then the production link type to which the second animation production file belongs can be determined, avoiding the situation that the production link type to which the animation production file belongs cannot be determined in the prior art. It is helpful to manage the animation production file based on the production link type.
[0127] In the method and device provided in the example embodiment of the present disclosure, the animation keyword in the animation production file is used to convert the file fingerprint corresponding to the animation production file, and the similarity between the animation production files is determined based on the similarity calculation results between the file fingerprints. On the one hand, it avoids the situation that the similarity between the animation production files cannot be analyzed in the prior art; on the other hand, the analysis of the similarity between the animation production files is helpful to the subsequent integration of the animation production files, avoiding the situation that the animation production files are transmitted incorrectly, and improving the efficiency of subsequent animation production.
[0128] The file similarity calculation method in the embodiments of the present disclosure will be described in detail below in combination with an application scenario.
[0129] An animation production file generated by using Nuke software (a digital node type synthesis software) is acquired, and an analyzer corresponding to the Nuke software is used to parse the animation production file to obtain animation keywords included in the animation production file. The animation keywords are converted into file fingerprints that can uniquely identify the animation production file, a Hamming distance between the file fingerprints is calculated to obtain a similarity calculation result between the file fingerprints, and based on the similarity calculation result, a similarity degree between the animation production files is determined.
[0130] In the application scenario, the file fingerprints corresponding to the animation production files are converted from the animation keywords in the animation production files, and based on the similarity calculation result between the file fingerprints, the similarity degree between the animation production files is determined. On the one hand, the situation that the prior art cannot analyze the similarity degree of the animation production files is avoided; on the other hand, the analysis of the similarity degree of the animation production files helps subsequent integration of the animation production files, avoids the situation that the animation production files are incorrectly transmitted, and improves the efficiency of subsequent animation production.
[0131] In addition, in the exemplary embodiments of the present disclosure, a file similarity calculation device is also provided. Figure 12 The structure diagram of the file similarity calculation device is shown, as Figure 12 As shown in the figure, the file similarity calculation device 1300 can include a parsing module 1310, a fingerprint module 1320, and a similarity degree determination module 1330. Among them:
[0132] The parsing module 1310 is configured to acquire an animation production file generated in an animation production process, parse the animation production file to obtain animation keywords included in the animation production file; the fingerprint module 1320 is configured to convert the animation keywords into file fingerprints corresponding to the animation production file, and calculate the similarity between the file fingerprints to obtain a similarity calculation result; and the similarity degree determination module 1330 is configured to determine the similarity degree between the animation production files according to the similarity calculation result.
[0133] The specific details of the file similarity calculation device 1300 have been described in detail in the corresponding file similarity calculation method, and therefore will not be described here.
[0134] It should be noted that although several modules or units of the document similarity calculation apparatus 1300 are mentioned in the foregoing detailed description, such division is not mandatory. In fact, according to embodiments of the present disclosure, features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, features and functions of one module or unit described above can be further divided into a plurality of modules or units.
[0135] Furthermore, in exemplary embodiments of the present disclosure, an electronic device capable of implementing the above-described method is also provided.
[0136] The electronic device 1400 according to this embodiment of the present disclosure will be described below with reference to Figure 13 Figure 13 The displayed electronic device 1400 is merely an example and should not impose any limitation on the functions and usage range of embodiments of the present disclosure.
[0137] As shown in Figure 13 The components of the electronic device 1400 can include, but are not limited to, the at least one processing unit 1410 described above, the at least one storage unit 1420 described above, a bus 1430 connecting different system components, including the storage unit 1420 and the processing unit 1410, and a display unit 1440.
[0138] The storage unit stores program codes which can be executed by the processing unit 1410, so that the processing unit 1410 performs the steps described in the above "Exemplary Method" section according to various exemplary embodiments of the present disclosure.
[0139] The storage unit 1420 can include a readable medium in the form of a volatile storage unit, such as a random access memory (RAM) 1421 and / or a cache memory 1422, and can further include a read-only memory (ROM) 1423.
[0140] The storage unit 1420 can further include a program / utility 1424 having a set of program modules 1425, including but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which can contain realizations of a network environment, alone or in some combination.
[0141] The bus 1430 can represent one or more of several types of bus structures, including a storage unit bus or storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of a variety of bus structures.
[0142] Electronic device 1400 can also communicate with one or more external devices 1470 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 1400, and / or with any device that enables electronic device 1400 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1450. Furthermore, electronic device 1400 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1460. As shown, network adapter 1460 communicates with other modules of electronic device 1400 via bus 1430. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0143] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0144] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the invention described in the "Exemplary Methods" section above.
[0145] refer to Figure 14 As shown, a program product 1500 for implementing the above-described method according to an embodiment of the present invention is described. It may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0146] The program product can employ any combination of one or more computer readable media or storage media. A computer readable medium or storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable medium or storage medium include the following: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0147] A computer readable signal medium can include a propagated data signal with computer readable program code embodied therein. The propagated data signal can take any of a variety of forms, including but not limited to electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium can be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport program code for use by or in connection with an instruction execution system, apparatus, or device.
[0148] Program code embodied on a computer readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0149] Program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++, or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, such as through the Internet using an Internet Service Provider. The application is related to the use of computer system 100 for online analytics, online training, and online training management. Any of the embodiments of the present application can employ a computer system 100 for these purposes.
[0150] Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the features disclosed herein. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
Claims
1. A method for calculating file similarity, characterized in that, The method includes: The animation production files generated during the animation production process are acquired, and the animation production files are parsed to obtain the animation keywords included in the animation production files; The animation keywords are converted into file fingerprints corresponding to the animation production files, and the similarity between the file fingerprints is calculated to obtain the similarity calculation result; Based on the similarity calculation results, the degree of similarity between the animation production files is determined; The step of determining the degree of similarity between the animation production files based on the similarity calculation results includes: Obtain a similarity threshold corresponding to the similarity calculation result; if the similarity calculation result is less than or equal to the similarity threshold, determine that the animation production files have a first degree of similarity; if the similarity calculation result is greater than the similarity threshold, determine that the animation production files have a second degree of similarity; the second degree of similarity is less than the first degree of similarity; the similarity calculation result represents the distance between the animation production files, and the similarity threshold is a threshold of distance; Furthermore, if the similarity calculation result is greater than the similarity threshold, and the difference between the similarity calculation result and the similarity threshold is less than a preset difference threshold, then the animation reference files parsed from the animation production files are determined, and the target animation reference files that are repeated among the animation reference files are determined; the number of the target animation reference files is determined, and a number threshold corresponding to the number is determined; if the number is greater than the number threshold, then the animation production files are determined to have a third degree of similarity; if the number is less than or equal to the number threshold, then the animation production files are determined to have a fourth degree of similarity; the fourth degree of similarity is less than the third degree of similarity.
2. The document similarity calculation method according to claim 1, characterized in that, The process of parsing the animation production file to obtain the animation keywords included in the animation production file includes: The animation production file is parsed to obtain parsing keywords, and the animation reference files, animation node files, and the hierarchical relationships between the animation node files are identified from the parsing keywords; Animation keywords are determined by utilizing the animation node files and the hierarchical relationships between them.
3. The document similarity calculation method according to claim 2, characterized in that, The animation reference files include: the referenced scene files, the referenced texture files, and the referenced cache files.
4. The document similarity calculation method according to claim 1, characterized in that, The similarity calculation results include Hamming distance.
5. The document similarity calculation method according to claim 1, characterized in that, The animation keywords include multiple key animation strings; The step of converting the animation keywords into file fingerprints corresponding to the animation production file includes: Each of the multiple animation key strings is encoded separately to obtain multiple string encoding results; The multiple string encoding results are converted to obtain multiple binary arrays. If a preset element 0 exists in the multiple binary arrays, a preset replacement element is determined. The preset element in the multiple binary arrays is replaced with the preset replacement element to obtain multiple target binary arrays. The target binary arrays are composed of 1 and the preset replacement element. The multiple target binary arrays are calculated to obtain the file fingerprint corresponding to the animation production file.
6. The document similarity calculation method according to claim 5, characterized in that, The step of calculating the file fingerprint corresponding to the animation production file by analyzing the plurality of target binary arrays includes: Add the elements with the same number of bits in the multiple target binary arrays to obtain the file fingerprint corresponding to the animation production file.
7. The document similarity calculation method according to claim 5, characterized in that, The preset replacement element is -1.
8. The document similarity calculation method according to claim 1, characterized in that, The animation production files include a first animation production file with a known production stage type and a second animation production file with an unknown production stage type; The method further includes: In the first animation production file, a target animation production file with the same production stage type is identified; The target animation production file is parsed to obtain the target animation keywords included in the target animation production file. The same target animation keyword is statistically analyzed to obtain the word frequency corresponding to the same target animation keyword. Based on the word frequency, target word frequency keywords are determined from the target animation keywords. A type file fingerprint corresponding to the production stage type is constructed based on the target word frequency keywords, so as to determine the production stage type to which the second animation production file belongs using the type file fingerprint.
9. A document similarity calculation device, characterized in that, include: The parsing module is configured to acquire animation production files generated during the animation production process, and parse the animation production files to obtain the animation keywords included in the animation production files; The fingerprint module is configured to convert the animation keywords into file fingerprints corresponding to the animation production file, and calculate the similarity between the file fingerprints to obtain a similarity calculation result; The similarity determination module is configured to determine the degree of similarity between the animation production files based on the similarity calculation results; The step of determining the degree of similarity between the animation production files based on the similarity calculation results includes: Obtain a similarity threshold corresponding to the similarity calculation result; if the similarity calculation result is less than or equal to the similarity threshold, determine that the animation production files have a first degree of similarity; if the similarity calculation result is greater than the similarity threshold, determine that the animation production files have a second degree of similarity; the second degree of similarity is less than the first degree of similarity; the similarity calculation result represents the distance between the animation production files, and the similarity threshold is a threshold of distance; Furthermore, if the similarity calculation result is greater than the similarity threshold, and the difference between the similarity calculation result and the similarity threshold is less than a preset difference threshold, then the animation reference files parsed from the animation production files are determined, and the target animation reference files that are repeated among the animation reference files are determined; the number of the target animation reference files is determined, and a number threshold corresponding to the number is determined; if the number is greater than the number threshold, then the animation production files are determined to have a third degree of similarity; if the number is less than or equal to the number threshold, then the animation production files are determined to have a fourth degree of similarity; the fourth degree of similarity is less than the third degree of similarity.
10. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to execute the file similarity calculation method according to any one of claims 1-8 by executing the executable instructions.
11. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by the processor, it implements the file similarity calculation method according to any one of claims 1-8.
Citation Information
Patent Citations
Massive unstructured text similarity calculation method
CN108132929A
Applet code similarity determination method and device, server and storage medium
CN111562920A