[go: up one dir, main page]

WO2017005085A1 - Data compression method, apparatus, and terminal - Google Patents

Data compression method, apparatus, and terminal Download PDF

Info

Publication number
WO2017005085A1
WO2017005085A1 PCT/CN2016/086463 CN2016086463W WO2017005085A1 WO 2017005085 A1 WO2017005085 A1 WO 2017005085A1 CN 2016086463 W CN2016086463 W CN 2016086463W WO 2017005085 A1 WO2017005085 A1 WO 2017005085A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
target data
target
compression
storage space
Prior art date
Application number
PCT/CN2016/086463
Other languages
French (fr)
Chinese (zh)
Inventor
张海平
Original Assignee
广东欧珀移动通信有限公司
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 广东欧珀移动通信有限公司 filed Critical 广东欧珀移动通信有限公司
Publication of WO2017005085A1 publication Critical patent/WO2017005085A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a data compression method, apparatus, and terminal.
  • the amount of data stored in the terminal is also increasing.
  • the data can be compressed to improve the utilization of the storage space.
  • a uniform compression method is adopted for all types of data, resulting in poor data compression flexibility.
  • the embodiment of the invention discloses a data compression method, device, terminal and non-volatile computer storage medium, which can improve the flexibility of data compression.
  • the embodiment of the invention discloses a data compression method, including:
  • the target process is a process of performing data compression by using a compression mode corresponding to the target data type set in advance;
  • the target process is invoked to compress the target data.
  • the embodiment of the invention further discloses a data compression device, the device comprising:
  • a first determining module configured to determine target data to be compressed
  • a detecting module configured to detect a target data type of the target data determined by the first determining module
  • a second determining module configured to determine, according to the target data type detected by the detecting module, a target process for compressing the target data; the target process is to perform data compression by using a compression mode corresponding to the target data type set in advance process;
  • a compression module configured to invoke a target process determined by the second determining module to compress the target data.
  • the embodiment of the invention further discloses a terminal, which comprises the data compression device described in the above embodiments of the invention.
  • the embodiment of the invention further discloses a non-volatile computer storage medium, wherein the computer storage medium stores one Or a plurality of programs, when the one or more programs are executed by a device, causing the device to perform the data compression method described in the embodiment of the present invention.
  • the embodiment of the present invention may determine target data to be compressed; detect a target data type of the target data; determine a target process of the compressed target data according to the target data type; and the target process is performed by using a compression mode corresponding to a preset target data type.
  • the process of data compression; the target process is called to compress the target data.
  • FIG. 1 is a schematic flowchart of a data compression method according to an embodiment of the present invention.
  • FIG. 2 is a schematic flow chart of another data compression method according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a data compression apparatus according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of another data compression apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
  • the embodiment of the invention discloses a data compression method, device and terminal, which can improve the flexibility of data compression.
  • the terminal may include a mobile phone, a tablet computer, a notebook, or other portable device.
  • the target data may be classified into three types: data such as pictures, audio and video, and text files.
  • data redundancy such as spatial redundancy, time redundancy, etc., in audio and video types.
  • the data in the changed audio or moving object has less variation in the adjacent time series, and only needs to store the difference portion; while the image type data is the same or similar at many pixel points, the text file type Data has a lot of duplicate text. If you store all of them, it will take up more storage space, so data compression only needs to keep uncertain or irrelevant data. Because different data types have the above-mentioned focus time redundancy or spatial redundancy, the embodiment of the present invention can flexibly select a compression mode corresponding to a preset target data type for data compression for different data types of target data. To improve data compression ratio and improve data compression. The details are described below separately.
  • FIG. 1 is a schematic flowchart of a data compression method according to an embodiment of the present invention. As shown in FIG. 1, the data compression method may include the following steps.
  • the terminal determines target data to be compressed.
  • the terminal determining the target data to be compressed may include the following steps:
  • the terminal receives operation information input by the user, and the operation information includes operation object data and operation fingerprint data;
  • the operation object data is the video program A
  • the preset operation fingerprint data is the preset fingerprint data for data compression, such as the middle finger fingerprint of the terminal binding user account; when the user clicks on the video program A with the middle finger
  • the terminal receives the user input operation target data as the video program A, and operates the fingerprint data as the middle finger fingerprint, and after step 12) determines that the middle finger fingerprint is the preset operation fingerprint data, the terminal displays the video program.
  • A is the target data to be compressed.
  • the data compression operation may be triggered, compared with the prior art triggering the data compression operation by the corresponding compression button or the control. Implementations simplify user operations and improve the user experience.
  • the terminal determining the target data to be compressed may include the following steps:
  • the terminal determines the ratio of the storage space used by each application installed on the local end to the total storage space of the local end;
  • the terminal uses the storage data corresponding to the application whose value is greater than the second preset threshold as the target data to be compressed.
  • the applications installed on the local end include cameras, e-books, and video viewing applications.
  • the storage space used by cameras, e-books, and video viewing applications is 8 GB, 2 GB, and 15 GB, respectively.
  • the total storage space of the terminal is 30 GB.
  • the ratio of the storage space used by the local device to the local storage space is 0.27, 0.1, and 0.5, and the second preset threshold is 0.4.
  • the terminal can view the video viewing application that is greater than the second preset threshold.
  • the corresponding stored data is used as the target data to be compressed.
  • the storage data corresponding to the application that has a large ratio of the total storage space of the local end is used as the target data to be compressed, and the relatively more available storage space can be released by compressing the data as few times as possible.
  • the terminal detects a target data type of the target data.
  • the terminal determines, according to the target data type, a target process of compressing the target data.
  • the target data type of the target data detected by the terminal may include any one or more types of audio and video, a picture, and a text file.
  • the target process is a process of performing data compression by using a compression mode corresponding to a preset target data type.
  • the terminal determines according to the target data type.
  • the target process of the target data may include multiple processes, that is, the terminal may simultaneously invoke the process corresponding to the compressed mode corresponding to each of the plurality of data types to perform data compression in parallel.
  • the terminal invokes the target process to compress the target data.
  • the terminal invouses the target process to compress the target data, and compresses the target data into the data block corresponding to the target data type of the target data, for example, compressing the text file type data into the text data block, and sounding Video data is compressed to medium and audio data blocks.
  • the terminal determines that the target data to be compressed includes the text file and the audio and video data, and the terminal detects, by the step S102, the target data type of the target data of the target data includes the text file data type and the audio and video data type, and the terminal will The target processes A and B for compressing the respective data types are respectively determined for the two data types.
  • the terminal may simultaneously call the target process A to compress the text file, and call the target process B to compress the audio and video. Further, the terminal may compress the text file into the data block A and compress the audio and video file into the data block B, wherein the data types stored in the data block A and the data block B are different.
  • the terminal may determine target data to be compressed, and detect a target data type of the target data, and determine a target process for compressing the target data according to the target data type, by calling the target process, The target data is compressed. It can be seen that the method described in FIG. 1 can flexibly determine the target process according to the target data type of the target data to compress the target data, thereby improving the flexibility of data compression.
  • FIG. 2 is a schematic flowchart diagram of another data compression method according to an embodiment of the present invention. As shown in FIG. 2, the data compression method may include the following steps.
  • step S201 The terminal determines whether the remaining available storage space of the local end is smaller than the first preset threshold. If the terminal is smaller than the first preset threshold, step S202 is performed. Otherwise, the process ends.
  • the terminal may set a first preset threshold according to the total storage space of the device, or the user may customize the first preset threshold.
  • the terminal performs data compression on the data to improve the utilization of the storage space, and relatively expand the remaining available storage space.
  • the terminal may determine that the remaining available storage space of the local end is smaller than the first preset threshold, so step S202 may be performed.
  • the terminal outputs a prompt message for prompting that the remaining available storage space is insufficient.
  • the terminal may output a prompt message for prompting that the remaining available storage space is insufficient in a voice manner or a pop-up prompt box.
  • the prompt message may also specifically indicate how many GB of available storage space is available.
  • the terminal receives an acknowledge compression command input for the prompt message.
  • the compression command may be a click or slide operation command input by the user through the touch screen, or a voice command input by the user through the microphone.
  • the terminal responds to the confirmation compression instruction, and obtains a ratio of a storage space used by each application installed on the local end to a total storage space of the local end;
  • the terminal uses the storage data corresponding to the application whose value is greater than the second preset threshold as the target data to be compressed.
  • the applications installed on the local end include cameras, e-books, and video viewing applications.
  • the storage space used by cameras, e-books, and video viewing applications is 8 GB, 2 GB, and 15 GB, respectively.
  • the total storage space of the terminal is 30 GB.
  • the ratio of the storage space used by the local device to the local storage space is 0.27, 0.1, and 0.5, and the second preset threshold is 0.4.
  • the terminal can view the video viewing application that is greater than the second preset threshold.
  • the corresponding stored data is used as the target data to be compressed.
  • the terminal detects a target data type of the target data.
  • the terminal determines, according to the target data type, a target process of compressing the target data.
  • the target process is a process of performing data compression by using a compression mode corresponding to the target data type set in advance;
  • the terminal invokes the target process to compress the target data.
  • the terminal when determining that the remaining available storage space of the local end is smaller than the first preset threshold, the terminal may output a prompt message for prompting that the remaining available storage space is insufficient, and receive the input for the prompt message.
  • the confirmation compression instruction determines the target data to be compressed in response to the confirmation compression instruction, and further detects the target data type of the target data, determines a corresponding target process according to the target data type, and invokes the target process to compress the target data. It can be seen that the method described in FIG. 2 can not only flexibly determine the target process according to the target data type, but also the target process determined according to the target data type can better compress the target data process and improve the data compression effect.
  • FIG. 3 is a schematic structural diagram of a data compression apparatus according to an embodiment of the present invention.
  • the data compression device shown in FIG. 3 may be disposed in a terminal such as a mobile phone, a tablet computer, a notebook, or other portable device.
  • the data compression device shown in FIG. 3 may include: a first determining module 310 and a detecting module 320.
  • the second determining module 330 and the compressing module 340 wherein:
  • a first determining module 310 configured to determine target data to be compressed
  • the detecting module 320 is configured to detect a target data type of the target data determined by the first determining module 310.
  • the second determining module 330 is configured to determine, according to the target data type detected by the detecting module 320, the target of the compressed target data. Standard process
  • the target process is a process of performing data compression by using a compression mode corresponding to a preset target data type
  • the compression module 340 is configured to invoke the target process determined by the second determining module 330 to compress the target data.
  • the target data can be classified into three types: data such as pictures, audio and video, and text files.
  • data such as pictures, audio and video, and text files.
  • the essence of data compression is to remove redundant parts of the data without affecting the understanding of the original data.
  • the reason why data can be compressed is because of data redundancy, such as spatial redundancy, time redundancy, etc., in audio and video types.
  • the data in the changed audio or moving object has less variation in the adjacent time series, and only needs to store the difference portion; while the image type data is the same or similar at many pixel points, the text file type Data has a lot of duplicate text. If you store all of them, it will take up more storage space, so data compression only needs to keep uncertain or irrelevant data.
  • the embodiment of the present invention can select a compression mode corresponding to a preset target data type for data compression to improve data according to different data types of the target data. Compression ratio to improve data compression.
  • FIG. 4 is a schematic structural diagram of another data compression apparatus according to an embodiment of the present invention.
  • the data compression device shown in FIG. 4 is optimized by the data compression device shown in FIG. 3.
  • the first determining module 310 may include the following units:
  • the receiving unit 311 is configured to receive operation information input by the user, where the operation information includes operation object data and operation fingerprint data;
  • the detecting unit 312 is configured to detect whether the operation fingerprint data in the operation information received by the receiving unit 311 matches the preset operation fingerprint data. If the matching, the first determining unit 313 can be triggered to perform the following operations.
  • the first determining unit 313 is configured to determine the operation target data as the target data to be compressed when the detecting unit 312 detects that the operation fingerprint data matches the preset operation fingerprint data.
  • the operation object data is the video program A
  • the preset operation fingerprint data is the preset fingerprint data for data compression, such as the middle finger fingerprint of the terminal binding user account; when the user clicks on the video program A with the middle finger
  • the receiving unit 311 receives the user input operation object data as the video program A, and the operation fingerprint data as the middle finger fingerprint.
  • the detecting unit 312 detects that the middle finger fingerprint is the preset operation fingerprint data
  • the first determining is performed.
  • Unit 313 uses the video program A as the target data to be compressed.
  • modules may be further included in the data compression apparatus shown in FIG. 4:
  • the determining module 350 is configured to determine whether the remaining available storage space of the local end is less than a first preset threshold
  • the output module 360 is configured to: when the determining module 350 determines that the remaining available storage space of the local end is less than the first preset threshold, output a prompt message for prompting that the remaining available storage space is insufficient;
  • the receiving module 370 is configured to receive an acknowledge compression command input for the prompt message, and respond to the confirm compression command,
  • the triggering first determining module performs the operation of determining the target data to be compressed.
  • the compression command may be a click or slide operation command input by the user through the touch screen, or a voice command input by the user through the microphone.
  • the remaining available storage space is too small, which may affect the running speed of each application of the terminal. Therefore, the terminal may set a first preset threshold according to the total storage space of the device, or the user may customize the first preset threshold.
  • the determining module 350 can perform data compression on the data through the output module 360, the receiving module 370, the second determining module, and the calling module 340 to improve the storage space when determining that the remaining available storage space of the local end is less than the first preset threshold. Utilization, relatively expanding the remaining available storage space.
  • the first determining module 310 may include the following units:
  • the obtaining unit 314 is configured to obtain a ratio of a storage space used by each application installed on the local end to a total storage space of the local end;
  • the second determining unit 315 is configured to determine, as the target data to be compressed, the storage data corresponding to the application whose ratio is greater than the second preset threshold acquired by the obtaining unit 314.
  • the first determining module 310 may determine the target data to be compressed by using the receiving unit 311, the detecting unit 312, and the first determining unit 313 in the foregoing embodiment, or may obtain the acquiring unit 314 in the foregoing embodiment, and The second determining unit 315 determines the target data to be compressed, and thus the first determining module can simultaneously include the units in the above two embodiments.
  • the applications installed on the local end include a camera, an e-book, and a video viewing application.
  • the storage space used by the camera, the e-book, and the video viewing application is 8 GB, 2 GB, and 15 GB, respectively, and the total storage space of the terminal is 30 GB.
  • the acquiring unit 314 The ratio of the storage space used by the local device to the local storage space is 0.27, 0.1, and 0.5, and the second predetermined threshold is 0.4.
  • the second determining unit 315 can be greater than the second
  • the stored data corresponding to the threshold video viewing application is used as the target data to be compressed.
  • the target data type of the target data detected by the terminal may include any one or more types of audio and video, a picture, and a text file.
  • the compression mode corresponding to the preset target data type adopted by the target process includes any one or more of a compression mode for audio and video data, a compression mode for pictures, and a compression mode for text files.
  • the target process that the second determining module 330 can determine the target data according to the target data type may include multiple processes, and the compression module 340 may simultaneously invoke multiple data types.
  • the process corresponding to the compression mode corresponding to each data type performs data compression in parallel.
  • the terminal invokes the target process to compress the target data, and may compress the target data into the data block corresponding to the target data type of the target data, for example, compress the text file type data into the text data block. Compress audio and video data to audio and video data blocks.
  • the first determining module 310 determines that the target data to be compressed includes a text file and audio and video data
  • the detecting module 320 detects that the target data type of the target data of the target data includes a text file data type and an audio and video data type
  • the second determining The module 330 respectively determines the target processes A and B for compressing the respective data types for the two data types
  • the compression module 340 can simultaneously call the target process A to compress the text file, and call the target process B to compress the audio and video.
  • the terminal may compress the text file into the data block A and compress the audio and video file into the data block B, wherein the data types stored in the data block A and the data block B are different.
  • the first determining module may determine the target data to be compressed
  • the detecting module may detect the target data type of the target data
  • the second determining module may determine to compress according to the target data type.
  • the calling module can call the target process to compress the target data. It can be seen that the data compression apparatus shown in FIG. 3 and FIG. 4 can flexibly determine the target process according to the target data type of the target data to compress the target data, thereby improving the flexibility of data compression. Further, in the data compression device shown in FIG.
  • the output module may output a prompt message for prompting that the remaining available storage space is insufficient.
  • the receiving module may receive the confirmation compression instruction input for the prompt message, and determine the target data to be compressed in response to the confirmation compression instruction, so that when the remaining available space of the terminal is insufficient, the target process is selected in time to compress the data in the terminal, and Good compression of the target data process to improve data compression.
  • FIG. 5 is a schematic structural diagram of a terminal according to an embodiment of the present invention, where the terminal can perform the functions of the data compression method.
  • the terminal may include at least one processor 401, such as a CPU, at least one memory 402, at least one communication bus 403, a user interface 404, and a network interface 405.
  • Communication bus 403 is used to implement a communication connection between these components.
  • User interface 404 can include a display, a keyboard, and the like.
  • the memory 402 can be a high speed RAM memory or a non-stable memory such as at least one disk memory.
  • the memory 402 may include an operating system, a network communication protocol module, a data compression program, and the like.
  • the network interface 405 is mainly used for data communication of other terminals, such as receiving and transmitting various messages, and the processor 401 can call the data compression program stored in the memory 402 and perform the following operations. :
  • the target data type of the target data is detected
  • the target process is a process of compressing the data by using a compression mode corresponding to the preset target data type
  • the target process is called to compress the target data.
  • the target data can be classified into three types: data such as pictures, audio and video, and text files.
  • data such as pictures, audio and video, and text files.
  • the essence of data compression is to remove redundant parts of the data without affecting the understanding of the original data.
  • the reason why data can be compressed is because of data redundancy, such as spatial redundancy, time redundancy, etc., in audio and video types.
  • the data in the changed audio or moving object has less variation in the adjacent time series, and only needs to store the difference portion; while the image type data is the same or similar at many pixel points, the text file type Data has a lot of duplicate text. If you store all of them, it will take up more storage space, so data compression only needs to keep uncertain or irrelevant data.
  • the embodiment of the present invention can select a compression mode corresponding to a preset target data type for data compression to improve data according to different data types of the target data. Compression ratio to improve data compression.
  • the processor 401 calls the program stored in the memory 402 to determine the target data to be compressed, and may specifically include the following operations:
  • the operation information includes operation object data and operation fingerprint data
  • the operation object data is taken as the target data to be compressed.
  • the operation object data is the video program A
  • the preset operation fingerprint data is the preset fingerprint data for data compression, such as the middle finger fingerprint of the terminal binding user account; when the user clicks on the video program A with the middle finger
  • the processor 401 can receive the user input operation object data as the video program A, the operation fingerprint data as the middle finger fingerprint, and the processor 401 determines that the middle finger fingerprint is the preset operation fingerprint data, and the video is received.
  • Program A is the target data to be compressed.
  • the processor 401 calls the program stored in the memory 402, and can also perform the following operations:
  • the operation of determining the target data to be compressed is performed in response to the confirmation compression instruction.
  • the processor 401 may set a first preset threshold according to the total storage space of the device, or customize the first preset by the user.
  • the threshold is set, so that the processor 401 can perform data compression on the data to improve the utilization of the storage space and relatively expand the remaining available storage space when determining that the remaining available storage space of the local end is less than the first preset threshold.
  • the processor 401 may output a prompt message for prompting that the remaining available storage space is insufficient in a voice manner or a pop-up prompt box.
  • the prompt message may also specifically indicate that the remaining available storage space is large. How many GB is it.
  • the compression command may be a click or slide operation command input by the user through the touch screen, or a voice command input by the user through the microphone.
  • the processor 401 calls the program stored in the memory 402 to determine the target data to be compressed, and may include the following steps:
  • the storage data corresponding to the application whose ratio is greater than the second preset threshold is taken as the target data to be compressed.
  • the applications installed on the local end include cameras, e-books, and video viewing applications.
  • the storage space used by cameras, e-books, and video viewing applications is 8 GB, 2 GB, and 15 GB, respectively.
  • the total storage space of the terminal is 30 GB, and the processor 401
  • the ratio of the storage space used by the local device to the local storage space is 0.27, 0.1, and 0.5, and the second preset threshold is 0.4.
  • the processor 401 can be greater than the second preset threshold.
  • the video of the video viewing application corresponds to the target data to be compressed.
  • the target data type of the target data detected by the processor 401 may include any one or more types of audio and video, a picture, and a text file.
  • the target process is a process of performing data compression by using a compression mode corresponding to a preset target data type.
  • the processor 401 calls the target process to compress the target data, and compresses the target data into the data block corresponding to the target data type of the target data, for example, compressing the text file type data into the text data block. Compress audio and video data to audio and video data blocks.
  • the processor 401 determines that the target data to be compressed includes a text file and audio and video data, and the target data type of the target data of the target data detected by the processor 401 includes a text file data type and an audio and video data type, and the processor 401 respectively targets The two data types respectively determine the target processes A and B for compressing the respective data types.
  • the processor 401 can simultaneously call the target process A to compress the text file, and call the target process B to compress the audio and video.
  • the processor 401 may compress the text file into the data block A and compress the audio and video files into the data block B, wherein the data types stored in the data block A and the data block B are different.
  • the terminal introduced in this embodiment may implement some or all of the processes in the embodiment of the data compression method introduced in conjunction with FIG. 1 or FIG.
  • the unit or subunit in the terminal or the device in the embodiment of the present invention may be combined, divided, and deleted according to actual needs.
  • An embodiment of the present invention further provides a non-volatile computer storage medium, wherein the computer storage medium can store one or more programs, when the one or more programs are executed by a device, causing the device to perform the foregoing Some or all of the steps of any of the data compression methods described in the method embodiments.
  • first and second are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated.
  • features defining “first” or “second” may include at least one of the features, either explicitly or implicitly.
  • the meaning of "a plurality” is at least two, such as two, three, etc., unless specifically defined otherwise.
  • a "computer-readable medium” can be any apparatus that can contain, store, communicate, propagate, or transport a program for use in an instruction execution system, apparatus, or device, or in conjunction with the instruction execution system, apparatus, or device.
  • computer readable media include the following: electrical connections (electronic devices) having one or more wires, portable computer disk cartridges (magnetic devices), random access memory (RAM), Read only memory (ROM), erasable editable read only memory (EPROM or flash memory), fiber optic devices, and portable compact disk read only memory (CDROM).
  • the computer readable medium may even be a paper or other suitable medium on which the program can be printed, as it may be optically scanned, for example by paper or other medium, followed by editing, interpretation or, if appropriate, other suitable The method is processed to obtain the program electronically and then stored in computer memory.
  • portions of the invention may be implemented in hardware, software, firmware or a combination thereof.
  • multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
  • a suitable instruction execution system For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), and the like.
  • each functional unit in each embodiment of the present invention may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated modules, if implemented in the form of software functional modules and sold or used as stand-alone products, may also be stored in a computer readable storage medium.
  • the above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the data compression method, device and terminal are disclosed in detail in the embodiment of the present invention. The principle and the implementation manner of the present invention are described in the following. The description of the above embodiment is only used to help understand the present invention. The method of the invention and its core idea; at the same time, for the person of ordinary skill in the art, according to the idea of the present invention, there are some changes in the specific embodiment and the scope of application. In summary, the content of the specification should not be understood. To limit the invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

