CN114064467A - Resource analysis method and device, electronic equipment and storage medium - Google Patents

Resource analysis method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114064467A
CN114064467A CN202111304338.2A CN202111304338A CN114064467A CN 114064467 A CN114064467 A CN 114064467A CN 202111304338 A CN202111304338 A CN 202111304338A CN 114064467 A CN114064467 A CN 114064467A
Authority
CN
China
Prior art keywords
resource
analyzed
analysis
storage path
calling function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111304338.2A
Other languages
Chinese (zh)
Inventor
陈云佳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202111304338.2A priority Critical patent/CN114064467A/en
Publication of CN114064467A publication Critical patent/CN114064467A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • G06F11/3608Software analysis for verifying properties of programs using formal methods, e.g. model checking, abstract interpretation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution

Abstract

The present application relates to the field of computer technologies, and in particular, to a resource analysis method, apparatus, electronic device, and storage medium, where the method includes: when a resource to be analyzed is submitted, determining a preset calling function corresponding to the resource to be analyzed; the preset calling function comprises a first storage path where the resource to be analyzed is located and a second storage path where the resource analysis tool is located; calling the resource analysis tool under the second storage path based on the preset calling function, and transmitting the first storage path to the resource analysis tool based on the preset calling function; and analyzing the static characteristics of the resource to be analyzed under the first storage path based on the resource analysis tool to obtain a static analysis result of the resource to be analyzed. The resource analysis method and the resource analysis device can improve the efficiency and accuracy of resource analysis.

Description

