Resource file processing method and device, electronic equipment and readable medium

By monitoring the usage time and file identifier of resource files in the application's view controls, and combining this with the difference in server creation time, useless files are identified and deleted. This solves the problem of accidentally deleting useful resource files in existing technologies, effectively reducing the size of the APP installation package without affecting the normal operation of the application.

CN115017111BActive Publication Date: 2026-01-16BEIJING CHENGSHI WANGLIN INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210493402.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-07
Publication Date
2026-01-16
Estimated Expiration
2042-05-07

AI Technical Summary

Technical Problem

Existing technologies can easily lead to the accidental deletion of useful resource files when reducing the size of an app installation package, causing the app to crash or malfunction.

Method used

By monitoring the resource file usage time and file identifier in the application's view controls, and combining this with the difference in server creation time, useless files are identified and deleted when a preset threshold is exceeded.

Benefits of technology

Accurately identify and delete useless resource files that have not been used for a long time, avoid accidentally deleting useful files, reduce the size of the APP installation package without affecting the normal operation of the application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115017111B_ABST
    Figure CN115017111B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a resource file processing method and device, electronic equipment and readable medium, the method comprises: obtaining the use time and file identifier of the resource file in the application program; sending the use time and the file identifier to the server; the server is used for obtaining the creation time of the resource file in the application program, if the time difference between the use time and the creation time of the same file identifier exceeds the preset threshold, it is determined as a to-be-processed file identifier; receiving the to-be-processed file identifier sent by the server; the resource file corresponding to the to-be-processed file identifier in the application program is deleted as useless resource file. Embodiments of the present application accurately determine the last use time of the resource file by monitoring the resource file in the view control in the application program, so as to avoid deleting useful resource files in the APP installation package.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of Internet, and in particular, to a resource file processing method, a resource file processing device, an electronic device and a computer readable medium. BACKGROUND

[0002] With the rapid development of Internet technology, the update iteration speed of APP (Application) is getting faster and faster. The multiple version iterations of APP make the size of APP installation package increase. The large APP installation package occupies a large amount of storage space. Therefore, it is urgent for those skilled in the art to optimize the APP installation package.

[0003] In the prior art, the optimization method of the APP installation package is to delete useless resource files in the APP installation package. However, although the prior art can reduce the size of the APP installation package to a certain extent, useful resource files may be mistakenly deleted, which may cause APP crash, APP running error and other problems. SUMMARY

[0004] Embodiments of the present application provide a resource file processing method, device, electronic device and computer readable storage medium to solve the problem of mistakenly deleting useful resource files when reducing the size of the APP installation package.

[0005] Embodiments of the present application disclose a resource file processing method, comprising:

[0006] obtaining the use time and the file identifier of the resource file in the application program; the use time is obtained by listening to the view control of the application program, the view control is used to display the resource file in the interface of the application program, and the file identifier is used to uniquely identify the resource file;

[0007] sending the use time and the file identifier to the server; the server is used to obtain the creation time of the resource file in the application program, and if the time difference between the use time and the creation time of the same file identifier exceeds a preset threshold, the file identifier is determined as a to-be-processed file identifier;

[0008] receiving the to-be-processed file identifier sent by the server;

[0009] deleting the resource file corresponding to the to-be-processed file identifier in the application program as a useless resource file.

[0010] Optionally, the view control is provided with a plug-in function, and the plug-in function is used to listen to the resource file in the view control.

[0011] Optionally, after the corresponding resource file of the to-be-processed file identification in the application program is deleted as useless resource file, the method further comprises:

[0012] In response to an operation of displaying a target resource file on the application program, a target file identification of the target resource file is acquired;

[0013] If the corresponding resource file of the target file identification does not exist in the application program, the target file identification is sent to the server;

[0014] After receiving the target resource file sent by the server for the target file identification, the target resource file is displayed in the interface of the application program through the view control.

