Application program storage resource attribution method and device, equipment and storage medium

By obtaining and analyzing the read and write stack of storage resource files generated during the operation of the application, the accurate attribution of storage resource files is achieved, and the problem of difficulty in determining the reason for the storage resource file changes in the prior art is solved, thereby improving the efficiency of storage optimization.

CN119537310APending Publication Date: 2025-02-28BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311102846.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-29
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The prior art is difficult to accurately attribute the storage resource files generated during the operation of the application, which makes it difficult to determine the specific reasons for the changes in the storage resource files, which in turn affects storage optimization.

Method used

By obtaining the storage resource file generated during the operation of the target application, detecting whether it is a change resource file. If it is a change resource file, it obtains its corresponding read and write stack, and attribution of code dimensions is performed based on the read and write stack to generate the attribution result of the storage resource file.

Benefits of technology

It realizes accurate attribution of storage resource file space occupation, and can determine the specific reasons for the changes in storage resource file based on the code execution logic, thereby facilitating the optimization of the resource storage of the application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537310A_ABST
    Figure CN119537310A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses an attribution method and device for application program storage resources, equipment and a storage medium. The method comprises the steps that a storage resource file generated in the running process of a target application program is acquired; detecting whether the storage resource file is a changed resource file or not; when the storage resource file is a changed resource file, obtaining a read-write stack corresponding to the storage resource file; and performing code dimension attribution on the storage resource file based on the read-write stack to generate an attribution result of the storage resource file. By implementing the technical scheme disclosed by the invention, the accurate attribution of the occupied space of the storage resource file is realized, and the resource storage of the application program is conveniently optimized in combination with the attribution result of the storage resource file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to an attribution method, device, equipment and storage medium for application storage resources. Background Art

[0002] When performing device storage testing on an application, it is necessary to determine the changes in the storage resource files generated during the operation of the application in order to clearly determine the storage space occupied by the application during operation. Although the changes in the corresponding storage resource files can be obtained from the test results, such as the storage of newly added pictures, videos, etc., the changes in resource files can only be located at the file level, and it is difficult to accurately attribute the storage of resource files generated by the application. However, if the changed resource files are not attributed, it is difficult to determine the specific reasons for the changes in the storage resource files generated by the application, and it is difficult to optimize the storage of the application based on the storage test results. Summary of the invention

[0003] In view of this, the embodiments of the present disclosure provide a method, apparatus, device and storage medium for attributing application storage resources to solve the problem of difficulty in attributing storage resource files of an application.

[0004] In a first aspect, an embodiment of the present disclosure provides an attribution method for application storage resources, comprising: obtaining a storage resource file generated during the operation of a target application, the storage resource file being a resource file obtained by running the target application under the current version, or a resource file generated during the current operation; detecting whether the storage resource file is a changed resource file; when the storage resource file is a changed resource file, obtaining a read-write stack corresponding to the storage resource file; attributing the storage resource file in a code dimension based on the read-write stack, and generating an attribution result for the storage resource file.

[0005] The attribution method for application storage resources provided by the embodiment of the present disclosure, when a changed resource file is detected, determines the corresponding calling method by reading and writing the stack of the changed resource file, thereby locating the corresponding code, and can determine the specific reason for the change of the storage resource file according to the execution logic of the code, thereby achieving accurate attribution of the space occupied by the storage resource file, and facilitating the optimization of the resource storage of the application in combination with the attribution results of the storage resource file.

[0006] In a second aspect, an embodiment of the present disclosure provides an attribution device for application storage resources, including: a resource file acquisition module, used to acquire storage resource files generated by a target application during operation; a detection module, used to detect whether a storage resource file is a changed resource file; a stack acquisition module, used to acquire a read-write stack corresponding to the storage resource file when the storage resource file is a changed resource file; and an attribution analysis module, used to attribute the code dimension of the storage resource file based on the read-write stack to generate an attribution result for the storage resource file.

[0007] In a third aspect, an embodiment of the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to execute the attribution method for application storage resources of the first aspect or any corresponding embodiment thereof.