A data compression method, apparatus, and terminal. The method comprises: a terminal determines a to-be-compressed target data (S101); the terminal detects a target data type of the target data (S102); the terminal determines, according to the target data type, a target process for compressing the target data (S103), the target process being a process for performing data compression by using a preset compression mode corresponding to the target data type; and the terminal invokes the target process to compress the target data (S104). A data compression process can be flexibly selected according to the target data type, so as to compress the target data.

Description

一种数据压缩方法、装置及终端Data compression method, device and terminal
相关申请的交叉引用Cross-reference to related applications
本申请要求广东欧珀移动通信有限公司于2015年7月9日提交的、发明名称为“一种数据压缩方法、装置及终端”的、中国专利申请号“201510406470.2”的优先权。The present application claims the priority of the Chinese patent application No. 201510406470.2, filed on July 9, 2015, by the name of the European Patent.
技术领域Technical field
本发明涉及计算机技术领域,具体涉及一种数据压缩方法、装置及终端。The present invention relates to the field of computer technologies, and in particular, to a data compression method, apparatus, and terminal.
背景技术Background technique
目前,随着计算机技术的发展,终端中存储的数据量也越来越多,为了减少这些数据的存储空间,可将数据进行压缩,以提高存储空间的利用率。然而,现有的数据压缩方案中,对所有类型的数据均采用统一的压缩方法,导致数据压缩的灵活性较差。At present, with the development of computer technology, the amount of data stored in the terminal is also increasing. In order to reduce the storage space of the data, the data can be compressed to improve the utilization of the storage space. However, in the existing data compression scheme, a uniform compression method is adopted for all types of data, resulting in poor data compression flexibility.
发明内容Summary of the invention
本发明实施例公开了一种数据压缩方法、装置、终端及非易失性计算机存储介质,能够提高数据压缩的灵活性。The embodiment of the invention discloses a data compression method, device, terminal and non-volatile computer storage medium, which can improve the flexibility of data compression.
本发明实施例公开了一种数据压缩方法,包括:The embodiment of the invention discloses a data compression method, including:
确定待压缩的目标数据;Determining target data to be compressed;
检测所述目标数据的目标数据类型;Detecting a target data type of the target data;
根据所述目标数据类型确定压缩所述目标数据的目标进程;所述目标进程为采用预先设定的所述目标数据类型对应的压缩模式进行数据压缩的进程;Determining, according to the target data type, a target process of compressing the target data; the target process is a process of performing data compression by using a compression mode corresponding to the target data type set in advance;
调用所述目标进程对所述目标数据进行压缩。The target process is invoked to compress the target data.
本发明实施例还公开了一种数据压缩装置,所述装置包括:The embodiment of the invention further discloses a data compression device, the device comprising:
第一确定模块,用于确定待压缩的目标数据;a first determining module, configured to determine target data to be compressed;
检测模块,用于检测所述第一确定模块确定的目标数据的目标数据类型;a detecting module, configured to detect a target data type of the target data determined by the first determining module;
第二确定模块,用于根据所述检测模块检测的目标数据类型确定压缩所述目标数据的目标进程;所述目标进程为采用预先设定的所述目标数据类型对应的压缩模式进行数据压缩的进程;a second determining module, configured to determine, according to the target data type detected by the detecting module, a target process for compressing the target data; the target process is to perform data compression by using a compression mode corresponding to the target data type set in advance process;
压缩模块,用于调用所述第二确定模块确定的目标进程对所述目标数据进行压缩。And a compression module, configured to invoke a target process determined by the second determining module to compress the target data.
本发明实施例还公开了一种终端,所述终端包括上述发明实施例所述的数据压缩装置。The embodiment of the invention further discloses a terminal, which comprises the data compression device described in the above embodiments of the invention.
本发明实施例还公开了一种非易失性计算机存储介质所述计算机存储介质存储有一个 或者多个程序,当所述一个或者多个程序被一个设备执行时,使得所述设备执行上述本发明实施例所述的数据压缩方法。The embodiment of the invention further discloses a non-volatile computer storage medium, wherein the computer storage medium stores one Or a plurality of programs, when the one or more programs are executed by a device, causing the device to perform the data compression method described in the embodiment of the present invention.
本发明实施例可以确定待压缩的目标数据;检测该目标数据的目标数据类型;根据目标数据类型确定压缩目标数据的目标进程;该目标进程为采用预先设定的目标数据类型对应的压缩模式进行数据压缩的进程;调用目标进程对目标数据进行压缩。实施本发明实施例,可以针对目标数据类型灵活选择数据压缩进程以对目标数据进行压缩。The embodiment of the present invention may determine target data to be compressed; detect a target data type of the target data; determine a target process of the compressed target data according to the target data type; and the target process is performed by using a compression mode corresponding to a preset target data type. The process of data compression; the target process is called to compress the target data. By implementing the embodiments of the present invention, the data compression process can be flexibly selected for the target data type to compress the target data.
附图说明DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the embodiments will be briefly described below. It is obvious that the drawings in the following description are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without paying any creative work.
图1是本发明实施例公开的一种数据压缩方法的流程示意图;1 is a schematic flowchart of a data compression method according to an embodiment of the present invention;
图2是本发明实施例公开的另一种数据压缩方法的流程示意图;2 is a schematic flow chart of another data compression method according to an embodiment of the present invention;
图3是本发明实施例公开的一种数据压缩装置的结构示意图;3 is a schematic structural diagram of a data compression apparatus according to an embodiment of the present invention;
图4是本发明实施例公开的另一种数据压缩装置的结构示意图;4 is a schematic structural diagram of another data compression apparatus according to an embodiment of the present invention;
图5是本发明实施例公开的一种终端的结构示意图。FIG. 5 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明实施例公开了一种数据压缩方法、装置及终端,能够提高数据压缩的灵活性。本发明实施例中,终端可以包括手机、平板电脑、笔记本或者其他便携式设备等,本发明实施例中,目标数据可以分为三类:图片、音视频和文本文件等类型的数据。数据压缩的本质是去掉数据中的冗余部分,而又不影响对原始数据的理解,数据之所以可以被压缩是因为存在数据冗余,例如空间冗余、时间冗余等,在音视频类型的数据中变化的音频或运动的物体在相邻时间序列的变化较小,只需存储有差异的部分即可;而图片类型的数据在很多像素点都是相同或相似的,文本文件类型的数据有很多重复的文字,若将所有都存储则会占用较多的存储空间,因此数据压缩只需将不确定或不相关的数据保留下来即可。由于不同数据类型具有上述侧重点的时间冗余或空间冗余,因此本发明实施例可以针对目标数据的不同数据类型,灵活选择预先设定的目标数据类型对应的压缩模式进行数据压缩, 以提高数据压缩比,改善数据压缩效果。以下分别进行详细说明。The embodiment of the invention discloses a data compression method, device and terminal, which can improve the flexibility of data compression. In the embodiment of the present invention, the terminal may include a mobile phone, a tablet computer, a notebook, or other portable device. In the embodiment of the present invention, the target data may be classified into three types: data such as pictures, audio and video, and text files. The essence of data compression is to remove redundant parts of the data without affecting the understanding of the original data. The reason why data can be compressed is because of data redundancy, such as spatial redundancy, time redundancy, etc., in audio and video types. The data in the changed audio or moving object has less variation in the adjacent time series, and only needs to store the difference portion; while the image type data is the same or similar at many pixel points, the text file type Data has a lot of duplicate text. If you store all of them, it will take up more storage space, so data compression only needs to keep uncertain or irrelevant data. Because different data types have the above-mentioned focus time redundancy or spatial redundancy, the embodiment of the present invention can flexibly select a compression mode corresponding to a preset target data type for data compression for different data types of target data. To improve data compression ratio and improve data compression. The details are described below separately.
请参阅图1,图1是本发明实施例公开的一种数据压缩方法的流程示意图。如图1所示,该数据压缩方法可以包括以下步骤。Please refer to FIG. 1. FIG. 1 is a schematic flowchart of a data compression method according to an embodiment of the present invention. As shown in FIG. 1, the data compression method may include the following steps.
S101、终端确定待压缩的目标数据;S101. The terminal determines target data to be compressed.
作为一种可选地实施方式,终端确定待压缩的目标数据可以包括以下步骤:As an optional implementation manner, the terminal determining the target data to be compressed may include the following steps:
11)终端接收用户输入的操作信息,该操作信息包括操作对象数据和操作指纹数据;11) The terminal receives operation information input by the user, and the operation information includes operation object data and operation fingerprint data;
12)终端检测操作指纹数据与预设的操作指纹数据是否匹配,若操作指纹数据与预设的操作指纹数据匹配,则将操作对象数据作为待压缩的目标数据,否则,结束本流程。12) Whether the terminal detection operation fingerprint data matches the preset operation fingerprint data. If the operation fingerprint data matches the preset operation fingerprint data, the operation target data is used as the target data to be compressed, otherwise, the process ends.
举例来说,操作对象数据为视频节目A,预设的操作指纹数据为预设的进行数据压缩的指纹数据,如终端绑定用户帐号的中指指纹;当用户用中指对视频节目A进行单击、双击或者滑动等操作时,终端接收用户输入操作对象数据为视频节目A、操作指纹数据为中指指纹,经过步骤12)判断出该中指指纹为预设的操作指纹数据,则终端将该视频节目A作为待压缩的目标数据。For example, the operation object data is the video program A, and the preset operation fingerprint data is the preset fingerprint data for data compression, such as the middle finger fingerprint of the terminal binding user account; when the user clicks on the video program A with the middle finger When the operation is performed by double-clicking or sliding, the terminal receives the user input operation target data as the video program A, and operates the fingerprint data as the middle finger fingerprint, and after step 12) determines that the middle finger fingerprint is the preset operation fingerprint data, the terminal displays the video program. A is the target data to be compressed.
该实施方式可以根据用户输入的操作信息中操作指纹数据为预设的操作指纹数据时,即可触发数据压缩操作,与现有技术中通过相应的压缩按键或控件触发数据压缩操作相比,该实施方式可以简化用户操作流程,改善用户体验。In this implementation manner, when the fingerprint data is operated as the preset operation fingerprint data in the operation information input by the user, the data compression operation may be triggered, compared with the prior art triggering the data compression operation by the corresponding compression button or the control. Implementations simplify user operations and improve the user experience.
作为另一种可选的实施方式,终端确定待压缩的目标数据可以包括以下步骤:As another optional implementation manner, the terminal determining the target data to be compressed may include the following steps:
21)终端确定获取本端安装的各应用所使用的存储空间占本端总存储空间的比值;21) The terminal determines the ratio of the storage space used by each application installed on the local end to the total storage space of the local end;
22)终端将比值大于第二预设阈值的应用对应的存储数据作为待压缩的目标数据。22) The terminal uses the storage data corresponding to the application whose value is greater than the second preset threshold as the target data to be compressed.
例如,本端安装的各应用包括相机、电子书以及视频观看应用,相机、电子书以及视频观看应用所使用的存储空间大小分别为8GB、2GB、15GB,终端总存储空间为30GB,终端可以分别确定本端安装的这些应用所使用的存储空间占本端总存储空间的比值分别为0.27、0.1、0.5,第二预设阈值为0.4,则终端可以将大于第二预设阈值的视频观看应用对应的存储数据作为待压缩的目标数据。For example, the applications installed on the local end include cameras, e-books, and video viewing applications. The storage space used by cameras, e-books, and video viewing applications is 8 GB, 2 GB, and 15 GB, respectively. The total storage space of the terminal is 30 GB. The ratio of the storage space used by the local device to the local storage space is 0.27, 0.1, and 0.5, and the second preset threshold is 0.4. The terminal can view the video viewing application that is greater than the second preset threshold. The corresponding stored data is used as the target data to be compressed.
该实施方式将占本端总存储空间的比值过大的应用对应的存储数据作为待压缩的目标数据,可以通过尽可能少次数的数据压缩,释放相对更多的可用存储空间。In this embodiment, the storage data corresponding to the application that has a large ratio of the total storage space of the local end is used as the target data to be compressed, and the relatively more available storage space can be released by compressing the data as few times as possible.
S102、终端检测目标数据的目标数据类型;S102. The terminal detects a target data type of the target data.
S103、终端根据目标数据类型确定压缩目标数据的目标进程;S103. The terminal determines, according to the target data type, a target process of compressing the target data.
本发明实施例中,终端检测出的目标数据的目标数据类型可以包括音视频、图片和文本文件中的任一种或多种类型。本发明实施例中,目标进程为采用预先设定的目标数据类型对应的压缩模式进行数据压缩的进程。In the embodiment of the present invention, the target data type of the target data detected by the terminal may include any one or more types of audio and video, a picture, and a text file. In the embodiment of the present invention, the target process is a process of performing data compression by using a compression mode corresponding to a preset target data type.
可选地,若目标数据类型同时包括多种数据类型,则终端根据目标数据类型确定出的 目标数据的目标进程可以包括多个进程,即终端可以同时调用多种数据类型中每种数据类型对应的压缩模式对应的进程并行执行数据压缩。Optionally, if the target data type includes multiple data types at the same time, the terminal determines according to the target data type. The target process of the target data may include multiple processes, that is, the terminal may simultaneously invoke the process corresponding to the compressed mode corresponding to each of the plurality of data types to perform data compression in parallel.
S104、终端调用目标进程对目标数据进行压缩。S104. The terminal invokes the target process to compress the target data.
本发明实施例中,终端调用目标进程对目标数据进行压缩,可以将目标数据压缩到该目标数据的目标数据类型对应的数据块中,例如将文本文件类数据压缩到文本数据块中,将音视频数据压缩到音视频数据块中等。In the embodiment of the present invention, the terminal invouses the target process to compress the target data, and compresses the target data into the data block corresponding to the target data type of the target data, for example, compressing the text file type data into the text data block, and sounding Video data is compressed to medium and audio data blocks.
举例来说,终端确定待压缩的目标数据包括文本文件和音视频数据,则终端通过步骤S102检测目标数据的目标数据的目标数据类型包括文本文件数据类型和音视频数据类型,则终端在步骤S103中会分别针对这两种数据类型分别确定压缩各个数据类型的目标进程A和B,则终端在步骤S104中可以同时调用目标进程A对文本文件进行压缩,调用目标进程B对音视频进行压缩。进一步的,终端可以将文本文件压缩到数据块A中,将音视频文件压缩到数据块B中,其中,数据块A和数据块B中存储的数据类型不同。For example, the terminal determines that the target data to be compressed includes the text file and the audio and video data, and the terminal detects, by the step S102, the target data type of the target data of the target data includes the text file data type and the audio and video data type, and the terminal will The target processes A and B for compressing the respective data types are respectively determined for the two data types. Then, in step S104, the terminal may simultaneously call the target process A to compress the text file, and call the target process B to compress the audio and video. Further, the terminal may compress the text file into the data block A and compress the audio and video file into the data block B, wherein the data types stored in the data block A and the data block B are different.
在图1所描述的数据压缩方法中,终端可以确定待压缩的目标数据,并检测该目标数据的目标数据类型,根据目标数据类型确定压缩该目标数据的目标进程,通过调用该目标进程可以对目标数据进行压缩。可见,图1所描述的方法中可以根据目标数据的目标数据类型,灵活确定目标进程来对目标数据进行压缩,从而改善了数据压缩的灵活性。In the data compression method described in FIG. 1, the terminal may determine target data to be compressed, and detect a target data type of the target data, and determine a target process for compressing the target data according to the target data type, by calling the target process, The target data is compressed. It can be seen that the method described in FIG. 1 can flexibly determine the target process according to the target data type of the target data to compress the target data, thereby improving the flexibility of data compression.
请参阅图2,图2是本发明实施例公开的另一种数据压缩方法的流程示意图。如图2所示,该数据压缩方法可以包括以下步骤。Please refer to FIG. 2. FIG. 2 is a schematic flowchart diagram of another data compression method according to an embodiment of the present invention. As shown in FIG. 2, the data compression method may include the following steps.
S201、终端判断本端的剩余可用存储空间是否小于第一预设阈值,若小于第一预设阈值,则执行步骤S202,否则,结束本流程。S201: The terminal determines whether the remaining available storage space of the local end is smaller than the first preset threshold. If the terminal is smaller than the first preset threshold, step S202 is performed. Otherwise, the process ends.
本发明实施例中,由于剩余可用存储空间过小时,会影响终端各应用的运行速度,因此终端可以根据设备的总存储空间设定第一预设阈值,或者由用户自定义第一预设阈值,使得终端可以在判断出本端的剩余可用存储空间小于第一预设阈值时,对数据进行数据压缩以提高存储空间的利用率,相对扩大剩余可用存储空间。In the embodiment of the present invention, the remaining available storage space is too small, which may affect the running speed of each application of the terminal. Therefore, the terminal may set a first preset threshold according to the total storage space of the device, or the user may customize the first preset threshold. When the terminal can determine that the remaining available storage space of the local end is less than the first preset threshold, the terminal performs data compression on the data to improve the utilization of the storage space, and relatively expand the remaining available storage space.
举例来说,第一预设阈值为5GB,则当本端的剩余可用存储空间为4GB时,由于终端可以判断出本端的剩余可用存储空间小于第一预设阈值,因此可以执行步骤S202。For example, if the first preset threshold is 5 GB, when the remaining available storage space of the local end is 4 GB, the terminal may determine that the remaining available storage space of the local end is smaller than the first preset threshold, so step S202 may be performed.
S202、终端输出用于提示剩余可用存储空间不足的提示消息;S202. The terminal outputs a prompt message for prompting that the remaining available storage space is insufficient.
本发明实施例中,终端可以以语音方式或弹出提示框的方式输出用于提示剩余可用存储空间不足的提示消息。可选地,该提示消息也可以具体指出剩余可用存储空间大概为多少GB。In the embodiment of the present invention, the terminal may output a prompt message for prompting that the remaining available storage space is insufficient in a voice manner or a pop-up prompt box. Optionally, the prompt message may also specifically indicate how many GB of available storage space is available.
S203、终端接收针对提示消息输入的确认压缩指令; S203. The terminal receives an acknowledge compression command input for the prompt message.
本发明实施例中,确定压缩指令可以为用户通过触控屏输入的点击或滑动操作指令,也可以为用户通过话筒输入的语音指令等。In the embodiment of the present invention, the compression command may be a click or slide operation command input by the user through the touch screen, or a voice command input by the user through the microphone.
S204、终端响应该确认压缩指令,获取本端安装的各应用所使用的存储空间占本端总存储空间的比值;S204: The terminal responds to the confirmation compression instruction, and obtains a ratio of a storage space used by each application installed on the local end to a total storage space of the local end;
S205、终端将比值大于第二预设阈值的应用对应的存储数据作为待压缩的目标数据。S205. The terminal uses the storage data corresponding to the application whose value is greater than the second preset threshold as the target data to be compressed.
例如,本端安装的各应用包括相机、电子书以及视频观看应用,相机、电子书以及视频观看应用所使用的存储空间大小分别为8GB、2GB、15GB,终端总存储空间为30GB,终端可以分别确定本端安装的这些应用所使用的存储空间占本端总存储空间的比值分别为0.27、0.1、0.5,第二预设阈值为0.4,则终端可以将大于第二预设阈值的视频观看应用对应的存储数据作为待压缩的目标数据。For example, the applications installed on the local end include cameras, e-books, and video viewing applications. The storage space used by cameras, e-books, and video viewing applications is 8 GB, 2 GB, and 15 GB, respectively. The total storage space of the terminal is 30 GB. The ratio of the storage space used by the local device to the local storage space is 0.27, 0.1, and 0.5, and the second preset threshold is 0.4. The terminal can view the video viewing application that is greater than the second preset threshold. The corresponding stored data is used as the target data to be compressed.
S206、终端检测该目标数据的目标数据类型;S206. The terminal detects a target data type of the target data.
S207、终端根据目标数据类型确定压缩目标数据的目标进程;S207. The terminal determines, according to the target data type, a target process of compressing the target data.
本发明实施例中,目标进程为采用预先设定的所述目标数据类型对应的压缩模式进行数据压缩的进程;In the embodiment of the present invention, the target process is a process of performing data compression by using a compression mode corresponding to the target data type set in advance;
S208、终端调用目标进程对目标数据进行压缩。S208. The terminal invokes the target process to compress the target data.
其中,步骤S204至S208的具体阐述可以参见上述发明实施例中的相关阐述,本发明实施例不再详述。For a detailed description of the steps S204 to S208, reference may be made to the related description in the foregoing embodiments of the present invention, and the embodiments of the present invention are not described in detail.
在图2所描述的数据压缩方法中,终端可以在判断出本端的剩余可用存储空间小于第一预设阈值时,输出用于提示剩余可用存储空间不足的提示消息,并接收针对该提示消息输入的确认压缩指令,响应该确认压缩指令,确定待压缩的目标数据,进而检测该目标数据的目标数据类型,根据该目标数据类型确定相应的目标进程,从而调用该目标进程对目标数据进行压缩。可见,图2所描述的方法不仅可以根据目标数据类型灵活确定目标进程,而且根据目标数据类型确定的目标进程可以更好的对目标数据进程压缩,改善数据压缩效果。In the data compression method described in FIG. 2, when determining that the remaining available storage space of the local end is smaller than the first preset threshold, the terminal may output a prompt message for prompting that the remaining available storage space is insufficient, and receive the input for the prompt message. The confirmation compression instruction determines the target data to be compressed in response to the confirmation compression instruction, and further detects the target data type of the target data, determines a corresponding target process according to the target data type, and invokes the target process to compress the target data. It can be seen that the method described in FIG. 2 can not only flexibly determine the target process according to the target data type, but also the target process determined according to the target data type can better compress the target data process and improve the data compression effect.
请参阅图3,图3是本发明实施例公开的一种数据压缩装置的结构示意图。其中,图3所示的数据压缩装置可以设置在手机、平板电脑、笔记本或者其他便携式设备等终端中,具体的,图3所示的数据压缩装置可以包括:第一确定模块310、检测模块320、第二确定模块330以及压缩模块340,其中:Please refer to FIG. 3. FIG. 3 is a schematic structural diagram of a data compression apparatus according to an embodiment of the present invention. The data compression device shown in FIG. 3 may be disposed in a terminal such as a mobile phone, a tablet computer, a notebook, or other portable device. Specifically, the data compression device shown in FIG. 3 may include: a first determining module 310 and a detecting module 320. The second determining module 330 and the compressing module 340, wherein:
第一确定模块310,用于确定待压缩的目标数据;a first determining module 310, configured to determine target data to be compressed;
检测模块320,用于检测第一确定模块310确定的目标数据的目标数据类型;The detecting module 320 is configured to detect a target data type of the target data determined by the first determining module 310.
第二确定模块330,用于根据检测模块320检测的目标数据类型确定压缩目标数据的目 标进程;The second determining module 330 is configured to determine, according to the target data type detected by the detecting module 320, the target of the compressed target data. Standard process
本发明实施例中,目标进程为采用预先设定的目标数据类型对应的压缩模式进行数据压缩的进程;In the embodiment of the present invention, the target process is a process of performing data compression by using a compression mode corresponding to a preset target data type;
压缩模块340,用于调用第二确定模块330确定的目标进程对目标数据进行压缩。The compression module 340 is configured to invoke the target process determined by the second determining module 330 to compress the target data.
本发明实施例中,目标数据可以分为三类:图片、音视频和文本文件等类型的数据。数据压缩的本质是去掉数据中的冗余部分,而又不影响对原始数据的理解,数据之所以可以被压缩是因为存在数据冗余,例如空间冗余、时间冗余等,在音视频类型的数据中变化的音频或运动的物体在相邻时间序列的变化较小,只需存储有差异的部分即可;而图片类型的数据在很多像素点都是相同或相似的,文本文件类型的数据有很多重复的文字,若将所有都存储则会占用较多的存储空间,因此数据压缩只需将不确定或不相关的数据保留下来即可。由于不同数据类型具有上述侧重点的时间冗余或空间冗余,因此本发明实施例可以针对目标数据的不同数据类型,选择预先设定的目标数据类型对应的压缩模式进行数据压缩,以提高数据压缩比,改善数据压缩效果。In the embodiment of the present invention, the target data can be classified into three types: data such as pictures, audio and video, and text files. The essence of data compression is to remove redundant parts of the data without affecting the understanding of the original data. The reason why data can be compressed is because of data redundancy, such as spatial redundancy, time redundancy, etc., in audio and video types. The data in the changed audio or moving object has less variation in the adjacent time series, and only needs to store the difference portion; while the image type data is the same or similar at many pixel points, the text file type Data has a lot of duplicate text. If you store all of them, it will take up more storage space, so data compression only needs to keep uncertain or irrelevant data. The embodiment of the present invention can select a compression mode corresponding to a preset target data type for data compression to improve data according to different data types of the target data. Compression ratio to improve data compression.
请一并参阅图4,图4是本发明实施例公开的另一种数据压缩装置的结构示意图。其中,图4所示的数据压缩装置是由图3所示的数据压缩装置进行优化得到的。与图3所示的数据压缩装置相比较,图4所示的数据压缩装置中,第一确定模块310可以包括以下单元:Referring to FIG. 4, FIG. 4 is a schematic structural diagram of another data compression apparatus according to an embodiment of the present invention. The data compression device shown in FIG. 4 is optimized by the data compression device shown in FIG. 3. Compared with the data compression device shown in FIG. 3, in the data compression device shown in FIG. 4, the first determining module 310 may include the following units:
接收单元311,用于接收用户输入的操作信息,该操作信息包括操作对象数据和操作指纹数据;The receiving unit 311 is configured to receive operation information input by the user, where the operation information includes operation object data and operation fingerprint data;
检测单元312,用于检测接收单元311接收的操作信息中操作指纹数据与预设的操作指纹数据是否匹配,若匹配,可以触发第一确定单元313执行如下操作。The detecting unit 312 is configured to detect whether the operation fingerprint data in the operation information received by the receiving unit 311 matches the preset operation fingerprint data. If the matching, the first determining unit 313 can be triggered to perform the following operations.
第一确定单元313,用于在检测单元312检测出操作指纹数据与预设的操作指纹数据匹配时,将操作对象数据确定为待压缩的目标数据。The first determining unit 313 is configured to determine the operation target data as the target data to be compressed when the detecting unit 312 detects that the operation fingerprint data matches the preset operation fingerprint data.
举例来说,操作对象数据为视频节目A,预设的操作指纹数据为预设的进行数据压缩的指纹数据,如终端绑定用户帐号的中指指纹;当用户用中指对视频节目A进行单击、双击或者滑动等操作时,接收单元311接收用户输入操作对象数据为视频节目A、操作指纹数据为中指指纹,经过检测单元312检测出该中指指纹为预设的操作指纹数据,则第一确定单元313将该视频节目A作为待压缩的目标数据。For example, the operation object data is the video program A, and the preset operation fingerprint data is the preset fingerprint data for data compression, such as the middle finger fingerprint of the terminal binding user account; when the user clicks on the video program A with the middle finger The receiving unit 311 receives the user input operation object data as the video program A, and the operation fingerprint data as the middle finger fingerprint. After the detecting unit 312 detects that the middle finger fingerprint is the preset operation fingerprint data, the first determining is performed. Unit 313 uses the video program A as the target data to be compressed.
本发明实施例中,在图4所示的数据压缩装置中还可以包括以下模块:In the embodiment of the present invention, the following modules may be further included in the data compression apparatus shown in FIG. 4:
判断模块350,用于判断本端的剩余可用存储空间是否小于第一预设阈值;The determining module 350 is configured to determine whether the remaining available storage space of the local end is less than a first preset threshold;
输出模块360,用于在判断模块350判断出本端的剩余可用存储空间小于第一预设阈值时,输出用于提示剩余可用存储空间不足的提示消息;The output module 360 is configured to: when the determining module 350 determines that the remaining available storage space of the local end is less than the first preset threshold, output a prompt message for prompting that the remaining available storage space is insufficient;
接收模块370,用于接收针对提示消息输入的确认压缩指令,并响应该确认压缩指令, 触发第一确定模块执行所述的确定待压缩的目标数据的操作。The receiving module 370 is configured to receive an acknowledge compression command input for the prompt message, and respond to the confirm compression command, The triggering first determining module performs the operation of determining the target data to be compressed.
本发明实施例中,确定压缩指令可以为用户通过触控屏输入的点击或滑动操作指令,也可以为用户通过话筒输入的语音指令等。In the embodiment of the present invention, the compression command may be a click or slide operation command input by the user through the touch screen, or a voice command input by the user through the microphone.
本发明实施例中,由于剩余可用存储空间过小时,会影响终端各应用的运行速度,因此终端可以根据设备的总存储空间设定第一预设阈值,或者由用户自定义第一预设阈值,使得判断模块350可以在判断出本端的剩余可用存储空间小于第一预设阈值时,通过输出模块360、接收模块370、第二确定模块以及调用模块340对数据进行数据压缩以提高存储空间的利用率,相对扩大剩余可用存储空间。In the embodiment of the present invention, the remaining available storage space is too small, which may affect the running speed of each application of the terminal. Therefore, the terminal may set a first preset threshold according to the total storage space of the device, or the user may customize the first preset threshold. The determining module 350 can perform data compression on the data through the output module 360, the receiving module 370, the second determining module, and the calling module 340 to improve the storage space when determining that the remaining available storage space of the local end is less than the first preset threshold. Utilization, relatively expanding the remaining available storage space.
作为另一种可选的实施方式,图4所示的数据压缩装置中,第一确定模块310可以包括以下单元:As another optional implementation manner, in the data compression apparatus shown in FIG. 4, the first determining module 310 may include the following units:
获取单元314,用于获取本端安装的各应用所使用的存储空间占本端总存储空间的比值;The obtaining unit 314 is configured to obtain a ratio of a storage space used by each application installed on the local end to a total storage space of the local end;
第二确定单元315,用于将获取单元314获取的比值大于第二预设阈值的应用对应的存储数据确定为待压缩的目标数据。The second determining unit 315 is configured to determine, as the target data to be compressed, the storage data corresponding to the application whose ratio is greater than the second preset threshold acquired by the obtaining unit 314.
本发明实施例中,第一确定模块310可以通过上述实施方式中的接收单元311、检测单元312以及第一确定单元313确定待压缩的目标数据,或者可以通过上述实施方式中的获取单元314以及第二确定单元315确定待压缩的目标数据,因此第一确定模块可以同时包括上述两种实施方式中的单元。In the embodiment of the present invention, the first determining module 310 may determine the target data to be compressed by using the receiving unit 311, the detecting unit 312, and the first determining unit 313 in the foregoing embodiment, or may obtain the acquiring unit 314 in the foregoing embodiment, and The second determining unit 315 determines the target data to be compressed, and thus the first determining module can simultaneously include the units in the above two embodiments.
例如,本端安装的各应用包括相机、电子书以及视频观看应用,相机、电子书以及视频观看应用所使用的存储空间大小分别为8GB、2GB、15GB,终端总存储空间为30GB,获取单元314可以分别获取本端安装的这些应用所使用的存储空间占本端总存储空间的比值分别为0.27、0.1、0.5,第二预设阈值为0.4,则第二确定单元315可以将大于第二预设阈值的视频观看应用对应的存储数据作为待压缩的目标数据。For example, the applications installed on the local end include a camera, an e-book, and a video viewing application. The storage space used by the camera, the e-book, and the video viewing application is 8 GB, 2 GB, and 15 GB, respectively, and the total storage space of the terminal is 30 GB. The acquiring unit 314 The ratio of the storage space used by the local device to the local storage space is 0.27, 0.1, and 0.5, and the second predetermined threshold is 0.4. The second determining unit 315 can be greater than the second The stored data corresponding to the threshold video viewing application is used as the target data to be compressed.
本发明实施例中,终端检测出的目标数据的目标数据类型可以包括音视频、图片和文本文件中的任一种或多种类型。相应地,目标进程采用的预先设定的目标数据类型对应的压缩模式包括针对音视频数据的压缩模式、针对图片的压缩模式以及针对文本文件的压缩模式中的任一种或多种。In the embodiment of the present invention, the target data type of the target data detected by the terminal may include any one or more types of audio and video, a picture, and a text file. Correspondingly, the compression mode corresponding to the preset target data type adopted by the target process includes any one or more of a compression mode for audio and video data, a compression mode for pictures, and a compression mode for text files.
可选地,若目标数据类型同时包括多种数据类型,则第二确定模块330可以根据目标数据类型确定出的目标数据的目标进程可以包括多个进程,压缩模块340可以同时调用多种数据类型中每种数据类型对应的压缩模式对应的进程并行执行数据压缩。Optionally, if the target data type includes multiple data types, the target process that the second determining module 330 can determine the target data according to the target data type may include multiple processes, and the compression module 340 may simultaneously invoke multiple data types. The process corresponding to the compression mode corresponding to each data type performs data compression in parallel.
本发明实施例中,终端调用目标进程对目标数据进行压缩,可以将目标数据压缩到该目标数据的目标数据类型对应的数据块中,例如将文本文件类数据压缩到文本数据块中, 将音视频数据压缩到音视频数据块中等。In the embodiment of the present invention, the terminal invokes the target process to compress the target data, and may compress the target data into the data block corresponding to the target data type of the target data, for example, compress the text file type data into the text data block. Compress audio and video data to audio and video data blocks.
举例来说,第一确定模块310确定待压缩的目标数据包括文本文件和音视频数据,则检测模块320检测目标数据的目标数据的目标数据类型包括文本文件数据类型和音视频数据类型,则第二确定模块330会分别针对这两种数据类型分别确定压缩各个数据类型的目标进程A和B,则压缩模块340可以同时调用目标进程A对文本文件进行压缩,调用目标进程B对音视频进行压缩。进一步的,终端可以将文本文件压缩到数据块A中,将音视频文件压缩到数据块B中,其中,数据块A和数据块B中存储的数据类型不同。For example, the first determining module 310 determines that the target data to be compressed includes a text file and audio and video data, and the detecting module 320 detects that the target data type of the target data of the target data includes a text file data type and an audio and video data type, and then the second determining The module 330 respectively determines the target processes A and B for compressing the respective data types for the two data types, and the compression module 340 can simultaneously call the target process A to compress the text file, and call the target process B to compress the audio and video. Further, the terminal may compress the text file into the data block A and compress the audio and video file into the data block B, wherein the data types stored in the data block A and the data block B are different.
在图3和图4所示的数据压缩装置中,第一确定模块可以确定待压缩的目标数据,检测模块可以检测该目标数据的目标数据类型,第二确定模块可以根据目标数据类型确定压缩该目标数据的目标进程,调用模块可以调用该目标进程对目标数据进行压缩。可见,图3和图4所示的数据压缩装置可以根据目标数据的目标数据类型,灵活确定目标进程来对目标数据进行压缩,从而改善了数据压缩的灵活性。进一步的,在图4所示的数据压缩装置中,判断模块可以在判断出本端的剩余可用存储空间小于第一预设阈值时,输出模块可以输出用于提示剩余可用存储空间不足的提示消息,接收模块可以接收针对该提示消息输入的确认压缩指令,响应该确认压缩指令,确定待压缩的目标数据,从而可以在终端剩余可用空间不足时,及时选择目标进程对终端中的数据进行压缩,更好的对目标数据进程压缩,改善数据压缩效果。In the data compression apparatus shown in FIG. 3 and FIG. 4, the first determining module may determine the target data to be compressed, the detecting module may detect the target data type of the target data, and the second determining module may determine to compress according to the target data type. The target process of the target data, the calling module can call the target process to compress the target data. It can be seen that the data compression apparatus shown in FIG. 3 and FIG. 4 can flexibly determine the target process according to the target data type of the target data to compress the target data, thereby improving the flexibility of data compression. Further, in the data compression device shown in FIG. 4, when the determining module can determine that the remaining available storage space of the local end is less than the first preset threshold, the output module may output a prompt message for prompting that the remaining available storage space is insufficient. The receiving module may receive the confirmation compression instruction input for the prompt message, and determine the target data to be compressed in response to the confirmation compression instruction, so that when the remaining available space of the terminal is insufficient, the target process is selected in time to compress the data in the terminal, and Good compression of the target data process to improve data compression.
请参阅图5,图5是本发明实施例公开的一种终端的结构示意图,该终端可以执行上述数据压缩方法的功能。如图5所示,该终端可以包括:至少一个处理器401,例如CPU,至少一个存储器402,至少一个通信总线403,用户接口404以及网络接口405。通信总线403用于实现这些组件之间的通信连接。用户接口404可以包括显示屏(Display)、键盘(Keyboard)等。存储器402可以是高速RAM存储器,也可以是非不稳定的存储器,例如至少一个磁盘存储器。如图5所示,该存储器402中可以包括操作系统、网络通信协议模块以及数据压缩程序等。Referring to FIG. 5, FIG. 5 is a schematic structural diagram of a terminal according to an embodiment of the present invention, where the terminal can perform the functions of the data compression method. As shown in FIG. 5, the terminal may include at least one processor 401, such as a CPU, at least one memory 402, at least one communication bus 403, a user interface 404, and a network interface 405. Communication bus 403 is used to implement a communication connection between these components. User interface 404 can include a display, a keyboard, and the like. The memory 402 can be a high speed RAM memory or a non-stable memory such as at least one disk memory. As shown in FIG. 5, the memory 402 may include an operating system, a network communication protocol module, a data compression program, and the like.
在图5所示的终端中,网络接口405主要用于其他终端进行数据通信,例如各种消息的接收和发送等;而处理器401可以调用存储器402中存储的数据压缩程序,并执行以下操作:In the terminal shown in FIG. 5, the network interface 405 is mainly used for data communication of other terminals, such as receiving and transmitting various messages, and the processor 401 can call the data compression program stored in the memory 402 and perform the following operations. :
确定待压缩的目标数据;Determining target data to be compressed;
检测目标数据的目标数据类型;The target data type of the target data is detected;
根据目标数据类型确定压缩目标数据的目标进程;目标进程为采用预先设定的目标数据类型对应的压缩模式进行数据压缩的进程; Determining a target process of the compressed target data according to the target data type; the target process is a process of compressing the data by using a compression mode corresponding to the preset target data type;
调用目标进程对目标数据进行压缩。The target process is called to compress the target data.
本发明实施例中,目标数据可以分为三类:图片、音视频和文本文件等类型的数据。数据压缩的本质是去掉数据中的冗余部分,而又不影响对原始数据的理解,数据之所以可以被压缩是因为存在数据冗余,例如空间冗余、时间冗余等,在音视频类型的数据中变化的音频或运动的物体在相邻时间序列的变化较小,只需存储有差异的部分即可;而图片类型的数据在很多像素点都是相同或相似的,文本文件类型的数据有很多重复的文字,若将所有都存储则会占用较多的存储空间,因此数据压缩只需将不确定或不相关的数据保留下来即可。由于不同数据类型具有上述侧重点的时间冗余或空间冗余,因此本发明实施例可以针对目标数据的不同数据类型,选择预先设定的目标数据类型对应的压缩模式进行数据压缩,以提高数据压缩比,改善数据压缩效果。In the embodiment of the present invention, the target data can be classified into three types: data such as pictures, audio and video, and text files. The essence of data compression is to remove redundant parts of the data without affecting the understanding of the original data. The reason why data can be compressed is because of data redundancy, such as spatial redundancy, time redundancy, etc., in audio and video types. The data in the changed audio or moving object has less variation in the adjacent time series, and only needs to store the difference portion; while the image type data is the same or similar at many pixel points, the text file type Data has a lot of duplicate text. If you store all of them, it will take up more storage space, so data compression only needs to keep uncertain or irrelevant data. The embodiment of the present invention can select a compression mode corresponding to a preset target data type for data compression to improve data according to different data types of the target data. Compression ratio to improve data compression.
本发明实施例中,处理器401调用存储器402中存储的程序,确定待压缩的目标数据,可以具体包括以下操作:In the embodiment of the present invention, the processor 401 calls the program stored in the memory 402 to determine the target data to be compressed, and may specifically include the following operations:
接收用户输入的操作信息,操作信息包括操作对象数据和操作指纹数据;Receiving operation information input by the user, the operation information includes operation object data and operation fingerprint data;
检测操作指纹数据与预设的操作指纹数据是否匹配;Detecting whether the operation fingerprint data matches the preset operation fingerprint data;
若操作指纹数据与预设的操作指纹数据匹配,则将操作对象数据作为待压缩的目标数据。If the operation fingerprint data matches the preset operation fingerprint data, the operation object data is taken as the target data to be compressed.
举例来说,操作对象数据为视频节目A,预设的操作指纹数据为预设的进行数据压缩的指纹数据,如终端绑定用户帐号的中指指纹;当用户用中指对视频节目A进行单击、双击或者滑动等操作时,处理器401可以接收用户输入操作对象数据为视频节目A、操作指纹数据为中指指纹,处理器401判断出该中指指纹为预设的操作指纹数据,则将该视频节目A作为待压缩的目标数据。For example, the operation object data is the video program A, and the preset operation fingerprint data is the preset fingerprint data for data compression, such as the middle finger fingerprint of the terminal binding user account; when the user clicks on the video program A with the middle finger The processor 401 can receive the user input operation object data as the video program A, the operation fingerprint data as the middle finger fingerprint, and the processor 401 determines that the middle finger fingerprint is the preset operation fingerprint data, and the video is received. Program A is the target data to be compressed.
本发明实施例中,处理器401调用存储器402中存储的程序,还可以执行以下操作:In the embodiment of the present invention, the processor 401 calls the program stored in the memory 402, and can also perform the following operations:
判断本端的剩余可用存储空间是否小于第一预设阈值;Determining whether the remaining available storage space of the local end is less than a first preset threshold;
若小于第一预设阈值,则输出用于提示剩余可用存储空间不足的提示消息;If it is less than the first preset threshold, outputting a prompt message for prompting that the remaining available storage space is insufficient;
接收针对提示消息输入的确认压缩指令;Receiving a confirmation compression instruction input for the prompt message;
响应确认压缩指令,执行所述的确定待压缩的目标数据的操作。The operation of determining the target data to be compressed is performed in response to the confirmation compression instruction.
本发明实施例中,由于剩余可用存储空间过小时,会影响终端各应用的运行速度,因此处理器401可以根据设备的总存储空间设定第一预设阈值,或者由用户自定义第一预设阈值,使得处理器401可以在判断出本端的剩余可用存储空间小于第一预设阈值时,对数据进行数据压缩以提高存储空间的利用率,相对扩大剩余可用存储空间。In the embodiment of the present invention, the remaining available storage space is too small, which may affect the running speed of each application of the terminal. Therefore, the processor 401 may set a first preset threshold according to the total storage space of the device, or customize the first preset by the user. The threshold is set, so that the processor 401 can perform data compression on the data to improve the utilization of the storage space and relatively expand the remaining available storage space when determining that the remaining available storage space of the local end is less than the first preset threshold.
本发明实施例中,处理器401可以以语音方式或弹出提示框的方式输出用于提示剩余可用存储空间不足的提示消息。可选地,该提示消息也可以具体指出剩余可用存储空间大 概为多少GB。In the embodiment of the present invention, the processor 401 may output a prompt message for prompting that the remaining available storage space is insufficient in a voice manner or a pop-up prompt box. Optionally, the prompt message may also specifically indicate that the remaining available storage space is large. How many GB is it.
本发明实施例中,确定压缩指令可以为用户通过触控屏输入的点击或滑动操作指令,也可以为用户通过话筒输入的语音指令等。In the embodiment of the present invention, the compression command may be a click or slide operation command input by the user through the touch screen, or a voice command input by the user through the microphone.
作为另一种可选的实施方式,处理器401调用存储器402中存储的程序,确定待压缩的目标数据,可以包括以下步骤:As another optional implementation manner, the processor 401 calls the program stored in the memory 402 to determine the target data to be compressed, and may include the following steps:
获取本端安装的各应用所使用的存储空间占本端总存储空间的比值;Obtain the ratio of the storage space used by each application installed on the local end to the total storage space of the local end;
将比值大于第二预设阈值的应用对应的存储数据作为待压缩的目标数据。The storage data corresponding to the application whose ratio is greater than the second preset threshold is taken as the target data to be compressed.
例如,本端安装的各应用包括相机、电子书以及视频观看应用,相机、电子书以及视频观看应用所使用的存储空间大小分别为8GB、2GB、15GB,终端总存储空间为30GB,处理器401可以分别确定本端安装的这些应用所使用的存储空间占本端总存储空间的比值分别为0.27、0.1、0.5,第二预设阈值为0.4,则处理器401可以将大于第二预设阈值的视频观看应用对应的存储数据作为待压缩的目标数据。For example, the applications installed on the local end include cameras, e-books, and video viewing applications. The storage space used by cameras, e-books, and video viewing applications is 8 GB, 2 GB, and 15 GB, respectively. The total storage space of the terminal is 30 GB, and the processor 401 The ratio of the storage space used by the local device to the local storage space is 0.27, 0.1, and 0.5, and the second preset threshold is 0.4. The processor 401 can be greater than the second preset threshold. The video of the video viewing application corresponds to the target data to be compressed.
本发明实施例中,处理器401检测出的目标数据的目标数据类型可以包括音视频、图片和文本文件中的任一种或多种类型。本发明实施例中,目标进程为采用预先设定的目标数据类型对应的压缩模式进行数据压缩的进程。In the embodiment of the present invention, the target data type of the target data detected by the processor 401 may include any one or more types of audio and video, a picture, and a text file. In the embodiment of the present invention, the target process is a process of performing data compression by using a compression mode corresponding to a preset target data type.
本发明实施例中,处理器401调用目标进程对目标数据进行压缩,可以将目标数据压缩到该目标数据的目标数据类型对应的数据块中,例如将文本文件类数据压缩到文本数据块中,将音视频数据压缩到音视频数据块中等。In the embodiment of the present invention, the processor 401 calls the target process to compress the target data, and compresses the target data into the data block corresponding to the target data type of the target data, for example, compressing the text file type data into the text data block. Compress audio and video data to audio and video data blocks.
举例来说,处理器401确定待压缩的目标数据包括文本文件和音视频数据,则处理器401检测目标数据的目标数据的目标数据类型包括文本文件数据类型和音视频数据类型,处理器401会分别针对这两种数据类型分别确定压缩各个数据类型的目标进程A和B,处理器401可以同时调用目标进程A对文本文件进行压缩,调用目标进程B对音视频进行压缩。进一步的,处理器401可以将文本文件压缩到数据块A中,将音视频文件压缩到数据块B中,其中,数据块A和数据块B中存储的数据类型不同。For example, the processor 401 determines that the target data to be compressed includes a text file and audio and video data, and the target data type of the target data of the target data detected by the processor 401 includes a text file data type and an audio and video data type, and the processor 401 respectively targets The two data types respectively determine the target processes A and B for compressing the respective data types. The processor 401 can simultaneously call the target process A to compress the text file, and call the target process B to compress the audio and video. Further, the processor 401 may compress the text file into the data block A and compress the audio and video files into the data block B, wherein the data types stored in the data block A and the data block B are different.
具体的,本实施例中介绍的终端可以实施本发明结合图1或图2介绍的数据压缩方法实施例中的部分或全部流程。Specifically, the terminal introduced in this embodiment may implement some or all of the processes in the embodiment of the data compression method introduced in conjunction with FIG. 1 or FIG.
本发明实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。The steps in the method of the embodiment of the present invention may be sequentially adjusted, merged, and deleted according to actual needs.
本发明实施例终端或设备中的单元或子单元可以根据实际需要进行合并、划分和删减。The unit or subunit in the terminal or the device in the embodiment of the present invention may be combined, divided, and deleted according to actual needs.
本发明实施例还提供一种非易失性计算机存储介质,其中,该计算机存储介质可存储有一个或者多个程序,当该一个或者多个程序被一个设备执行时,使得该设备执行包括上述方法实施例中记载的任意一种数据压缩方法的部分或全部步骤。An embodiment of the present invention further provides a non-volatile computer storage medium, wherein the computer storage medium can store one or more programs, when the one or more programs are executed by a device, causing the device to perform the foregoing Some or all of the steps of any of the data compression methods described in the method embodiments.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示 例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of the present specification, reference is made to the terms "one embodiment", "some embodiments", "example", "specific" The description of the examples, or "some examples", and the like, is intended to mean that the specific features, structures, materials, or characteristics described in connection with the embodiments or examples are included in at least one embodiment or example of the invention. The singular representations are not necessarily the same as the embodiments or examples. Also, the specific features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. In the event of a conflict, those skilled in the art can combine and combine the various embodiments or examples described in the specification and the features of the various embodiments or examples.
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本发明的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。Moreover, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, features defining "first" or "second" may include at least one of the features, either explicitly or implicitly. In the description of the present invention, the meaning of "a plurality" is at least two, such as two, three, etc., unless specifically defined otherwise.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本发明的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本发明的实施例所属技术领域的技术人员所理解。Any process or method description in the flowcharts or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a particular logical function or process. And the scope of the preferred embodiments of the invention includes additional implementations, in which the functions may be performed in a substantially simultaneous manner or in an opposite order depending on the functions involved, in the order shown or discussed. It will be understood by those skilled in the art to which the embodiments of the present invention pertain.
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。The logic and/or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer readable medium, Used in conjunction with, or in conjunction with, an instruction execution system, apparatus, or device (eg, a computer-based system, a system including a processor, or other system that can fetch instructions and execute instructions from an instruction execution system, apparatus, or device) Or use with equipment. For the purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport a program for use in an instruction execution system, apparatus, or device, or in conjunction with the instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer readable media include the following: electrical connections (electronic devices) having one or more wires, portable computer disk cartridges (magnetic devices), random access memory (RAM), Read only memory (ROM), erasable editable read only memory (EPROM or flash memory), fiber optic devices, and portable compact disk read only memory (CDROM). In addition, the computer readable medium may even be a paper or other suitable medium on which the program can be printed, as it may be optically scanned, for example by paper or other medium, followed by editing, interpretation or, if appropriate, other suitable The method is processed to obtain the program electronically and then stored in computer memory.
应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路 的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that portions of the invention may be implemented in hardware, software, firmware or a combination thereof. In the above-described embodiments, multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), and the like.
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。One of ordinary skill in the art can understand that all or part of the steps carried by the method of implementing the above embodiments can be completed by a program to instruct related hardware, and the program can be stored in a computer readable storage medium. When executed, one or a combination of the steps of the method embodiments is included.
此外,在本发明各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. The integrated modules, if implemented in the form of software functional modules and sold or used as stand-alone products, may also be stored in a computer readable storage medium.
上述提到的存储介质可以是只读存储器,磁盘或光盘等。以上对本发明实施例公开了一种数据压缩方法、装置及终端进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。 The above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like. The data compression method, device and terminal are disclosed in detail in the embodiment of the present invention. The principle and the implementation manner of the present invention are described in the following. The description of the above embodiment is only used to help understand the present invention. The method of the invention and its core idea; at the same time, for the person of ordinary skill in the art, according to the idea of the present invention, there are some changes in the specific embodiment and the scope of application. In summary, the content of the specification should not be understood. To limit the invention.