[0015] Optionally, the resource file comprises a picture file.

[0016] Optionally, the corresponding resource file of the to-be-processed file identification in the application program is deleted as useless resource file, comprising:

[0017] If the to-be-processed file identification is not referenced in the specified file of the application program, the corresponding resource file of the to-be-processed file identification in the application program is deleted as useless resource file.

[0018] Embodiments of the application further disclose a resource file processing device, comprising:

[0019] An acquisition module is configured to acquire a usage time and a file identification of a resource file in an application program; the usage time is obtained by monitoring a view control of the application program, the view control is used to display the resource file in an interface of the application program, and the file identification is used to uniquely identify the resource file;

[0020] A sending module is configured to send the usage time and the file identification to a server; the server is configured to acquire a creation time of the resource file in the application program, and if a time difference between the usage time and the creation time of the same file identification exceeds a preset threshold, determine the file identification as a to-be-processed file identification;

[0021] A receiving module is configured to receive the to-be-processed file identification sent by the server;

[0022] A deletion module is configured to delete the corresponding resource file of the to-be-processed file identification in the application program as useless resource file.

[0023] Optionally, the view control is provided with a plug-in function for monitoring a resource file in the view control.

[0024] Optionally, the apparatus further comprises a reacquisition module for acquiring a target file identifier of a target resource file in response to an operation of displaying the target resource file on the application program; if there is no resource file corresponding to the target file identifier in the application program, sending the target file identifier to the server; and after receiving the target resource file sent by the server in response to the target file identifier, displaying the target resource file in the interface of the application program through the view control.

[0025] Optionally, the resource file comprises a picture file.

[0026] Optionally, the deletion module is configured to delete, as useless resource files, resource files corresponding to the to-be-processed file identifiers in the application program if the to-be-processed file identifiers are not referenced in the specified files of the application program.

[0027] The embodiment of the application further discloses an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus.

[0028] The memory is used for storing a computer program.

[0029] The processor is used for executing the program stored on the memory, and realizes the method as described in the embodiment of the application.

[0030] The embodiment of the application further discloses one or more computer readable media, which store instructions, and when executed by one or more processors, make the processor execute the method as described in the embodiment of the application.

[0031] The embodiment of the application further discloses a computer program product, which is stored in a storage medium, and the computer program product is executed by at least one processor to realize the method as described in the embodiment of the application.

[0032] The embodiment of the application has the following advantages:

[0033] In the embodiment of the present application, the use time and the file identifier of the resource file in the application program are acquired, wherein the use time is obtained by monitoring the view control of the application program, the view control is used to display the resource file in the interface of the application program, and the file identifier is used to uniquely identify the resource file, then the use time and the file identifier are sent to the server, after the server acquires the creation time of the resource file in the application program, if the time difference between the use time and the creation time of the same file identifier exceeds the preset threshold value, it is indicated that the resource file corresponding to the file identifier is a useless resource file, then the file identifier is determined as a to-be-processed file identifier, after receiving the to-be-processed file identifier sent by the server, the resource file corresponding to the to-be-processed file identifier in the application program can be deleted as a useless resource file. The embodiment of the present application accurately determines the last use time of the resource file by monitoring the resource file in the view control of the application program, so that whether the resource file is not used beyond the preset threshold value can be determined based on the use time, if yes, the resource file can be deleted from the APP installation package as a useless resource file, when reducing the size of the APP installation package, the useful resource file is avoided from being mistakenly deleted. BRIEF DESCRIPTION OF DRAWINGS

[0034] Figure 1 is a step flow chart of a resource file processing method provided in the embodiment of the present application;

[0035] Figure 2 is a resource file processing flow chart provided in the embodiment of the present application;