[0008] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the attribution method for application storage resources of the first aspect or any corresponding implementation manner thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0010] Figure 1 is a flowchart of an attribution method for application storage resources according to an embodiment of the present disclosure;

[0011] Figure 2 is a flowchart of another attribution method for application storage resources according to an embodiment of the present disclosure;

[0012] Figure 3 is a flowchart of another attribution method for application storage resources according to an embodiment of the present disclosure;

[0013] Figure 4 This is a schematic diagram of uploading a full storage resource file according to an embodiment of the present disclosure;

[0014] Figure 5 is a structural block diagram of an attribution device for application storage resources according to an embodiment of the present disclosure;

[0015] Figure 6It is a schematic diagram of the hardware structure of the computer device of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0016] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0017] In the related art, changes to resource files generated by the running of an application can only be located at the file level, and it is difficult to determine the specific reason for the change in the resource file, thereby making it difficult to accurately attribute the storage of the resource files generated by the application.

[0018] Based on this, the technical solution disclosed in the present invention can obtain the read-write stack of the changed storage resource file, determine the calling method for the storage resource file from the read-write stack, and locate the code corresponding to the calling method, thereby achieving accurate attribution of the code dimension.

[0019] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0020] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0021] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0022] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0023] According to an embodiment of the present disclosure, an embodiment of a method for attributing application storage resources is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0024] In this embodiment, a method for attributing application storage resources is provided, which can be used in the above-mentioned computer devices, such as mobile phones, tablet computers, computers, etc. Figure 1 is a flowchart of an attribution method for application storage resources according to an embodiment of the present disclosure, such as Figure 1 As shown, the process includes the following steps:

[0025] Step S101, obtaining storage resource files generated during the operation of the target application.

[0026] The stored resource files are resource files obtained when the target application is run under the current version, or resource files generated during the current run.

[0027] The target application is an application installed in the computer device, such as a video application, an audio application, an office application, etc. The storage resource file is a resource file generated when the target application is running in the computer device. Specifically, the storage resource file may include video resources, picture resources, audio resources, etc.

[0028] Specifically, the target application has a corresponding storage space in the computer device, and the storage space is used to store resource files required for the target application to run and resource files generated during the running process. Accordingly, the computer device can obtain the storage resource files generated during the running process of the target application.

[0029] Step S102: Detect whether the stored resource file is a changed resource file.

[0030] The changed resource files are resource files that are changed during the current operation, and the changed resource files may specifically include newly added resource files, modified resource files, and deleted resource files.

[0031] Compare the storage resource file generated by the current operation with the storage resource file generated by the previous operation to determine whether the storage resource file generated by the current operation is a changed resource file. If the storage resource file generated by the current operation is a changed resource file, execute step S103, otherwise execute other operations. Among them, the other operations can be waiting for the next operation detection, can be a secondary detection to determine whether there is a change, or can be determining that there is no changed resource file at present. Other operations are not specifically limited here, and those skilled in the art can determine them according to actual needs.

[0032] Step S103: when the storage resource file is a changed resource file, obtain a read-write stack corresponding to the storage resource file.

[0033] The read-write stack is used to record various calling methods for storage resource files. The operation of an application will execute multiple calling methods at the same time, and the execution of each calling method will generate a corresponding resource file. Therefore, when it is determined that the storage resource file is a changed resource file, it means that the storage resource file is generated by the execution of certain calling methods at that time. At this time, the stack information of the target application during operation can be retrieved, and the read-write stack for the storage resource file can be parsed from it.

[0034] Step S104: Attributing the code dimension of the storage resource file based on the read-write stack to generate an attribution result of the storage resource file.

[0035] Combined with the read-write stack, the calling method that generates the storage resource file can be determined, and then the code program segment corresponding to the calling method can be located. In this way, the code location that generates the storage resource file can be determined from the code dimension, realizing the attribution of the storage resource file in the code dimension.

