CN113110851A - Resource loading method and device, electronic equipment and medium - Google Patents

Resource loading method and device, electronic equipment and medium Download PDF

Info

Publication number
CN113110851A
CN113110851A CN202110658466.0A CN202110658466A CN113110851A CN 113110851 A CN113110851 A CN 113110851A CN 202110658466 A CN202110658466 A CN 202110658466A CN 113110851 A CN113110851 A CN 113110851A
Authority
CN
China
Prior art keywords
resource
server
installation
target
loaded
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
CN202110658466.0A
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 Yizhen Xuesi Education Technology Co Ltd
Original Assignee
Beijing Yizhen Xuesi Education 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 Yizhen Xuesi Education Technology Co Ltd filed Critical Beijing Yizhen Xuesi Education Technology Co Ltd
Priority to CN202110658466.0A priority Critical patent/CN113110851A/en
Publication of CN113110851A publication Critical patent/CN113110851A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates

Abstract

The present disclosure relates to a method, an apparatus, an electronic device, and a medium for loading a resource; wherein, the method comprises the following steps: receiving a resource loading request of an application program; the resource loading request comprises a resource to be loaded; acquiring a target installation directory of an application program, and determining a storage position of a resource to be loaded in a server from an occupied file of the target installation directory; sending a resource downloading request carrying a storage position to a server; and receiving the target resource returned by the server and loading and displaying the target resource. According to the embodiment of the disclosure, the target resource can be isolated from the installation package, and the resource loading is realized by using the placeholder file as a storage medium, so that the resource occupation ratio in the installation package is effectively reduced.

Description