[0036] Figure 3 is a structure block diagram of a resource file processing device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the above-mentioned objects, features and advantages of the present application more apparent and easy to understand, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0038] In the related art, the optimization method of the APP installation package is to use the function of detecting useless resources provided by Android Studio (a commonly used code editing and compiling tool for developers to develop Android application programs). Then, because the function of detecting useless resources provided by Android Studio, some resource files are called by a reflection method, or resource files built-in RN (an open source cross-platform mobile application development framework), these resource files are detected as useless resource files, and will be mistakenly deleted, which affects the normal operation of the APP.

[0039] To solve the above problems, the embodiment of the present application provides a resource file processing method, which uses Hook (a program segment for processing messages, which is hung into the system of a terminal device through system call) technology to monitor the resource file displayed in the view control and record the corresponding use time, and then, in combination with the creation time of the resource file, the resource file which is not used for a long time can be determined and deleted from the APP installation package to reduce the size of the APP installation package.

[0040] The resource file processing method provided by the embodiment of the present application can be applied to an application environment as shown in the figure. Figure 1 Specifically, the terminal device 102 obtains the use time and the file identifier of the resource file in the application program, the use time is obtained by monitoring the view control of the application program, the view control is used to display the resource file in the interface of the application program, and the file identifier is used to uniquely identify the resource file; the use time and the file identifier are sent to the server 104; the server 104 is used to obtain the creation time of the resource file in the application program, and if the time difference between the use time and the creation time of the same file identifier exceeds a preset threshold value, the file identifier is determined as a to-be-processed file identifier; the terminal device 102 receives the to-be-processed file identifier sent by the server; and the resource file corresponding to the to-be-processed file identifier in the application program is deleted as a useless resource file.

[0041] In practical application, the terminal device 102 can be but is not limited to various personal computers, notebook computers, smart phones, tablet computers, robots, vehicle-mounted terminals and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.

[0042] Referring to Figure 1 , a step flowchart of a resource file processing method provided in the embodiment of the present application is shown, which can specifically include the following steps:

[0043] Step 102, obtaining the use time and the file identifier of the resource file in the application program; the use time is obtained by monitoring the view control of the application program, the view control is used to display the resource file in the interface of the application program, and the file identifier is used to uniquely identify the resource file.

[0044] In a specific implementation, an APP installation package of an application program (APP) is packaged and encapsulated by a project code and a project resource package. The project source code refers to a source code of the APP, and the project resource package refers to a collection of resource files used in the project code of the APP, including resource files required for implementing various functions of the APP. Specifically, the resource files are design files for providing interface display or representing shapes, styles, sounds, and other properties in the APP, and can specifically include picture files, layout or style files, audio files, and video files, and the like.

[0045] The project resource package can include multiple resource files, each of which has a corresponding file identifier, and the resource file can be uniquely identified based on the file identifier. Specifically, the file identifier can be a number, a name, or the like string. For example, the file identifier can be [scenery picture.jpg] or [005.mp3]. In an optional embodiment, the file identifier can be an MD5 (Message Digest Algorithm, the fifth edition of message digest algorithm) value calculated based on the MD5 algorithm for the resource file. Specifically, the MD5 algorithm is a message digest algorithm, which can generate a special string according to a certain rule for the resource file. The MD5 value corresponding to a resource file is fixed. When the content of the resource file changes, the MD5 value also changes. Therefore, in the embodiment of the application, the MD5 value is used as the file identifier of the resource file. In addition to being used to verify whether the resource files are the same resource files, the MD5 value can also ensure that the resource files are not tampered with during saving or in the transmission process, thereby ensuring the security and accuracy of the resource files.

[0046] During the running of the APP, the resource files need to be displayed in the interface of the APP through a view control. For example, if a picture of a scenery needs to be displayed in the interface of the APP, the picture of the scenery needs to be filled into the view control for display. In the embodiment of the application, in order to accurately monitor the use time of the resource file when it was last used in the APP, the view control of the APP is monitored.