Claims (18)

  1. 一种数据压缩方法,其特征在于,所述方法包括:A data compression method, the method comprising:
    确定待压缩的目标数据;Determining target data to be compressed;
    检测所述目标数据的目标数据类型;Detecting a target data type of the target data;
    根据所述目标数据类型确定压缩所述目标数据的目标进程;所述目标进程为采用预先设定的所述目标数据类型对应的压缩模式进行数据压缩的进程;Determining, according to the target data type, a target process of compressing the target data; the target process is a process of performing data compression by using a compression mode corresponding to the target data type set in advance;
    调用所述目标进程对所述目标数据进行压缩。The target process is invoked to compress the target data.
  2. 如权利要求1所述的方法,其特征在于,所述确定待压缩的目标数据,包括:The method of claim 1, wherein the determining the target data to be compressed comprises:
    接收用户输入的操作信息,所述操作信息包括操作对象数据和操作指纹数据;Receiving operation information input by the user, the operation information including operation object data and operation fingerprint data;
    检测所述操作指纹数据与预设的操作指纹数据是否匹配;Detecting whether the operation fingerprint data matches the preset operation fingerprint data;
    若所述操作指纹数据与预设的操作指纹数据匹配,则将所述操作对象数据作为待压缩的目标数据。If the operation fingerprint data matches the preset operation fingerprint data, the operation object data is taken as target data to be compressed.
  3. 如权利要求2所述的方法,其特征在于,其中,所述预设的操作指纹数据为预设的进行数据压缩的指纹数据,所述指纹数据包括终端绑定用户帐号的手指指纹和操作行为。The method according to claim 2, wherein the preset operation fingerprint data is preset fingerprint data for data compression, and the fingerprint data includes finger fingerprints and operation behaviors of the terminal binding user account. .
  4. 如权利要求3所述的方法,其特征在于,所述操作行为包括单击操作、双击操作或滑动操作。The method of claim 3 wherein said operational behavior comprises a click operation, a double click operation, or a sliding operation.
  5. 如权利要求1至4任一项所述的方法,其特征在于,所述方法还包括:The method of any of claims 1 to 4, further comprising:
    判断本端的剩余可用存储空间是否小于第一预设阈值;Determining whether the remaining available storage space of the local end is less than a first preset threshold;
    若小于所述第一预设阈值,则输出用于提示剩余可用存储空间不足的提示消息;If less than the first preset threshold, outputting a prompt message for prompting that the remaining available storage space is insufficient;
    接收针对所述提示消息输入的确认压缩指令;Receiving a confirmation compression instruction input for the prompt message;
    响应所述确认压缩指令,执行所述的确定待压缩的目标数据的步骤。The step of determining the target data to be compressed is performed in response to the confirming the compression instruction.
  6. 如权利要1或5所述的方法,其特征在于,所述确定待压缩的目标数据,包括:The method of claim 1 or 5, wherein the determining the target data to be compressed comprises:
    获取本端安装的各应用所使用的存储空间占所述本端总存储空间的比值;Obtaining the ratio of the storage space used by each application installed on the local end to the total storage space of the local end;
    将所述比值大于第二预设阈值的应用对应的存储数据作为待压缩的目标数据。The storage data corresponding to the application whose ratio is greater than the second preset threshold is used as the target data to be compressed.
  7. 如权利要求1至6任一项所述的方法,其特征在于,所述目标数据类型包括音视频、图片和文本文件中的任一种或多种类型。The method according to any one of claims 1 to 6, wherein the target data type comprises any one or more of audio, video, picture and text files.
  8. 如权利要求7所述的方法,其特征在于,所述目标进程采用的预先设定的所述目标数据类型对应的压缩模式包括针对音视频数据的压缩模式、针对图片的压缩模式以及针对文本文件的压缩模式中的任一种或多种。The method according to claim 7, wherein the predetermined compression mode corresponding to the target data type adopted by the target process comprises a compression mode for audio and video data, a compression mode for a picture, and a text file. Any one or more of the compression modes.
  9. 一种数据压缩装置,其特征在于,所述装置包括: A data compression device, the device comprising:
    第一确定模块,用于确定待压缩的目标数据;a first determining module, configured to determine target data to be compressed;
    检测模块,用于检测所述第一确定模块确定的目标数据的目标数据类型;a detecting module, configured to detect a target data type of the target data determined by the first determining module;
    第二确定模块,用于根据所述检测模块检测的目标数据类型确定压缩所述目标数据的目标进程;所述目标进程为采用预先设定的所述目标数据类型对应的压缩模式进行数据压缩的进程;a second determining module, configured to determine, according to the target data type detected by the detecting module, a target process for compressing the target data; the target process is to perform data compression by using a compression mode corresponding to the target data type set in advance process;
    压缩模块,用于调用所述第二确定模块确定的目标进程对所述目标数据进行压缩。And a compression module, configured to invoke a target process determined by the second determining module to compress the target data.
  10. 如权利要求9所述的装置,其特征在于,所述第一确定模块包括:The apparatus of claim 9, wherein the first determining module comprises:
    接收单元,用于接收用户输入的操作信息,所述操作信息包括操作对象数据和操作指纹数据;a receiving unit, configured to receive operation information input by a user, where the operation information includes operation object data and operation fingerprint data;
    检测单元,用于检测所述接收单元接收的操作信息中所述操作指纹数据与预设的操作指纹数据是否匹配;a detecting unit, configured to detect whether the operation fingerprint data in the operation information received by the receiving unit matches the preset operation fingerprint data;
    第一确定单元,用于在所述检测单元检测出所述操作指纹数据与预设的操作指纹数据匹配时,将所述操作对象数据确定为待压缩的目标数据。The first determining unit is configured to determine the operation target data as the target data to be compressed when the detecting unit detects that the operation fingerprint data matches the preset operation fingerprint data.
  11. 如权利要求10所述的装置,其特征在于,其中,所述预设的操作指纹数据为预设的进行数据压缩的指纹数据,所述指纹数据包括终端绑定用户帐号的手指指纹和操作行为。The device according to claim 10, wherein the preset operation fingerprint data is preset fingerprint data for data compression, and the fingerprint data includes finger fingerprints and operation behaviors of the terminal binding user account. .
  12. 如权利要求11所述的装置,其特征在于,所述操作行为包括单击操作、双击操作或滑动操作。The apparatus of claim 11 wherein said operational behavior comprises a click operation, a double click operation, or a sliding operation.
  13. 如权利要求9至12任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 9 to 12, wherein the device further comprises:
    判断模块,用于判断本端的剩余可用存储空间是否小于第一预设阈值;a determining module, configured to determine whether the remaining available storage space of the local end is less than a first preset threshold;
    输出模块,用于在所述判断模块判断出本端的剩余可用存储空间小于所述第一预设阈值时,输出用于提示剩余可用存储空间不足的提示消息;The output module is configured to: when the determining module determines that the remaining available storage space of the local end is smaller than the first preset threshold, output a prompt message for prompting that the remaining available storage space is insufficient;
    接收模块,用于接收针对所述提示消息输入的确认压缩指令,并响应所述确认压缩指令,触发第一确定模块执行所述的确定待压缩的目标数据的操作。And a receiving module, configured to receive an acknowledgment compression instruction input for the prompt message, and in response to the acknowledgment compression instruction, trigger the first determining module to perform the operation of determining the target data to be compressed.
  14. 如权利要求9或13所述的装置,其特征在于,所述第一确定模块包括:The apparatus according to claim 9 or 13, wherein the first determining module comprises:
    获取单元,用于获取本端安装的各应用所使用的存储空间占所述本端总存储空间的比值;The obtaining unit is configured to obtain a ratio of a storage space used by each application installed on the local end to a total storage space of the local end;
    第二确定单元,用于将所述获取单元获取的比值大于第二预设阈值的应用对应的存储数据确定为待压缩的目标数据。The second determining unit is configured to determine, as the target data to be compressed, the storage data corresponding to the application whose ratio is greater than the second preset threshold.
  15. 如权利要求9至14任一项所述的装置,其特征在于,所述目标数据类型包括音视频、图片和文本文件中的任一种或多种类型。The apparatus according to any one of claims 9 to 14, wherein the target data type comprises any one or more of audio, video, picture and text files.
  16. 如权利要求15所述的装置,其特征在于,所述目标进程采用的预先设定的所 述目标数据类型对应的压缩模式包括针对音视频数据的压缩模式、针对图片的压缩模式以及针对文本文件的压缩模式中的任一种或多种。The apparatus of claim 15 wherein said target process employs a predetermined setting The compression mode corresponding to the target data type includes any one or more of a compression mode for audio and video data, a compression mode for a picture, and a compression mode for a text file.
  17. 一种终端,其特征在于,所述终端包括权利要求9至16任一项所述的装置。A terminal, characterized in that the terminal comprises the device according to any one of claims 9 to 16.
  18. 一种非易失性计算机存储介质,其特征在于,所述计算机存储介质存储有一个或者多个程序,当所述一个或者多个程序被一个设备执行时,使得所述设备执行根据权利要求1-8任一项所述的数据压缩方法。 A non-volatile computer storage medium, characterized in that the computer storage medium stores one or more programs, when the one or more programs are executed by a device, causing the device to perform according to claim 1. The data compression method of any of the items -8.
