CN108492339A - Obtain method, apparatus, electronic equipment and the storage medium of resource compressed package - Google Patents

Obtain method, apparatus, electronic equipment and the storage medium of resource compressed package Download PDF

Info

Publication number
CN108492339A
CN108492339A CN201810263635.9A CN201810263635A CN108492339A CN 108492339 A CN108492339 A CN 108492339A CN 201810263635 A CN201810263635 A CN 201810263635A CN 108492339 A CN108492339 A CN 108492339A
Authority
CN
China
Prior art keywords
resource
picture resource
picture
compression
compressed
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.)
Granted
Application number
CN201810263635.9A
Other languages
Chinese (zh)
Other versions
CN108492339B (en
Inventor
戴新宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810263635.9A priority Critical patent/CN108492339B/en
Publication of CN108492339A publication Critical patent/CN108492339A/en
Application granted granted Critical
Publication of CN108492339B publication Critical patent/CN108492339B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping

Abstract

The invention discloses a kind of method, apparatus, electronic equipment and storage mediums obtaining resource compressed package, belong to field of computer technology.The method includes:Obtain at least one picture resource in resource;For any one picture resource at least one picture resource, according to picture resource and compression parameters, query history handles data;When at least one picture resource includes the first picture resource, the compressed data of the Target Photo resource in history processing data is obtained;Compressed data based on Target Photo resource, second picture resource and other types resource, obtains resource compressed package.The present invention can directly acquire compressed data of the corresponding compressed data of picture resource as the picture resource in history processing data, eliminate the compression step to picture resource, reduce to picture resource compressed needed for spend time, to reduce the time for obtaining and being spent needed for the process of resource compressed package, the acquisition efficiency of resource compressed package is improved.

Description

Obtain method, apparatus, electronic equipment and the storage medium of resource compressed package
Technical field
The present invention relates to field of computer technology, more particularly to a kind of method, apparatus obtaining resource compressed package, electronics are set Standby and storage medium.
Background technology
Texture compression is a kind of hot technology for being applied to draw scene, it can improve the rendering efficiency of texture.Wherein, Texture can be image data, color or transparent degrees of data, roughness or smooth degrees of data and reflectivity data etc..
In order to reduce the memory and bandwidth burden of texture occupancy, the rendering efficiency of texture is improved, for money to be issued Source is packaged again after typically being compressed to resource, obtains resource compressed package, to which the resource compressed package is handed down to end End, for terminal-pair, the resource compressed package unzips it, and carries out rendering the operations such as display to resource therein.Wherein, to money Source, which is compressed, is related to texture compression.For example, in three-dimensional electronic game application, the picture of the three-dimensional electronic game application Very big with the memory of the resource occupation such as code, when resource transmission, will also result in prodigious bandwidth burden, and the difference of terminal hardware Different, Rendering algorithms of the texture in the terminal of different operating system also have very big difference, therefore, in three-dimensional electronic game application In, it needs to treat the resource issued and be compressed, the compressed data of resource, which is then packaged into one, to pacify in terminal The compressed package of dress.
In the implementation of the present invention, the inventor finds that the existing technology has at least the following problems:
Increasingly huge with resource, process the time it takes of above-mentioned acquisition resource compressed package is increasingly longer, especially It is that spent time longest is compressed to picture resource, the acquisition efficiency of resource compressed package is low.
Invention content
An embodiment of the present invention provides a kind of method, apparatus, electronic equipment and storage mediums obtaining resource compressed package, can Process to solve to obtain resource compressed package in the prior art spends the time long, the low problem of the acquisition efficiency of resource compressed package. The technical solution is as follows:
On the one hand, a kind of method obtaining resource compressed package is provided, the method includes:
At least one picture resource in resource is obtained, the resource includes at least one picture resource and other types Resource;
For any one picture resource at least one picture resource, joined according to the picture resource and compression Number, query history handle data, and the compression parameters are the compress mode of the picture resource, and the history processing data include The characteristic value and compression parameters of the picture resource of overcompression are carried out;
When at least one picture resource includes the first picture resource, the target figure in history processing data is obtained The compressed data of piece resource, first picture resource is consistent with the characteristic value of Target Photo resource, first picture The compression parameters of resource are consistent with the compression parameters of Target Photo resource;
Compressed data based on the Target Photo resource, second picture resource and the other types resource, is provided Source compressed package, the second picture resource are the money in addition to first picture resource at least one picture resource Source.
On the one hand, a kind of device obtaining resource compressed package is provided, described device includes:
Acquisition module, for obtaining at least one picture resource in resource, the resource includes at least one picture Resource and other types resource;
Enquiry module is used for for any one picture resource at least one picture resource, according to the picture Resource and compression parameters, query history handle data, and the compression parameters are the compress mode of the picture resource, described to go through History processing data include the characteristic value and compression parameters for the picture resource for having carried out overcompression;
The acquisition module is additionally operable to when at least one picture resource includes the first picture resource, and acquisition is gone through History handles the compressed data of the Target Photo resource in data, the feature of first picture resource and the Target Photo resource Value is consistent, and the compression parameters of first picture resource are consistent with the compression parameters of Target Photo resource;
The acquisition module is additionally operable to based on the Target Photo resource, second picture resource and other types money The compressed data in source, obtains resource compressed package, and the second picture resource is at least one picture resource except described the Resource other than one picture resource.
On the one hand, a kind of electronic equipment is provided, the electronic equipment includes processor and memory, in the memory It is stored at least one instruction, described instruction is loaded by the processor and executed to realize the side for obtaining resource compressed package Operation performed by method.
On the one hand, provide a kind of computer readable storage medium, be stored in the computer readable storage medium to A few instruction, described instruction are loaded by processor and are executed to realize the behaviour performed by the method for obtaining resource compressed package Make.
The advantageous effect that technical solution provided in an embodiment of the present invention is brought is:
The embodiment of the present invention with history processing data by by picture resource in resource and compression parameters, being compared, such as There are the picture resource and compression parameters consistent with the picture resource and compression parameters in fruit history processing data, can directly acquire Compressed data of the corresponding compressed data of picture resource cached in history processing data as the picture resource, in this way by slow It deposits mechanism and directly carries out comparison and obtaining step, eliminate the compression step to picture resource, considerably reduce to figure Piece resource compressed needed for time for spending, obtain time for spending needed for the process of resource compressed package to reduce, carry The high acquisition efficiency of resource compressed package.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, other are can also be obtained according to these attached drawings Attached drawing.
Fig. 1 is a kind of implementation environment schematic diagram of method obtaining resource compressed package provided in an embodiment of the present invention;
Fig. 2 is a kind of method flow diagram obtaining resource compressed package provided in an embodiment of the present invention;
Fig. 3 is a kind of schematic diagram of picture resource including transparence information provided in an embodiment of the present invention;
Fig. 4 is a kind of schematic diagram of third picture resource provided in an embodiment of the present invention;
Fig. 5 is a kind of schematic diagram of 4th picture resource provided in an embodiment of the present invention;
Fig. 6 is a kind of schematic diagram of data structure that history processing data storage uses provided in an embodiment of the present invention;
Fig. 7 be it is provided in an embodiment of the present invention it is a kind of carry transparence information user interface (User Interface, UI) the schematic diagram of atlas;
Fig. 8 is a kind of schematic diagram of method flow obtaining resource compressed package provided in an embodiment of the present invention;
Fig. 9 is a kind of method flow diagram obtaining resource compressed package provided in an embodiment of the present invention;
Figure 10 is a kind of structural schematic diagram of device obtaining resource compressed package provided in an embodiment of the present invention;
Figure 11 is the structure diagram of a kind of electronic equipment 1100 provided in an embodiment of the present invention;
Figure 12 is the structural schematic diagram of a kind of electronic equipment 1200 provided in an embodiment of the present invention.
Specific implementation mode
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
Fig. 1 is a kind of implementation environment schematic diagram of method obtaining resource compressed package provided in an embodiment of the present invention, referring to Fig. 1 may include multiple electronic equipments in the implementation environment, wherein the electronic equipment may include three kinds:Electronic equipment 101, Electronic equipment 102 and electronic equipment 103.Electronic equipment 101 and electronic equipment 103 can be associated with electronic equipment 102, the electricity Sub- equipment 101 can be used for generating resource, and electronic equipment 102 is for storing the resource uploaded by electronic equipment 101, electronic equipment 103 can be used for obtaining resource from electronic equipment 102, compress, and be packaged to compressed resource, obtain to the resource To resource compressed package.After obtaining the resource compressed package, electronics where can sending it to user is set the electronic equipment 103 Standby, which can on an electronic device be decompressed in the user, and the operation based on user runs the resource Code resource in compressed package carries out rendering to the picture resource in the resource compressed package and shows.
The electronic equipment 101 can be terminal or server, which is typically server, the electronic equipment 103 can be terminal, can also be server, the embodiment of the present invention to the particular hardware structure of the electronic equipment 101 to 103 not Make specific limit.
For example, above-mentioned electronic equipment 101 can be electronic equipment where developer, electronic equipment 103 can be for providing The machine of source encapsulation, can be called structure machine, the electronic equipment 102 for storing and safeguard data, the electronic equipment 101 to Version control system (Subversion, SVN) can be installed, developer can be by electronic equipment 101 to electronics on 103 Equipment 102 uploads resource, which can preserve the resource of the electronic equipment 101 upload, and the electronic equipment 102 The final version information of the same resource can be determined based on multiple electronic equipments 101 to the modification time of same resource.Electricity Sub- equipment 103 can obtain resource from the electronic equipment 102, be compressed to the resource, and be encapsulated into resource compression Packet.
Fig. 2 is a kind of method flow diagram obtaining resource compressed package provided in an embodiment of the present invention, acquisition resource compression The method of packet applies above-mentioned electronic equipment 103, the method referring to Fig. 2, the acquisition resource compressed package to include the following steps:
201, electronic equipment obtain resource at least one picture resource, the resource include at least one picture resource and Other types resource.
Wherein, which can be server, can also be terminal, tool of the embodiment of the present invention to the electronic equipment Body hardware facility does not limit.In embodiments of the present invention, resource refers to the data in electronic equipment.For example, the resource can be with Including picture, word, code or audio and video etc..Wherein, picture is the picture resource in the embodiment of the present invention, and other types Resource refers to other resources other than picture in the resource, for example, word, code or audio and video.The electronic equipment has The function of being compressed and encapsulated to resource, it can obtain resource, traverse whether each resource in the resource is pressed Contracting, and be resource compressed package by the Resource Encapsulation after traversal.Specifically, which is packaged to resource When, the resource in the resource can also be encapsulated as to the resource compressed package of each project according to classification of the items.
In a kind of possible realization method, which, can be to the figure after the picture resource in getting resource The targeted compression format of piece resource is detected, and specifically, which can detect at least one picture money in the resource The targeted compression format in source;When the targeted compression format is not default compressed format, by the targeted compression lattice of the picture resource Formula is converted to default compressed format.
The default compressed format is pre-set by technical staff in the electronic equipment, which may include Multiple, in practical applications, other electronic equipments are when importing the picture resource, since the importing approach of selection is not preset Approach, then electronic equipment may then not be inconsistent standardization for the targeted compression format of its generation, for example, can be retouched for its generation File is stated, file is described according to this, it may be determined that the targeted compression format of the picture resource can according to the targeted compression format The picture resource is compressed with determining how, when the electronic equipment compresses picture resource in this way, if due to figure The compressed format of piece resource is not default compressed format, and for electronic equipment when being compressed to it, can detect should be to the figure The compress mode that piece resource carries out is not inconsistent with the compress mode currently for its generation, and such electronic equipment can judge the picture resource Lead-in mode is wrong, then the picture resource can be prompted to need and imported again with default compressed format, to increase the electronics Equipment the time it takes during obtaining resource compressed package, therefore, which carries out picture resource to compress it Whether the preceding compressed format for needing to detect the picture resource is default compressed format.
In specific implementation, above-mentioned in order to reduce process the time it takes that the electronic equipment obtains resource compressed package Targeted compression format detection and switch process can also be executed before the step 201 by other electronic equipments.For example, it is assumed that The electronic equipment of uploading pictures resource is the first electronic equipment, and the electronic equipment for storing picture resource is the second electronic equipment, when When picture resource is uploaded to the second electronic equipment by the first electronic equipment, which can execute above-mentioned targeted compression Format detection and targeted compression format conversion step are all converted to the picture resource of upload any in default compressed format Kind, such electronic equipment executes step 201, when obtaining resource from second electronic equipment, at least one picture in the resource The targeted compression format of resource meets the requirements, and the electronic equipment only needs simply to be verified in this way, you can executes follow-up The step of compression post package is carried out to resource, to considerably reduce the overall flow that the electronic equipment obtains resource compressed package Middle the time it takes.
Certainly, above-mentioned targeted compression format detection and targeted compression format conversion step can also be by uploading pictures resources First electronic equipment executes, and the embodiment of the present invention holds the targeted compression format detection and targeted compression format conversion step Row main body is not especially limited.For example, in some project, the developer of the project is electric to second by the first electronic equipment When sub- equipment uploading pictures resource, which can execute above-mentioned targeted compression format inspection before uploading pictures resource Survey and switch process, to which the picture resource that first electronic equipment is uploaded to second electronic equipment is default compressed format In it is any, increase the time it takes when electronic equipment obtains resource compressed package so as to avoid due to human error.
202, for any one picture resource at least one picture resource, electronic equipment according to the picture resource with And compression parameters, query history handle data, which is the compress mode of the picture resource.
Since the compression process to picture resource is to spend the time longest in the compression process to resource, and for same For a project, the recycling rate of waterused of picture resource is higher, that is to say during repeatedly obtaining resource compressed package, required pressure The variation of the picture resource of contracting will not be very big, and caching mechanism can be arranged on the electronic equipment.Wherein, caching mechanism refers to one The physical memory of electronic equipment is marked off what a part of space was used for storing the data generated in the electronic equipment by kind Function.For example, electronic equipment can store the request received, to avoid loss.Electronic equipment can also be by some Account information or historical data in are stored, subsequently to use.In embodiments of the present invention, which can It is stored with the compressed data for obtaining initial data when being compressed every time to picture resource, intermediate data and finally compressing It is handled in data in history, subsequently to reuse, the compression step to picture resource can also be reduced, obtained to save Take process the time it takes of resource compressed package.
Wherein, which is the picture resource or characteristic value that the initial data is the picture resource or this is original Data are the characteristic value of the picture resource and the picture resource, and the embodiment of the present invention is not especially limited this.Wherein, the picture The characteristic value of resource is used for unique mark picture resource, it may ensure that the picture resource integrality and consistency, different figures The characteristic value of piece is different.In a kind of possible realization method, this feature value can be Message Digest Algorithm 5 (Message Digest Algorithm 5, MD5) value.Intermediate data can be some for describing how the electronic equipment provides the picture The parameter that source is compressed that is to say that the compression parameters of the picture resource, final compressed data can be the picture resource pressures The data obtained after contracting.
Electronic equipment in step 201 is got in resource after at least one picture resource, the caching machine can be based on System, traverses all picture resources at least one picture resource, for any one picture resource, electronic equipment can execute Step 202, whether detection electronic equipment once carried out same compression step to same picture resource, specifically, the step Rapid 202 may include following step 202A to step 202D:
202A, electronic equipment obtain the compression parameters of the picture resource.
Electronic equipment can first determine that this needs how to compress picture resource, that is to say the pressure of the picture resource Contracting parameter, the compression parameters may include whether to need to compress the picture resource, and if necessary to be provided to the picture Source is compressed, and when compression needs which kind of compress mode used.Specifically, which obtains the compression ginseng of the picture resource Several processes may include following step (1) and (2):
(1) electronic equipment reads Resource TOC of the picture resource in the resource.
It, can will wherein different types of resource according to the Resource Properties of each resource for each resource in resource It is placed under different Resource TOCs, even same type of resource, Resource Properties may also be different, then same type of money Source can also be placed under different Resource TOCs, which can be the compressed format of the resource or that the resource includes is pre- If the information of type.For example, the Resource Properties of picture resource can be the transparence information of the picture resource, can also be the figure The shape information etc. of figure in piece resource.
When due to above-mentioned Resource Properties difference, need the compress mode carried out to resource also different, for different resources, When its Resource TOC difference being located at, the corresponding compress mode of the resource is then different, namely is different Resource TOC correspondence In different compression parameters.
(2) electronic equipment obtains the picture resource at this from the correspondence of the Resource TOC of caching and compression parameters The corresponding compression parameters of Resource TOC in resource.
Correspond to different compression parameters based on above-mentioned different Resource TOC, can be pre-set in the electronic equipment There are the correspondence of Resource TOC and compression parameters, such electronic equipment that can be based on the Resource TOC read in step (1), In the Resource TOC of caching and the correspondence of compression parameters, the corresponding compression parameters of Resource TOC of reading are inquired, then Obtain compression parameters of the compression parameters as the picture resource.For example, the Resource TOC in the resource can be as follows:
Wherein, above-mentioned exclusion file ExcludeFolder and exclusion file ExcludeFile is two in the resource Resource TOC, according to the corresponding compression parameters of the two Resource TOCs, it may be determined that the file under the two Resource TOCs is not necessarily to Compression, pic is a kind of image file format, which is the format of record and storage image information, Animation is animation file, and ut_playericon refers to player icon, and splash is a kind of unique rendered formats, Splashnormal is a kind of normal rendered formats.Electronic equipment reads the Resource TOC of some picture resource, the picture Resource TOC is ExcludeFolder, then electronic equipment can obtain the corresponding compression ginsengs of Resource TOC ExcludeFolder Number, electronic equipment get the compression parameters, you can determine without being compressed to the picture resource.
Certainly, in practical applications, the electronic equipment is in addition to the above-mentioned Resource TOC according to the picture resource in resource It determines except its compression parameters, electronic equipment can also determine its compression parameters according to the naming rule of the picture resource, specifically Ground can be previously provided with the corresponding resource naming rule of different compression parameters in the electronic equipment, to picture resource into The naming rule can be followed when row name, to which electronic equipment is when getting the picture resource, its resource name can be read Claim, which is matched with pre-set resource naming rule, to obtain the resource naming rule pair of hit The compression parameters answered.Certainly, which can also analyze the Resource Properties of the picture resource, determine its compression ginseng Number, how the embodiment of the present invention is to determine that the compression parameters of the picture resource are not especially limited.
202B, when according to the compression parameters, determine need to compress the picture resource when, by the spy of the picture resource Characteristic value and compression parameters in value indicative and compression parameters, with history processing data are compared.
Electronic equipment can compare the characteristic value in the characteristic value of the picture resource and history processing data, it is determined whether It is same picture resource, the compression parameters in the compression parameters of the picture resource and history processing data can be compared, really Whether fixed is same compress mode.
Further, which is also based on the classification of the items of the picture resource, preferentially by the picture resource Characteristic value and compression parameters handle the characteristic value of the identical items classification in data with history and are compared with compression parameters, to Comparison number can be reduced to the greatest extent, improve hit speed, to obtain the process saves time of resource compressed package, improve resource compression The acquisition efficiency of packet.
202C, characteristic value and compression parameters when the picture resource handle characteristic value and compression ginseng in data with history When number is hit, determine that the picture resource is the first picture resource.
Wherein, which refers to the picture that identical compressed data can be got in history handles data Resource.In other words, electronic equipment once a pair picture resource identical with first picture resource carried out it is identical compressed Journey has obtained compressed data, and is stored in history processing data.In embodiments of the present invention, historical data is handled In the corresponding picture resource of the first picture resource be known as Target Photo resource, i.e. first picture resource and the Target Photo resource Characteristic value it is consistent, the compression parameters of first picture resource are consistent with the compression parameters of the Target Photo resource.
In step 202C, two dimensions of characteristic value and compression parameters of the picture resource are hit, and illustrate the picture Picture resource in resource and history processing data is identical picture resource, and electronic equipment this need to the picture resource The compress mode of progress and the compress mode once carried out to same picture resource are also identical, it is possible to understand that ground, electronics are set If standby compress the picture resource, obtained compressed data and above-mentioned identical picture resource in history processing data Compressed data is also identical.Therefore, electronic equipment can determine that the picture resource is the first picture resource, be wrapped in history processing data Include the compressed data of Target Photo resource.
202D, characteristic value and compression parameters when the picture resource handle characteristic value and compression ginseng in data with history When any one of number miss, determine that the picture resource is second picture resource.
Based on the comparison for having carried out two dimensions to the picture resource, in the step 202D characteristic value of the picture resource and The case where any one of characteristic value and compression parameters in compression parameters, with history processing data miss may include following three Kind situation:
The first:If the characteristic value miss of the picture resource, compression parameters are hit, illustrates the picture resource and go through Any one picture resource that history is handled in data is all different, then electronic equipment, which can determine in history processing data, does not include and this The consistent picture resource of picture resource that is to say that in history processing data do not include Target Photo resource, without identical compression Data, hence, it can be determined that the picture resource is second picture resource.
Second:If the compression parameters miss of the picture resource, characteristic value are hit, illustrate the pressure of the picture resource Contracting parameter and the compression step that the electronic equipment once the carried out compress mode used are different, it may also be said to the bright electronic equipment Same compression process was not carried out, then electronic equipment can determine in history processing data not include that Target Photo provides Source, history, which is handled in data, does not have identical compressed data, hence, it can be determined that the picture resource is second picture resource.
The third:If the equal miss of characteristic value and compression parameters of the picture resource, illustrate the electronic equipment before simultaneously Overcompression is not carried out to same picture resource, did not also use the compress mode of this second compression requirement progress, then electronics Equipment can determine that in history processing data do not include Target Photo resource, without identical compressed data, hence, it can be determined that The picture resource is second picture resource.
Above-mentioned steps 202A to step 202D is according to the picture resource and compression parameters, and query history handles data Process, in a kind of possible realization method, in order to reduce the above-mentioned number for comparing picture resource and history processing data, Shorten the time of query history processing data, above-mentioned steps 202A to 202D can also be step 2021 to step 2026:
2021, electronic equipment obtains the compression parameters of the picture resource.
The step 2021 similarly, does not repeat herein with step 202A.
2022, when according to the compression parameters, determining that electronic equipment is by the picture when needing to compress the picture resource The characteristic value of resource handles the characteristic value in data with history and is compared.
Unlike step 202B, in the step 2022, electronic equipment can be first by the characteristic value of the picture resource The characteristic value in data is handled with history to compare, to determine whether the electronic equipment once carried out overvoltage to same picture resource Contracting can execute step if it is, determining that the characteristic value of the picture resource is hit with the characteristic value in history processing data 2023;If it is not, then step 2026 can be executed.
2023, when it includes the characteristic value of the picture resource that history, which handles the characteristic value in data, electronic equipment should The compression parameters of picture resource, compression parameters corresponding with the characteristic value hit in history processing data are compared, the history The characteristic value hit in processing data is consistent with the characteristic value of the picture resource.
Characteristic value in history processing data includes the characteristic value of the picture resource, illustrates the electronic equipment to same Picture resource carries out overcompression, and such electronic equipment can be directly by the compression parameters of picture resource picture same as this The corresponding compression parameters of resource are compared, if identical, then follow the steps 2024;If it is different, then executing step 2025.This Sample electronic equipment is not necessarily to compare the compression parameters of the picture resource and each compression parameters in history processing data, can To greatly reduce the number of comparison, to save the detection time to picture resource, resource compression is obtained to reduce The time spent needed for the process of packet.
2024, when the compression parameters of picture resource compression parameters corresponding with the characteristic value hit in history processing data When identical, electronic equipment determines that the picture resource is the first picture resource.
When the compression parameters of picture resource compression parameters corresponding with the characteristic value compared in step 2022 also phase Meanwhile that is, with step 202C similarly, be the characteristic value of the picture resource and the case where compression parameters are hit, electronic equipment can be with Determine that the picture resource is the first picture resource.
2025, when the compression parameters of picture resource compression parameters corresponding with the characteristic value hit in history processing data When different, electronic equipment determines that the picture resource is second picture resource.
When the compression parameters of picture resource compression parameters corresponding from the characteristic value compared in step 2022 are different When, i.e., similarly with the second situation in step 202D, it is that the characteristic value of the picture resource is hit, but compression parameters miss The case where, electronic equipment can determine that picture resource is second picture resource.
2026, when in the characteristic value of the caching not including the characteristic value of the picture resource, electronic equipment determines the picture Resource is second picture resource.
If comparing result illustrates that electronic equipment does not carry out overcompression to same picture resource in step 2022, It is then also impossible to there are Target Photo resource in history processing data, such electronic equipment can directly determine the picture resource For second picture resource, without executing step 2023 again, so as to greatly reduce the number of comparison, to save pair The detection time of picture resource, to reduce the time for obtaining and being spent needed for the process of resource compressed package.
Above-mentioned steps 2021 to step 2026 is formerly to compare the characteristic value of the picture resource, is obtained based on comparison consistent Characteristic value, then compare the comparison process of the compression parameters of the image resource, since the characteristic value of same picture resource is fixed, on Many unnecessary comparison process can be saved by stating comparison process, and the electronic equipment can be made to obtain the process of resource compressed package The time it takes is shorter.In practical application, which can also first compare compression parameters, then the knot obtained based on comparison Fruit contrast characteristic's value, the embodiment of the present invention are specifically not especially limited the step 202 using which kind of comparison process.
203, when at least one picture resource includes the first picture resource, electronic equipment obtains history and handles data In Target Photo resource compressed data.
At least one picture resource includes the first picture resource, illustrates that history processing data include Target Photo money Source, namely explanation, before this second compression, which once obtained picture resource identical with the picture resource, and adopted Compress mode identical with the compress mode required with this carries out overcompression to the picture resource, has obtained compressed data, this Sample picture resource is identical, and compress mode is also first identical, and the compressed data of the picture resource should also be the same, due to before Obtained compressed data has been stored in the history processing data of the electronic equipment, which can save to the figure The compression process of piece resource directly handles to obtain in data from history and compresses obtained compressed data before as the picture resource Compressed data.
In this way for the same project, the variation of the picture resource in each resource is not too large, passes through above-mentioned caching machine System, can save the compression step of a big chunk picture resource, be spent so as to greatly reduce picture resource compression Time, so as to improve the acquisition efficiency of resource compressed package.
Above-mentioned is the compressed data for being stored in the electronic equipment picture resource for once carrying out overcompression step, and electronics is set Standby can be obtained from history processing data carries out the compressed data obtained after identical compress mode to identical picture resource The compressed data acquisition modes of compressed data as this picture resource can also be set in practical applications in the electronics The compression of the corresponding characteristic value, compression parameters and the picture resource for being stored with above-mentioned picture resource in standby history processing data Data address, such electronic equipment determine that at least one picture resource includes that the first picture provides by above-mentioned steps 202 When source, the compressed data address of Target Photo resource can be got, to get the Target Photo based on the address The compressed data of resource, the mode that the embodiment of the present invention gets electronic equipment the compressed data of the picture resource specifically use It is above-mentioned any to be not construed as limiting.
204, when at least one picture resource includes second picture resource, according to the compression of the second picture resource Parameter, electronic equipment compress the second picture resource, obtain the compressed data of the second picture resource.
Electronic equipment is by step 202, also can not be from history with regard to explanation when determining that picture resource is second picture resource The compressed data consistent with this required compressed data is got in reason data, then electronic equipment can be provided according to the second picture The compression parameters in source compress the second picture resource.It specifically, can be with to the compress mode of the second picture resource It is divided into two major classes:Standard compression mode splits compress mode.
For standard compression mode, when the compression parameters are to comply with standard the corresponding compression parameters of compress mode, electronics Equipment can be determined using the corresponding compress mode of the compression parameters in standard compression mode, be pressed second picture resource Contracting, obtains the compressed data of the second picture resource.The standard compression mode can be ericsson texture compression (Ericsson Texture Compression, ETC), electric power virtual reality texture compression (Power Virtual Reality Texture Compression, PVRTC), S3 companies propose texture compression (Silicon&Software Systems Texture Compression, S3TC), vectorial texture compression (Vector-Quantization Texture Compression, VQTC) Etc. compress modes, which may be used the corresponding compress mode of compression parameters of the second picture resource, to the second figure Piece resource is compressed, and the embodiment of the present invention does not limit specifically specifically including which kind compress mode in the standard compression mode It is fixed.A kind of example of the compression parameters of standard compression mode is given below:Compressed format uses automatic compression (Automatic Compressed), it is forbidden to use computer graphic image technique (multum in parvo, Mipmap), the size of picture is no more than 1024x1024, compression quality are 100 (Compression Quality=100) etc..Electronic equipment can be by the second picture The compression parameters of resource compression parameters corresponding with standard compression mode are compared, so that it is determined that the pressure of the second picture resource Contracting mode, you can compression step is executed using corresponding compress mode, obtains the compressed data of the second picture resource.
For split compress mode, due on the electronic equipment of Android operation system to the compressed data of ETC compressed formats Rendering efficiency is best, but ETC compressed formats do not support include transparence information picture resource, and will be including transparence information Should include the picture of transparence information when compressed format (such as PVR formats) that picture resource boil down to IOS operating system is supported Resource can be distorted, then when the second picture resource includes transparence information, in order to ensure that second picture resource upon compression can Enough not damage, electronic equipment needs, using compress mode is split, to carry out fractionation compression to second picture resource, should include transparency The picture resource of information that is to say the picture resource for carrying the channels alpha.Specifically, the electronic equipment is to the second picture resource Carrying out the process of fractionation compression can be:When the compression parameters according to the second picture resource, determines and need to the second picture Resource is compressed, and when the second picture resource includes transparence information, and electronic equipment can tear the second picture resource open It is divided into third picture resource and the 4th picture resource, the format of the third picture resource and the 4th picture resource is RGB three Primary colors (Red Green Blue, RGB) format, the 4th picture resource carry the transparence information.Typically, for including The picture required precision of the picture resource of transparence information all will not be too high, then may not necessarily ensure the size of this kind of picture resource It is full size, that is to say that the 4th picture resource after electronic equipment can split the second picture resource zooms in and out, with drop The burden of memory, bandwidth shared by low 4th picture resource.Wherein, the scaling zoomed in and out to the 4th picture resource can With self-defined setting, the embodiment of the present invention is not especially limited the specific value of the scaling.
For example, Fig. 3 is a kind of schematic diagram of picture resource including transparence information provided in an embodiment of the present invention, electronics Equipment is when compressing the second picture resource, according to the compression parameters of the second picture resource, determine need to this Two picture resources are compressed, and the second picture resource includes transparence information, namely are to determine needs to the second picture Resource carries out fractionation compression, which can be split as third picture resource and carry transparency by electronic equipment The size of 4th picture resource of information, the second picture resource can be 128x128, the third picture resource as shown in figure 4, The format of the third picture resource is rgb format, and size 128x128, the 4th picture resource is as shown in figure 5, the 4th figure The format of piece resource is rgb format, and the 4th picture resource carries transparence information, due to the picture of the 4th picture resource Required precision is not high, and electronic equipment also zooms in and out the 4th picture resource, then the size of the 4th picture resource can be 64x64。
It in specific implementation, can also be by original material when which carries out above-mentioned picture resource splitting step Tinter is replaced, the third picture resource and the 4th picture resource that the tinter after replacement compresses after to above-mentioned fractionation into When row renders display, the third picture resource and the 4th picture resource can be merged so that the third picture resource and the 4th Picture resource is consistent with the preceding rendering display effect of the second picture resource is split when rendering display.
It should be noted that the transparence information of some picture resources is complex, if electronic equipment is to these pictures Resource is compressed, and the distortion rate of these picture resources is larger, then electronic equipment no longer compresses these picture resources, It is that, according to the compression parameters of these picture resources, determination need not compress these picture resources, then electronic equipment is held After row above-mentioned steps 202A or 2021, subsequent step 202B to step 202D or step 2022 are no longer executed to step 2026, step 203 is to step 205, but directly executes following step 206, and by the picture resource directly with following step 206 Middle compressed data is equally copied in the corresponding project folder of classification of the items of the picture resource, to subsequently carry out resource envelope Step is filled, resource compressed package is obtained.
205, electronic equipment by the compressed data of the second picture resource, the characteristic value of the second picture resource and this The compression parameters correspondence of two picture resources is stored in history processing data.
After electronic equipment obtains the compressed data of picture resource in above-mentioned steps 204, it can be stored, in this way It can execute above-mentioned steps 202 and 203 when having to the progress same squeeze operation of same picture resource next time, obtain This compressed data stored is taken, so as to save the time, to improve acquisition without executing above-mentioned steps 204 and 205 again The overall efficiency of resource compressed package.For example, for the above-mentioned picture resource for including transparence information, which handles data storage The data structure used can with as shown in fig. 6, history processing data include the second picture resource compressed data, that is to say The RGB figures after alpha figures and fractionation after fractionation, store the characteristic value of original image when storing the second picture resource, In figure 6, only by taking this feature value is MD5 values as an example, the compression parameters of the second picture resource that is to say that this tears the compression of figure open Strategy.Certainly, electronic equipment can also store the second picture resource in history handles data, wait needing to carry out above-mentioned steps When 202, the characteristic value of the second picture resource is generated based on second picture resource by the electronic equipment.Certainly, the electronic equipment The second picture resource and corresponding characteristic value can also be stored in history handles data, the embodiment of the present invention does not make this to have Body limits.
Above-mentioned steps 204 and 205 are the electronic equipments pair when at least one picture resource includes second picture resource Second picture resource is compressed, and to the process that compressed data is stored, in practical applications, in such a scenario, should Second picture resource can also be sent to server by electronic equipment, and picture resource compression service is provided for it by server, from And get the compressed data of the second picture resource.Specifically, when at least one picture resource includes second picture money When source, electronic equipment sends picture resource compression request to server, right by the server according to the picture resource compression request The second picture resource is compressed, and returns to the compressed data of the second picture resource, which carries There are the second picture resource and corresponding compression parameters;Electronic equipment receives the second picture resource of server return Compressed data, and by the compressed data of the second picture resource, the characteristic value of the second picture resource and the picture resource Compression parameters correspondence is stored in history processing data.Similarly, electronic equipment can not also store the spy of second picture resource Value indicative only stores second picture resource, or is stored to second picture resource and characteristic value, and the embodiment of the present invention does not make this It is specific to limit.
For it is above-mentioned to second picture resource carry out compression and server compression two ways is carried out to second picture resource, When electronic equipment compresses second picture resource, which is not necessarily to interact between server, even if network It goes wrong or the encapsulation of the picture resource of server goes wrong, which obtains flow and will not be interrupted, from And the method compressed to picture resource has good atomicity and robustness.In addition, server is to second picture resource In the method compressed, picture resource compression burden can be reduced, it should be noted that the server can also be periodically right Its picture resource preserved is compressed, so that the timeliness of its compressed data is stronger, to meet the picture resource pressure of user The period of contracting demand, compression self-defined can be arranged, and if the period of the compression is excessive, the server may be caused to provide Compressed data poor in timeliness, need to re-start compression, if the period of the compression is too small, the server may be caused Compression frequency is larger, compression burden it is larger, and picture resource is compressed by electronic equipment itself and cache may not need into The process of the above-mentioned periodic compression of row, and can be effectively prevented to same picture resource the case where repeating compression.
It should be noted that above-mentioned steps 202 to 205 are the compression parameters according to the picture resource, determine and need to this The case where when picture resource is compressed, after which can also execute step 202A or step 2021, when basis should The compression parameters of picture resource when determination need not compress the picture resource, do not execute subsequent step 202B to step 202D or step 2022 directly execute following step 206 to step 2026, step 203 to step 205, and by the figure Piece resource is directly equally copied to the corresponding item file of the classification of the items of the picture resource with compressed data in following step 206 In folder, to subsequently carry out Resource Encapsulation process.The above-mentioned picture resource without being compressed includes:The frequency of occurrences and precision are wanted Higher picture resource is sought, for example, the rocking bar background in single innings of electronic game, the frequency of occurrences of the rocking bar background and required precision It is all very high.The above-mentioned picture resource without being compressed further includes:The more complicated picture of transparence information in above-mentioned steps 205 Resource, for example, Fig. 7 is a kind of schematic diagram of UI atlas carrying transparence information provided in an embodiment of the present invention, such as Fig. 7 institutes Show, which is the atlas of the picture resource in the resource of an electronic game, including shape information it is too complicated, such as Fruit compresses the UI atlas, can cause prodigious loss, influences quality of playing.
Above-mentioned steps 201 to step 205 is to obtain the process of the compressed data of at least one picture resource in resource, in reality In the application of border, electronic equipment can also compress other types resource in the resource, obtain its compressed data, due to figure The step of process that piece resource is compressed is cost time longest in resource compression process, it is above-mentioned only to the compression of picture resource Process is described in detail, and is not repeated excessively herein the specific compression process of other types resource.
206, history is handled the Target Photo resource, second picture resource and other types resource in data by electronic equipment Compressed data, be copied in the corresponding project folder of the classification of the items according to classification of the items.
Above-mentioned resource may include the resource of multiple projects, can be with when electronic equipment is compressed and encapsulated to the resource By it according to classification of the items, it is encapsulated as the corresponding resource compressed package of multiple projects.It is above-mentioned for every at least one picture resource One picture resource carries out above-mentioned steps, is also compressed after obtaining compressed data to the other types resource in the resource, Electronic equipment can by the above-mentioned Target Photo resource got, the compressed data of second picture resource and other types resource, It is copied in the corresponding project folder of the classification of the items according to classification of the items, with literary according to project to compressed data to be packaged Part clip area separates, convenient to be subsequently packaged process.
In a kind of possible realization method, history can also be handled Target Photo resource, second in data by electronic equipment The compressed data of picture resource and other types resource passes through built-in cache server according to classification of the items (cacheserver) it is copied in the corresponding project folder of the classification of the items, so that above-mentioned reproduction process is faster, The time spent needed for resource compressed package acquisition process is saved, to improve the whole efficiency of resource compressed package acquisition process. In specific implementation, which can be the corresponding cacheserver of operating system corresponding to the picture resource, It that is to say in the electronic equipment to be the different corresponding cacheserver of allocating operating system, be also provided with not The same ports IP cacheserver connections corresponding from different operating system, in this way can be to avoid different operating system There is entanglement in data.
207, the data in each project folder are encapsulated as a resource compressed package by electronic equipment.
In addition to the compression number of the compressed data of above-mentioned picture resource, other types resource in data in the project folder Further include the picture resource that determination need not be compressed in above-mentioned steps 204 or step 205 except, electronic equipment can will provide Source is encapsulated as the resource compressed package of disparity items according to project folder, for example, the update peace of electronic game last update Dress packet, the update installation kit include code and picture resource etc. needed for this update.
Above-mentioned steps 206 and step 207 are to be based on the Target Photo resource, second picture resource and the other types resource Compressed data, the process of resource compressed package is obtained, in this way as shown in figure 8, passing through in entire resource compressed package acquisition process Offline compression, in advance can convert the compressed format of the picture resource by the electronic equipment or other electronic equipments, And the compression number to picture resource is reduced based on caching, and use and replicated compressed data by built-in cacheserver Into project folder, be finally packaged, that is to say encapsulation, it is possible to reduce spend needed for resource compressed package acquisition process when Between, improve the whole efficiency for obtaining resource compressed package.It is obtained through experiment, it is right in the method using above-mentioned acquisition resource compressed package Resource carries out compression the time it takes and has been reduced to from 40 minutes 5 minutes, greatly improves the acquisition effect of resource compressed package Rate.
In summary the method for obtaining resource compressed package, in practical applications, the method flow of the acquisition resource compressed package It can be with as shown in figure 9, the flow of the acquisition resource compressed package be compression for the picture resource including transparence information and envelope Dress flow specifically when being compressed to picture resource, can first detect whether current image resource has modification, that is to say Whether detection current image resource is changed compared with the characteristic value of caching, herein only by taking this feature value is MD5 values as an example It illustrates, if MD5 values do not change, detects the Compression Strategies of current image resource compared with the Compression Strategies of caching Whether changed, if the Compression Strategies also do not change, the data in caching are copied to project folder. If MD5 values change or Compression Strategies are changed, directly picture resource can be compressed, it can after compression To preserve data cached (alpha figures, RGB figures and Compression Strategies and the MD5 values) of the picture resource, traversal compresses all figures After piece resource, can it be copied to project folder by data cached again, carry out subsequent encapsulation step.
The embodiment of the present invention is carried out by the way that picture resource in resource and corresponding compression parameters are handled data with history Comparison can be with if having the picture resource and compression parameters consistent with the picture resource and compression parameters in history processing data Compressed data of the corresponding compressed data of picture resource cached in history processing data as the picture resource is directly acquired, this Sample directly carries out comparison and obtaining step by caching mechanism, eliminates the compression step to picture resource, greatly subtracts Lacked to picture resource compressed needed for time for spending, spent needed for the process of resource compressed package to reduce to obtain Time improves the acquisition efficiency of resource compressed package.
Further, the embodiment of the present invention also by before picture resource is compressed and is encapsulated first by picture resource Targeted compression format conversion be default compressed format, the electronic equipment so only needs simply to be verified, you can execution The step of subsequently carrying out compression post package to resource carries out obtaining resource compressed package to considerably reduce the electronic equipment The time it takes in overall flow.Further, the embodiment of the present invention includes also target figure by handling data not in history When piece resource, picture resource is compressed, obtains its compressed data, or ask by sending picture resource compression to server It asks, picture resource is compressed by server, to provide the realization method for the compressed data that two kinds obtain picture resource. Further, the embodiment of the present invention to the picture resource including transparence information also by carrying out fractionation compression, it is ensured that figure Piece resource can not be damaged upon compression.Further, the embodiment of the present invention is also corresponding by built-in different operating system Compressed data is copied to project folder by cacheserver, can make the reproduction process more rapidly, while being avoided different There is entanglement in the data of operating system.
The alternative embodiment that any combination forms the present invention may be used, herein no longer in above-mentioned all optional technical solutions It repeats one by one.
Figure 10 is a kind of structural schematic diagram of device obtaining resource compressed package provided in an embodiment of the present invention, referring to figure 10, which includes:
Acquisition module 1001, for obtaining at least one picture resource in resource, which includes at least one picture Resource and other types resource;
Enquiry module 1002 is used for for any one picture resource at least one picture resource, according to the picture Resource and compression parameters, query history handle data, which is the compress mode of the picture resource, history processing Data include the characteristic value and compression parameters for the picture resource for having carried out overcompression;
The acquisition module 1001 is additionally operable to when at least one picture resource includes the first picture resource, and acquisition is gone through History handles the compressed data of the Target Photo resource in data, the characteristic value one of first picture resource and the Target Photo resource It causes, the compression parameters of first picture resource are consistent with the compression parameters of the Target Photo resource;
The acquisition module 1001 is additionally operable to be based on the Target Photo resource, second picture resource and the other types resource Compressed data, obtain resource compressed package, the second picture resource be at least one picture resource in except first picture provide Resource other than source.
In a kind of possible realization method, which is used for:
Obtain the compression parameters of the picture resource;
When according to the compression parameters, determine need to compress the picture resource when, by the characteristic value of the picture resource And compression parameters, with history handle data in characteristic value and compression parameters compared;
When the characteristic value and compression parameters of the picture resource, handles characteristic value in data with history and compression parameters are ordered When middle, determine that the picture resource is the first picture resource;
When the characteristic value and compression parameters of the picture resource, handles in characteristic value and compression parameters in data and appoint with history When one miss, determine that the picture resource is second picture resource.
In a kind of possible realization method, which is used for:
Read Resource TOC of the picture resource in the resource;
From in the correspondence of the Resource TOC of caching and compression parameters, resource of the picture resource in the resource is obtained The corresponding compression parameters of catalogue.
In a kind of possible realization method, which further includes:
Compression module, for when at least one picture resource includes second picture resource, being provided according to second picture The compression parameters in source compress the second picture resource, obtain the compressed data of the second picture resource;
Memory module is used for the compressed data of the second picture resource, the characteristic value of the second picture resource and is somebody's turn to do The compression parameters correspondence of second picture resource is stored in history processing data.
In a kind of possible realization method, which is used for when the compression parameters according to the second picture resource, really It is fixed to need to compress the second picture resource, and when the second picture resource includes transparence information, by the second picture Resource is split as third picture resource and the 4th picture resource, and the format of the third picture resource and the 4th picture resource is red Turquoise three primary colors format, the 4th picture resource carry the transparence information.
In a kind of possible realization method, which further includes:
Sending module, for when at least one picture resource includes second picture resource, sending and scheming to server Piece resource compression request is compressed second picture resource, and return by the server according to the picture resource compression request The compressed data of the second picture resource, the picture resource compression request carry the second picture resource and corresponding compression Parameter;
Receiving module, the compressed data of the second picture resource for receiving server return, and by second figure The compression parameters correspondence of the compressed data of piece resource, the characteristic value of the second picture resource and the second picture resource is stored in History is handled in data.
In a kind of possible realization method, which is used for:
History is handled to the compression number of the Target Photo resource, second picture resource and the other types resource in data According to being copied in the corresponding project folder of the classification of the items according to classification of the items;
Data in each project folder are encapsulated as a resource compressed package.
In a kind of possible realization method, which further includes:
Detection module, the targeted compression format for detecting at least one picture resource in the resource;
Format converting module, for when the targeted compression format is not default compressed format, by the mesh of the picture resource Mark compressed format is converted to default compressed format.
Device provided in an embodiment of the present invention by by picture resource in resource and compression parameters, with history handle data into Row comparison can if having the picture resource and compression parameters consistent with the picture resource and compression parameters in history processing data To directly acquire the corresponding compressed data of picture resource that caches in history processing data as the compressed data of the picture resource, Comparison and obtaining step are directly carried out by caching mechanism in this way, eliminates the compression step to picture resource, greatly Reduce to picture resource compressed needed for spend time, to reduce obtain resource compressed package process needed for spend Time, improve the acquisition efficiency of resource compressed package.
It should be noted that:Above-described embodiment provide acquisition resource compressed package device when obtaining resource compressed package, It only the example of the division of the above functional modules, can be as needed and by above-mentioned function distribution in practical application It is completed by different function modules, i.e., the internal structure of electronic equipment is divided into different function modules, to complete above retouch The all or part of function of stating.In addition, the device for the acquisition resource compressed package that above-described embodiment provides is compressed with resource is obtained The embodiment of the method for packet belongs to same design, and specific implementation process refers to embodiment of the method, and which is not described herein again.
Figure 11 is the structure diagram of a kind of electronic equipment 1100 provided in an embodiment of the present invention.The electronic equipment 1100 can be with It is provided as a terminal.The electronic equipment 1100 can be:Smart mobile phone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III, dynamic image expert's compression standard audio level 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert's compression standard audio level 4) is broadcast Put device, laptop or desktop computer.Terminal 1100 be also possible to be referred to as user equipment, portable terminal, laptop terminal, Other titles such as terminal console.
In general, electronic equipment 1100 includes:Processor 1101 and memory 1102.
Processor 1101 may include one or more processing cores, such as 4 core processors, 8 core processors etc..Place DSP (Digital Signal Processing, Digital Signal Processing), FPGA (Field- may be used in reason device 1101 Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, may be programmed Logic array) at least one of example, in hardware realize.Processor 1101 can also include primary processor and coprocessor, master Processor is the processor for being handled data in the awake state, also referred to as CPU (Central Processing Unit, central processing unit);Coprocessor is the low power processor for being handled data in the standby state. In some embodiments, processor 1101 can be integrated with GPU (Graphics Processing Unit, image processor), GPU is used to be responsible for the rendering and drafting of content to be shown needed for display screen.In some embodiments, processor 1101 can also wrap AI (Artificial Intelligence, artificial intelligence) processor is included, the AI processors are for handling related machine learning Calculating operation.
Memory 1102 may include one or more computer readable storage mediums, which can To be non-transient.Memory 1102 may also include high-speed random access memory and nonvolatile memory, such as one Or multiple disk storage equipments, flash memory device.In some embodiments, the non-transient computer in memory 1102 can Storage medium is read for storing at least one instruction, at least one instruction is for performed to realize this hair by processor 1101 The method for the acquisition resource compressed package that bright middle embodiment of the method provides.
In some embodiments, electronic equipment 1100 is also optional includes:Peripheral device interface 1103 and at least one outer Peripheral equipment.It can be connected by bus or signal wire between processor 1101, memory 1102 and peripheral device interface 1103.Respectively A peripheral equipment can be connected by bus, signal wire or circuit board with peripheral device interface 1103.Specifically, peripheral equipment packet It includes:Radio circuit 1104, touch display screen 1105, camera 1106, voicefrequency circuit 1107, positioning component 1108 and power supply 1109 At least one of.
Peripheral device interface 1103 can be used for I/O (Input/Output, input/output) is relevant at least one outer Peripheral equipment is connected to processor 1101 and memory 1102.In some embodiments, processor 1101, memory 1102 and periphery Equipment interface 1103 is integrated on same chip or circuit board;In some other embodiments, processor 1101, memory 1102 and peripheral device interface 1103 in any one or two can be realized on individual chip or circuit board, this implementation Example is not limited this.
Radio circuit 1104 is for receiving and emitting RF (Radio Frequency, radio frequency) signal, also referred to as electromagnetic signal. Radio circuit 1104 is communicated by electromagnetic signal with communication network and other communication equipments.Radio circuit 1104 is by telecommunications Number being converted to electromagnetic signal is sent, alternatively, the electromagnetic signal received is converted to electric signal.Optionally, radio circuit 1104 include:Antenna system, one or more amplifiers, tuner, oscillator, digital signal processor, compiles solution at RF transceivers Code chipset, user identity module card etc..Radio circuit 1104 can by least one wireless communication protocol come with it is other Electronic equipment is communicated.The wireless communication protocol includes but not limited to:Metropolitan Area Network (MAN), each third generation mobile communication network (2G, 3G, 4G And 5G), WLAN and/or WiFi (Wireless Fidelity, Wireless Fidelity) network.In some embodiments, radio frequency Circuit 1104 can also include the related circuits of NFC (Near Field Communication, wireless near field communication), this hair It is bright that this is not limited.
Display screen 1105 is for showing UI.The UI may include figure, text, icon, video and its their arbitrary group It closes.When display screen 1105 is touch display screen, display screen 1105 also has acquisition on the surface or surface of display screen 1105 The ability of the touch signal of side.The touch signal can be used as control signal to be input to processor 1101 and be handled.At this point, aobvious Display screen 1105 can be also used for providing virtual push button and/or dummy keyboard, also referred to as soft button and/or soft keyboard.In some implementations In example, display screen 1105 can be one, and the front panel of electronic equipment 1100 is arranged;In further embodiments, display screen 1105 can be at least two, be separately positioned on the different surfaces of electronic equipment 1100 or in foldover design;In still other implementation Example in, display screen 1105 can be flexible display screen, be arranged on the curved surface of electronic equipment 1100 or fold plane on.Very Extremely, display screen 1105 can also be arranged to non-rectangle irregular figure, namely abnormity screen.LCD may be used in display screen 1105 (LiquidCrystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, organic light emission Diode) etc. materials prepare.
CCD camera assembly 1106 is for acquiring image or video.Optionally, CCD camera assembly 1106 includes front camera And rear camera.In general, the front panel in electronic equipment is arranged in front camera, rear camera is arranged in electronic equipment The back side.In some embodiments, rear camera at least two are main camera, depth of field camera, wide-angle imaging respectively Head, any one in focal length camera, to realize that main camera and the fusion of depth of field camera realize that background blurring function, master are taken the photograph As head and wide-angle camera fusion realize pan-shot and VR (Virtual Reality, virtual reality) shooting functions or Other fusion shooting functions.In some embodiments, CCD camera assembly 1106 can also include flash lamp.Flash lamp can be single Colour temperature flash lamp can also be double-colored temperature flash lamp.Double-colored temperature flash lamp refers to the combination of warm light flash lamp and cold light flash lamp, It can be used for the light compensation under different-colour.
Voicefrequency circuit 1107 may include microphone and loud speaker.Microphone is used to acquire the sound wave of user and environment, and It converts sound waves into electric signal and is input to processor 1101 and handled, or be input to radio circuit 1104 to realize that voice is logical Letter.For stereo acquisition or the purpose of noise reduction, microphone can be multiple, be separately positioned on the different portions of electronic equipment 1100 Position.Microphone can also be array microphone or omnidirectional's acquisition type microphone.Loud speaker then be used for will come from processor 1101 or The electric signal of radio circuit 1104 is converted to sound wave.Loud speaker can be traditional wafer speaker, can also be piezoelectric ceramics Loud speaker.When loud speaker is piezoelectric ceramic loudspeaker, the audible sound wave of the mankind can be not only converted electrical signals to, also may be used To convert electrical signals to the sound wave that the mankind do not hear to carry out the purposes such as ranging.In some embodiments, voicefrequency circuit 1107 It can also include earphone jack.
Positioning component 1108 is used for the current geographic position of Positioning Electronic Devices 1100, to realize navigation or LBS (Location Based Service, location based service).Positioning component 1108 can be the GPS based on the U.S. The dipper system of (Global Positioning System, global positioning system), China, the Gray of Russia receive this system Or the positioning component of the Galileo system of European Union.
Power supply 1109 is used to be powered for the various components in electronic equipment 1100.Power supply 1109 can be alternating current, Direct current, disposable battery or rechargeable battery.When power supply 1109 includes rechargeable battery, which can support Wired charging or wireless charging.The rechargeable battery can be also used for supporting fast charge technology.
In some embodiments, electronic equipment 1100 further include there are one or multiple sensors 1110.The one or more Sensor 1110 includes but not limited to:Acceleration transducer 1111, gyro sensor 1112, pressure sensor 1113, fingerprint Sensor 1114, optical sensor 1115 and proximity sensor 1116.
Acceleration transducer 1111 can detect adding in three reference axis of the coordinate system established with electronic equipment 1100 Velocity magnitude.For example, acceleration transducer 1111 can be used for detecting component of the acceleration of gravity in three reference axis.Processing The acceleration of gravity signal that device 1101 can be acquired according to acceleration transducer 1111, control touch display screen 1105 is laterally to regard Figure or longitudinal view carry out the display of user interface.Acceleration transducer 1111 can be also used for game or the movement number of user According to acquisition.
Gyro sensor 1112 can detect body direction and the rotational angle of electronic equipment 1100, gyro sensor 1112 can cooperate with acquisition user to act the 3D of electronic equipment 1100 with acceleration transducer 1111.Processor 1101 is according to top The data that spiral shell instrument sensor 1112 acquires, may be implemented following function:Action induction (for example changed according to the tilt operation of user Become UI), shooting when image stabilization, game control and inertial navigation.
Pressure sensor 1113 can be arranged under the side frame of electronic equipment 1100 and/or touch display screen 1105 Layer.When pressure sensor 1113 is arranged in the side frame of electronic equipment 1100, user can be detected to electronic equipment 1100 Signal is held, right-hand man's identification or quick behaviour are carried out according to the gripping signal that pressure sensor 1113 acquires by processor 1101 Make.It is aobvious to touching according to user by processor 1101 when pressure sensor 1113 is arranged in the lower layer of touch display screen 1105 The pressure operation of display screen 1105, realization control the operability control on the interfaces UI.Operability control includes button At least one of control, scroll bar control, icon control, menu control.
Fingerprint sensor 1114 is used to acquire the fingerprint of user, is collected according to fingerprint sensor 1114 by processor 1101 Fingerprint recognition user identity, alternatively, by fingerprint sensor 1114 according to the identity of collected fingerprint recognition user.Knowing When the identity for not going out user is trusted identity, the user is authorized to execute relevant sensitive operation, sensitivity behaviour by processor 1101 Work includes solving lock screen, checking encryption information, download software, payment and change setting etc..Fingerprint sensor 1114 can be set Set the front, the back side or side of electronic equipment 1100.When being provided with physical button or manufacturer Logo on electronic equipment 1100, refer to Line sensor 1114 can be integrated with physical button or manufacturer Logo.
Optical sensor 1115 is for acquiring ambient light intensity.In one embodiment, processor 1101 can be according to light The ambient light intensity that sensor 1115 acquires is learned, the display brightness of touch display screen 1105 is controlled.Specifically, work as ambient light intensity When higher, the display brightness of touch display screen 1105 is turned up;When ambient light intensity is relatively low, the aobvious of touch display screen 1105 is turned down Show brightness.In another embodiment, the ambient light intensity that processor 1101 can also be acquired according to optical sensor 1115, is moved State adjusts the acquisition parameters of CCD camera assembly 1106.
Proximity sensor 1116, also referred to as range sensor are generally arranged at the front panel of electronic equipment 1100.Close to sensing Device 1116 is used to acquire the distance between the front of user and electronic equipment 1100.In one embodiment, work as proximity sensor 1116 when detecting that the distance between the front of user and electronic equipment 1100 tapers into, and is touched by the control of processor 1101 aobvious Display screen 1105 is switched to breath screen state from bright screen state;When proximity sensor 1116 detects user with electronic equipment 1100 just When the distance between face becomes larger, touch display screen 1105 is controlled by processor 1101 and is switched to bright screen shape from breath screen state State.
It will be understood by those skilled in the art that structure shown in Figure 11 does not constitute the restriction to electronic equipment 1100, May include either combining certain components than illustrating more or fewer components or being arranged using different components.
Figure 12 is the structural schematic diagram of a kind of electronic equipment 1200 provided in an embodiment of the present invention, which can To be provided as a server, which can generate bigger difference because configuration or performance are different, can wrap It includes one or more processors (central processing units, CPU) 1201 and one or more deposits Reservoir 1202, wherein be stored at least one instruction in the memory 1202, which is added by the processor 1201 The method for carrying and executing the acquisition resource compressed package to realize above-mentioned each embodiment of the method offer.Certainly, the electronic equipment 1200 can also have the components such as wired or wireless network interface, keyboard and input/output interface, to carry out input and output, The electronic equipment 1200 can also be including other for realizing the component of functions of the equipments, and this will not be repeated here.
In the exemplary embodiment, a kind of computer readable storage medium, such as the memory including instruction are additionally provided, Above-metioned instruction can be executed the method to complete the acquisition resource compressed package in above-described embodiment by the processor in terminal.For example, The computer readable storage medium can be that ROM, random access memory (RAM), CD-ROM, tape, floppy disk and light data are deposited Store up equipment etc..
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, which can be stored in a kind of computer-readable storage In medium, storage medium mentioned above can be read-only memory, disk or CD etc..
Presently preferred embodiments of the present invention is above are only, is not intended to limit the invention, it is all in the spirit and principles in the present invention Within, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention.