Resource loading method and device, electronic equipment and medium
Technical Field
The present disclosure relates to the field of mobile terminal technologies, and in particular, to a resource loading method and apparatus, an electronic device, and a medium.
Background
The existing application software has a wide variety, and the life of a user is greatly enriched; however, the size of the software installation package is strongly related to the market transformation effect, and the download will of the user is directly affected, so that it is important to optimize the software installation package for slimming. The common android installation package is provided with resources such as pictures, audio and video files, dynamic link libraries and the like; at present, the optimization and slimming of the software installation package are mainly realized by a resource cutting and replacing mode, namely, the resource to be downloaded is cut and compressed, for example, only one set of resolution is reserved for an image, only one set of architecture is reserved for a dynamic link library, and the format of an image is converted, so that the volume of the resource is reduced.
The defects of the existing scheme are as follows: there is a limit to resource compression, and when the volume of the resource itself is too large, the compressed resource volume still occupies most of the software installation package.
Disclosure of Invention
To solve the technical problem or at least partially solve the technical problem, the present disclosure provides a method, an apparatus, an electronic device, and a medium for loading a resource.
In a first aspect, the present disclosure provides a method for loading a resource, including:
receiving a resource loading request of an application program; wherein the resource loading request comprises a resource to be loaded;
acquiring a target installation directory of the application program, and determining a storage position of the resource to be loaded in a server from an occupied file of the target installation directory;
sending a resource downloading request carrying the storage position to the server;
and receiving the target resource returned by the server, and loading and displaying the target resource.
Optionally, before obtaining the target installation directory of the application program, the method further includes:
acquiring an initial installation catalog of the application program; wherein the initial installation catalog includes installation resources of the application; the installation resources comprise file information and code information;
and determining a target installation catalog of the application program according to the installation resources.
Optionally, the determining a target installation directory of the application program according to the installation resource includes:
removing the installation resource from the initial installation catalog;
and generating an occupied file in the initial installation directory according to the identifier of the installation resource, and modifying the initial installation directory into a target installation directory.
Optionally, after determining the target installation catalog of the application program according to the installation resource, the method further includes:
determining a resource compression packet according to the installation resource;
uploading the resource compression packet to a server; wherein, at least one resource to be loaded is stored in the resource compression packet.
Optionally, the determining a resource compression packet according to the installation resource includes:
compressing the installation resource to obtain an actual resource package of the current version;
and comparing the actual resource package with the resource package of the historical version to determine a differential package.
Optionally, the uploading the resource compression packet to a server includes:
sending a resource storage request to a server; wherein the resource storage request comprises the resource compression packet;
receiving a storage success indication returned by the server; wherein, the storage success indication includes the storage location of the resource compression packet.
Optionally, the method further includes:
and storing the storage position of the resource compression package in the placeholder file.
Optionally, before obtaining the target installation directory of the application program, the method further includes:
and if the resource to be loaded is detected to exist, displaying the resource to be loaded.
Optionally, the sending the resource downloading request carrying the storage location to the server includes:
if the resource to be loaded is stored in the differential packet, sending a differential resource downloading request to the server;
and if the resource to be loaded is stored in the actual resource packet, sending an actual resource downloading request to the server.
Optionally, the receiving, loading and displaying the target resource returned by the server includes:
receiving the difference resource returned by the server; the differential resource is determined by the server from the differential packet according to the resource identifier of the resource to be loaded;
or, receiving the actual resource returned by the server; and the actual resource is determined from the actual resource packet by the server according to the resource identifier of the resource to be loaded.
In a second aspect, the present disclosure provides a resource loading apparatus, including:
the request receiving module is used for receiving a resource loading request of an application program; wherein the resource loading request comprises a resource to be loaded;
the position determining module is used for acquiring a target installation directory of the application program and determining the storage position of the resource to be loaded in the server from an occupied file of the target installation directory;
a request sending module, configured to send a resource downloading request carrying the storage location to the server;
and the resource display module is used for receiving the target resource returned by the server and loading and displaying the target resource.
Optionally, the method further includes: an initial installation target acquisition module and a target installation catalog determination module;
an initial installation target acquisition module, configured to acquire an initial installation directory of the application program; wherein the initial installation catalog includes installation resources of the application; the installation resources comprise file information and code information;
and the target installation catalog determining module is used for determining the target installation catalog of the application program according to the installation resources.
Optionally, the target installation directory determining module is specifically configured to:
removing the installation resource from the initial installation catalog;
and generating an occupied file in the initial installation directory according to the identifier of the installation resource, and modifying the initial installation directory into a target installation directory.
Optionally, the method further includes: the device comprises a compressed packet determining module and a compressed packet uploading module;
a compressed packet determining module, configured to determine a resource compressed packet according to the installation resource;
the compressed packet uploading module is used for uploading the resource compressed packet to a server; wherein, at least one resource to be loaded is stored in the resource compression packet.
Optionally, the compressed packet determining module is specifically configured to:
compressing the installation resource to obtain an actual resource package of the current version;
and comparing the actual resource package with the resource package of the historical version to determine a differential package.
Optionally, the compressed packet uploading module is specifically configured to:
sending a resource storage request to a server; wherein the resource storage request comprises the resource compression packet;
receiving a storage success indication returned by the server; wherein, the storage success indication includes the storage location of the resource compression packet.
Optionally, the method further includes:
and the compressed packet storage module is used for storing the storage position of the resource compressed packet in the placeholder file.
Optionally, the method further includes:
and the resource detection module is used for displaying the resource to be loaded if the resource to be loaded is detected to exist.
Optionally, the request sending module is specifically configured to:
if the resource to be loaded is stored in the differential packet, sending a differential resource downloading request to the server;
and if the resource to be loaded is stored in the actual resource packet, sending an actual resource downloading request to the server.
Optionally, the resource display module is specifically configured to:
receiving the difference resource returned by the server; the differential resource is determined by the server from the differential packet according to the resource identifier of the resource to be loaded;
or, receiving the actual resource returned by the server; and the actual resource is determined from the actual resource packet by the server according to the resource identifier of the resource to be loaded.
In a third aspect, the present disclosure also provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for loading resources according to any one of the embodiments of the present invention.
In a fourth aspect, the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method for loading resources according to any one of the embodiments of the present invention.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages: and storing the storage position of the target resource in the server by using the placeholder file so as to move the target resource to the server, thereby effectively reducing the occupation ratio of the target resource in the installation package.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a resource loading method according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of another resource loading method provided in the embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a method for loading a resource according to an embodiment of the present disclosure;
fig. 4 is a flowchart illustrating a method for loading a resource according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a resource loading apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
When a user downloads a software application, the user firstly needs to download a software installation package corresponding to the application and install the software installation package in electronic equipment to run the software, but because the data volume stored in the electronic equipment is rapidly increased along with the running time of the equipment, when a certain type of software needs to be used, the residual memory resources in the electronic equipment are not enough to support the downloading of the software installation package, or when a software installation package is downloaded, the user abandons the downloading of the software installation package because the software installation package is seen to have larger resources; therefore, resource slimming processing corresponding to the software installation package becomes extremely important.
At present, the slimming processing of a software installation package mainly includes resource cutting or plug-in so as to realize the loading and display of a user on required data; the resources stored in the installation package only comprise pictures, audio and video files, dynamic link libraries and the like. The resource cutting is mainly to optimize the resources in the installation package and compress the resources to optimize the volume of the resources in the installation package; for example, only one set of resolution is reserved for the pictures in the original installation package, and the extra resolution is deleted; only one set of basic framework is reserved in the dynamic link library; or, the pictures are converted into the webp format, but the resource compression of the method is limited, the resources after compression still occupy most of the installation package in general, and when the installation package is upgraded, the resource clipping and replacement need to be performed manually again. The method comprises the following steps of plug-in, packaging a service program into an individual apk installation package (namely an apk file), and directly running codes in the plug-in a hook system code mode during running so as to achieve the purpose of using resources; but there are compatibility problems, for example, the android system officially is not supported, the current implementation mode needs hook system code (i.e. system code is modified to implement system compatibility) to adapt to the system of the used version, and the system upgrade may cause the risk of being unusable. Both the two modes are difficult to effectively realize the optimized slimming of the software installation package, and the resource occupation ratio in the installation package is difficult to reduce.
Fig. 1 is a schematic flowchart of a resource loading method according to an embodiment of the present disclosure. The embodiment can be applied to the situation that resources are obtained from the server to be loaded in real time. The method of the embodiment may be performed by a device for loading resources, which may be implemented in hardware and/or software and may be configured in an electronic device. The resource loading method in any embodiment of the present application can be realized. As shown in fig. 1, the method specifically includes the following steps:
s110, receiving a resource loading request of an application program; the resource loading request comprises a resource to be loaded.
In the present embodiment, the application program is application software capable of implementing a specifically defined function; it may include system applications, desktop applications, driver applications, web applications, cell phone applications, and internet of things applications, among others. The resource loading request is a request which is triggered by a user and needs to be sent to check a certain resource; the resources to be loaded can comprise pictures, audio and video files or dynamic link libraries; for example, the resource to be loaded included in the desktop application may be a picture; the resources to be recorded included in the mobile phone application program can be audio and video files; the resource to be loaded included in the application program of the internet of things can be a dynamic link library.
For example, the application is taken as a desktop application and the desktop application is taken as an album; when a user needs to view pictures stored in the album, the album comprises a plurality of picture folders, and any folder in the album can be clicked to indicate that the album has a resource loading requirement so as to send a resource loading request to a computer. Specifically, the actual picture that the user wants to view may not be stored in the folder, but may be the search path thereof.
S120, obtaining a target installation directory of the application program, and determining the storage position of the resource to be loaded in the server from the placeholder file of the target installation directory.
In this embodiment, the target installation directory is a resource installation package of the application program; the target installation directory does not store the actual resource, but stores the storage location of the actual resource in the other storage space, so as to search the actual resource from the other storage space by using the storage location as an indication.
The target installation directory stores an occupancy file, and the occupancy file stores the storage position of actual resources in the server, which should be stored in the target installation directory, so that corresponding resources can be obtained from the server when the resources need to be loaded, and the influence of blocked operation of the application program caused by increased resource occupancy of all the resources stored in the target installation package is reduced.
The server stores two forms of resources, namely an actual resource package and a differential package, wherein the actual resource package is a resource of the electronic equipment in the current version, and the differential package is a differential package generated by comparing the current version with the historical version.
In this embodiment, optionally, before obtaining the target installation directory of the application program, the method of this embodiment further includes:
and if the resource to be loaded is detected to exist, displaying the resource to be loaded.
When the resource loading is carried out for the first time, any resource related to the application program is not stored in the electronic equipment, so that the electronic equipment needs to be searched and obtained from a target installation directory of the application program; however, if the resource is not loaded for the first time, that is, a part of the resource of the application program may be stored in the electronic device, and the part of the resource is acquired and stored for the historical loading request.
If the resource to be loaded which is desired to be checked is detected to exist, the target installation directory of the application program does not need to be acquired, and the resource to be loaded is directly searched from the resource local library and returned, so that the problem of repeated searching of the existing resource is solved.
S130, sending a resource downloading request carrying the storage position to the server.
In this embodiment, the server is a cloud information base which stores resources and can perform information interaction with the electronic device; when the resource loading is needed, a request carrying the storage position of the resource can be directly sent to the server so as to indicate the server to quickly find the corresponding resource according to the storage position and return.
The storage position of the resource is determined by the server according to the resource compression packet sent to the server by the electronic equipment.
And S140, receiving the target resource returned by the server and loading and displaying the target resource.
In this embodiment, the server and the electronic device can effectively communicate with each other in a wireless transmission manner, so that the transmission efficiency is high, and the real-time transmission between information can be satisfied. According to the method and the device, the target resource which the user only wants to see is fed back to the user, and other resources are stored in the server, so that the problem that the resource occupation ratio in the installation package is greatly influenced by the resource amount is solved.
The method comprises the steps of receiving a resource loading request of an application program; the resource loading request comprises a resource to be loaded; acquiring a target installation directory of an application program, and determining a storage position of a resource to be loaded in a server from an occupied file of the target installation directory; sending a resource downloading request carrying a storage position to a server; and receiving the target resource returned by the server and loading and displaying the target resource. The storage position of the target resource in the server can be stored by utilizing the placeholder file so as to move the target resource to the server, and therefore the occupation ratio of the target resource in the installation package is effectively reduced.
Fig. 2 is a schematic flowchart of another resource loading method according to an embodiment of the present disclosure. The present embodiment is based on the foregoing embodiment, and further before the step S120, the method may further include:
s111, acquiring an initial installation catalog of the application program; wherein the initial installation catalog comprises installation resources of the application program; the installation resource includes file information and code information.
In this embodiment, the initial installation directory includes storage resources in an installation package corresponding to the application program; the storage resource can support the complete operation of the installation package, so that the use requirement of a user on the application program is met.
And S112, determining a target installation catalog of the application program according to the installation resources.
In this embodiment, data preprocessing is performed on the initial installation catalog of the application program, so as to isolate the installation resources from the installation package, and effectively reduce the resource volume of the installation package, thereby improving the downloading heat of the application program.
In this embodiment, optionally, determining the target installation catalog of the application according to the installation resource includes:
removing the installation resource from the initial installation catalog;
and generating an occupied file in the initial installation directory according to the identifier of the installation resource, and modifying the initial installation directory into a target installation directory.
The installation resource can be separated from the installation package through the resource separation script; the resource separation script is a code program which is written by programmers in advance and used for extracting installation resources from the installation package; specifically, the computer implementation process may include: introducing a resource separation script into an engineering catalog, and referring the resource separation script in a construction script (such as build. script) of a module needing resource separation according to an application keyword so as to realize effective separation of an installation package and an installation resource.
The name of the placeholder file generated in the initial installation directory according to the identifier of the installation resource is the same as the name of the installation resource in the installation package, so that the condition that the resource search fails due to the fact that the names are not corresponding is avoided; the stub file does not include any installation resource, but only includes a storage location of the installation resource in the server, that is, the purpose of the stub file is to indicate a storage path of the installation resource. Modifying the initial installation directory to a target installation directory may mean to reconcile the display name of the target installation directory in the computer with the display name of the initial installation directory to ensure an efficient separation of installation resources from the installation package.
Fig. 3 is a flowchart illustrating a method for loading a resource according to an embodiment of the present disclosure. The present embodiment is based on the foregoing embodiment, and further, after the step S112, the method may further include:
and S113, determining a resource compression packet according to the installation resource.
In this embodiment, the installation resource is stored in the server in the form of a resource compression packet, that is, the installation resource needs to be compressed and packaged, and a resource compression packet corresponding to the installation resource is generated; the installation resource may include an actual resource and a differential resource, and the corresponding resource compression packet also includes an actual resource packet and a differential packet.
The actual resource is a resource updated to the current version by the application program; the difference packet is a difference resource obtained by comparing the resource of the current version with the resource of the historical version.
In this embodiment, optionally, determining the resource compression packet according to the installation resource includes:
compressing the installation resource to obtain an actual resource package of the current version;
and comparing the actual resource package with the resource package of the historical version to determine a differential package.
The resource compression can be realized through compression software, the resource capacity of the resource with larger capacity is optimized to obtain a compression packet, and the storage space of the resource can be effectively reduced.
Illustratively, the current version number of the application program is 7.0; the actual resource package includes 15 pictures, the historical version is 6.0 example, and if 10 pictures are included in the 6.0 version, the determined differential package includes 5 pictures that are not included in the historical version. If the current version number of the application program installed by the user is 6.0, the user can realize the upgrading requirement only by downloading the differential package without downloading the actual resource package when upgrading the application program. The embodiment determines the difference package according to the actual resource package to adapt to the requirements of different users on the application program versions.
S114, uploading the resource compression packet to a server; wherein, at least one resource to be loaded is stored in the resource compression packet.
In the embodiment, the installation package is separated from the installation resource, and the resource compression package generated by the installation resource is independently stored in the server, so that the real-time description of the resource is not influenced while the installation resource is separately stored.
In this embodiment, optionally, uploading the resource compression packet to the server includes:
sending a resource storage request to a server; the resource storage request comprises a resource compression packet;
receiving a storage success indication returned by the server; wherein, the storage success indication comprises the storage position of the resource compression packet.
The resource compression packet comprises an actual resource packet and a differential packet; sending the resource storage request to the server may include: sending a resource storage request to a server according to the type of the installation resource, and if the type of the installation resource is an actual resource packet, sending the resource storage request of the actual resource packet to the server; and if the type of the installed resource is the differential packet, sending a resource storage request of the differential packet to the server.
The server can independently store the corresponding compressed packets according to the types of the different installation resources so as to effectively distinguish the types of the different installation resources.
It should be noted that, in this embodiment, the storage location of the resource compression packet is not limited to be provided only by the server, and in an alternative manner, the storage location of the resource compression packet may also be carried in a resource storage request sent to the server to instruct the server to store the resource compression packet according to the specified storage location.
In this embodiment, optionally, the method of this embodiment further includes:
and storing the storage position of the resource compression package in the placeholder file.
After receiving the storage position of the resource compression package returned by the server, storing the storage position into the placeholder file, so that the resource to be loaded can be quickly found out from the server according to the placeholder file in the target installation directory and can be loaded and displayed when the resource loading request is received.
Fig. 4 is a flowchart illustrating a method for loading a resource according to an embodiment of the present disclosure. The present embodiment is based on the above embodiment, wherein a possible implementation method of S130 is as follows, and includes:
s1301, detecting whether the resource to be loaded is stored in the differential packet, and if yes, executing S1302; if not, S1303 is executed.
In this embodiment, since the actual resource package and the differential package are stored independently in the server, before sending the resource download request to the server, it is necessary to determine which type of the installed resource the resource to be loaded that the user wants to view belongs to, i.e., the actual resource package or the differential package; and the resource capacity of the differential packet is smaller than that of the actual resource packet.
S1302, sending a differential resource downloading request to a server.
In this embodiment, the resource downloading request of the specified type is sent to the server, which can be beneficial for the server to quickly find out the related resource, thereby effectively improving the resource obtaining efficiency.
And S1303, sending an actual resource downloading request to the server.
In this embodiment, if the resource to be detected is not stored in the differential packet, it is determined that the resource to be loaded is stored in the actual resource packet, and an actual resource downloading request is sent to the server, so that the service class can quickly find the resource to be loaded, which is required by the user.
Optionally, with continuing reference to fig. 4, when performing S140 shown in fig. 1, the method includes:
and S1401, receiving the difference resource returned by the server.
And the differential resource is determined from the differential packet by the server according to the resource identifier of the resource to be loaded.
In this embodiment, the storage location for storing the differential packet in the server is divided according to the application program identifier, and since the resource compression packets under multiple application programs are stored in the server, the resource compression packets need to be marked. The resource identifier of the resource to be loaded can be composed of two parts, wherein the first part is a resource type, and the second part is an application program identifier; specifically, the resource identifier of the resource to be loaded may be obtained according to the sequential combination of the resource type and the application program identifier, or may be obtained according to the sequential combination of the application program identifier and the resource type.
The received differential resources in this embodiment enable a user with an upgrade requirement to directly obtain the required resources, and add the differential resources to the current version for direct upgrade, thereby avoiding the problem of repeated storage of the resources.
S1402, receiving the actual resource returned by the server.
And the actual resource is determined from the actual resource packet by the server according to the resource identifier of the resource to be loaded.
In this embodiment, if the user downloads the application program for the first time, the resource that the user wants to view can be satisfied through the received actual resource, so that the resource that the user wants to view is directly displayed for the user, and spatial redundancy caused by not needing the resource is avoided.
Fig. 5 is a schematic structural diagram of a resource loading apparatus according to an embodiment of the present disclosure; the device is configured in the electronic equipment, and can realize the resource loading method in any embodiment of the application. The device specifically comprises the following steps:
a request receiving module 510, configured to receive a resource loading request of an application; wherein the resource loading request comprises a resource to be loaded;
a location determining module 520, configured to obtain a target installation directory of the application program, and determine, from an placeholder file of the target installation directory, a storage location of the resource to be loaded in the server;
a request sending module 530, configured to send a resource downloading request carrying the storage location to the server;
and the resource display module 540 is configured to receive the target resource returned by the server and load and display the target resource.
In this embodiment, optionally, the apparatus of this embodiment further includes: an initial installation target acquisition module and a target installation catalog determination module;
an initial installation target acquisition module, configured to acquire an initial installation directory of the application program; wherein the initial installation catalog includes installation resources of the application; the installation resources comprise file information and code information;
and the target installation catalog determining module is used for determining the target installation catalog of the application program according to the installation resources.
In this embodiment, optionally, the target installation directory determining module is specifically configured to:
removing the installation resource from the initial installation catalog;
and generating an occupied file in the initial installation directory according to the identifier of the installation resource, and modifying the initial installation directory into a target installation directory.
In this embodiment, optionally, the apparatus of this embodiment further includes: the device comprises a compressed packet determining module and a compressed packet uploading module;
a compressed packet determining module, configured to determine a resource compressed packet according to the installation resource;
the compressed packet uploading module is used for uploading the resource compressed packet to a server; wherein, at least one resource to be loaded is stored in the resource compression packet.
In this embodiment, optionally, the compressed packet determining module is specifically configured to:
compressing the installation resource to obtain an actual resource package of the current version;
and comparing the actual resource package with the resource package of the historical version to determine a differential package.
In this embodiment, optionally, the compressed packet uploading module is specifically configured to:
sending a resource storage request to a server; wherein the resource storage request comprises the resource compression packet;
receiving a storage success indication returned by the server; wherein, the storage success indication includes the storage location of the resource compression packet.
In this embodiment, optionally, the apparatus of this embodiment further includes:
and the compressed packet storage module is used for storing the storage position of the resource compressed packet in the placeholder file.
In this embodiment, optionally, the apparatus of this embodiment further includes:
and the resource detection module is used for displaying the resource to be loaded if the resource to be loaded is detected to exist.
In this embodiment, optionally, the request sending module 530 is specifically configured to:
if the resource to be loaded is stored in the differential packet, sending a differential resource downloading request to the server;
and if the resource to be loaded is stored in the actual resource packet, sending an actual resource downloading request to the server.
In this embodiment, optionally, the resource display module 540 is specifically configured to:
receiving the difference resource returned by the server; the differential resource is determined by the server from the differential packet according to the resource identifier of the resource to be loaded;
or, receiving the actual resource returned by the server; and the actual resource is determined from the actual resource packet by the server according to the resource identifier of the resource to be loaded.
By the resource loading device provided by the embodiment of the invention, the storage position of the target resource in the server can be stored by using the placeholder file so as to move the target resource to the server, so that the occupation ratio of the target resource in the installation package is effectively reduced.
The resource loading device provided by the embodiment of the invention can execute the resource loading method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. As shown in fig. 6, the electronic device includes a processor 610, a memory 620, an input device 630, and an output device 640; the number of the processors 610 in the electronic device may be one or more, and one processor 610 is taken as an example in fig. 6; the processor 610, the memory 620, the input device 630, and the output device 640 in the electronic apparatus may be connected by a bus or other means, and fig. 6 illustrates an example of connection by a bus.
The memory 620 is used as a computer-readable storage medium for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the resource loading method in the embodiment of the present invention. The processor 610 executes various functional applications and data processing of the electronic device by executing software programs, instructions and modules stored in the memory 620, that is, implements a loading method of resources provided by the embodiment of the present invention.
The memory 620 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 620 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 620 can further include memory located remotely from the processor 610, which can be connected to an electronic device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 630 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device, and may include a keyboard, a mouse, and the like. The output device 640 may include a display device such as a display screen.
The embodiment of the present disclosure also provides a storage medium containing computer-executable instructions, which are used for implementing the loading method of the resource provided by the embodiment of the present invention when being executed by a computer processor.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the method operations described above, and may also perform related operations in the resource loading method provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the above search apparatus, each included unit and module are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (13)