PCT/CN2016/086463 2015-07-09 2016-06-20 Data compression method, apparatus, and terminal WO2017005085A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510406470.2A CN105007082A (en) 2015-07-09 2015-07-09 A data compression method, device and terminal
CN201510406470.2 2015-07-09

Publications (1)

Publication Number Publication Date
WO2017005085A1 true WO2017005085A1 (en) 2017-01-12

Family

ID=54379623

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/086463 WO2017005085A1 (en) 2015-07-09 2016-06-20 Data compression method, apparatus, and terminal

Country Status (2)

Country Link
CN (1) CN105007082A (en)
WO (1) WO2017005085A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111310627A (en) * 2020-02-07 2020-06-19 广州视源电子科技股份有限公司 Detection method and device of sensing device and electronic equipment
CN114827288A (en) * 2022-03-30 2022-07-29 阿里云计算有限公司 Data forwarding apparatus, data processing method, and computer-readable storage medium
CN117076447A (en) * 2023-08-14 2023-11-17 平安银行股份有限公司 Storage method, system, device, equipment and medium of JDBC layer data
CN117111845A (en) * 2023-08-18 2023-11-24 中电云计算技术有限公司 Data compression method, device, equipment and storage medium
CN118945238A (en) * 2024-10-14 2024-11-12 杭州数云信息技术有限公司 Sensor network equipment data return dimension reduction compression method, device and equipment

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105007082A (en) * 2015-07-09 2015-10-28 广东欧珀移动通信有限公司 A data compression method, device and terminal
US11232524B2 (en) * 2016-04-22 2022-01-25 Vertigo Media, Inc. System for enhancing data transmission in a network environment
CN106507107B (en) * 2016-12-08 2019-07-05 北京数码视讯科技股份有限公司 The treating method and apparatus of data
WO2019075672A1 (en) * 2017-10-18 2019-04-25 深圳市云中飞网络科技有限公司 File processing method and apparatus, computer device, and computer-readable storage medium
CN109947722B (en) * 2019-02-13 2021-08-17 北京达佳互联信息技术有限公司 Data compression method and device for application program and computer readable storage medium
CN112506879B (en) * 2020-12-18 2024-06-25 深圳智慧林网络科技有限公司 Data processing method and related equipment
CN113346909B (en) * 2021-05-11 2023-03-24 清华大学 Data compression method and device
CN115459779A (en) * 2022-08-11 2022-12-09 深圳市国电科技通信有限公司 Data compression method, device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101252749A (en) * 2008-03-28 2008-08-27 深圳华为通信技术有限公司 Apparatus and method for processing mobile terminal information
CN103488481A (en) * 2013-09-11 2014-01-01 华为技术有限公司 Application program control method, terminal equipment and remote control system
CN103942481A (en) * 2014-05-04 2014-07-23 上海鼎为电子科技(集团)有限公司 Application access method and mobile terminal
CN105007082A (en) * 2015-07-09 2015-10-28 广东欧珀移动通信有限公司 A data compression method, device and terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101252749A (en) * 2008-03-28 2008-08-27 深圳华为通信技术有限公司 Apparatus and method for processing mobile terminal information
CN103488481A (en) * 2013-09-11 2014-01-01 华为技术有限公司 Application program control method, terminal equipment and remote control system
CN103942481A (en) * 2014-05-04 2014-07-23 上海鼎为电子科技(集团)有限公司 Application access method and mobile terminal
CN105007082A (en) * 2015-07-09 2015-10-28 广东欧珀移动通信有限公司 A data compression method, device and terminal

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111310627A (en) * 2020-02-07 2020-06-19 广州视源电子科技股份有限公司 Detection method and device of sensing device and electronic equipment
CN111310627B (en) * 2020-02-07 2024-01-30 广州视源电子科技股份有限公司 Detection method and device of sensing device and electronic equipment
CN114827288A (en) * 2022-03-30 2022-07-29 阿里云计算有限公司 Data forwarding apparatus, data processing method, and computer-readable storage medium
CN117076447A (en) * 2023-08-14 2023-11-17 平安银行股份有限公司 Storage method, system, device, equipment and medium of JDBC layer data
CN117111845A (en) * 2023-08-18 2023-11-24 中电云计算技术有限公司 Data compression method, device, equipment and storage medium
CN118945238A (en) * 2024-10-14 2024-11-12 杭州数云信息技术有限公司 Sensor network equipment data return dimension reduction compression method, device and equipment