[0036] The attribution method for application storage resources provided in this embodiment, when a changed resource file is detected, determines the corresponding calling method by reading and writing the stack of the changed resource file, thereby locating the corresponding code, and can determine the specific reason for the change of the storage resource file based on the execution logic of the code, thereby achieving accurate attribution of the space occupied by the storage resource file, and facilitating the optimization of the resource storage of the application in combination with the attribution results of the storage resource file.

[0037] In this embodiment, a method for attributing application storage resources is provided, which can be used in computer devices such as mobile phones, tablet computers, and computers. Figure 2 is a flowchart of an attribution method for application storage resources according to an embodiment of the present disclosure, such as Figure 2 As shown, the process includes the following steps:

[0038] Step S201, obtaining the storage resource files generated by the target application during operation. The storage resource files are resource files obtained by running the target application under the current version, or resource files generated during the current operation. For detailed description, please refer to the relevant description of the above embodiment, which will not be repeated here.

[0039] Step S202: Detect whether the stored resource file is a changed resource file. For detailed description, please refer to the relevant description of the above embodiment, which will not be repeated here.

[0040] Step S203: when the storage resource file is a changed resource file, obtain a read-write stack corresponding to the storage resource file.

[0041] Specifically, the above step S203 may include:

[0042] Step S2031, obtaining the interface exchange data corresponding to the storage resource file, and determining the target interface corresponding to the storage resource file.

[0043] The interface exchange data is used to characterize the input and output of the storage resource file, that is, the IO data of the storage resource file. According to the interface exchange data, the program interface for controlling the input / output of the storage resource can be determined, and the program interface is the target interface.

[0044] Step S2032: determining a read / write stack for the storage resource file according to the target interface.

[0045] The storage resource file is input and output through the target interface, that is, the target interface is called to implement the input and output of the storage resource file. Since the read-write stack can record the calling process of the target interface, the read-write stack that records the calling process can be determined in combination with the calling process of the target interface.

[0046] Step S204: Attributing the code dimension of the storage resource file based on the read-write stack to generate an attribution result of the storage resource file.

[0047] Specifically, the above step S204 may include:

[0048] Step S2041, based on the read-write stack, determine the target method for generating the storage resource file, and locate the target code corresponding to the target method.

[0049] The calling process of the target method is recorded in the read-write stack. The target method is a calling method used to implement a specific function of the target application, and the target code is a programming language that implements the specific function.

[0050] By parsing the data linked list corresponding to the read-write stack, the mapping relationship between the calling method and the storage resource file is determined, and then the target method for generating the storage resource file can be determined based on the mapping relationship, and the corresponding target code can be located based on the target method.

[0051] Step S2042: determining the attribution result of the resource storage file generated during the operation of the target application according to the execution logic of the target code.

[0052] Combined with the execution logic of the target code, the sequential execution part, the branch execution part and the loop execution part of the target code are determined, and the execution result of the target code is generated according to the sequential execution logic of the sequential execution part, the judgment logic and selection logic of the branch execution part, and the loop logic of the loop execution part. According to the execution result of the target code, the storage resource files generated during the operation of the target application can be determined, and it can be determined which part of the code is used to generate the storage resource files, thereby achieving attribution for the storage resource files.

[0053] The attribution method of application storage resources provided in this embodiment can determine the read-write stack for the storage resource file by exchanging data with the interface corresponding to the storage resource file, thereby accurately determining the read-write operation for the storage resource file, and facilitating the determination of the generation logic of the storage resource file. The target method to be called for the storage resource file is parsed from the read-write stack, and the corresponding target code can be located in combination with the target method, so that the cause of the generation of the storage resource file can be further determined according to the execution logic of the target code, thereby ensuring the attribution accuracy of the storage resource file to the greatest extent.

[0054] In this embodiment, a method for attributing application storage resources is provided, which can be used in computer devices such as mobile phones, tablet computers, and computers. Figure 3 is a flowchart of an attribution method for application storage resources according to an embodiment of the present disclosure, such as Figure 3 As shown, the process includes the following steps:

[0055] Step S301, obtaining the storage resource files generated by the target application during operation. The storage resource files are resource files obtained by running the target application under the current version, or resource files generated during the current operation. For detailed description, please refer to the relevant description corresponding to the above embodiment, which will not be repeated here.

[0056] Step S302: Detect whether the stored resource file is a changed resource file.

[0057] Specifically, the above step S302 may include:

[0058] Step S3021, obtaining a first full storage resource file generated by the target application during the current running process and a second full storage resource file before the running process.

[0059] The first full storage resource is all the storage resources that the target application has when it is run; the second full storage resource file is all the storage resources that the target application has before running. Specifically, the first full storage resource and the second full storage resource can be represented in the form of data packets. The first full storage resource and the second full storage resource can be different versions of application resource data packets, or they can be resource data packets of the same version with different test dates.

[0060] The tester can upload the first full storage resource file and the second full storage resource file respectively through the resource package upload interface of the computer device, such as Figure 4 Correspondingly, the computer device can respond to the upload operation of the tester and obtain the first full storage resource file and the second full storage resource file uploaded by the tester.

[0061] Step S3022: Parse the first full storage resource file and the second full storage resource file to determine the target resource file that changes during the running of the application.

[0062] The first full storage resource file is parsed to determine all files included in the first full storage resource file. At the same time, the second full storage resource file is parsed to determine all files included in the second full storage resource file.

[0063] Compare all files included in the first full storage resource file with all files included in the second full storage resource file, determine the resource files that have changed in the first full storage resource file compared to the second full storage resource file, determine the changed resource files as target resource files, and determine the capacity and change type of the target resource files. The change type is used to characterize whether the target resource file is a newly added resource file, a modified resource file, a shared resource file, or a deleted resource file.

[0064] Step S3023: when the target resource file is a newly added resource file or a modified resource file, the target resource file is determined as a changed resource file.

[0065] According to the change type of the target resource file, it can be determined whether it is a newly added resource file or a modified resource file. When the target resource file is a newly added resource file or a modified resource file, the target resource file is determined as a modified resource file.

[0066] Of course, if the first full storage resource file is a resource file that has changed compared to the second full storage resource file, some storage resource files have been deleted, and these deleted storage resource files also belong to the target resource files that have changed. However, since they are deleted storage resource files, it means that they are optimized storage resource files or storage resource files are lost due to operation errors, and thus no files related to them will be generated during the current operation. For deleted storage resource files, they will be displayed in the generated resource analysis report so that testers can further confirm.

[0067] In some optional implementation manners, the method of determining that the target resource file is a newly added resource file in the above step S3023 includes:

[0068] Step a1: determine candidate new files from the first full storage resource file.

[0069] Step a2, determining whether the candidate newly added file is a top-level file.

[0070] Step a3: when the candidate newly added file is a top-level file, determine that the candidate newly added file is a newly added resource file.

[0071] Step a4: when the candidate newly added file is not a top-level file, obtain the parent directory corresponding to the candidate newly added file.

[0072] Step a5, detecting the file change status in the parent directory, recursively searching for candidate newly added files based on the file change status, and determining the target newly added file from the candidate newly added files.

[0073] The candidate newly added file is a resource file newly added compared to the second fully stored resource file in the preliminarily determined first fully stored resource file. The top-level file corresponding to the candidate newly added file is recursively searched, that is, the parent directory of the candidate newly added file is searched level by level until the top-level directory is reached.

[0074] If, through recursive search, it is determined that the candidate newly added file is a top-level file, that is, the candidate newly added file itself is a top-level directory and does not have any parent directory, the candidate newly added file is directly determined to be a newly added resource file.

[0075] If the recursive search determines that the candidate newly added file is not a top-level file, that is, the candidate newly added file has a corresponding parent directory, then continue to detect the file change status of the parent directory. If the space occupied by the folder corresponding to the parent directory changes slightly, it may be caused by changes in some sub-files in the folder. At this time, further detect each folder at the same level under the parent directory to determine the resource files that have been modified or deleted at the same level, and send them to the tester to determine the new resource files.