[0047] As an example, a plug-in function is set for a view control in the APP, specifically, the view control of the APP is subjected to program plug-in processing, which refers to inserting some probes in the APP on the basis of ensuring the integrity of the original logic of the APP, wherein the probe is essentially a code segment for information collection, which can be an assignment statement or a function call for collecting coverage information, etc. In this way, in the process of monitoring the APP in which the plug-in function is inserted, the resource file in the view control is monitored through the plug-in function, and if the resource file is displayed in the interface of the APP through the view control, it means that the resource file is used, and the latest use time of the resource file can be obtained. For example, if it is determined through the plug-in function that the view control of the APP displayed the picture file A1 at 2020-5-20 12:00:00, then 2020-5-20 12:00:00 can be taken as the use time of the picture file A1.

[0048] In the embodiments of the application, the processing of the resource file can be performed according to the version cycle of the APP, for example, when the APP is iterated from version V1.0 to version V2.0, the use time and the file identifier of the resource file in the APP can be obtained for subsequent processing of the resource file.

[0049] Step 104, sending the use time and the file identifier to a server; the server is configured to determine a to-be-processed file identifier if a time difference between the use time and the creation time of the resource file with the same file identifier exceeds a preset threshold after obtaining the creation time of the resource file in the APP.

[0050] In the server, the file identifier of the resource file of the APP and the creation time of the resource file in the APP are stored, wherein the creation time is the time when the resource file is first added to the APP in the process of iteration and update of the APP, for example, assuming that the picture file A2 is newly added at 2020-10-20 12:00:00 when the APP is updated from version V2.0 to version V3.0, then 2020-10-20 12:00:00 can be taken as the creation time of the picture file A2.

[0051] In the embodiments of the application, the APP can send the use time and the file identifier of the resource file to the server, the server can obtain the creation time and the file identifier of the resource file maintained in the server, then determine the use time and the creation time of the resource file with the same file identifier, and if the time difference between the two times exceeds a preset threshold, for example, more than half a year, it means that the resource file corresponding to the file identifier has not been used for a long time, which is a useless resource file, and the file identifier is determined as a to-be-processed file identifier, that is, the file identifier corresponding to the useless resource file needs to be deleted from the APP installation package.

[0052] Step 106, receiving the to-be-processed file identifier sent by the server.

[0053] Step 108, deleting the resource file corresponding to the to-be-processed file identifier in the application as useless resource file.

[0054] In the determination of the to-be-processed file identifier, the server can send the to-be-processed file identifier to the APP of the terminal device, and the APP will delete the resource file corresponding to the to-be-processed file identifier in the project resource package based on the to-be-processed file identifier, so as to avoid that the APP installation package occupies a large amount of memory space and affects the performance of the terminal device.

[0055] In the above resource file processing method, the usage time and the file identifier of the resource file in the application are obtained, wherein the usage time is obtained by listening to the view control of the application, and the view control is used to display the resource file in the interface of the application, and then the usage time and the file identifier are sent to the server. After the server obtains the creation time of the resource file in the application, if the time difference between the usage time and the creation time of the file identifier exceeds a preset threshold, it is determined that the resource file corresponding to the file identifier is a useless resource file, and the file identifier is determined as a to-be-processed file identifier. After receiving the to-be-processed file identifier sent by the server, the resource file corresponding to the to-be-processed file identifier in the application can be deleted as a useless resource file. In the embodiment of the application, the last usage time of the resource file is accurately determined by listening to the resource file in the view control of the application, so that whether the resource file is not used beyond the preset threshold can be determined based on the usage time. If so, the useful resource file can be deleted from the APP installation package. When reducing the size of the APP installation package, the useful resource file is not deleted by mistake.

[0056] On the basis of the above embodiment, a variant embodiment of the above embodiment is proposed. It should be noted that, in order to make the description brief, only the differences between the variant embodiment and the above embodiment are described in the variant embodiment.

[0057] In an exemplary embodiment, after the step 108, the method can further include the following steps:

[0058] In response to an operation of displaying a target resource file on the application, a target file identifier of the target resource file is obtained;

[0059] If the resource file corresponding to the target file identifier does not exist in the application, the target file identifier is sent to the server;

[0060] After receiving the target resource file sent by the server in response to the target file identifier, the target resource file is displayed in the interface of the application program through the view control.

[0061] In a specific implementation, after the useless resource file is deleted locally in the terminal device, the server still saves the useless resource file, and if the user needs to use the deleted useless resource file, the user can download the useless resource file from the server and display the useless resource file in the interface of the application program through the view control. For example, it is assumed that the resource file of the housing transaction block of the application program has not been used for a long time and has been deleted locally as a useless resource file, and if the user needs to find a house for rent, the user needs to browse the resource file of the housing transaction block of the application program, and at this time, the user can obtain the resource file of the housing transaction block from the server.

[0062] In the embodiment of the application, in response to the operation of displaying the target resource file on the application program, the target file identifier of the target resource file is obtained. For example, it is assumed that the user clicks the housing transaction block in the interface of the application program, and the file identifier of the resource file of the housing transaction block is obtained as the target file identifier. If the resource file corresponding to the target file identifier does not exist in the application program, it is indicated that the resource file has been deleted from the local as a useless resource file, and the target file identifier can be sent to the server to obtain the target resource file corresponding to the target file identifier from the server, so that the target resource file can be displayed in the interface of the application program through the view control.

[0063] In the above example embodiment, a bottom-up strategy is provided. Specifically, after the useless resource file is deleted locally in the application program, the useless resource file can still be saved in the server. Thus, if the deleted useless resource file needs to be displayed in the application program, the useless resource file can be obtained from the server and displayed in the interface of the application program, so as to ensure normal use of the application program by the user and ensure the use experience of the user.

[0064] In an example embodiment, the step 108 of deleting the resource file corresponding to the to-be-processed file identifier in the application program as a useless resource file can include the following steps:

[0065] If the to-be-processed file identifier is not referenced in the specified file of the application program, the resource file corresponding to the to-be-processed file identifier in the application program is deleted as a useless resource file.

[0066] In a specific implementation, the project code of the APP installation package can include a plurality of code files, and the code files include a specified file. The specified file is the development code of the application program and is very important and cannot be changed at will. If the specified file is changed, the application program may crash or run incorrectly.

[0067] Therefore, after obtaining the to-be-processed file identifier, the embodiment of the present application can search in the project code first, and if the search finds that the to-be-processed file identifier is in the specified file in the project code, the resource file corresponding to the to-be-processed file identifier will not be deleted in the APP. Of course, if the search finds that the to-be-processed file identifier is not in the specified file in the project code, the resource file corresponding to the to-be-processed file identifier can be deleted in the APP.

[0068] In the above exemplary embodiment, if the search finds that the to-be-processed file identifier is in the specified file in the project code, which means that the resource file is a useful resource file, the resource file can not be deleted, thereby ensuring the normal operation of the application program.

[0069] In actual application, after many versions of the APP are iterated, useless resource files, such as picture files, are retained, which increases the size of the APP installation package, and the mistaken deletion of the resource files will cause the abnormal function of the App, such as the failure to normally display pictures. In order to make the person skilled in the art better understand the embodiment of the present application, a complete example is used for illustration below. Referring to Figure 2 is a flowchart of processing of a resource file provided by the embodiment of the present application, and for the picture file of the APP installation package, the picture control is displayed through the view control imageview, and the specific processing steps are as follows:

[0070] Step 202, using the Hook technology, the use time of the picture file listened to by the picture control imageview set in the APP is obtained. Optionally, the picture file used by the user can be counted according to the version cycle;

[0071] Step 204, the MD5 value of the picture file used by the user is calculated;

[0072] Step 206, the MD5 value of the picture file used by the user is sent to the server;