Also Published As

Publication number Publication date
CN105007082A (en) 2015-10-28

Similar Documents

Publication Publication Date Title
WO2017005085A1 (en) Data compression method, apparatus, and terminal
JP6677425B2 (en) Intelligent terminal control method
US9317413B2 (en) Testing device and testing method thereof
US20110161989A1 (en) Dynamic program integration
KR20150132291A (en) Viewing effects of proposed change in document before commiting change
CN109542361A (en) A kind of distributed memory system file reading, system and relevant apparatus
CN108463799A (en) The flexible display and its operating method of electronic equipment
US11036468B2 (en) Human-computer interface for navigating a presentation file
WO2017032078A1 (en) Interface control method and mobile terminal
US20240086360A1 (en) File saving method and electronic device
US20170300225A1 (en) Displaying application page of mobile terminal
CN114489458A (en) Parameter adjustment method and device
CN105760458A (en) Picture processing method and electronic equipment
CN111597009B (en) Application program display method, device and terminal equipment
CN111427449A (en) Interface display method, device and storage medium
CN107272989B (en) Using starting method, apparatus and terminal device
US20150112997A1 (en) Method for content control and electronic device thereof
EP2849058A1 (en) Method and device for displaying a message associated with an application
CN105224233A (en) A kind of method of adjustment of person's handwriting color and system
CN116543745A (en) Voice recording method, device, electronic equipment and storage medium
CN108984024A (en) Touch operation method and device, storage medium and electronic equipment
CN106598811B (en) Anomalous event processing method, device and terminal
CN111886569A (en) Electronic device and method for executing function of electronic device
CN105988804B (en) Software transfer method and terminal
CN119719125A (en) Data comparison method, device, electronic equipment, chip and medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16820736

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16820736

Country of ref document: EP

Kind code of ref document: A1