Claims (15)

1. a kind of method obtaining resource compressed package, which is characterized in that the method includes:
At least one picture resource in resource is obtained, the resource includes at least one picture resource and other types money Source;
For any one picture resource at least one picture resource, according to the picture resource and compression parameters, Query history handles data, and the compression parameters are the compress mode of the picture resource, and the history processing data include Carry out the characteristic value and compression parameters of the picture resource of overcompression;
When at least one picture resource includes the first picture resource, the Target Photo money in history processing data is obtained The compressed data in source, first picture resource is consistent with the characteristic value of Target Photo resource, first picture resource Compression parameters it is consistent with the compression parameters of Target Photo resource;
Compressed data based on the Target Photo resource, second picture resource and the other types resource, obtains resource pressure Contracting packet, the second picture resource are the resource in addition to first picture resource at least one picture resource.
2. according to the method described in claim 1, it is characterized in that, described according to the picture resource and compression parameters, look into It askes history and handles data, including:
Obtain the compression parameters of the picture resource;
When according to the compression parameters, determine need to compress the picture resource when, by the feature of the picture resource Characteristic value and compression parameters in value and compression parameters, with history processing data are compared;
When the characteristic value and compression parameters of the picture resource, handles characteristic value in data with history and compression parameters are hit When, determine that the picture resource is the first picture resource;
When the characteristic value and compression parameters of the picture resource, handled with history any in characteristic value and compression parameters in data When item miss, determine that the picture resource is second picture resource.
3. according to the method described in claim 2, it is characterized in that, the compression parameters for obtaining the picture resource, including:
Read Resource TOC of the picture resource in the resource;
From in the correspondence of the Resource TOC of caching and compression parameters, resource of the picture resource in the resource is obtained The corresponding compression parameters of catalogue.
4. according to claim 1-3 any one of them methods, which is characterized in that the method further includes:
It is right according to the compression parameters of second picture resource when at least one picture resource includes second picture resource The second picture resource is compressed, and the compressed data of the second picture resource is obtained;
By the compressed data of the second picture resource, the characteristic value of the second picture resource and the second picture resource Compression parameters correspondence be stored in history processing data in.
5. according to the method described in claim 4, it is characterized in that, the compression parameters according to second picture resource, to institute It states second picture resource to be compressed, obtains the compressed data of the second picture resource, including:
When the compression parameters according to the second picture resource, determines and need to compress the second picture resource, and institute When to state second picture resource include transparence information, the second picture resource is split as third picture resource and the 4th picture The format of resource, the third picture resource and the 4th picture resource is red green blue tricolor format, the 4th picture Resource carries the transparence information.
6. according to the method described in claim 1, it is characterized in that, the method further includes:
When at least one picture resource includes second picture resource, picture resource compression request is sent to server, By the server according to the picture resource compression request, second picture resource is compressed, and returns to second figure The compressed data of piece resource, the picture resource compression request carry the second picture resource and corresponding compression ginseng Number;
Receive the compressed data for the second picture resource that the server returns, and by the compression of the second picture resource The compression parameters correspondence of data, the characteristic value of the second picture resource and the second picture resource is stored in history processing In data.
7. according to the method described in claim 1, it is characterized in that, described provided based on the Target Photo resource, second picture The compressed data in source and the other types resource obtains resource compressed package, including:
History is handled to the compression number of Target Photo resource, second picture resource and the other types resource described in data According to being copied in the corresponding project folder of the classification of the items according to classification of the items;
Data in each project folder are encapsulated as a resource compressed package.
8. according to the method described in claim 1, it is characterized in that, the method further includes:
Detect the targeted compression format of at least one picture resource in the resource;
It is pre- by the targeted compression format conversion of the picture resource when the targeted compression format is not default compressed format If compressed format.
9. a kind of device obtaining resource compressed package, which is characterized in that described device includes:
Acquisition module, for obtaining at least one picture resource in resource, the resource includes at least one picture resource With other types resource;
Enquiry module is used for for any one picture resource at least one picture resource, according to the picture resource And compression parameters, query history handle data, the compression parameters are the compress mode of the picture resource, at the history Reason data include the characteristic value and compression parameters for the picture resource for having carried out overcompression;
The acquisition module is additionally operable to when at least one picture resource includes the first picture resource, is obtained at history Manage the compressed data of the Target Photo resource in data, the characteristic value one of first picture resource and the Target Photo resource It causes, the compression parameters of first picture resource are consistent with the compression parameters of Target Photo resource;
The acquisition module is additionally operable to based on the Target Photo resource, second picture resource and the other types resource Compressed data, obtains resource compressed package, and the second picture resource is that first figure is removed at least one picture resource Resource other than piece resource.
10. device according to claim 9, which is characterized in that the enquiry module is used for:
Obtain the compression parameters of the picture resource;
When according to the compression parameters, determine need to compress the picture resource when, by the feature of the picture resource Characteristic value and compression parameters in value and compression parameters, with history processing data are compared;
When the characteristic value and compression parameters of the picture resource, handles characteristic value in data with history and compression parameters are hit When, determine that the picture resource is the first picture resource;
When the characteristic value and compression parameters of the picture resource, handled with history any in characteristic value and compression parameters in data When item miss, determine that the picture resource is second picture resource.
11. device according to claim 9 or 10, which is characterized in that described device further includes:
Compression module is used for when at least one picture resource includes second picture resource, according to second picture resource Compression parameters, the second picture resource is compressed, the compressed data of the second picture resource is obtained;
Memory module is used for the compressed data of the second picture resource, the characteristic value of the second picture resource and institute The compression parameters correspondence for stating second picture resource is stored in history processing data.
12. according to the devices described in claim 11, which is characterized in that the compression module is used for:
When the compression parameters according to the second picture resource, determines and need to compress the second picture resource, and institute When to state second picture resource include transparence information, the second picture resource is split as third picture resource and the 4th picture The format of resource, the third picture resource and the 4th picture resource is red green blue tricolor format, the 4th picture Resource carries the transparence information.
13. device according to claim 9, which is characterized in that described device further includes:
Detection module, the targeted compression format for detecting at least one picture resource in the resource;
Format converting module, for when the targeted compression format is not default compressed format, by the mesh of the picture resource Mark compressed format is converted to default compressed format.
14. a kind of electronic equipment, which is characterized in that the electronic equipment includes processor and memory, is deposited in the memory At least one instruction is contained, described instruction is loaded by the processor and executed to realize as claim 1 to claim 8 is appointed Operation performed by the method for acquisition resource compressed package described in one.
15. a kind of computer readable storage medium, which is characterized in that be stored at least one in the computer readable storage medium Item instructs, and described instruction is loaded by processor and executed to realize that claim 1 to claim 8 any one of them such as obtains Operation performed by the method for resource compressed package.
CN201810263635.9A 2018-03-28 2018-03-28 Method and device for acquiring resource compression packet, electronic equipment and storage medium Active CN108492339B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810263635.9A CN108492339B (en) 2018-03-28 2018-03-28 Method and device for acquiring resource compression packet, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810263635.9A CN108492339B (en) 2018-03-28 2018-03-28 Method and device for acquiring resource compression packet, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108492339A true CN108492339A (en) 2018-09-04
CN108492339B CN108492339B (en) 2021-06-01