[0073] Step 208, the server finds the picture file not used for a long time by comparing the local MD5 value and the creation time, and then, the picture file with the creation time and the use time more than half a year can be determined as the useless resource file with a high probability, and the APP of the terminal device can delete the picture as the useless resource file locally. In the embodiment of the present application, a bottom strategy is set, specifically, the picture deleted locally in the terminal device is still saved in the server, and if the user needs to use the picture deleted locally in the terminal device in the APP, the picture can be downloaded from the server and displayed in the interface of the application program.

[0074] By using the embodiment of the application, the real useless resource files in the APP installation package can be deleted, the size of the APP installation package is reduced, and in addition, by setting the bottom-up strategy, even if the resource files in the local APP installation package are deleted by the terminal device, the resource files can be retrieved from the server and displayed in the interface of the application program, thereby guaranteeing the user experience.

[0075] It should be noted that, for the method embodiments, in order to simply describe, they are all described as a series of action combinations, but those skilled in the art should know that the embodiments of the present application are not limited to the action sequence described, because according to the embodiments of the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions involved are not necessarily necessary for the embodiments of the present application.

[0076] With reference to Figure 3 , a structural block diagram of a resource file processing device provided in an embodiment of the present application is shown, which can specifically include the following modules:

[0077] The obtaining module 302 is configured to obtain the usage time and the file identifier of the resource file in the application program, wherein the usage time is obtained by monitoring the view control of the application program, the view control is used to display the resource file in the interface of the application program, and the file identifier is used to uniquely identify the resource file.

[0078] The sending module 304 is configured to send the usage time and the file identifier to a server, wherein the server is configured to, after obtaining the creation time of the resource file in the application program, determine the file identifier as a to-be-processed file identifier if the time difference between the usage time and the creation time of the same file identifier exceeds a preset threshold.

[0079] The receiving module 306 is configured to receive the to-be-processed file identifier sent by the server.

[0080] The deleting module 308 is configured to delete the resource file corresponding to the to-be-processed file identifier in the application program as a useless resource file.

[0081] In an exemplary embodiment, the view control is provided with a plug-in function, and the plug-in function is used to monitor the resource file in the view control.

[0082] In an example embodiment, the apparatus further comprises a reacquisition module configured to, in response to the operation of displaying the target resource file on the application program, acquire a target file identifier of the target resource file; if there is no resource file corresponding to the target file identifier in the application program, send the target file identifier to the server; and after receiving the target resource file sent by the server in response to the target file identifier, display the target resource file in the interface of the application program through the view control.

[0083] In an example embodiment, the resource file comprises a picture file.

[0084] In an example embodiment, the deletion module 308 is configured to, if the to-be-processed file identifier is not referenced in the specified file of the application program, delete the resource file corresponding to the to-be-processed file identifier in the application program as a useless resource file.

[0085] In the embodiment of the application, the last use time of the resource file is accurately determined by listening to the resource file in the application program on the view control, so that whether the resource file is not used for more than a preset threshold can be determined based on the use time, and if so, the resource file can be deleted from the APP installation package as a useless resource file. In the process of reducing the size of the APP installation package, the useful resource file is avoided from being mistakenly deleted.

[0086] For the apparatus embodiment, it is basically similar to the method embodiment, so the description is relatively simple, and the related parts refer to the part of the method embodiment.

[0087] Preferably, the embodiment of the application further provides an electronic device, which comprises a processor, a memory, and a computer program stored in the memory and executable on the processor. The computer program is executed by the processor to implement each process of the above-mentioned resource file processing method embodiment and achieve the same technical effects. To avoid repetition, no further description is given here.

[0088] The embodiment of the application further provides a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement each process of the above-mentioned resource file processing method embodiment and achieve the same technical effects. To avoid repetition, no further description is given here. The computer readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0089] The embodiment of the present application provides a computer program product, the program product is stored in a storage medium, the program product is executed by at least one processor to realize each process of the resource file processing method embodiment, and the same technical effects can be achieved, to avoid repetition, here no longer tedious.