[0076] If the space occupied by the folder corresponding to the parent directory changes significantly, all files under the parent directory will be recursively searched to locate the candidate new files corresponding to the latest focus dimension (i.e. the current business line, the directory to which the current internal and external storage belongs), and the candidate new files generated by the latest focus dimension will be determined as new resource files.

[0077] In the above implementation, by detecting whether the candidate newly added file is a top-level file, the target newly added file can be accurately determined from the candidate newly added files, thereby ensuring the accuracy of the determination of the newly added file and avoiding misjudgment of the newly added file.

[0078] In some optional implementation manners, the method of determining that the target resource file is a newly added resource file in the above step S3023 may also include:

[0079] Step b1, obtaining the same-level deleted files corresponding to the candidate newly added files.

[0080] Step b2: Detect whether the candidate newly added file contains the same subfile as the file deleted at the same level, and / or detect whether the information digest value of the candidate newly added file is the same as the file deleted at the same level.

[0081] Step b3: when the sub-files are different and / or the information digest values ​​are different, the candidate newly added file is determined to be a reconstructed file.

[0082] Check whether there is a deleted file at the same level as the candidate new file. If there is a deleted file at the same level corresponding to the candidate new file, check whether the sub-files contained in the candidate new file and the deleted file at the same level are the same. If the candidate new file and the deleted file at the same level are exactly the same, then it is determined that the candidate new file is a rename and there is no new addition; if the candidate new file and the deleted file at the same level contain sub-files that are not exactly the same, it means that the candidate new file is a reconstructed file and can be sent to the tester for further judgment of the new resource file. If the candidate new file and the deleted file at the same level contain sub-files that are completely different, it means that the candidate new file is a new resource file.

[0083] If there is a deleted file at the same level corresponding to the candidate new file, it is also possible to detect whether the candidate new file and the deleted file have the same information digest values. If the candidate new file and the deleted file have the same information digest values, it is determined that the candidate new file is renamed and there is no new addition.

[0084] If the candidate new file has a different information summary value from the file deleted at the same level, and the sub-files contained in the candidate new file and the file deleted at the same level are not completely the same, it means that the candidate new file is a reconstructed file; if the candidate new file has a different information summary value from the file deleted at the same level, and the sub-files contained in the candidate new file and the file deleted at the same level are completely different, it means that the candidate new file is a new resource file.

[0085] In the above implementation, by detecting the information digest values ​​of the candidate newly added files and the files deleted at the same level and the subfiles contained in the candidate newly added files and the files deleted at the same level, the candidate newly added files are further analyzed, thereby improving the accuracy of the target newly added files.

[0086] In some optional implementation manners, the method of determining the target resource file as a modified resource file in the above step S3023 includes:

[0087] Step c1, determining candidate modified files from the first full storage resource file, and detecting each stack for reading and writing the candidate modified files.

[0088] Step c2, sorting the write capacity differences corresponding to the various stacks, and determining the attribution stack for generating the candidate modified file based on the sorting result.

[0089] Step c3, detecting whether the attribution stack that generates the file space change has a corresponding target stack.

[0090] Step c4, when the file changes of the target stack and the attribution stack are different, determine that the candidate modified file read and written by the attribution stack is a modified resource file.

[0091] The candidate modified file is a resource file that is initially determined to be modified compared to the second full storage resource file. After the candidate modified file is determined, the stack ears for reading and writing the candidate modified file are obtained, and the write capacity of each stack is sorted to determine which stack caused the modification of the storage resource file, that is, to determine the attribution stack corresponding to the candidate modified file.

[0092] The target stack is the stack in which the file space change occurs in the second full storage resource file, and the file space change amount of the target stack is the same as that of the attribution stack. Check whether the file changes generated by the target stack and the attribution stack are the same, that is, whether the files reduced by the target stack are the files added by the attribution stack, or whether the files added by the target stack are the files reduced by the attribution stack.