Resource analysis method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a resource analysis method and apparatus, an electronic device, and a storage medium.
Background
In the prior art, for resource compliance inspection, two modes of manual post-inspection and post-processing resource inspection are mostly adopted, namely after the conditions of incorrect expression effect, abnormal function, error in building an installation package, abnormal size of the package body of the installation package and the like are found, and then the manual post-processing resource inspection and the post-processing resource inspection are carried out to find out problematic resources and carry out resource restoration; therefore, the post-processing resource inspection method cannot prevent the problems in the prior art, manual intervention is needed for troubleshooting, and the resource inspection efficiency and accuracy are low.
Disclosure of Invention
The technical problem to be solved by the present application is to provide a resource analysis method, device, electronic device and storage medium, which can improve resource analysis efficiency and accuracy.
In order to solve the above technical problem, in one aspect, the present application provides a resource analysis method, including:
when a resource to be analyzed is submitted, determining a preset calling function corresponding to the resource to be analyzed; the preset calling function comprises a first storage path where the resource to be analyzed is located and a second storage path where the resource analysis tool is located;
calling the resource analysis tool under the second storage path based on the preset calling function, and transmitting the first storage path to the resource analysis tool based on the preset calling function;
and analyzing the static characteristics of the resource to be analyzed under the first storage path based on the resource analysis tool to obtain a static analysis result of the resource to be analyzed.
On the other hand, an embodiment of the present application provides a resource analysis apparatus, including:
the system comprises a preset calling function determining module, a preset calling function determining module and a resource analyzing module, wherein the preset calling function determining module is used for determining a preset calling function corresponding to a resource to be analyzed when the resource to be analyzed is submitted; the preset calling function comprises a first storage path where the resource to be analyzed is located and a second storage path where the resource analysis tool is located;
the resource analysis tool calling module is used for calling the resource analysis tool under the second storage path based on the preset calling function and transmitting the first storage path to the resource analysis tool based on the preset calling function;
and the static analysis module is used for analyzing the static characteristics of the resource to be analyzed under the first storage path based on the resource analysis tool to obtain a static analysis result of the resource to be analyzed.
In another aspect, the present application provides an electronic device, which includes a processor and a memory, where at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded by the processor and executed to implement the resource analysis method as described above.
In another aspect, the present application provides a computer storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded by a processor and executes the resource analysis method as described above.
The embodiment of the application has the following beneficial effects:
when submitting resources to be analyzed, the method first determines a preset calling function corresponding to the resources to be analyzed; calling a resource analysis tool under the second storage path based on a preset calling function, and transmitting the first storage path to the resource analysis tool; and analyzing the static analysis characteristics of the resource to be analyzed under the first storage path based on a resource analysis tool to obtain a static analysis result of the resource to be analyzed. Before submitting the resources to be analyzed to the version library, the method analyzes the static characteristics of the resources to be analyzed, so that the resources which do not accord with the submission target can be prevented from being submitted to the version library, and problems are prevented from occurring from the source; in addition, the resource analysis tool is called through the preset calling function corresponding to the resource to be analyzed, so that the analysis of the static characteristics of the resource to be analyzed is realized, and the efficiency and the accuracy of the resource analysis can be improved.
Drawings
In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
FIG. 2 is a flowchart of a resource analysis method provided in an embodiment of the present application;
fig. 3 is a flowchart of a preset call function registration method according to an embodiment of the present application;
fig. 4 is a flowchart of a preset call function generation method according to an embodiment of the present application;
fig. 5 is a flowchart of a resource file update amount analysis method according to an embodiment of the present application;
FIG. 6 is a flowchart of a globally unique identifier analysis method provided in an embodiment of the present application;
FIG. 7 is a flow chart of resource analysis provided by an embodiment of the present application;
FIG. 8 is a flowchart illustrating the execution of a resource pre-analysis item according to an embodiment of the present disclosure;
FIG. 9 is a schematic diagram of a code compilation error prompt interface according to an embodiment of the present application;
FIG. 10 is a schematic diagram of an automatic add hook interface provided by an embodiment of the present application;
FIG. 11 is a first log graph provided by an embodiment of the present application;
FIG. 12 is a schematic diagram of a second log provided by an embodiment of the present application;
FIG. 13 is a schematic diagram of a GUID path provided by an embodiment of the present application;
fig. 14 is a schematic diagram of a resource analysis apparatus according to an embodiment of the present application;
fig. 15 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, the present application will be further described in detail with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, the following explanations are made with respect to the terms involved in the embodiments of the present specification:
pre-inspection: most of the checking items belong to pre-checking, checking is carried out immediately when a user submits resources through an SVN tool, and the checking calculation work is distributed to a user terminal depending on a local resource analysis tool of a submitter, so that the result of resource analysis is obtained in real time, and if the resources have problems, submitting is prevented and the user is informed how to solve the resource problems.
Post-inspection: a few checking items belong to post-checking, checking is carried out after a user submits resources, and automatic calculation is carried out by utilizing a public machine, such as: and (4) checking the code compiling error, and if the submitted resource has a problem, informing a user to modify.
Referring to fig. 1, a schematic diagram of an implementation environment provided by an embodiment of the present application is shown, where the implementation environment may include: at least one front analysis end 110 and a back analysis end 120, wherein the front analysis end 110 and the back analysis end 120 can perform data communication through a network.
Specifically, when the pre-analysis end 110 receives a resource submission request to be analyzed, a resource analysis tool in the pre-analysis end 110 is called to perform static feature analysis on the resource to be analyzed, so as to obtain a static analysis result; when the static analysis result meets the submission target, the front-end analysis end 110 submits the resource to be analyzed to the back-end analysis end 120; the post-analysis end 120 performs dynamic feature analysis on the received resource to be analyzed to obtain a dynamic analysis result of the resource to be analyzed.
The front end 110 can communicate with the back end 120 based on Browser/Server mode (Browser/Server, B/S) or Client/Server mode (Client/Server, C/S). The front end 110 may include: the physical devices may also include software running in the physical devices, such as application programs and the like. The operating system running on the front end analysis terminal 110 in the embodiment of the present application may include, but is not limited to, an android system, an IOS system, linux, windows, and the like.
The post-analysis end 120 and the pre-analysis end 110 may establish a communication connection through a wire or wirelessly, and the post-analysis end 120 may include an independently operating server, or a distributed server, or a server cluster composed of a plurality of servers, where the server may be a cloud server.
In order to solve the problems of low efficiency and low accuracy in resource check in the prior art, an embodiment of the present application provides a resource analysis method, where an execution main body of the resource analysis method may be the aforementioned front end, please refer to fig. 2, and the method may include:
s210, when a resource to be analyzed is submitted, determining a preset calling function corresponding to the resource to be analyzed; the preset calling function comprises a first storage path where the resource to be analyzed is located and a second storage path where the resource analysis tool is located.
In the embodiment of the application, the resource to be analyzed can be submitted through a resource management platform, wherein the resource management platform is a platform for performing operations such as resource processing, resource monitoring and resource submission. The preset calling function corresponding to the resource to be analyzed can be obtained by registering in the resource management platform, so that when the resource to be analyzed is submitted through the resource management platform, the resource analysis tool is called to perform resource analysis based on the preset calling function corresponding to the resource to be analyzed. Resource analysis items corresponding to a plurality of static characteristics of the resource to be analyzed are integrated in the resource analysis tool.
The resource to be analyzed may correspond to an engineering project, and a resource file in one engineering project may be regarded as one resource to be analyzed, that is, the resource to be analyzed may include resource files of various different forms. Correspondingly, the resource analysis tool further comprises resource analysis items aiming at resource files with different formats.
Furthermore, the first storage path and the second storage path can be storage paths under the front analysis end, so that the process of calling the resource analysis tool to perform static analysis on the resource to be analyzed can be realized at the front analysis end, and the processing pressure of the rear analysis end is reduced.
S220, calling the resource analysis tool under the second storage path based on the preset calling function, and transmitting the first storage path to the resource analysis tool based on the preset calling function.
In this embodiment, the function of presetting the call function may include calling a resource analysis tool in the second storage path, and transmitting the first storage path to the resource analysis tool, so that the resource analysis tool analyzes the resource to be analyzed in the first storage path. Specifically, the resource analysis tool may analyze the resource to be analyzed in the first storage path by reading the resource to be analyzed from the first storage path and placing the resource to be analyzed in a working area preset by the resource analysis tool, so that the resource analysis tool may analyze the resource to be analyzed in the working area; the resource analysis tool may also analyze the resource to be analyzed directly under the first storage path without reading out the resource.
And S230, analyzing the static characteristics of the resource to be analyzed under the first storage path based on the resource analysis tool to obtain a static analysis result of the resource to be analyzed.
The static characteristics can be characteristics of the resource to be analyzed in a non-compiling state or a non-running state, and a static analysis result of the resource to be analyzed can be obtained through a resource analysis item corresponding to static analysis in the resource analysis tool.
When submitting resources to be analyzed, the method first determines a preset calling function corresponding to the resources to be analyzed; calling a resource analysis tool under the second storage path based on a preset calling function, and transmitting the first storage path to the resource analysis tool; and analyzing the static analysis characteristics of the resource to be analyzed under the first storage path based on a resource analysis tool to obtain a static analysis result of the resource to be analyzed. Before submitting the resources to be analyzed to the version library, the method analyzes the static characteristics of the resources to be analyzed, so that the resources which do not accord with the submission target can be prevented from being submitted to the version library, and problems are prevented from occurring from the source; in addition, the resource analysis tool is called through the preset calling function corresponding to the resource to be analyzed, so that the analysis of the static characteristics of the resource to be analyzed is realized, and the efficiency and the accuracy of the resource analysis can be improved.
Further, as for the preset call function corresponding to the resource to be analyzed, the preset call function may be obtained through registration, specifically referring to fig. 3, which shows a preset call function registration method, where the method may include:
s310, determining the first storage path where the resource to be analyzed is located and the second storage path where the resource analysis tool is located.
S320, registering the preset calling function corresponding to the resource to be analyzed on a resource management platform based on the first storage path and the second storage path.
When registering a preset calling function corresponding to each resource to be analyzed, determining a first storage path where the resource to be analyzed is located, so that a resource analysis tool can definitely search the path of the resource to be analyzed; the second storage path where the resource analysis tool is located also needs to be determined, so that the preset call function can definitely find the path of the resource analysis tool.
Therefore, by pre-registering a preset calling function corresponding to the resource to be analyzed, when the resource to be analyzed is submitted, the calling of the resource analysis tool is firstly carried out through the preset calling function; and once the preset calling function is successfully registered, the preset calling function can be used for multiple times, so that the flexibility and the convenience of calling the resource analysis tool are improved.
For the generation of the preset call function, which may be implemented in a resource management platform in particular, refer to fig. 4, which shows a method for generating the preset call function, where the method may include:
and S410, acquiring a preset calling function creating template corresponding to the resource to be analyzed.
S420, configuring the preset calling function creating template based on the first storage path and the second storage path to obtain configured calling function information.
And S430, generating a preset calling function corresponding to the resource to be analyzed based on the configured calling function information.
When a preset calling function corresponding to a resource to be analyzed needs to be created, a preset calling function creating instruction can be executed on the resource management platform, so that a preset calling function creating template can be obtained. The preset calling function creating template comprises a plurality of configurable items, the plurality of configurable items comprise a storage path where the resource to be analyzed is located, a path where the resource analysis tool is located and the like, and the corresponding configurable items can be specifically configured based on the first storage path and the second storage path, so that a preset calling function corresponding to the resource to be analyzed is obtained.
Because the template generally has universality, in order to obtain a preset calling function corresponding to a resource to be analyzed, the template can be established by configuring the preset calling function; the configurable items in the preset calling function creation template can be flexibly modified, so that when the path of the resource to be analyzed changes or the path of the resource analysis tool changes, the corresponding configurable items can be adaptively modified, the changed preset calling function is generated, and the flexibility of creating the preset calling function is improved.
The static analysis characteristics of the resource to be analyzed can include the update quantity of the resource file in the resource to be analyzed, wherein the update quantity of the resource file is used for representing the sum of the byte number of the resource file and the byte number of the associated file which refers to the resource file. For example, for resource file A, it is referenced by resource file B, resource file C, and resource file D, so that the update amount of resource file A is the sum of the size of resource file A, the size of resource file B, the size of resource file C, and the size of resource file D. Referring specifically to fig. 5, a method for analyzing the update amount of a resource file is shown, where the method may include:
s510, acquiring a target updating amount of each resource file in the resource to be analyzed based on the resource analysis tool; the target update amount is obtained based on the byte number of each resource file and the reference relationship among the resource files.
S520, analyzing the target updating amount of each resource file to obtain an updating amount analysis result of the resource to be analyzed.
S530, determining the static analysis result based on the update analysis result.
The target update volume of each resource file can be recorded in an update volume log file, the update volume log file comprises a plurality of file update volume entries, and each entry corresponds to one resource file; the update amount log file can be included in the resource to be analyzed, so that when the resource analysis tool is called to update the amount of the resource file in the resource to be analyzed, the resource analysis tool can obtain the update amount log file, so as to traverse each file update amount entry in the update amount log file, determine the resource file with the target update amount larger than the preset update amount as the resource file to be confirmed, and determine that the corresponding resource to be analyzed does not meet the submission requirement. Namely, the updated quantity analysis result can be that the resource to be analyzed meets the submission requirement; or the update analysis result may include a prompt that the resource to be analyzed does not meet the submission requirement, and related information of the resource file whose update amount is greater than the preset update amount, where the related information may be information such as a file name, a file identifier, or a path where the file is located. The static analysis result may include the update amount analysis result.
By analyzing the updating amount of the resource files, the problem that the updating amount of the user resources is large due to the fact that the resource files with large updating amount are issued to the user can be avoided, and the speed and the efficiency of loading and using corresponding resources by the user are improved.
The static features may also include a globally unique identifier; accordingly, referring to FIG. 6, a method of globally unique identifier analysis is shown, which may include:
s610, determining existing global unique identifiers corresponding to resource files in the resources to be analyzed based on the resource analysis tool.
S620, carrying out path analysis on the existing global unique identifier to obtain an analysis path corresponding to each resource file.
S630, carrying out consistency comparison on the analysis path corresponding to each resource file and the target path where each resource file is located to obtain a global unique identifier analysis result of the resource to be analyzed.
S640, determining the static analysis result based on the global unique identifier analysis result.
In general, each globally unique identifier GUID and the path where the resource file is located are in one-to-one correspondence, and if the globally unique identifier GUID and the path do not correspond, it is indicated that the globally unique identifier GUID conflicts. In this embodiment, the existing global unique identifier may be a global unique identifier corresponding to each resource file, which is marked in the system, and may be accurate or inaccurate; and performing path analysis on the existing globally unique identifier identified by each resource file through a resource analysis tool to obtain an analysis path corresponding to each resource file. The target path of each resource file can be an actual storage path of each resource file; and carrying out consistency comparison on the analyzed path and a target path where the resource file is located, and determining whether the resource files have global unique identifier conflict or not according to a consistency comparison result. The global unique identifier analysis result can comprise prompt information of the resource to be analyzed through the global unique identifier analysis; or the global unique identifier analysis result may be prompt information that the resource to be analyzed does not pass the global unique identifier analysis, and related information of the resource file with the GUID conflict, where the related information may be information such as a file name, a file identifier, or a path where the file is located. The above-mentioned globally unique identifier analysis result may be included in the static analysis result. By analyzing the global unique identifier of the resource to be analyzed, the problem of GUID conflict in the issued resource information can be avoided, and the running stability of the resource to be analyzed is enhanced.
In the embodiment of the application, when the static analysis result indicates that the resource to be analyzed does not meet the submission target, automatically repairing the resource to be analyzed based on the resource analysis tool to obtain a repaired resource; for example, when the static features include an encoding format of the resource script, the encoding format of the resource script may be analyzed by a resource analysis tool; the method specifically comprises the following steps: when the coding format of the resource script is not a target format, converting the coding format of the resource script into the target format based on the resource analysis tool; and obtaining the repaired resources based on the resource script of the target format. If the encoding format of the C # and Lua scripts submitted by the user is UTF 8-WithoBOM, and the format does not conform to the pre-established script specification, the resource analysis tool automatically converts the encoding format of the script into UTF8-WithoutBOM, namely, the repair of the resources to be analyzed is realized, and the repaired resources are submitted.
In addition, when the static analysis result indicates that the resource to be analyzed accords with a submission target, submitting the resource to be analyzed to a post-analysis end; the post-analysis end is used for analyzing the dynamic characteristics of the resources to be analyzed to obtain the dynamic analysis result of the resources to be analyzed; the dynamic characteristics are used for characterizing the characteristics of the resource to be analyzed in the compiling or running process. The condition that the resource to be analyzed of the post-analysis end is compiled and the result that the resource to be analyzed has the compiling error may include: the resource code file modified by the developer is not completely submitted, and the developer is directly submitted after not performing local compiling modification. Under the conditions, after the released resources are downloaded and updated, the resources are locally reported in error and cannot run, and errors also occur when the installation package is correspondingly constructed.
In this embodiment, the reason why the compiling analysis of the resource to be analyzed is placed at the post-analysis end is that a code compiling error needs to be found by compiling the code, and once the code is compiled, a period of time is needed, and if the resource to be analyzed is placed at the pre-analysis end for analysis, a developer needs to wait for a period of time for submitting the code once, so that the code submitting process is longer; when the post-analysis end carries out compiling analysis, the post-public resources can be fully utilized, and the efficiency of the whole analysis process is improved. The pre-analysis is analysis in the process of submission, and when the resource to be analyzed passes the pre-analysis, the resource to be analyzed is submitted to a post-analysis end.
Referring to fig. 7, a flow chart of resource analysis is shown, which includes:
1. submitting resources by a submitter;
2. performing pre-submission check on the submitted resources through a resource analysis tool, and judging whether the submitted resources are normal or not;
3. when the resources are normal, submitting the submitted resources to a version library;
4. when the resources are abnormal, the resources are repaired through a resource analysis tool to obtain repaired resources, and the repaired resources are submitted to a version library; for resources which cannot be repaired through a resource analysis tool, prompting failure of submission and reporting errors;
5. checking the successfully submitted resources through a rear analysis end; when the resources are normal, ending the resource check; and when the resource is abnormal, sending an error report message.
The static feature analysis items integrated in the resource analysis tool may specifically include:
1. submitting a description specification check: to enter a meaningful and detailed submission description, it is also necessary to include a requirements sheet/bug sheet link.
2. Forbidding the submission of certain types of files: for example, dds because dds can result in packaging failures.
3. Atlas submission check: prefab of atlas can only be submitted under/Assets/Resources/directory, png and mat of atlas can only be submitted under/Assets/Common/directory.
4. Checking the picture format: the meta file corresponding to the scatter chart is checked for fields such as maxTextureSize, textureFormat, overridden, etc., and the picture format will be automatically standardized for pictures with incorrect format.
5. Checking the multiples of the length and the width of the picture 4: pictures with both length and width being multiples of 4 will, on average, be reduced in size by 75%.
6. The new file corresponds to meta submission check: the new file must be submitted with the corresponding meta file, and the function of automatically promoting the meta is also provided.
7. Material quality inspection: and when the new mat is added, the new mat is prevented from being missed, and if the submitter misses the mat, the submitter can automatically help to lift the mat.
8. Checking m _ Name field in mat: the copied mat can not be directly submitted only by changing the Name, but can be submitted only after automatically modifying the m _ Name field under the condition of Unity storage, otherwise, the material performance is abnormal.
9. File commit check with conflict prohibited: and submitting after the conflict is resolved.
10. Checking the influence of the modified file on the size of the update amount: a committed file may result in an update volume of greater than 50 megabytes, then commit is prohibited! The submitted file will result in an update volume of greater than 25 million and less than 50 million, and confirmation is prompted for a second pop-up. If yes, cs only performs a second popup to prompt the developer to confirm whether there is any change related to serialization, and submission is not prohibited.
GUID global duplicate check: GUID repetition in meta.
12. Meta file consistency check for trunk and branch: meta errors caused by thread-closing are avoided, resulting in abnormal performance.
13. Video format checking: the video coding format must be h264, the frame rate must be 24 frames, and there is also a requirement on the bit rate.
14. Video size checking: the video within 10 seconds is less than 10M, the video within 10 seconds to 25 seconds is less than 20M, and the video above 25 seconds is less than 25M.
15. File path and file name cannot be checked in chinese: avoiding some tool and function anomalies.
UTF8-WithoutBOM Format check of C # and lua scripts: the C # and lua scripts unify the encoding format, and must be UTF8-WithOutBOM format, otherwise, the format will be automatically changed into UTF8-WithOutBOM format at the time of submission.
17. Code specification checking: for example, a UnityEditor cannot be used in a C # script which is not under an Editor directory, so that a packaging error caused by common misuse of the UnityEditor is avoided.
Accordingly, a flow chart for performing resource pre-analysis can be seen in fig. 8.
Compiling error analysis items for codes contained in a post-analysis end: the public machine automatically compiles the codes, and if the codes have compiling errors, the codes are pushed to a submitter through related communication software to prompt resource repair. For example, please refer to fig. 9, which illustrates a code compilation error prompt interface.
For the resource analysis tool committchecker, the tool is located under the Unity engineering directory, and has a corresponding registration mechanism and an update mechanism, and the preset call function may be a hook. Executing CommitChecker. exe, if the parameter is not transmitted or the parameter is 'Register', indicating that the parameter is registered SvnHook; if the parameter of the biography is 'Unregister', it is the Svnhook of the anti-registration, register Svnhook and show and turn on and submit the check switch; the deregistration SvnHook indicates that the commit check switch is turned off. The reason for de-registration is that because there are very few submissions that cannot pass the checks of the submission checking tool, but the submissions have to be submitted, there is a need to de-register the submissions checking tool before it is closed. Of course, Svnhook can be manually registered and counterregistered, and the function is added to the Tools toolbar of Unity.
And each time the user starts Unity or finishes compiling, the user automatically checks whether the hook of the project is registered, if not, the user automatically registers SVNHook, and also checks whether the CommitChecker tool is the latest version, and if not, the user automatically updates the tool directory. This ensures that each submission is checked and that each submission checking tool is up-to-date. In addition, if the submitter intentionally deletes the folder in which the CommitChecker tool resides, causing the inspection tool to fail, the background will block submissions that have not been pre-inspected by the client and prompt the submitter to update the CommitChecker tool back to the engineering catalog.
The resource management platform may be specifically a tortoseisesvn (tortoseisesuubversion) or an SVN (version control system of open source code), which is described by taking the tortoseisesvn as an example, an existing key value pair of the tortosesvn may be read from a registry, and then a newly added hook and an existing hook are all rewritten into the registry, where the newly added hook refers to a newly added hook corresponding to a newly created project; the existing hook refers to a hook corresponding to an original project. Keys of each key-value pair are character strings spliced by HookType, WorkingCopyPath and Command line, wherein the HookType is a type of hook, the check is a check before submission, and the HookType is pre _ commit _ hook; this field may be the same in each hook; the WorkingCopyPath is a project path corresponding to the hook, and since each hook corresponds to a project and the paths of different projects are different, the field is different in each hook; CommandLine is the path that the CommitChecker tool resides in, and this field may be the same in every hook.
The behavior after automatic hook addition is shown in fig. 10 below. Similarly, the method of reverse registration of hook is to delete the hook in the registry. One hook corresponds to one TotosiseSVN key value pair, the key value pair exists in a registry of the TotosiseSVN of the Windows system, one project corresponds to one hook, and a plurality of projects exist in the terminal, so that a plurality of hooks exist at the same time.
After the Hook registration is successful, the SVN will execute the checking tool committchecker. exe and pass the parameters when the submitter submits. Two of the parameters are critical and are paths of two temporary files; example of a path of a temporary file:
C:\Users\UsersA\AppData\Local\Temp\svnD16C.tmp。
the content in the first temporary file is the submission description submitted this time, and the submission description can be used for making a submission description specification check; the contents in the second temporary file are paths of all files submitted this time, and the SVN status of each file to be submitted can be queried if there are paths of all files submitted this time, for example: add, delete.
Exe is needed to query the Svn state of the file according to the file path. The path on which svn.exe is located can be found in the Windows registry by finding the installation directory of tortoissvn from "softwave \ \ tortoissvn". However, if the user does not check the commandlinectienttools item when installing the tortoissvn, then the result is that there is no svn.exe under the installation directory of the tortoissvn, and the SVN command cannot be executed. The CommitChecker tool itself also integrates svn. exe to solve this problem. ForEach is used for parallel data processing, the Svn state of each file can be quickly obtained, and the Svn states of the files can be inquired, so that the files can be distinguished, and the files are newly added, modified and deleted.
Describing the implementation process of the update amount of the resource file, a full amount of bundle is automatically constructed, so as to generate a full amount of a log file, namely, bundle build info. With the information in fig. 11, the update amount caused by each file can be obtained through text analysis, as shown in fig. 12.
In addition, log files of the assignchangebundlelist can be automatically updated once a day by the resource analysis tool, and the log files are used for guaranteeing the real-time performance of the influence of the modified files on the size of the bundle.
Log file can then be used by the asset analysis tool to check the effect of modifying the file on the size of the update. The current inspection rules are as follows: a committed file may result in an update volume of greater than 50 megabytes, then commit is prohibited! The submitted file will result in an update volume of greater than 25 million and less than 50 million, and confirmation is prompted for a second pop-up. If yes, cs only performs a second popup to prompt the developer to confirm whether there is any change related to serialization, and submission is not prohibited.
The implementation process of the above GUID global repetition check is explained, each GUID corresponds to a path where the Unity resource file is located one by one, and if not, it is explained that the GUID has a problem, and Unity needs to be opened to regenerate a new GUID. There are two ways to determine whether guids conflict:
the first method is to input the GUID of the resource to be submitted, the tool can analyze the path, then compare the analyzed path with the real path of the resource to be submitted, if the path is consistent, it indicates that the file has no GUID conflict, otherwise, it indicates that the file has GUID conflict.
The second method assumes that the GUID is 3f00c7a036e1d4b47a173fc87e4ce828, and finds a file with the file name of 3f00c7a036e1d4b47a173fc87e4ce828 in/Library/metadata under the Unity engineering directory, i.e.,/Library/metadata/3 f/3f00c7a036e1d4b47a173fc87e4ce828, as shown in FIG. 13 below. If the directory in which the file corresponding to the GUID is located exists, the GUID is already used by other files, namely, the GUID conflicts.
Therefore, when the resource is submitted, the resource inspection method and the resource inspection system provide a scheme for carrying out automatic resource inspection through a tool, the work of the resource inspection is more instrumental and streamlined, the waste of manpower and possible careless omission are avoided, the resource is more standardized, the efficiency of a developer is higher, and the stability of engineering is guaranteed.
Referring to fig. 14, the present embodiment further provides a resource analysis apparatus, which may include:
a preset call function determining module 1410, configured to determine, when a resource to be analyzed is submitted, a preset call function corresponding to the resource to be analyzed; the preset calling function comprises a first storage path where the resource to be analyzed is located and a second storage path where the resource analysis tool is located;
a resource analysis tool calling module 1420, configured to call the resource analysis tool in the second storage path based on the preset call function, and transfer the first storage path to the resource analysis tool based on the preset call function;
the static analysis module 1430 is configured to analyze the static features of the resource to be analyzed in the first storage path based on the resource analysis tool, so as to obtain a static analysis result of the resource to be analyzed.
Further, the apparatus further comprises:
the first determining module is used for determining the first storage path where the resource to be analyzed is located and the second storage path where the resource analyzing tool is located;
and the registration module is used for registering the preset calling function corresponding to the resource to be analyzed on a resource management platform based on the first storage path and the second storage path.
Further, the registration module includes:
the template acquisition module is used for acquiring a preset calling function creation template corresponding to the resource to be analyzed;
the information configuration module is used for configuring the preset calling function creation template based on the first storage path and the second storage path to obtain configured calling function information;
and the generating module is used for generating a preset calling function corresponding to the resource to be analyzed based on the configured calling function information.
Further, the static characteristics comprise the update amount of resource files in the resources to be analyzed; the updated amount of the resource file is used for representing the sum of the byte number of the resource file and the byte number of an associated file which refers to the resource file;
the static analysis module 1430 includes:
the updating amount obtaining module is used for obtaining the target updating amount of each resource file in the resource to be analyzed based on the resource analysis tool; the target updating amount is obtained based on the byte number of each resource file and the reference relation among the resource files;
the update quantity analysis module is used for analyzing the target update quantity of each resource file to obtain an update quantity analysis result of the resource to be analyzed;
and the second determination module is used for determining the static analysis result based on the update analysis result.
Further, the static feature comprises a globally unique identifier;
the static analysis module 1430 includes:
a third determining module, configured to determine, based on the resource analysis tool, existing globally unique identifiers corresponding to resource files in the resource to be analyzed;
the path analysis module is used for carrying out path analysis on the existing global unique identifier to obtain an analysis path corresponding to each resource file;
the consistency comparison module is used for carrying out consistency comparison on the analysis path corresponding to each resource file and the target path where each resource file is located to obtain a global unique identifier analysis result of the resource to be analyzed;
a fourth determination module to determine the static analysis result based on the globally unique identifier analysis result.
Further, the apparatus further comprises:
and the resource repairing module is used for automatically repairing the resource to be analyzed based on the resource analysis tool when the static analysis result indicates that the resource to be analyzed does not accord with the submission target, so as to obtain a repaired resource.
Further, the static features include an encoding format of the resource script;
the resource repair module includes:
the format conversion module is used for converting the coding format of the resource script into a target format based on the resource analysis tool when the coding format of the resource script is not the target format;
and the repaired resource determining module is used for obtaining the repaired resources based on the resource script in the target format.
Further, the apparatus further comprises:
the dynamic analysis module is used for submitting the resource to be analyzed to a post-analysis end when the static analysis result indicates that the resource to be analyzed conforms to a submission target;
the post-analysis end is used for analyzing the dynamic characteristics of the resources to be analyzed to obtain the dynamic analysis result of the resources to be analyzed; the dynamic characteristics are used for characterizing the characteristics of the resource to be analyzed in the compiling or running process.
The device provided in the above embodiments can execute the method provided in any embodiment of the present application, and has corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in the above embodiments may be referred to a method provided in any of the embodiments of the present application.
The present embodiment also provides a computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded by a processor and executes any one of the methods described in the present embodiment.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform any of the methods in the above embodiments.
Further, fig. 15 shows a hardware structure diagram of an apparatus for implementing the method provided in the embodiment of the present application, and the apparatus may participate in constituting or including the apparatus provided in the embodiment of the present application. As shown in fig. 15, the device 10 may include one or more (shown as 102a, 102b, … …, 102 n) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. Besides, the method can also comprise the following steps: a display, an input/output interface (I/O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the I/O interface), a network interface, a power source, and/or a camera. It will be understood by those skilled in the art that the structure shown in fig. 15 is only an illustration and is not intended to limit the structure of the electronic device. For example, device 10 may also include more or fewer components than shown in FIG. 15, or have a different configuration than shown in FIG. 15.
It should be noted that the one or more processors 102 and/or other data processing circuitry described above may be referred to generally herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part in software, hardware, firmware, or any combination thereof. Further, the data processing circuitry may be a single, stand-alone processing module, or incorporated in whole or in part into any of the other elements in the device 10 (or mobile device). As referred to in the embodiments of the application, the data processing circuit acts as a processor control (e.g. selection of a variable resistance termination path connected to the interface).
The memory 104 may be used for storing software programs and modules of application software, such as program instructions/data storage devices corresponding to the methods described in the embodiments of the present application, and the processor 102 executes various functional applications and data processing by executing the software programs and modules stored in the memory 104, so as to implement a player preloading method or a player running method as described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory located remotely from processor 102, which may be connected to device 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of such networks may include wireless networks provided by the communication provider of the device 10. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the device 10 (or mobile device).
Any of the methods described above in this embodiment can be implemented based on the apparatus shown in fig. 15.
The present specification provides method steps as described in the examples or flowcharts, but may include more or fewer steps based on routine or non-inventive labor. The steps and sequences recited in the embodiments are but one manner of performing the steps in a multitude of sequences and do not represent a unique order of performance. In the actual system or interrupted product execution, it may be performed sequentially or in parallel (e.g., in the context of parallel processors or multi-threaded processing) according to the embodiments or methods shown in the figures.
The configurations shown in the present embodiment are only partial configurations related to the present application, and do not constitute a limitation on the devices to which the present application is applied, and a specific device may include more or less components than those shown, or combine some components, or have an arrangement of different components. It should be understood that the methods, apparatuses, and the like disclosed in the embodiments may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a division of one logic function, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or unit modules.
Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (11)

