CN115017111A - Resource file processing method and device, electronic equipment and readable medium - Google Patents

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

Info

Publication number
CN115017111A
CN115017111A CN202210493402.4A CN202210493402A CN115017111A CN 115017111 A CN115017111 A CN 115017111A CN 202210493402 A CN202210493402 A CN 202210493402A CN 115017111 A CN115017111 A CN 115017111A
Authority
CN
China
Prior art keywords
file
resource file
application program
resource
identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210493402.4A
Other languages
Chinese (zh)
Inventor
弓晓东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Chengshi Wanglin Information Technology Co Ltd
Original Assignee
Beijing Chengshi Wanglin Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Chengshi Wanglin Information Technology Co Ltd filed Critical Beijing Chengshi Wanglin Information Technology Co Ltd
Priority to CN202210493402.4A priority Critical patent/CN115017111A/en
Publication of CN115017111A publication Critical patent/CN115017111A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/168Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention provides a method and a device for processing a resource file, electronic equipment and a readable medium, wherein the method comprises the following steps: acquiring the use time and the file identification of a resource file in an application program; sending the use time and the file identification to a server; the server is used for determining the file identifier to be processed if the time difference value between the use time and the creation time, which are the same as the file identifier, exceeds a preset threshold value after the creation time of the resource file in the application program is obtained; receiving the identifier of the file to be processed sent by the server; and deleting the resource file corresponding to the file identifier to be processed in the application program as a useless resource file. According to the embodiment of the invention, the latest using time of the resource file is accurately determined by monitoring the view control of the resource file in the application program, so that the useful resource file in the APP installation package is prevented from being deleted.

Description