[0093] If the file changes generated by the target stack and the attribution stack are the same, it means that the storage resource file has not been modified, and only the storage directory of the storage resource file has been changed; if the file changes generated by the target stack and the attribution stack are different, it means that the storage resource file has been modified. At this time, it can be determined that the candidate modified file read and written by the attribution stack is the modified resource file.

[0094] For example, the write capacity of the attribution stack in the first full storage resource is A, and the corresponding write capacity of the target stack in the second full storage resource is B. The difference between the two is |AB|, that is, the write capacity difference is |AB|. When the attribution stack is determined to be TOP2 by comparing the write capacity differences, whether there is a target stack in the second full storage resource where file space changes have occurred. If so, and the file changes generated by the target stack and the attribution stack are the same, it means that the storage resource file has not been modified, and only the storage directory of the storage resource file has been changed; if the file changes generated by the target stack and the attribution stack are different, it means that the storage resource file has been modified.

[0095] In the above implementation, the write capacity differences of the stacks corresponding to the candidate modification files are detected and sorted to determine the attribution stack that generates the candidate modification file. Then, the file changes of the target stack and the attribution stack are combined to determine whether the candidate modification file is a modified resource file, thereby ensuring the accuracy of the determination of the modified resource file.

[0096] Step S303: when the storage resource file is a changed resource file, obtain the read / write stack corresponding to the storage resource file. For detailed description, please refer to the relevant description corresponding to the above embodiment, which will not be repeated here.

[0097] Step S304: attribute the code dimension of the storage resource file based on the read-write stack to generate an attribution result of the storage resource file. For detailed description, please refer to the relevant description corresponding to the above embodiment, which will not be repeated here.

[0098] In some optional embodiments, the above method may further include:

[0099] Step d1, performing a single analysis on the storage resource files generated during the operation of the target application to generate a resource analysis result.

[0100] Step d2: Visualize the resource analysis results and attribution results.

[0101] A single analysis specifically includes total storage ratio analysis, total file quantity analysis, large file storage analysis, expired file storage analysis, duplicate file storage analysis, discrete file storage analysis, resource utilization file analysis, and read-write ratio analysis.

[0102] Among them, large file storage analysis is used to detect whether each file exceeds the preset threshold. If it exceeds the preset threshold, it is judged as a large file; expired file storage analysis is used to count the number of expired files to determine the files whose creation exceeds the preset time; duplicate file storage analysis is used to distinguish whether there are duplicate files through the information summary value, and optimize the duplicate files; discrete file storage analysis is used to perform classification aggregation through regular matching, such as global aggregation, global aggregation of timestamp named files, etc.; resource utilization file analysis is used to rank the utilization of each folder to determine the number of times each resource is used; read-write ratio analysis is used to statistically calculate the number of read-write files to determine the files in six dimensions: high-frequency read files, high-frequency write files, low-frequency read files, low-frequency write files, high-frequency read-write files, and low-frequency read-write files, so as to optimize file reading and writing.

[0103] After completing a single analysis, the corresponding resource analysis results are generated, and the resource analysis results such as duplicate resource files, large resource files, expired resource files, and the attribution results of changed resource files are displayed to the corresponding R&D personnel in a visual manner, so that the R&D personnel can carry out targeted solutions.

[0104] The attribution method of application storage resources provided in this embodiment compares the first full storage resource file generated during the current operation with the second full storage resource file before the operation, so as to reasonably determine the changed resource file generated during the current operation. By visually displaying the attribution results and the resource analysis results of the storage resource files generated by the target application during the operation, it is convenient for testers to accurately locate the problem resource files for optimization, thereby improving the optimization efficiency for the storage resource files.

[0105] In this embodiment, an attribution device for application storage resources is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0106] This embodiment provides an attribution device for application storage resources, such as Figure 5 As shown, including:

[0107] The resource file acquisition module 401 is used to acquire the storage resource files generated during the operation of the target application program, wherein the storage resource files are resource files obtained when the target application program is run under the current version, or resource files generated during the current operation.