Family

ID=63316512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810263635.9A Active CN108492339B (en) 2018-03-28 2018-03-28 Method and device for acquiring resource compression packet, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108492339B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111260768A (en) * 2020-02-07 2020-06-09 腾讯科技(深圳)有限公司 Picture processing method and device, storage medium and electronic device
CN115277674A (en) * 2022-07-19 2022-11-01 广州博冠信息科技有限公司 Picture compression method, device, electronic equipment, medium and program product
CN116860183A (en) * 2023-09-04 2023-10-10 北京安天网络安全技术有限公司 Data storage method, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101546434A (en) * 2008-03-28 2009-09-30 深圳市同洲电子股份有限公司 Method and system for compressing and decompressing BMP picture file
CN102684705A (en) * 2012-05-30 2012-09-19 奇智软件(北京)有限公司 Method and device for data compression
CN103605734A (en) * 2013-11-19 2014-02-26 广东电网公司电力科学研究院 Characteristic vector based data transmission compression method and system
US20140125458A1 (en) * 2010-01-05 2014-05-08 The Regents Of The University Of California MEMS Sensor Enabled RFID System and Method for Operating the Same
CN105513101A (en) * 2015-12-03 2016-04-20 小米科技有限责任公司 Image processing method and device
CN106776663A (en) * 2015-11-25 2017-05-31 腾讯科技(深圳)有限公司 The compression method and device of audio file

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101546434A (en) * 2008-03-28 2009-09-30 深圳市同洲电子股份有限公司 Method and system for compressing and decompressing BMP picture file
US20140125458A1 (en) * 2010-01-05 2014-05-08 The Regents Of The University Of California MEMS Sensor Enabled RFID System and Method for Operating the Same
CN102684705A (en) * 2012-05-30 2012-09-19 奇智软件(北京)有限公司 Method and device for data compression
CN103605734A (en) * 2013-11-19 2014-02-26 广东电网公司电力科学研究院 Characteristic vector based data transmission compression method and system
CN106776663A (en) * 2015-11-25 2017-05-31 腾讯科技(深圳)有限公司 The compression method and device of audio file
CN105513101A (en) * 2015-12-03 2016-04-20 小米科技有限责任公司 Image processing method and device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111260768A (en) * 2020-02-07 2020-06-09 腾讯科技(深圳)有限公司 Picture processing method and device, storage medium and electronic device
CN111260768B (en) * 2020-02-07 2022-04-26 腾讯科技(深圳)有限公司 Picture processing method and device, storage medium and electronic device
EP4002289A4 (en) * 2020-02-07 2022-11-30 Tencent Technology (Shenzhen) Company Limited Picture processing method and device, storage medium, and electronic apparatus
CN115277674A (en) * 2022-07-19 2022-11-01 广州博冠信息科技有限公司 Picture compression method, device, electronic equipment, medium and program product
CN116860183A (en) * 2023-09-04 2023-10-10 北京安天网络安全技术有限公司 Data storage method, electronic equipment and storage medium
CN116860183B (en) * 2023-09-04 2023-12-01 北京安天网络安全技术有限公司 Data storage method, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN108492339B (en) 2021-06-01