Resource file processing method and device, electronic equipment and readable medium
Technical Field
The embodiment of the invention relates to the technical field of internet, in particular to a resource file processing method, a resource file processing device, electronic equipment and a computer readable medium.
Background
With the rapid development of internet technology, the update iteration speed of APPs (applications)) is faster and faster, multiple versions of APPs are iterated to increase the size of an APP installation package, and an oversized APP installation package occupies more storage space, so that optimization of the APP installation package becomes an urgent problem to be solved by those skilled in the art.
In the prior art, the optimization mode of the APP installation package is to delete useless resource files in the APP installation package. However, although the prior art can reduce the volume of the APP installation package to a certain extent, the useful resource files are deleted by mistake, and then problems such as APP crash and APP running error occur.
Disclosure of Invention
The embodiment of the invention provides a resource file processing method, a resource file processing device, electronic equipment and a computer readable storage medium, and aims to solve the problem that useful resource files are deleted by mistake when the volume of an APP installation package is reduced.
The embodiment of the invention discloses a method for processing a resource file, which comprises the following steps:
acquiring the use time and the file identification of a resource file in an application program; the service time is obtained by monitoring a view control of the application program, the view control is used for displaying the resource file in an interface of the application program, and the file identification is used for uniquely identifying the resource file;
sending the use time and the file identification to a server; the server is used for determining the file identifier to be processed if the time difference value between the use time and the creation time, which are the same as the file identifier, exceeds a preset threshold value after the creation time of the resource file in the application program is obtained;
receiving the identifier of the file to be processed sent by the server;
and deleting the resource file corresponding to the file identifier to be processed in the application program as a useless resource file.
Optionally, the view control is provided with an instrumentation function, and the instrumentation function is used for monitoring resource files in the view control.
Optionally, after deleting the resource file corresponding to the to-be-processed file identifier in the application program as a useless resource file, the method further includes:
responding to the operation of displaying a target resource file on the application program, and acquiring a target file identifier of the target resource file;
if the resource file corresponding to the target file identification does not exist in the application program, sending the target file identification to the server;
and after receiving the target resource file sent by the server aiming at the target file identifier, displaying the target resource file in an interface of the application program through the view control.
Optionally, the resource file includes a picture file.
Optionally, the deleting the resource file corresponding to the to-be-processed file identifier in the application program as a useless resource file includes:
and if the identifier of the file to be processed is not referred to in the specified file of the application program, deleting the resource file corresponding to the identifier of the file to be processed in the application program as a useless resource file.
The embodiment of the invention also discloses a device for processing the resource file, which comprises the following components:
the acquisition module is used for acquiring the use time and the file identification of the resource file in the application program; the service time is obtained by monitoring a view control of the application program, the view control is used for displaying the resource file in an interface of the application program, and the file identification is used for uniquely identifying the resource file;
the sending module is used for sending the using time and the file identification to a server; the server is used for determining the file identifier to be processed if the time difference value between the use time and the creation time which are the same as the file identifier exceeds a preset threshold value after acquiring the creation time of the resource file in the application program;
the receiving module is used for receiving the file identifier to be processed sent by the server;
and the deleting module is used for deleting the resource file corresponding to the file identifier to be processed in the application program as a useless resource file.
Optionally, the view control is provided with an instrumentation function, and the instrumentation function is used for monitoring resource files in the view control.
Optionally, the apparatus further comprises: the reacquisition module is used for responding to the operation of displaying the target resource file on the application program and acquiring the target file identifier of the target resource file; if the resource file corresponding to the target file identification does not exist in the application program, sending the target file identification to the server; and after receiving the target resource file sent by the server aiming at the target file identifier, displaying the target resource file in an interface of the application program through the view control.
Optionally, the resource file includes a picture file.
Optionally, the deleting module is configured to delete, as a useless resource file, the resource file corresponding to the identifier of the to-be-processed file in the application program if the identifier of the to-be-processed file is not referred to in the specified file of the application program.
The embodiment of the invention also discloses electronic equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory finish mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the method according to the embodiment of the present invention when executing the program stored in the memory.
Also disclosed are one or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform a method according to an embodiment of the invention.
The embodiment of the invention also discloses a computer program product, which is stored in a storage medium and is executed by at least one processor to realize the method according to the embodiment of the invention.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, the use time and the file identification of the resource file in the application program are obtained, wherein the service time is obtained by monitoring a view control of the application program, the view control is used for displaying the resource file in an interface of the application program, the file identification is used for uniquely identifying the resource file, then, the using time and the file identification are sent to a server, after the server acquires the creating time of the resource file in the application program, if the time difference value between the using time and the creating time which are the same as the file identification exceeds a preset threshold value, the resource file corresponding to the file identification is a useless resource file, the file identification is determined as a file identification to be processed, and when the identifier of the file to be processed sent by the server is received, the resource file corresponding to the identifier of the file to be processed in the application program can be deleted as a useless resource file. The embodiment of the invention accurately determines the latest using time of the resource file by monitoring the view control of the resource file in the application program, thereby determining whether the resource file exceeds the preset threshold value and is not used based on the using time, if so, deleting the resource file from the APP installation package as a useless resource file, and avoiding mistaken deletion of the useful resource file when the volume of the APP installation package is reduced.
Drawings
FIG. 1 is a flowchart illustrating steps of a method for processing a resource file according to an embodiment of the present invention;
FIG. 2 is a flow chart of a process for resource files provided in an embodiment of the present invention;
fig. 3 is a block diagram of a resource file processing apparatus provided in an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
In the related art, the optimization method of the APP installation package is a function of detecting useless resources provided by the Android Studio (a common code editing and compiling tool used by a developer to develop an application program of the Android). Then, due to the function of detecting useless resources provided by the Android Studio, some resource files are called in a reflection mode or are built in an RN (open source cross-platform mobile application development framework), and the resource files are detected as useless resource files and can be deleted by mistake to influence the normal operation of the APP.
In view of the above problems, embodiments of the present invention provide a method for processing resource files, which uses Hook (a program segment for processing messages, and is hung to a system of a terminal device through system call) technology to monitor resource files displayed in a view control, and record corresponding use time, and then may determine resource files that are not used for a long time in combination with creation time of the resource files, and delete the resource files from an APP installation package to reduce the volume of the APP installation package.
The resource file processing method provided by the embodiment of the invention can be applied to the application environment shown in fig. 1. Wherein the terminal devices 102 each communicate with the server 104 via a network. Specifically, the terminal device 102 obtains the use time and the file identifier of the resource file in the application program; the service time is obtained by monitoring a view control of the application program, the view control is used for displaying the resource file in an interface of the application program, and the file identification is used for uniquely identifying the resource file; sending the usage time and the file identifier to the server 104; the server 104 is configured to determine that the file identifier is a to-be-processed file identifier if a time difference between the use time and the creation time, which are the same as the file identifier, exceeds a preset threshold after obtaining the creation time of the resource file in the application program; the terminal equipment 102 receives a file identifier to be processed sent by the server; and deleting the resource file corresponding to the file identifier to be processed in the application program as a useless resource file.
In practical applications, the terminal device 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, robots, vehicle terminals, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
Referring to fig. 1, a flowchart illustrating steps of a method for processing a resource file provided in an embodiment of the present invention is shown, which may specifically include the following steps:
102, acquiring the use time and the file identification of a resource file in an application program; the service time is obtained by monitoring a view control of the application program, the view control is used for displaying the resource file in an interface of the application program, and the file identification is used for uniquely identifying the resource file.
In a specific implementation, an application program (APP) installation package of an APP is obtained by packaging and encapsulating a project code and a project resource package. The project source code refers to the source code of the APP, and the project resource package refers to the set of resource files used in the project code of the APP, including the resource files required for realizing various functions of the APP. Specifically, the resource file is a design file providing an interface presentation or representing attributes such as shapes, styles, sounds and the like in the APP, and may specifically include a picture file, a layout or style file, an audio file, a video file and the like.
The project resource package may include a plurality of resource files, each resource file has a corresponding file identifier, and the resource files may be uniquely identified based on the file identifiers, specifically, the file identifiers may be character strings such as numbers and names, for example, the file identifiers may be [ landscape image ] jpg ], [ 005.mp3 ]. In an optional embodiment, the file identifier may be an MD5 value calculated for the resource file based on an MD5(Message Digest Algorithm, fifth edition), specifically, the MD5 Algorithm is a Message Digest Algorithm, a string of special character strings may be generated according to a certain rule for the resource file, an MD5 value corresponding to one resource file is fixed, and after content of the resource file changes, the MD5 value may also change, so that, in the embodiment of the present invention, the MD5 value is used as the file identifier of the resource file, which may be used to verify whether the resource file is the same resource file, and may also ensure that the resource file is not tampered during storage or transmission, thereby ensuring security and accuracy of the resource file.
In the running process of the APP, the resource file needs to be shown through a view control (view) in the interface of the APP, for example, if a picture of a landscape needs to be shown in the interface of the APP, the picture of the landscape needs to be shown after being filled in the view control. In the embodiment of the invention, in order to accurately monitor the use time of the resource file which is used in the APP last time, monitoring is performed through a view control of the APP.
As an example, an instrumentation function is set in an APP for a view control, specifically, program instrumentation processing is performed on the view control of the APP, where the program instrumentation processing refers to inserting some probes into the APP on the basis of ensuring the original logic integrity of the APP, where the probes are essentially code segments for performing information acquisition, and may be assignment statements or function calls for acquiring overlay information, and the like. Therefore, in the process of monitoring the APP with the inserted pile function, the resource file in the view control is monitored through the inserted pile function, if the resource file is displayed in the interface of the APP through the view control, the resource file is used, and the latest service time of the resource file can be obtained. For example, if the view control of the APP is determined by the instrumented function, at 2020-5-2012: 00: 00 shows picture file a1, then 2020-5-2012: 00: 00 is used as the use time of the picture file a 1.
In the embodiment of the present invention, the processing of the resource file may be performed according to the version cycle of the APP, for example, when the APP iterates from version V1.0 to version V2.0, the use time and the file identifier of the resource file in the APP may be obtained, and the processing of the resource file may be performed later.
Step 104, sending the use time and the file identification to a server; and the server is used for determining the file identifier to be processed if the time difference value between the use time and the creation time which are the same as the file identifier exceeds a preset threshold value after acquiring the creation time of the resource file in the application program.
In the server, the file identification of the resource file of the APP and the creation time of the resource file in the APP are stored, where the creation time is the time of adding to the APP for the first time in the iterative update of the APP, for example, assuming that the update is from version V2.0 to version V3.0, at 2020-10-2012: 00: 00 newly adding picture file a2, 2020-10-2012: 00: 00 is used as the creation time of the picture file a 2.
In the embodiment of the present invention, an APP may send the use time of a resource file and a file identifier to a server, and the server may obtain the creation time and the file identifier of the resource file held by the server, and then determine the use time and the creation time of the resource file with the same file identifier, if a time difference between the two times exceeds a preset threshold, for example, exceeds half a year, and if it is described that the resource file corresponding to the file identifier is not used for a long time and is a useless resource file, the file identifier is identified as a file identifier to be processed, that is, a file identifier corresponding to the useless resource file that needs to be deleted from an APP installation package.
And 106, receiving the identifier of the file to be processed sent by the server.
And 108, deleting the resource file corresponding to the file identifier to be processed in the application program as a useless resource file.
When the identification of the file to be processed is determined, the server can send the identification of the file to be processed to the APP of the terminal device, and the APP deletes the resource file corresponding to the identification of the file to be processed in the project resource package based on the identification of the file to be processed, so that the APP installation package is prevented from occupying a large amount of memory space and affecting the performance of the terminal device.
In the resource file processing method, the use time and the file identifier of a resource file in an application program are obtained by monitoring a view control of the application program, the view control is used for displaying the resource file in an interface of the application program, then, the use time and the file identifier are sent to a server, after the server obtains the creation time of the resource file in the application program, if the time difference value between the use time and the creation time which are the same as the file identifier exceeds a preset threshold value, the resource file corresponding to the file identifier is a useless resource file, the file identifier is determined as a file identifier to be processed, and after the file identifier to be processed sent by the server is received, the resource file corresponding to the file identifier to be processed in the application program can be deleted as a useless resource file. The embodiment of the invention accurately determines the latest using time of the resource file by monitoring the view control of the resource file in the application program, thereby determining whether the resource file exceeds the preset threshold value and is not used based on the using time, if so, deleting the resource file from the APP installation package as a useless resource file, and avoiding mistaken deletion of the useful resource file when the volume of the APP installation package is reduced.
On the basis of the above-described embodiment, a modified embodiment of the above-described embodiment is proposed, and it is to be noted herein that, in order to make the description brief, only the differences from the above-described embodiment are described in the modified embodiment.
In an exemplary embodiment, after the step 108, deleting the resource file corresponding to the to-be-processed file identifier in the application program as an useless resource file, the method may further include the following steps:
responding to the operation of displaying a target resource file on the application program, and acquiring a target file identifier of the target resource file;
if the resource file corresponding to the target file identification does not exist in the application program, sending the target file identification to the server;
and after receiving the target resource file sent by the server aiming at the target file identifier, displaying the target resource file in an interface of the application program through the view control.
In a specific implementation, after the APP of the terminal device locally deletes the useless resource files, the server still stores the resource files, and if the user needs to use the deleted useless resource files, the resource files can be downloaded from the server and displayed in the interface of the APP through the view control. For example, if the resource file of the house transaction block of the APP is not used for a long time and may have been deleted locally as a useless resource file, if house renting needs to be found, the resource file of the house transaction block of the APP needs to be browsed, and at this time, the resource file of the house transaction block may be obtained from the server.
In the embodiment of the present invention, in response to an operation of displaying a target resource file on an APP by a user, an object file identifier of the target resource file is obtained, for example, if the user clicks a house transaction plate in an APP interface, a file identifier of the resource file of the house transaction plate is obtained as the object file identifier, and if a resource file corresponding to the object file identifier does not exist in the APP, which indicates that the resource file has been deleted locally as a useless resource file, the object file identifier may be sent to a server, so as to obtain the target resource file corresponding to the object file identifier from the server, and thus the target resource file may be displayed in the APP interface through a view control.
In the above exemplary embodiment, a bottom-of-pocket policy is set, specifically, a useless resource file is deleted locally in an application program, and the useless resource file can still be stored in the server, so that if the deleted useless resource file needs to be displayed in the application program, the deleted useless resource file can be acquired from the server and displayed in an interface of the application program, thereby ensuring that a user normally uses the application program and ensuring the use experience of the user.
In an exemplary 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 may include the following steps:
and if the identifier of the file to be processed is not referred to in the specified file of the application program, deleting the resource file corresponding to the identifier of the file to be processed in the application program as a useless resource file.
In specific implementation, a project code of an APP installation package may include a plurality of code files, where the code files include a specific file, the specific file is a development code of an APP, and is very important and cannot be changed randomly, and if the specific file is changed, problems such as APP crash and operation error occur easily.
Therefore, after the identifier of the file to be processed is obtained, the embodiment of the invention can search in the project code, and if the identifier of the file to be processed is found in the specified file in the project code through searching, the resource file corresponding to the identifier of the file to be processed cannot be deleted in the APP. Of course, if the search finds that the identifier of the file to be processed is not in the specified file in the item code, the resource file corresponding to the identifier of the file to be processed may be deleted in the APP.
In the above exemplary embodiment, if the to-be-processed file is found by the search to be identified in the specified file in the project code, which indicates that the resource file is a useful resource file, the resource file may not be deleted, so that the normal operation of the application program is ensured.
In practical application, after the APP iterates over many versions, useless resource files are discarded, for example, picture files are reserved, the size of the APP installation package is increased, and the APP is abnormally operated due to mistaken deletion of the resource files, for example, pictures cannot be normally displayed. Referring to fig. 2, which is a flowchart of processing a resource file according to an embodiment of the present invention, a picture control is displayed by a view control imageview for a picture file of an APP installation package, and the specific processing steps are as follows:
step 202, acquiring the service time of the picture file monitored by the picture control imageview setting instrumentation function in the APP by using a Hook technology. Alternatively, the picture file used by the user can be counted according to the version period;
step 204, calculating the MD5 value of the picture file used by the user;
step 206, sending the MD5 value of the picture file used by the user to a server;
step 208, the server finds an unused picture file for a long time by comparing with the local MD5 value and the creation time, and then, the creation time and the use time may exceed half a year and are determined as an useless resource file which is not used with a high probability, and the APP of the terminal device may locally delete the picture as the useless resource file. The embodiment of the invention sets the bottom-finding strategy, specifically, the picture after the local deletion of the terminal equipment is still stored in the server, and if the user needs to use the picture after the local deletion of the terminal equipment in the APP, the picture can be downloaded from the server and displayed in an interface of an application program.
By applying the embodiment of the invention, the real useless resource files in the APP installation package can be deleted, the volume of the APP installation package is reduced, and in addition, the resource files can be retrieved from the server and displayed in the interface of the application program even if the resource files in the local APP installation package are deleted in the terminal equipment by setting the bottom-pocketing strategy, so that the use experience of a user is ensured.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 3, a block diagram of a structure of a resource file processing apparatus provided in the embodiment of the present invention is shown, and specifically, the structure may include the following modules:
an obtaining module 302, configured to obtain a use time and a file identifier of a resource file in an application; the service time is obtained by monitoring a view control of the application program, the view control is used for displaying the resource file in an interface of the application program, and the file identification is used for uniquely identifying the resource file;
a sending module 304, configured to send the usage time and the file identifier to a server; the server is used for determining the file identifier to be processed if the time difference value between the use time and the creation time which are the same as the file identifier exceeds a preset threshold value after acquiring the creation time of the resource file in the application program;
a receiving module 306, configured to receive the identifier of the file to be processed sent by the server;
and 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.
In an exemplary embodiment, the view control is provided with an instrumentation function, and the instrumentation function is used for monitoring resource files in the view control.
In an exemplary embodiment, the apparatus further comprises: the reacquisition module is used for responding to the operation of displaying the target resource file on the application program and acquiring the target file identifier of the target resource file; if the resource file corresponding to the target file identification does not exist in the application program, sending the target file identification to the server; and after receiving the target resource file sent by the server aiming at the target file identifier, displaying the target resource file in an interface of the application program through the view control.
In an exemplary embodiment, the resource file includes a picture file.
In an exemplary embodiment, the deleting module 308 is configured to delete, as a useless resource file, a resource file corresponding to the to-be-processed file identifier in the application program if the to-be-processed file identifier is not referred to in the specified file of the application program.
In the embodiment of the invention, the latest use time of the resource file is accurately determined by monitoring the view control of the resource file in the application program, so that whether the resource file exceeds the preset threshold value and is not used can be determined based on the use time, if yes, the resource file can be used as a useless resource file to be deleted from the APP installation package, and the mistaken deletion of the useful resource file is avoided when the volume of the APP installation package is reduced.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
Preferably, an embodiment of the present invention further provides an electronic device, including: the processor, the memory, and the computer program stored in the memory and capable of running on the processor, when executed by the processor, implement each process of the above-mentioned resource file processing method embodiment, and can achieve the same technical effect, and are not described herein again to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program implements each process of the embodiment of the resource file processing method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
Embodiments of the present invention provide a computer program product, where the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the processes of the foregoing embodiment of the method for processing a resource file, and can achieve the same technical effects, and in order to avoid repetition, details are not repeated here.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may 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 solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for processing resource files is characterized by comprising the following steps:
acquiring the use time and the file identification of a resource file in an application program; the service time is obtained by monitoring a view control of the application program, the view control is used for displaying the resource file in an interface of the application program, and the file identification is used for uniquely identifying the resource file;
sending the using time and the file identification to a server; the server is used for determining the file identifier to be processed if the time difference value between the use time and the creation time which are the same as the file identifier exceeds a preset threshold value after acquiring the creation time of the resource file in the application program;
receiving the identifier of the file to be processed sent by the server;
and deleting the resource file corresponding to the file identifier to be processed in the application program as a useless resource file.
2. The method according to claim 1, wherein the view control is provided with an instrumentation function for listening to resource files in the view control.
3. The method according to claim 1, wherein after deleting the resource file corresponding to the pending file identifier in the application program as a useless resource file, the method further comprises:
responding to the operation of displaying a target resource file on the application program, and acquiring a target file identifier of the target resource file;
if the resource file corresponding to the target file identification does not exist in the application program, sending the target file identification to the server;
and after receiving the target resource file sent by the server aiming at the target file identifier, displaying the target resource file in an interface of the application program through the view control.
4. The method of claims 1-3, wherein the resource file comprises a picture file.
5. The method according to claim 1, wherein deleting the resource file corresponding to the to-be-processed file identifier in the application program as a useless resource file comprises:
and if the identifier of the file to be processed is not referred to in the specified file of the application program, deleting the resource file corresponding to the identifier of the file to be processed in the application program as a useless resource file.
6. An apparatus for processing resource files, comprising:
the acquisition module is used for acquiring the use time and the file identification of the resource file in the application program; the service time is obtained by monitoring a view control of the application program, the view control is used for displaying the resource file in an interface of the application program, and the file identification is used for uniquely identifying the resource file;
the sending module is used for sending the using time and the file identification to a server; the server is used for determining the file identifier to be processed if the time difference value between the use time and the creation time, which are the same as the file identifier, exceeds a preset threshold value after the creation time of the resource file in the application program is obtained;
the receiving module is used for receiving the identification of the file to be processed sent by the server;
and the deleting module is used for deleting the resource file corresponding to the file identifier to be processed in the application program as a useless resource file.
7. The apparatus according to claim 6, wherein the view control is provided with an instrumentation function for listening to resource files in the view control.
8. The apparatus of claim 6, further comprising: the reacquisition module is used for responding to the operation of displaying the target resource file on the application program and acquiring the target file identifier of the target resource file; if the resource file corresponding to the target file identification does not exist in the application program, sending the target file identification to the server; and after receiving the target resource file sent by the server aiming at the target file identifier, displaying the target resource file in an interface of the application program through the view control.
9. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
the memory is used for storing a computer program;
the processor, when executing a program stored on the memory, implementing the method of any one of claims 1 to 5.
10. 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 of claims 1-5.
CN202210493402.4A 2022-05-07 2022-05-07 Resource file processing method and device, electronic equipment and readable medium Pending CN115017111A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210493402.4A CN115017111A (en) 2022-05-07 2022-05-07 Resource file processing method and device, electronic equipment and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210493402.4A CN115017111A (en) 2022-05-07 2022-05-07 Resource file processing method and device, electronic equipment and readable medium