[0108] The detection module 402 is used to detect whether the storage resource file is a changed resource file.

[0109] The stack acquisition module 403 is used to acquire the read-write stack corresponding to the storage resource file when the storage resource file is a changed resource file.

[0110] The attribution analysis module 404 is used to attribute the code dimension of the storage resource file based on the read-write stack and generate an attribution result of the storage resource file.

[0111] In some optional embodiments, the stack acquisition module 403 may include:

[0112] The interface acquisition unit is used to acquire the interface exchange data corresponding to the storage resource file and determine the target interface corresponding to the storage resource file.

[0113] The stack determination unit is used to determine the read / write stack for the storage resource file according to the target interface.

[0114] In some optional embodiments, the attribution analysis module 404 may include:

[0115] The code positioning unit is used to determine the target method for generating the storage resource file based on the read-write stack, and locate the target code corresponding to the target method.

[0116] The code attribution unit is used to determine the attribution results of the resource storage files generated by the target application during its operation according to the execution logic of the target code.

[0117] In some optional embodiments, the detection module 402 may include:

[0118] The full resource acquisition unit is used to acquire a first full storage resource file generated by the target application during the current running process and a second full storage resource file before the running process.

[0119] The resource parsing unit is used to parse the first full storage resource file and the second full storage resource file to determine the target resource file that changes during the running of the application.

[0120] The changed resource determination unit is used to determine the target resource file as a changed resource file when the target resource file is a newly added resource file or a modified resource file.

[0121] In some optional implementation modes, the above-mentioned resource change determination unit is specifically used to: determine a candidate new file from the first full storage resource file; determine whether the candidate new file is a top-level file; when the candidate new file is a top-level file, determine that the candidate new file is a new resource file; when the candidate new file is not a top-level file, obtain the parent directory corresponding to the candidate new file; detect the file change status in the parent directory, recursively search the candidate new files based on the file change status, and determine the target new file from the candidate new files.

[0122] In some optional implementation modes, the above-mentioned change resource determination unit is also specifically used to: obtain the same-level deleted file corresponding to the candidate new file; detect whether the sub-files contained in the candidate new file and the same-level deleted file are the same, and / or detect whether the information summary values ​​of the candidate new file and the same-level deleted file are the same; when the sub-files are different, and / or the information summary values ​​are different, determine that the candidate new file is a reconstructed file.

[0123] In some optional implementation modes, the above-mentioned change resource determination unit is specifically used to: determine candidate modified files from the first full storage resource file, and detect each stack that reads and writes the candidate modified files; sort the write capacity differences corresponding to each stack, and determine the attribution stack that generates the candidate modified files based on the sorting result; detect whether the attribution stack that generates the file space change has a corresponding target stack; when the file changes of the target stack and the attribution stack are different, determine that the candidate modified file read and written by the attribution stack is a modified resource file.

[0124] In some optional embodiments, the above device may further include:

[0125] The single analysis module is used to perform a single analysis on the storage resource files generated during the operation of the target application and generate resource analysis results.

[0126] The display module is used to visualize the resource analysis results and attribution results.

[0127] The further functional description of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0128] In this embodiment, the attribution device of the application storage resources is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0129] The attribution device for application storage resources provided in this embodiment, when detecting a changed resource file, determines the corresponding calling method by reading and writing the stack of the changed resource file, thereby locating the corresponding code, and can determine the specific reason for the change of the storage resource file according to the execution logic of the code, thereby realizing accurate attribution of the code dimension, and facilitating the optimization of the resource storage of the application in combination with the attribution results of the storage resource file.

[0130] The present disclosure also provides a computer device having the above Figure 5 The application shown stores the attribution device of the resource.

[0131] See also Figure 6 , Figure 6 is a schematic diagram of a computer device provided by an optional embodiment of the present disclosure, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.

[0132] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0133] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0134] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0135] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0136] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0137] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0138] The computer device also includes a communication interface for data communication between the computer device and other devices or a communication network.