1. A method for loading a resource, the method comprising:
receiving a resource loading request of an application program; wherein the resource loading request comprises a resource to be loaded;
acquiring a target installation directory of the application program, and determining a storage position of the resource to be loaded in a server from an occupied file of the target installation directory;
sending a resource downloading request carrying the storage position to the server;
and receiving the target resource returned by the server, and loading and displaying the target resource.
2. The method of claim 1, wherein prior to obtaining the target installation directory for the application, the method further comprises:
acquiring an initial installation catalog of the application program; wherein the initial installation catalog includes installation resources of the application; the installation resources comprise file information and code information;
and determining a target installation catalog of the application program according to the installation resources.
3. The method of claim 2, wherein determining the target installation directory for the application based on the installation resources comprises:
removing the installation resource from the initial installation catalog;
and generating an occupied file in the initial installation directory according to the identifier of the installation resource, and modifying the initial installation directory into a target installation directory.
4. The method of claim 2, wherein after determining the target installation catalog for the application based on the installation resources, the method further comprises:
determining a resource compression packet according to the installation resource;
uploading the resource compression packet to a server; wherein, at least one resource to be loaded is stored in the resource compression packet.
5. The method of claim 4, wherein determining the resource compression package according to the installation resource comprises:
compressing the installation resource to obtain an actual resource package of the current version;
and comparing the actual resource package with the resource package of the historical version to determine a differential package.
6. The method of claim 4, wherein uploading the resource compression package to a server comprises:
sending a resource storage request to a server; wherein the resource storage request comprises the resource compression packet;
receiving a storage success indication returned by the server; wherein, the storage success indication includes the storage location of the resource compression packet.
7. The method of claim 6, further comprising:
and storing the storage position of the resource compression package in the placeholder file.
8. The method of claim 1, wherein prior to obtaining the target installation directory for the application, the method further comprises:
and if the resource to be loaded is detected to exist, displaying the resource to be loaded.
9. The method of claim 5, wherein the sending the resource download request carrying the storage location to the server comprises:
if the resource to be loaded is stored in the differential packet, sending a differential resource downloading request to the server;
and if the resource to be loaded is stored in the actual resource packet, sending an actual resource downloading request to the server.
10. The method of claim 9, wherein receiving the target resource returned by the server and loading the presentation comprises:
receiving the difference resource returned by the server; the differential resource is determined by the server from the differential packet according to the resource identifier of the resource to be loaded;
or, receiving the actual resource returned by the server; and the actual resource is determined from the actual resource packet by the server according to the resource identifier of the resource to be loaded.
11. An apparatus for loading a resource, the apparatus comprising:
the request receiving module is used for receiving a resource loading request of an application program; wherein the resource loading request comprises a resource to be loaded;
the position determining module is used for acquiring a target installation directory of the application program and determining the storage position of the resource to be loaded in the server from an occupied file of the target installation directory;
a request sending module, configured to send a resource downloading request carrying the storage location to the server;
and the resource display module is used for receiving the target resource returned by the server and loading and displaying the target resource.
12. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method of loading a resource as claimed in any one of claims 1 to 10.
13. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method for loading a resource according to any one of claims 1 to 10.
CN202110658466.0A 2021-06-15 2021-06-15 Resource loading method and device, electronic equipment and medium Pending CN113110851A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110658466.0A CN113110851A (en) 2021-06-15 2021-06-15 Resource loading method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110658466.0A CN113110851A (en) 2021-06-15 2021-06-15 Resource loading method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN113110851A true CN113110851A (en) 2021-07-13