1. A resource analysis method, comprising:
when a resource to be analyzed is submitted, determining a preset calling function corresponding to the resource to be analyzed; the preset calling function comprises a first storage path where the resource to be analyzed is located and a second storage path where the resource analysis tool is located;
calling the resource analysis tool under the second storage path based on the preset calling function, and transmitting the first storage path to the resource analysis tool based on the preset calling function;
and analyzing the static characteristics of the resource to be analyzed under the first storage path based on the resource analysis tool to obtain a static analysis result of the resource to be analyzed.
2. The method of claim 1, further comprising:
determining the first storage path where the resource to be analyzed is located and the second storage path where the resource analysis tool is located;
and registering the preset calling function corresponding to the resource to be analyzed on a resource management platform based on the first storage path and the second storage path.
3. The method according to claim 2, wherein the registering, at the resource management platform, the preset calling function corresponding to the resource to be analyzed comprises:
acquiring a preset calling function creation template corresponding to the resource to be analyzed;
configuring the preset calling function creating template based on the first storage path and the second storage path to obtain configured calling function information;
and generating a preset calling function corresponding to the resource to be analyzed based on the configured calling function information.
4. The method of claim 1, wherein the static characteristics comprise an update amount of resource files in the resource to be analyzed; the updated amount of the resource file is used for representing the sum of the byte number of the resource file and the byte number of an associated file which refers to the resource file;
the analyzing the static features of the resource to be analyzed under the first storage path based on the resource analysis tool to obtain a static analysis result of the resource to be analyzed includes:
acquiring a target updating amount of each resource file in the resource to be analyzed based on the resource analysis tool; the target updating amount is obtained based on the byte number of each resource file and the reference relation among the resource files;
analyzing the target updating amount of each resource file to obtain an updating amount analysis result of the resource to be analyzed;
determining the static analysis result based on the update amount analysis result.
5. The method of claim 1, wherein the static features comprise a globally unique identifier;
the analyzing the static features of the resource to be analyzed under the first storage path based on the resource analysis tool to obtain a static analysis result of the resource to be analyzed includes:
determining existing global unique identifiers corresponding to resource files in the resources to be analyzed based on the resource analysis tool;
performing path analysis on the existing global unique identifier to obtain an analysis path corresponding to each resource file;
carrying out consistency comparison on the analysis path corresponding to each resource file and the target path where each resource file is located to obtain a global unique identifier analysis result of the resource to be analyzed;
determining the static analysis result based on the globally unique identifier analysis result.
6. The method of claim 1, further comprising:
and when the static analysis result indicates that the resource to be analyzed does not accord with the submission target, automatically repairing the resource to be analyzed based on the resource analysis tool to obtain a repaired resource.
7. The method of claim 6, wherein the static features comprise an encoding format of a resource script;
when the static analysis result indicates that the resource to be analyzed does not meet the submission target, automatically repairing the resource to be analyzed based on the resource analysis tool, and obtaining repaired resource comprises:
when the coding format of the resource script is not a target format, converting the coding format of the resource script into the target format based on the resource analysis tool;
and obtaining the repaired resources based on the resource script of the target format.
8. The method of claim 1, further comprising:
when the static analysis result indicates that the resource to be analyzed accords with a submission target, submitting the resource to be analyzed to a post-analysis end;
the post-analysis end is used for analyzing the dynamic characteristics of the resources to be analyzed to obtain the dynamic analysis result of the resources to be analyzed; the dynamic characteristics are used for characterizing the characteristics of the resource to be analyzed in the compiling or running process.
9. A resource analysis apparatus, comprising:
the system comprises a preset calling function determining module, a preset calling function determining module and a resource analyzing module, wherein the preset calling function determining module is used for determining a preset calling function corresponding to a resource to be analyzed when the resource to be analyzed is submitted; the preset calling function comprises a first storage path where the resource to be analyzed is located and a second storage path where the resource analysis tool is located;
the resource analysis tool calling module is used for calling the resource analysis tool under the second storage path based on the preset calling function and transmitting the first storage path to the resource analysis tool based on the preset calling function;
and the static analysis module is used for analyzing the static characteristics of the resource to be analyzed under the first storage path based on the resource analysis tool to obtain a static analysis result of the resource to be analyzed.
10. An electronic device, characterized in that the device comprises a processor and a memory, wherein at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the resource analysis method according to any one of claims 1 to 8.
11. A computer storage medium, characterized in that at least one instruction or at least one program is stored in the storage medium, which is loaded by a processor and executes the resource analysis method according to any one of claims 1 to 8.
CN202111304338.2A 2021-11-05 2021-11-05 Resource analysis method and device, electronic equipment and storage medium Pending CN114064467A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111304338.2A CN114064467A (en) 2021-11-05 2021-11-05 Resource analysis method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111304338.2A CN114064467A (en) 2021-11-05 2021-11-05 Resource analysis method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114064467A true CN114064467A (en) 2022-02-18