[0139] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0140] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for attributing application storage resources, characterized in that: include: Acquire a storage resource file generated during the operation of the target application, wherein the storage resource file is a resource file obtained by running the target application under the current version, or a resource file generated during the current operation; Detecting whether the storage resource file is a changed resource file; When the storage resource file is a change resource file, obtaining a read-write stack corresponding to the storage resource file; The code dimension of the storage resource file is attributed based on the read-write stack to generate an attribution result of the storage resource file.

2. The method according to claim 1, characterized in that: The obtaining of the read-write stack corresponding to the storage resource file includes: Acquire the interface exchange data corresponding to the storage resource file, and determine the target interface corresponding to the storage resource file; A read / write stack for the storage resource file is determined according to the target interface.

3. The method according to claim 1 or 2, characterized in that: The attributing the code dimension of the storage resource file based on the read-write stack to generate an attribution result of the storage resource file includes: Based on the read-write stack, determine the target method for generating the storage resource file, and locate the target code corresponding to the target method; According to the execution logic of the target code, an attribution result of the storage resource file generated by the target application during its operation is determined.

4. The method according to claim 1, characterized in that: The detecting whether the stored resource file is a changed resource file comprises: Obtaining a first full storage resource file generated by the target application during the current running process and a second full storage resource file before the running process; Parsing the first full storage resource file and the second full storage resource file to determine a target resource file that is changed during the running of the application; When the target resource file is a newly added resource file or a modified resource file, the target resource file is determined as the changed resource file.

5. The method according to claim 4, characterized in that The method of determining that the target resource file is a newly added resource file includes: Determining a candidate new file from the first full storage resource file; Determine whether the candidate newly added file is a top-level file; When the candidate newly added file is the top-level file, the candidate newly added file is determined to be the newly added resource file.

6. The method according to claim 5, characterized in that Also includes: When the candidate newly added file is not the top-level file, obtaining a parent directory corresponding to the candidate newly added file; The file change status in the parent directory is detected, the candidate newly added files are recursively searched based on the file change status, and the target newly added file is determined from the candidate newly added files.

7. The method according to claim 5, characterized in that Also includes: Obtain the same-level deleted file corresponding to the candidate newly added file; Detecting whether the candidate newly added file and the subfiles contained in the same-level deleted file are the same, and / or detecting whether the information digest values ​​of the candidate newly added file and the same-level deleted file are the same; When the sub-files are different and / or the information digest values ​​are different, it is determined that the candidate newly added file is a reconstructed file.

8. The method according to claim 4, characterized in that Determining that the target resource file is a method of modifying a resource file includes: Determine a candidate modified file from the first full storage resource file, and detect each stack for reading and writing the candidate modified file; Sorting the write capacity differences corresponding to the stacks, and determining the attribution stack for generating the candidate modified file based on the sorting result; Detecting whether the attribution stack that generates the file space change has a corresponding target stack; When the file changes of the target stack and the attribution stack are different, the candidate modified file read and written by the attribution stack is determined to be a modified resource file.

9. The method according to claim 1, characterized in that: Also includes: Performing a single analysis on the storage resource files generated during the operation of the target application to generate a resource analysis result; The resource analysis results and the attribution results are visualized.

10. An attribution device for application storage resources, characterized in that: include: A resource file acquisition module is used to acquire storage resource files generated during the operation of the target application, wherein the storage resource files are resource files obtained when the target application is run under the current version, or resource files generated during the current operation; A detection module, used for detecting whether the storage resource file is a changed resource file; A stack acquisition module, used for acquiring a read-write stack corresponding to the storage resource file when the storage resource file is a change resource file; The attribution analysis module is used to attribute the code dimension of the storage resource file based on the read-write stack to generate an attribution result of the storage resource file.

11. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the attribution method for application storage resources described in any one of claims 1 to 7 by executing the computer instructions.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the attribution method for application storage resources according to any one of claims 1 to 7.