Publications (1)

Publication Number Publication Date
CN115017111A true CN115017111A (en) 2022-09-06

Family

ID=83069242

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210493402.4A Pending CN115017111A (en) 2022-05-07 2022-05-07 Resource file processing method and device, electronic equipment and readable medium

Country Status (1)

Country Link
CN (1) CN115017111A (en)

Similar Documents

Publication Publication Date Title
CN110058873B (en) Application page updating method, device, equipment and storage medium
CN106843978B (en) SDK access method and system
US9864736B2 (en) Information processing apparatus, control method, and recording medium
WO2020015191A1 (en) Business rule releasing and managing method, electronic device and readable storage medium
EP2993603B1 (en) Permission determining method and device for application program
CN111008034B (en) Patch generation method and device
CN107645546B (en) File monitoring method based on android system, intelligent device and storage medium
CN107644075B (en) Method and device for collecting page information
CN113448862B (en) Software version testing method and device and computer equipment
CN111897846A (en) Cache data verification method, device, equipment and storage medium
CN109117153B (en) Application processing method, device, terminal and storage medium
CN106484779B (en) File operation method and device
US20160004850A1 (en) Secure download from internet marketplace
CN108762983B (en) Multimedia data recovery method and device
CN110865981A (en) File access method for mobile terminal and mobile terminal thereof
CN110597662A (en) Backup data automatic verification method and device, user equipment and storage medium
US20210349855A1 (en) Method of data structuring for difference between old and new data and device thereof
CN115080114B (en) Application program transplanting processing method, device and medium
CN115017111A (en) Resource file processing method and device, electronic equipment and readable medium
CN114143308A (en) File uploading information processing method and device, computer equipment and storage medium
CN114327548A (en) Software upgrading method and related device
CN110221952B (en) Service data processing method and device and service data processing system
CN108566293B (en) Electronic device, zk node information notification method, and storage medium
CN111538651A (en) Interface testing method, device, server and storage medium
CN110825406A (en) Software upgrading method and related equipment

Legal Events

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