Similar Documents

Publication Publication Date Title
CN108536463B (en) Method, device and equipment for acquiring resource package and computer readable storage medium
CN111932664B (en) Image rendering method and device, electronic equipment and storage medium
CN109829456A (en) Image-recognizing method, device and terminal
CN108845856A (en) Data Binding Method, device, storage medium and equipment
CN109815150A (en) Application testing method, device, electronic equipment and storage medium
CN110309243A (en) Obtain method, apparatus, equipment and the storage medium of outdoor scene electronic map
CN109285178A (en) Image partition method, device and storage medium
CN110368689A (en) Display methods, system, electronic equipment and the storage medium of interface
CN108563377A (en) The method and apparatus that switching shows the page
CN108762881A (en) Interface method for drafting, device, terminal and storage medium
CN108492339A (en) Obtain method, apparatus, electronic equipment and the storage medium of resource compressed package
CN110121094A (en) Video is in step with display methods, device, equipment and the storage medium of template
CN109241497A (en) Text handling method and device
CN110290426A (en) Method, apparatus, equipment and the storage medium of showing resource
CN110853128A (en) Virtual object display method and device, computer equipment and storage medium
CN110032384A (en) Method, apparatus, equipment and the storage medium of resource updates
CN108734662A (en) The method and apparatus for showing icon
CN109254775A (en) Image processing method, terminal and storage medium based on face
CN108491748A (en) The identification and generation method of graphic code, device and computer readable storage medium
CN111265885A (en) Resource display method, resource sending method, device, equipment and storage medium
CN110045958A (en) Data texturing generation method, device, storage medium and equipment
CN109771950B (en) Node map setting method, device and storage medium
CN110414448A (en) Image processing method, device, electronic equipment and storage medium
CN112738624B (en) Method and device for special effect rendering of video
CN114332709A (en) Video processing method, video processing device, storage medium and electronic 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
GR01 Patent grant
GR01 Patent grant