[0090] It should be noted that in this paper, the term "including", "containing" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or device. Without more limitations, the element defined by the sentence "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0091] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment method can be realized by software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a plurality of instructions for making a terminal (which can be a mobile phone, computer, server, air conditioner or network equipment) execute the method described in each embodiment of the present application.

[0092] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above specific embodiments, and the above specific embodiments are only illustrative, not limiting, and those skilled in the art can make many forms under the inspiration of the present application without departing from the purpose of the present application and the scope protected by the claims.

[0093] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the embodiments of the present application can be realized by electronic hardware or combination of computer software and electronic hardware. Whether the functions are realized by hardware or software depends on the specific application and design constraints of the technical solutions. Professional technicians can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0094] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, and will not be described here.

[0095] In the embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only schematic. The division of the units is only a logical function division. There can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between the units can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.

[0096] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, that is, can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0097] In addition, each functional unit in the various embodiments of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.

[0098] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, and various program codes that can be stored in the medium.

[0099] The above describes only the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A processing method of installing a resource file in a package, characterized by, The method comprises the following steps: obtaining the latest use time and file identifier of a resource file in an application installation package; the use time is obtained by setting a plug-in function for a view control of the application and monitoring the resource file in the view control, the view control being used to display the resource file in an interface of the application, and the file identifier being used to uniquely identify the resource file; sending the use time and the file identifier to a server; the server is configured to determine a to-be-processed file identifier if a time difference between the use time and a creation time of the resource file, which is first added to the application installation package during iterative updating of the application, exceeds a preset threshold value; receiving the to-be-processed file identifier sent by the server; if the to-be-processed file identifier is not referenced in a specified file in project code of the application, deleting the resource file corresponding to the to-be-processed file identifier in the application installation package as a useless resource file.

2. The method of claim 1, wherein, After the resource file corresponding to the to-be-processed file identifier in the application is deleted as a useless resource file, the method further comprises the following steps: in response to an operation of displaying a target resource file on the application, obtaining a target file identifier of the target resource file; if the resource file corresponding to the target file identifier does not exist in the application, sending the target file identifier to the server; after receiving the target resource file sent by the server for the target file identifier, displaying the target resource file in the interface of the application through the view control.

3. The method according to any one of claims 1 to 2, characterized in that, The resource file comprises a picture file.

4. A processing apparatus for installing resource files in a package, characterized by comprising: The method comprises the following steps: an obtaining module is configured to obtain the latest use time and file identifier of a resource file in an application installation package; the use time is obtained by setting a plug-in function for a view control of the application and monitoring the resource file in the view control, the view control being used to display the resource file in an interface of the application, and the file identifier being used to uniquely identify the resource file; a sending module is configured to send the use time and the file identifier to a server; the server is configured to determine a to-be-processed file identifier if a time difference between the use time and a creation time of the resource file, which is first added to the application installation package during iterative updating of the application, exceeds a preset threshold value; a receiving module is configured to receive the to-be-processed file identifier sent by the server; a deleting module is configured to delete the resource file corresponding to the to-be-processed file identifier in the application installation package as a useless resource file if the to-be-processed file identifier is not referenced in a specified file in project code of the application.

5. The apparatus of claim 4, wherein, The device further comprises a reacquiring module, configured to acquire a target file identifier of a target resource file in response to an operation of displaying the target resource file on the application program; if there is no resource file corresponding to the target file identifier in the application program, send the target file identifier to the server; and after receiving the target resource file sent by the server in response to the target file identifier, display the target resource file in the interface of the application program through the view control.

6. An electronic device, comprising: The device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used for storing a computer program; The processor is used for executing the program stored in the memory, and implements the method according to any one of claims 1 to 3.

7. One or more computer-readable media having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method of any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method and device for resource processing in games, electronic equipment and storage medium

    CN110052032A