Family

ID=76723518

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110658466.0A Pending CN113110851A (en) 2021-06-15 2021-06-15 Resource loading method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN113110851A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113806304A (en) * 2021-08-23 2021-12-17 北京天融信网络安全技术有限公司 Method and system for acquiring software file path
CN114138367A (en) * 2021-11-30 2022-03-04 中国建设银行股份有限公司 Service implementation method, device, equipment and storage medium on self-service equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062630A (en) * 2018-07-17 2018-12-21 北京奇艺世纪科技有限公司 A kind of program resource content download method, device and terminal device
CN110275723A (en) * 2019-06-25 2019-09-24 北京字节跳动网络技术有限公司 Obtain method, apparatus, electronic equipment and the readable medium of resource
CN110287146A (en) * 2019-06-19 2019-09-27 上海连尚网络科技有限公司 Using the method, equipment and computer storage medium of downloading
CN110968343A (en) * 2019-11-29 2020-04-07 合肥美的电冰箱有限公司 Resource file configuration method, configuration device, refrigerator and readable storage medium
CN111586170A (en) * 2020-05-07 2020-08-25 广州博冠信息科技有限公司 Resource downloading method, device, equipment and computer readable storage medium
CN112691382A (en) * 2021-01-15 2021-04-23 腾讯科技(深圳)有限公司 Resource processing method, device and computer readable storage medium
CN112698842A (en) * 2019-10-22 2021-04-23 北京国双科技有限公司 Method and device for acquiring additional information of application program

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062630A (en) * 2018-07-17 2018-12-21 北京奇艺世纪科技有限公司 A kind of program resource content download method, device and terminal device
CN110287146A (en) * 2019-06-19 2019-09-27 上海连尚网络科技有限公司 Using the method, equipment and computer storage medium of downloading
CN110275723A (en) * 2019-06-25 2019-09-24 北京字节跳动网络技术有限公司 Obtain method, apparatus, electronic equipment and the readable medium of resource
CN112698842A (en) * 2019-10-22 2021-04-23 北京国双科技有限公司 Method and device for acquiring additional information of application program
CN110968343A (en) * 2019-11-29 2020-04-07 合肥美的电冰箱有限公司 Resource file configuration method, configuration device, refrigerator and readable storage medium
CN111586170A (en) * 2020-05-07 2020-08-25 广州博冠信息科技有限公司 Resource downloading method, device, equipment and computer readable storage medium
CN112691382A (en) * 2021-01-15 2021-04-23 腾讯科技(深圳)有限公司 Resource processing method, device and computer readable storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113806304A (en) * 2021-08-23 2021-12-17 北京天融信网络安全技术有限公司 Method and system for acquiring software file path
CN113806304B (en) * 2021-08-23 2023-07-18 北京天融信网络安全技术有限公司 Method and system for acquiring software file path
CN114138367A (en) * 2021-11-30 2022-03-04 中国建设银行股份有限公司 Service implementation method, device, equipment and storage medium on self-service equipment

Similar Documents

Publication Publication Date Title
CN105867947B (en) Data processing method and device after preset application program updating
CN103092665B (en) Immediate updating device and immediate updating method
CN102520987B (en) Online experience and installation method, device, server and management system of application program
CN102523268B (en) Client side upgrading method and system
CN113110851A (en) Resource loading method and device, electronic equipment and medium
JP2001147826A (en) Device and method for loading object from hash index of primary memory
CN104918114A (en) Method and device for upgrading operation system
CN112114849B (en) Resource updating method and device
CN110968331A (en) Method and device for running application program
CN111290773B (en) System upgrade method, device and readable storage medium
CN112149035A (en) Website static resource processing method and device
CN111694585A (en) Method, system, terminal and storage medium for replacing system partition file
CN111399860A (en) Light application deployment method and device, computer equipment and storage medium
CN111045698A (en) Redundant picture deleting method and device, electronic equipment and storage medium
CN112286543B (en) Application service deployment method and device
CN113342419A (en) Loading method and device for push system, electronic equipment and storage medium
CN112612493A (en) Software upgrading method, device, equipment and storage medium for software set
CN111813423A (en) Application installation package processing method and device
CN112256351A (en) Implementation method of Feign component, micro-service calling method and device
CN111722865A (en) Resource data processing method and device for application program
CN106855816B (en) Resource file loading method and device of application program in terminal
WO2022241947A1 (en) Data processing method and apparatus for application program, device, and storage medium
CN115080114A (en) Application program transplanting processing method, device and medium
US20170105041A1 (en) Method and device of interactive function card of smart television
CN113157348A (en) Game starting method and device, computer equipment and storage medium

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