Family

ID=80274329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111304338.2A Pending CN114064467A (en) 2021-11-05 2021-11-05 Resource analysis method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114064467A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114666102A (en) * 2022-03-03 2022-06-24 华云数据控股集团有限公司 Resource permission method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114666102A (en) * 2022-03-03 2022-06-24 华云数据控股集团有限公司 Resource permission method and system
CN114666102B (en) * 2022-03-03 2024-02-06 华云数据控股集团有限公司 Resource licensing method and system

Similar Documents

Publication Publication Date Title
CN107608710B (en) Software project construction task configuration method and device based on Jenkins tool
US9411575B2 (en) Systems and methods for quality assurance automation
CN108595342B (en) Unit testing method and device
US20170199737A1 (en) Efficient detection of architecture related bugs during the porting process
US11651272B2 (en) Machine-learning-facilitated conversion of database systems
CN115454869A (en) Interface automation test method, device, equipment and storage medium
CN114691464A (en) Interface testing method, computer equipment and computer readable storage medium
US20210048999A1 (en) Automated generation of status chains for software updates
CN110990289B (en) Method and device for automatically submitting bug, electronic equipment and storage medium
CN103649924A (en) Embedded apparatus, program generation apparatus, and program
CN114064467A (en) Resource analysis method and device, electronic equipment and storage medium
CN108287720B (en) Software compiling method, device, equipment and storage medium
CN110716804A (en) Method and device for automatically deleting useless resources, storage medium and electronic equipment
CN113742228A (en) Test, data playback and recording method, system, device, equipment and medium
CN110007946B (en) Method, device, equipment and medium for updating algorithm model
CN113254326A (en) Method and system for releasing firmware codes of solid state disk by utilizing Jenkins
CN115981718A (en) Code publishing method and device, computer equipment and storage medium
US20190317877A1 (en) Application state monitoring
CN113918162A (en) Front-end code automatic checking method based on centralized management mode
CN115168175A (en) Program error solving method, device, electronic equipment and storage medium
CN111506339A (en) Method and device for processing change information of Software Development Kit (SDK)
CN111897794A (en) Database maintenance method and device, electronic equipment and storage medium
CN111142965A (en) Language configuration method and device, electronic equipment and storage medium
CN110022244B (en) Method and apparatus for transmitting information
US8825610B1 (en) System management based on goals relevant to a current state of a managed system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination