CN111538706B - Data compression method, device, storage medium and mobile terminal - Google Patents

Data compression method, device, storage medium and mobile terminal Download PDF

Info

Publication number
CN111538706B
CN111538706B CN202010317853.3A CN202010317853A CN111538706B CN 111538706 B CN111538706 B CN 111538706B CN 202010317853 A CN202010317853 A CN 202010317853A CN 111538706 B CN111538706 B CN 111538706B
Authority
CN
China
Prior art keywords
compression
file
log
compressed
mobile terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010317853.3A
Other languages
Chinese (zh)
Other versions
CN111538706A (en
Inventor
周波
宋文强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huizhou TCL Mobile Communication Co Ltd
Original Assignee
Huizhou TCL Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huizhou TCL Mobile Communication Co Ltd filed Critical Huizhou TCL Mobile Communication Co Ltd
Priority to CN202010317853.3A priority Critical patent/CN111538706B/en
Publication of CN111538706A publication Critical patent/CN111538706A/en
Application granted granted Critical
Publication of CN111538706B publication Critical patent/CN111538706B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application discloses a data compression method, a device, a storage medium and a mobile terminal, wherein the method comprises the following steps: acquiring a log compression request, wherein the log compression request carries a file identifier of a log file to be compressed; calling a system attribute control component to set a preset system parameter to a preset value according to the log compression request, so that the mobile terminal starts a compression component according to the preset value; generating a system compression instruction according to the file identification and the started compression component; the log files to be compressed are compressed according to the system compression instruction, so that the compression function of the system can be fully utilized to realize file compression, no additional compression tool is required to be installed, the use limitation is small, one-key compression of a plurality of files can be realized, and the compression efficiency is high.

Description

Data compression method, device, storage medium and mobile terminal
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a data compression method, a device, a storage medium, and a mobile terminal.
Background
KaiOS is a 2017 mobile operating system whose user interface was designed based on physical keys and a non-touch display screen.
Log logs in the KaiOS system are divided into various types, a plurality of logs are often required to be opened by testers for problem reproduction, when logs of certain test items are captured, log data are captured for even tens or hundreds of hours, and the captured Log data volume is large. The existing log file compression requires professional testers to install additional compression tools for compression, the compression mode is low in efficiency and is not suitable for non-professionals, the professional requirements on the compressors are high, and the use limitation is high.
Disclosure of Invention
The embodiment of the application provides a data compression method, a data compression device, a storage medium and a mobile terminal, which can improve compression efficiency, are suitable for various users and have small use limitation.
The embodiment of the application provides a data compression method, which is applied to a mobile terminal and comprises the following steps:
acquiring a log compression request, wherein the log compression request carries a file identifier of a log file to be compressed;
calling a system attribute control component to set a preset system parameter to a preset value according to the log compression request, so that the mobile terminal starts a compression component according to the preset value;
generating a system compression instruction according to the file identification and the started compression component;
and compressing the log file to be compressed according to the system compression instruction.
The embodiment of the application also provides a data compression device which is applied to the mobile terminal and comprises:
the acquisition module is used for acquiring a log compression request, wherein the log compression request carries a file identifier of a log file to be compressed;
the calling module is used for calling the system attribute control component to set a preset system parameter to a preset value according to the log compression request so that the mobile terminal starts the compression component according to the preset value;
the generation module is used for generating a system compression instruction according to the file identification and the started compression assembly;
and the compression module is used for compressing the log file to be compressed according to the system compression instruction.
The generating module is specifically configured to: determining the file data amount corresponding to the file identifier; determining the number of sub-packets according to the file data volume; generating a system compression instruction carrying the sub-package number through the started compression assembly;
when the number of the sub-packets is plural, the compression module is specifically configured to: and sub-packing the log file to be compressed according to the compression instruction to obtain a plurality of local compression packets with the number equal to the sub-packing number.
The generating module is specifically configured to:
acquiring the current network speed of the mobile terminal;
determining total uploading duration according to the file data quantity and the network speed;
and determining the number of the sub-packets according to the total uploading duration.
The data compression device further comprises an uploading module, wherein the uploading module is used for:
after the compression module performs sub-package compression on the log file to be compressed according to the compression instruction, an uploading request is obtained, wherein the uploading request carries a network address of a server to be uploaded;
acquiring the current residual electric quantity of the mobile terminal according to the uploading request;
when the residual electric quantity is larger than a preset electric quantity, uploading the plurality of local compression packets to the server to be uploaded;
when the residual electric quantity is smaller than or equal to a preset electric quantity, determining a target local compression packet from the plurality of local compression packets according to the residual electric quantity; uploading the target local compressed package to the server to be uploaded.
The uploading module is specifically configured to:
acquiring the current power consumption speed, the network speed and the data volume of each local compressed packet of the mobile terminal;
determining the operable duration of the mobile terminal according to the residual electric quantity and the power consumption speed;
determining the uploading duration of each local compressed packet according to the data volume and the network speed;
and determining a target local compressed packet from the plurality of local compressed packets according to the runnable duration and the uploading duration.
Embodiments of the present application also provide a computer readable storage medium having stored therein a plurality of instructions adapted to be loaded by a processor to perform any of the data compression methods described above.
The embodiment of the application also provides a mobile terminal, which comprises a processor and a memory, wherein the processor is electrically connected with the memory, the memory is used for storing instructions and data, and the processor is used for executing the steps in any data compression method.
According to the data compression method, the device, the storage medium and the mobile terminal, the log compression request is obtained, the log compression request carries the file identification of the log file to be compressed, then the system attribute control component is called according to the log compression request to set the preset system parameter to be the preset value, so that the mobile terminal starts the compression component according to the preset value, then the system compression instruction is generated according to the file identification and the started compression component, and the log file to be compressed is compressed according to the system compression instruction, so that the self-contained compression function of the system can be fully utilized to realize the file compression, no additional compression tool is required to be installed, the use limitation is small, the one-key compression of a plurality of files can be realized, and the compression efficiency is high.
Drawings
The technical solution and other advantageous effects of the present application will be made apparent by the following detailed description of the specific embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a flow chart of a data compression method according to an embodiment of the present application.
Fig. 2 is another flow chart of a data compression method according to an embodiment of the present application.
Fig. 3 is an operation schematic diagram of uploading a local compressed package through a web interface according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of a data compression device according to an embodiment of the present application.
Fig. 5 is a schematic diagram of another structure of a data compression device according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application.
Fig. 7 is a schematic diagram of another structure of a mobile terminal according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
The embodiment of the application provides a data compression method, a data compression device, a storage medium and a mobile terminal.
As shown in fig. 1, fig. 1 is a flow chart of a data compression method provided by an embodiment of the present application, where the data compression method is applied to a mobile terminal, and the mobile terminal may be a smart phone with a KaiOS system, and the specific flow may be as follows:
s101, acquiring a log compression request, wherein the log compression request carries a file identifier of a log file to be compressed.
The compression triggering widget can be provided without having a compression function, and when a user starts the widget, a log compression request can be generated by clicking a designated key on a widget display interface, or a log compression request can be generated by selecting a compression key from a right-key menu after selecting a log file to be compressed. The log file to be compressed may be a single file, such as a text file with a single suffix extension log, or a folder, such as a folder including a plurality of log files. The file identity may be a file storage address for distinguishing between different files.
S102, calling a system attribute control component to set a preset system parameter to a preset value according to the log compression request, so that the mobile terminal starts a compression component according to the preset value.
The system attribute control component may be a component provided for a system initialization service, and the preset system parameter is a persistence.sys.kaioscompres.enable parameter in a system initialization file, and the preset value may be set manually, for example, 1. When the value of the persist.sys.kaioscompes.enable parameter is 1, the compression component of the KaiOS system is started, and when the value of the persist.sys.kaioscompes.enable parameter is 0, the compression component of the KaiOS system is closed, generally, the compression component in the mobile terminal of the existing KaiOS system is in a default closing state, and a professional is required to trigger the starting, so that the operation requirement is high.
S103, generating a system compression instruction according to the file identification and the started compression assembly.
For example, referring to fig. 2, the step S103 may specifically include:
s1031, determining the file data quantity corresponding to the file identifier;
s1032, determining the number of sub-packets according to the file data volume;
s1033, generating a system compression instruction carrying the sub-package number through the started compression assembly.
The number of the sub-packets may be multiple or single, and the file data amount of the file corresponding to the file storage address may be determined first, and since many servers have the maximum limit on the size of the single uploading file, the larger the file data amount, the larger the corresponding number of the sub-packets. The number of the sub-packets may be determined in various ways, for example, the maximum data amount of each sub-packet may be set in advance, then when determining the number of sub-packets of the log file to be compressed, the quotient between the file data amount and the maximum data amount may be calculated, and the quotient may be maximized, for example, when the quotient is 5.2, the quotient is 6 after the maximum integer, and when the quotient is 5, the quotient is 5 after the maximum integer.
Of course, the maximum data amount of each sub-packet may not be a constant value set in advance manually, and may be a variable, for example, the maximum data amount depends on the network transmission condition of the mobile terminal, and in general, the better the network transmission state, the larger the maximum data amount of each sub-packet may be.
For example, the step S1032 may specifically include:
acquiring the current network speed of the mobile terminal;
determining the total uploading duration according to the file data quantity and the network speed;
and determining the number of the sub-packets according to the total uploading duration.
The total uploading time length can be obtained by calculating the ratio between the file data quantity and the network speed. Several preset duration ranges and the number of sub-packets associated with each preset duration range can be set in advance, and then the current total uploading duration is determined in which duration range, and the corresponding number of sub-packets is acquired.
S104, compressing the log file to be compressed according to the system compression instruction.
Wherein compressing the log file substantially compresses the directory. When the number of the sub-packets is single, only the whole log file to be compressed is compressed, so that the log file is compressed into a single compressed packet by one key. When the number of sub-packets is plural, the log file to be compressed needs to be split into plural parts for compression, so that the log file to be compressed is compressed into plural compressed packets by one key, that is, when the number of sub-packets is plural, the step S104 specifically includes:
and sub-packing and compressing the log file to be compressed according to the compression instruction to obtain a plurality of local compression packets equal to the number of the sub-packets.
The purpose of sub-package compression is to split a large log file to be compressed into a plurality of small log files for compression, so as to obtain a local compression package, wherein the sub-package compression can be that a single process compresses the small log files in sequence, or a plurality of processes simultaneously compress the small log files, and the local compression package can be named according to the position sequence of the corresponding small log files in the whole log files, for example, according to the position sequence from front to back, log001, log002 and the like in sequence.
After compression, the mobile terminal may also transmit the compressed file to other terminals or servers through wireless communication modes such as WiFi network, cellular data network, bluetooth, etc.
For example, in fig. 2, after the log file to be compressed is subcontracting compressed according to the compression instruction, the data compression method may further include:
s1051, obtaining an uploading request, wherein the uploading request carries a network address of a server to be uploaded;
s1052, acquiring the current residual electric quantity of the mobile terminal according to the uploading request;
s1053, uploading the plurality of local compression packets to the server to be uploaded when the residual electric quantity is larger than the preset electric quantity; when the residual electric quantity is smaller than or equal to the preset electric quantity, determining a target local compression packet from the plurality of local compression packets according to the residual electric quantity; uploading the target local compressed packet to the server to be uploaded.
The user can log in the server webpage through the mobile terminal, and the uploading request is generated by performing corresponding operation on the webpage. For example, referring to fig. 3, the web interface of the server may provide a function of uploading and downloading files by the user, which may include an upload button (such as "+" in fig. 3), and the user pops up a file upload window by clicking the upload button, and selects one or more or all of the partial compression packages through the file upload window, and uploads the partial compression packages to the server through the network. It is easy to understand that when uploading all the partial compressed packets, it usually takes a certain time to transmit, so as to reduce the interruption of transmission, such as being influenced by the battery power or the network state, and the mobile terminal can select an optimized transmission mode according to its own operation condition. Specifically, whether the residual electric quantity is larger than the preset electric quantity can be analyzed first, if yes, the electric quantity is sufficient, the whole uploading task can be supported, if not, the electric quantity is insufficient, the phenomenon that the terminal is powered off after the uploading task is not completed can occur, and aiming at the situation, part of the local compression package can be selected for uploading.
For example, the step of determining the target partial compression packet from the plurality of partial compression packets according to the remaining power may specifically include:
acquiring the current power consumption speed, network speed and data volume of each local compressed packet of the mobile terminal;
determining the operable duration of the mobile terminal according to the residual electric quantity and the power consumption speed;
determining the uploading duration of each local compressed packet according to the data quantity and the network speed;
and determining a target local compressed packet from the plurality of local compressed packets according to the executable time length and the uploading time length.
The power consumption speed of the mobile terminal may be the sum of the power consumption speeds of all running applications currently. The operable duration may be a quotient of the remaining power and the power consumption speed, and the uploading duration may be a quotient of the data amount and the network speed. The method can sequentially select a plurality of local compression packets according to the naming sequence of the local compression packets, or randomly select a plurality of local compression packets to be combined, so that the number of the selected local compression packets is ensured to be as large as possible, and meanwhile, the sum of uploading time of the local compression packets is smaller than the operable time, thereby reducing the interruption phenomenon of compression operation as much as possible and avoiding the waste of transmission time when the local compression packets with transmission interruption are retransmitted. When the running condition of the subsequent mobile terminal is good, the uploading of the residual partial compression packet can be considered, for example, a prompt box is generated to prompt a user whether to continuously upload the residual compression packet.
As can be seen from the foregoing, the data compression method provided in the embodiment of the present application is applied to a mobile terminal, by obtaining a log compression request, where the log compression request carries a file identifier of a log file to be compressed, and then invoking a system attribute control component according to the log compression request to set a preset system parameter to a preset value, so that the mobile terminal starts a compression component according to the preset value, then generates a system compression instruction according to the file identifier and the started compression component, and compresses the log file to be compressed according to the system compression instruction, thereby fully utilizing a compression function of the system to implement file compression without installing additional compression tools, having small use limitation, and being capable of implementing one-key compression of a plurality of files, and having high compression efficiency.
According to the method described in the above embodiments, the present embodiment will be further described from the point of view of a data compression device, where the data compression device may be implemented as a separate entity, or may be integrated in a mobile terminal, and the mobile terminal may be a smart phone with a KaiOS system or other terminals.
Referring to fig. 4, fig. 4 specifically illustrates a data compression device provided in an embodiment of the present application, where the data compression device may include: the device comprises an acquisition module 10, a calling module 20, a generating module 30 and a compressing module 40, wherein:
(1) Acquisition Module 10
The obtaining module 10 is configured to obtain a log compression request, where the log compression request carries a file identifier of a log file to be compressed.
The compression triggering widget can be provided without having a compression function, and when a user starts the widget, a log compression request can be generated by clicking a designated key on a widget display interface, or a log compression request can be generated by selecting a compression key from a right-key menu after selecting a log file to be compressed. The generation of the log compression request may be triggered when a user clicks a designated key on the display interface. The log file to be compressed may be a single file, such as a text file with a single suffix extension log, or a folder, such as a folder including a plurality of log files. The file identity may be a file storage address for distinguishing between different files.
(2) Calling module 20
And the calling module 20 is used for calling the system attribute control component to set a preset system parameter to a preset value according to the log compression request, so that the mobile terminal starts the compression component according to the preset value.
The system attribute control component may be a component provided for a system initialization service, and the preset system parameter is a persistence.sys.kaioscompres.enable parameter in a system initialization file, and the preset value may be set manually, for example, 1. When the value of the susist.sys.kaioscompes.enable parameter is 1, the compression component of the KaiOS system is started, and when the value of the susist.sys.kaioscompes.enable parameter is 0, the compression component of the KaiOS system is closed, usually, the compression component of the existing mobile terminal is in a default closed state, and needs professional personnel to trigger the start-up, so that the operation requirement is higher.
(3) Generating module 30
A generating module 30, configured to generate a system compression instruction according to the file identifier and the started compression component.
For example, the generating module 30 is specifically configured to:
s1031, determining the file data quantity corresponding to the file identifier;
s1032, determining the number of sub-packets according to the file data volume;
s1033, generating a system compression instruction carrying the sub-package number through the started compression assembly.
The number of the sub-packets may be multiple or single, and the file data amount of the file corresponding to the file storage address may be determined first, and since many servers have the maximum limit on the size of the single uploading file, the larger the file data amount, the larger the corresponding number of the sub-packets. The number of the sub-packets may be determined in various ways, for example, the maximum data amount of each sub-packet may be set in advance, then when determining the number of sub-packets of the log file to be compressed, the quotient between the file data amount and the maximum data amount may be calculated, and the quotient may be maximized, for example, when the quotient is 5.2, the quotient is 6 after the maximum integer, and when the quotient is 5, the quotient is 5 after the maximum integer.
Of course, the maximum data amount of each sub-packet may not be a constant value set in advance manually, and may be a variable, for example, the maximum data amount depends on the network transmission condition of the mobile terminal, and in general, the better the network transmission state, the larger the maximum data amount of each sub-packet may be.
For example, in executing the above step S1032, the generating module 30 is further configured to:
acquiring the current network speed of the mobile terminal;
determining the total uploading duration according to the file data quantity and the network speed;
and determining the number of the sub-packets according to the total uploading duration.
The total uploading time length can be obtained by calculating the ratio between the file data quantity and the network speed. Several preset duration ranges and the number of sub-packets associated with each preset duration range can be set in advance, and then the current total uploading duration is determined in which duration range, and the corresponding number of sub-packets is acquired.
(4) Compression module 40
The compression module 40 is configured to compress the log file to be compressed according to the system compression instruction.
Wherein compressing the log file substantially compresses the directory. When the number of the sub-packets is single, only the whole log file to be compressed is compressed, so that the log file is compressed into a single compressed packet by one key. When the number of sub-packets is plural, the log file to be compressed needs to be split into plural parts for compression, so that the log file to be compressed is compressed into plural compressed packets by one key, that is, when the number of sub-packets is plural, the compression module 40 is specifically configured to:
and sub-packing and compressing the log file to be compressed according to the compression instruction to obtain a plurality of local compression packets equal to the number of the sub-packets.
The purpose of sub-package compression is to split a large log file to be compressed into a plurality of small log files for compression, so as to obtain a local compression package, wherein the sub-package compression can be that a single process compresses the small log files in sequence, or a plurality of processes simultaneously compress the small log files, and the local compression package can be named according to the position sequence of the corresponding small log files in the whole log files, for example, according to the position sequence from front to back, log001, log002 and the like in sequence.
After compression, the mobile terminal may also transmit the compressed file to other terminals or servers through wireless communication modes such as WiFi network, cellular data network, bluetooth, etc.
For example, referring to fig. 5, the data compression apparatus further includes an upload module 50 for:
after the compression module 40 performs sub-packing compression on the log file to be compressed according to the compression instruction, an uploading request is obtained, where the uploading request carries a network address of a server to be uploaded;
acquiring the current residual electric quantity of the mobile terminal according to the uploading request;
when the residual electric quantity is larger than the preset electric quantity, uploading the plurality of local compression packets to the server to be uploaded;
when the residual electric quantity is smaller than or equal to the preset electric quantity, determining a target local compression packet from the plurality of local compression packets according to the residual electric quantity; uploading the target local compressed packet to the server to be uploaded.
The user can log in the server webpage, and the uploading request is generated by performing corresponding operation on the webpage. For example, referring to fig. 3, an upload button may be included on the web interface of the server, and the user pops up a file upload window by clicking the upload button, and selects one or more or all of the local compression packages to upload to the server through the file upload window. It is easy to understand that when uploading all the partial compressed packets, it usually takes a certain time to transmit, so as to reduce the interruption of transmission, such as being influenced by the battery power or the network state, and the mobile terminal can select an optimized transmission mode according to its own operation condition. Specifically, whether the residual electric quantity is larger than the preset electric quantity can be analyzed first, if yes, the electric quantity is sufficient, the whole uploading task can be supported, if not, the electric quantity is insufficient, the phenomenon that the terminal is powered off after the uploading task is not completed can occur, and aiming at the situation, part of the local compression package can be selected for uploading.
For example, the uploading module 50 is specifically configured to:
acquiring the current power consumption speed, network speed and data volume of each local compressed packet of the mobile terminal;
determining the operable duration of the mobile terminal according to the residual electric quantity and the power consumption speed;
determining the uploading duration of each local compressed packet according to the data quantity and the network speed;
and determining a target local compressed packet from the plurality of local compressed packets according to the executable time length and the uploading time length.
The power consumption speed of the mobile terminal may be the sum of the power consumption speeds of all running applications currently. The operable duration may be a quotient of the remaining power and the power consumption speed, and the uploading duration may be a quotient of the data amount and the network speed. The method can sequentially select a plurality of local compression packets according to the naming sequence of the local compression packets, or randomly select a plurality of local compression packets to be combined, so that the number of the selected local compression packets is ensured to be as large as possible, and meanwhile, the sum of uploading time of the local compression packets is smaller than the operable time, thereby reducing the interruption phenomenon of compression operation as much as possible and avoiding the waste of transmission time when the local compression packets with transmission interruption are retransmitted. When the running condition of the subsequent mobile terminal is good, the uploading of the residual partial compression packet can be considered, for example, a prompt box is generated to prompt a user whether to continuously upload the residual compression packet.
In the implementation, each unit may be implemented as an independent entity, or may be implemented as the same entity or several entities in any combination, and the implementation of each unit may be referred to the foregoing method embodiment, which is not described herein again.
As can be seen from the foregoing, the data compression device provided in this embodiment is applied to a mobile terminal, the obtaining module 10 obtains a log compression request, where the log compression request carries a file identifier of a log file to be compressed, and then the calling module 20 calls a system attribute control component according to the log compression request to set a preset system parameter to a preset value, so that the mobile terminal starts a compression component according to the preset value, and then the generating module 30 generates a system compression instruction according to the file identifier and the started compression component, and the compressing module 40 compresses the log file to be compressed according to the system compression instruction, thereby fully utilizing a compression function of the system to realize file compression, without installing additional compression tools, having small use limitations, and being capable of realizing one-key compression of multiple files, and having high compression efficiency.
Correspondingly, the embodiment of the application also provides a data compression system, which comprises any data compression device provided by the embodiment of the application, and the data compression device can be integrated in the mobile terminal.
The mobile terminal can acquire a log compression request, wherein the log compression request carries a file identifier of a log file to be compressed;
calling a system attribute control component to set a preset system parameter as a preset value according to the log compression request, so that the mobile terminal starts a compression component according to the preset value;
generating a system compression instruction according to the file identification and the started compression component;
and compressing the log file to be compressed according to the system compression instruction.
The specific implementation of each device can be referred to the previous embodiments, and will not be repeated here.
Because the data compression system may include any data compression device provided by the embodiments of the present application, the beneficial effects that any data compression device provided by the embodiments of the present application can achieve are detailed in the previous embodiments, and are not described herein.
In addition, the embodiment of the application also provides terminal equipment which can be equipment such as a smart phone and an intelligent vehicle. As shown in fig. 6, the terminal device 200 includes a processor 201, a memory 202. The processor 201 is electrically connected to the memory 202.
The processor 201 is a control center of the terminal device 200, connects respective parts of the entire terminal device using various interfaces and lines, and performs various functions of the terminal device and processes data by running or loading an application program stored in the memory 202 and calling data stored in the memory 202, thereby performing overall monitoring of the terminal device.
In this embodiment, the processor 201 in the terminal device 200 loads instructions corresponding to the processes of one or more application programs into the memory 202 according to the following steps, and the processor 201 executes the application program stored in the memory 202, where the processor is configured to perform the steps in any of the data compression methods provided in the embodiments of the present application.
Fig. 7 shows a specific block diagram of a terminal device according to an embodiment of the present application, which may be used to implement the data compression method provided in the above embodiment. The terminal device 300 may be a smart phone or a tablet computer.
The RF circuit 310 is configured to receive and transmit electromagnetic waves, and to perform mutual conversion between the electromagnetic waves and the electrical signals, thereby communicating with a communication network or other devices. RF circuitry 310 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and the like. The RF circuitry 310 may communicate with various networks such as the internet, intranets, wireless networks, or other devices via wireless networks. The wireless network may include a cellular telephone network, a wireless local area network, or a metropolitan area network. The wireless network may use various communication standards, protocols, and technologies including, but not limited to, global system for mobile communications (Global System for Mobile Communication, GSM), enhanced mobile communications technology (Enhanced Data GSM Environment, EDGE), wideband code division multiple access technology (Wideband Code Division Multiple Access, WCDMA), code division multiple access technology (Code Division Access, CDMA), time division multiple access technology (Time Division Multiple Access, TDMA), wireless fidelity technology (Wireless Fidelity, wi-Fi) (e.g., institute of electrical and electronics engineers standards IEEE 802.11a,IEEE 802.11b,IEEE802.11g and/or IEEE802.11 n), internet telephony (Voice over Internet Protocol, voIP), worldwide interoperability for microwave access (Worldwide Interoperability for Microwave Access, wi-Max), other protocols for mail, instant messaging, and short messaging, as well as any other suitable communication protocols, even including those not currently developed.
The memory 320 may be used for storing software programs and modules, such as program instructions/modules corresponding to the front-end camera photographing automatic light filling system and method in the above embodiments, and the processor 380 executes various functional applications and data processing by running the software programs and modules stored in the memory 320, that is, implements the front-end camera photographing automatic light filling function. Memory 320 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 320 may further include memory remotely located relative to processor 380, which may be connected to terminal device 300 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input unit 330 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 330 may include a touch-sensitive surface 331 as well as other input devices 332. The touch-sensitive surface 331, also referred to as a touch display screen or a touch pad, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch-sensitive surface 331 or thereabout using any suitable object or accessory such as a finger, stylus, etc.), and actuate the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 331 may comprise two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends the touch point coordinates to the processor 380, and can receive and execute commands sent from the processor 380. In addition, the touch-sensitive surface 331 may be implemented in a variety of types, such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 331, the input unit 330 may also comprise other input devices 332. In particular, other input devices 332 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 340 may be used to display information input by a user or information provided to the user and various graphical user interfaces of the terminal device 300, which may be composed of graphics, text, icons, video, and any combination thereof. The display unit 340 may include a display panel 341, and optionally, the display panel 341 may be configured in the form of an LCD (Liquid Crystal Display ), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch sensitive surface 331 may overlay the display panel 341 and, upon detection of a touch operation thereon or thereabout by the touch sensitive surface 331, is communicated to the processor 380 to determine the type of touch event, and the processor 380 then provides a corresponding visual output on the display panel 341 based on the type of touch event. Although in fig. 7 the touch sensitive surface 331 and the display panel 341 are implemented as two separate components, in some embodiments the touch sensitive surface 331 may be integrated with the display panel 341 to implement the input and output functions.
The terminal device 300 may also include at least one sensor 350, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 341 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 341 and/or the backlight when the terminal device 300 moves to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and the direction when the mobile phone is stationary, and can be used for applications of recognizing the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the terminal device 300 are not described in detail herein.
Audio circuitry 360, speaker 361, and microphone 362 may provide an audio interface between a user and terminal device 300. The audio circuit 360 may transmit the received electrical signal converted from audio data to the speaker 361, and the electrical signal is converted into a sound signal by the speaker 361 and output; on the other hand, the microphone 362 converts the collected sound signals into electrical signals, receives the electrical signals from the audio circuit 360, converts the electrical signals into audio data, outputs the audio data to the processor 380 for processing, and transmits the audio data to, for example, another terminal via the RF circuit 310, or outputs the audio data to the memory 320 for further processing. Audio circuitry 360 may also include an ear bud jack to provide communication of the peripheral ear bud with terminal device 300.
The terminal device 300 may facilitate user email, web browsing, streaming media access, etc. via the transmission module 370 (e.g., wi-Fi module), which provides wireless broadband internet access to the user. Although fig. 7 shows the transmission module 370, it is understood that it does not belong to the essential constitution of the terminal device 300, and may be omitted entirely as needed within the scope of not changing the essence of the application.
Processor 380 is a control center of terminal device 300 that connects the various parts of the overall handset using various interfaces and lines, performs various functions of terminal device 300 and processes data by running or executing software programs and/or modules stored in memory 320, and invoking data stored in memory 320, thereby performing overall monitoring of the handset. Optionally, processor 380 may include one or more processing cores; in some embodiments, processor 380 may integrate an application processor that primarily processes operating systems, user interfaces, applications, etc., with a modem processor that primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 380.
The terminal device 300 also includes a power supply 390 (e.g., a battery) that provides power to the various components, and in some embodiments, may be logically coupled to the processor 380 via a power management system to perform functions such as managing charging, discharging, and power consumption via the power management system. The power supply 190 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the terminal device 300 may further include a camera (such as a front camera, a rear camera), a bluetooth module, etc., which will not be described herein. In particular, in this embodiment, the display unit of the terminal device is a touch screen display, the terminal device further includes a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for:
acquiring a log compression request, wherein the log compression request carries a file identifier of a log file to be compressed;
calling a system attribute control component to set a preset system parameter as a preset value according to the log compression request, so that the mobile terminal starts a compression component according to the preset value;
generating a system compression instruction according to the file identification and the started compression component;
and compressing the log file to be compressed according to the system compression instruction.
In the implementation, each module may be implemented as an independent entity, or may be combined arbitrarily, and implemented as the same entity or several entities, and the implementation of each module may be referred to the foregoing method embodiment, which is not described herein again.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present application provides a storage medium having stored therein a plurality of instructions capable of being loaded by a processor to perform the steps of any of the data compression methods provided by the embodiments of the present application.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The instructions stored in the storage medium may perform steps in any data compression method provided by the embodiments of the present application, so that the beneficial effects that any data compression method provided by the embodiments of the present application can be achieved, which are detailed in the previous embodiments and are not described herein.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
In view of the foregoing, it will be evident to those skilled in the art that these embodiments are thus presented in terms of a preferred embodiment, and that these embodiments are not limited to the particular embodiments disclosed herein, as these embodiments are intended to be included within the scope of the application as defined by the following claims.

Claims (8)

1. The data compression method is characterized by being applied to a mobile terminal, wherein the mobile terminal is a terminal with a KaiOS system and comprises the following steps:
acquiring a log compression request, wherein the log compression request carries a file identifier of a log file to be compressed;
invoking a system attribute control component to set a preset system parameter as a preset value according to the log compression request, so that the mobile terminal starts a compression component according to the preset value, wherein the system attribute control component is a component provided by a system initialization service, and the preset system parameter is a persist.sys.kaioscompes.enable parameter in a system initialization file;
generating a system compression instruction according to the file identification and the started compression component;
compressing the log file to be compressed according to the system compression instruction;
the system compression instruction is generated by the compression component according to the file identification and the starting, and the system compression instruction comprises the following components:
determining the file data amount corresponding to the file identifier;
determining the number of sub-packets according to the file data volume;
generating a system compression instruction carrying the sub-package number through the started compression assembly;
when the number of the sub-packets is multiple, the compressing the log file to be compressed according to the system compression instruction includes: and sub-packing the log file to be compressed according to the compression instruction to obtain a plurality of local compression packets with the number equal to the sub-packing number.
2. The data compression method according to claim 1, wherein the determining the number of packets based on the file data amount includes:
acquiring the current network speed of the mobile terminal;
determining total uploading duration according to the file data quantity and the network speed;
and determining the number of the sub-packets according to the total uploading duration.
3. The data compression method according to claim 1, further comprising, after the sub-packaging compression of the log file to be compressed according to the compression instruction:
acquiring an uploading request, wherein the uploading request carries a network address of a server to be uploaded;
acquiring the current residual electric quantity of the mobile terminal according to the uploading request;
when the residual electric quantity is larger than a preset electric quantity, uploading the plurality of local compression packets to the server to be uploaded;
when the residual electric quantity is smaller than or equal to a preset electric quantity, determining a target local compression packet from the plurality of local compression packets according to the residual electric quantity; uploading the target local compressed package to the server to be uploaded.
4. The method of data compression according to claim 3, wherein the determining a target partial compression packet from the plurality of partial compression packets according to the remaining power includes:
acquiring the current power consumption speed, the network speed and the data volume of each local compressed packet of the mobile terminal;
determining the operable duration of the mobile terminal according to the residual electric quantity and the power consumption speed;
determining the uploading duration of each local compressed packet according to the data volume and the network speed;
and determining a target local compressed packet from the plurality of local compressed packets according to the runnable duration and the uploading duration.
5. A data compression device, applied to a mobile terminal, the mobile terminal being a terminal having a KaiOS system, comprising:
the acquisition module is used for acquiring a log compression request, wherein the log compression request carries a file identifier of a log file to be compressed;
the calling module is used for calling the system attribute control component to set a preset system parameter to a preset value according to the log compression request so that the mobile terminal starts the compression component according to the preset value;
the generation module is used for generating a system compression instruction according to the file identification and the started compression assembly;
the compression module is used for compressing the log file to be compressed according to the system compression instruction, wherein the generation module is specifically used for: determining the file data amount corresponding to the file identifier;
determining the number of sub-packets according to the file data volume;
generating a system compression instruction carrying the sub-package number through the started compression assembly;
when the number of the sub-packets is multiple, the compressing the log file to be compressed according to the system compression instruction includes: and sub-packing the log file to be compressed according to the compression instruction to obtain a plurality of local compression packets with the number equal to the sub-packing number.
6. The data compression device of claim 5, wherein the generating module is specifically configured to:
acquiring the current network speed of the mobile terminal;
determining total uploading duration according to the file data quantity and the network speed;
and determining the number of the sub-packets according to the total uploading duration.
7. A computer readable storage medium having stored therein a plurality of instructions adapted to be loaded by a processor to perform the data compression method of any one of claims 1 to 4.
8. A mobile terminal comprising a processor and a memory, the processor being electrically connected to the memory, the memory being for storing instructions and data, the processor being for performing the steps of the data compression method of any one of claims 1 to 4.
CN202010317853.3A 2020-04-21 2020-04-21 Data compression method, device, storage medium and mobile terminal Active CN111538706B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010317853.3A CN111538706B (en) 2020-04-21 2020-04-21 Data compression method, device, storage medium and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010317853.3A CN111538706B (en) 2020-04-21 2020-04-21 Data compression method, device, storage medium and mobile terminal

Publications (2)

Publication Number Publication Date
CN111538706A CN111538706A (en) 2020-08-14
CN111538706B true CN111538706B (en) 2023-11-14

Family

ID=71973078

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010317853.3A Active CN111538706B (en) 2020-04-21 2020-04-21 Data compression method, device, storage medium and mobile terminal

Country Status (1)

Country Link
CN (1) CN111538706B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113963458B (en) * 2021-11-17 2023-11-21 常州新途软件有限公司 Vehicle-mounted log management method

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546740A (en) * 2011-06-24 2012-07-04 奇智软件(北京)有限公司 Method, device and system used for compression and uncompression and based on cloud compression file
CN104978319A (en) * 2014-04-02 2015-10-14 东华软件股份公司 Method and equipment used for classified transmission of files
CN105446975A (en) * 2014-06-23 2016-03-30 广州爱九游信息技术有限公司 File packing method and device
US9779023B1 (en) * 2015-06-30 2017-10-03 EMC IP Holding Company LLC Storing inline-compressed data in segments of contiguous physical blocks
CN107977442A (en) * 2017-12-08 2018-05-01 北京希嘉创智教育科技有限公司 Journal file compresses and decompression method, electronic equipment and readable storage medium storing program for executing
WO2019061636A1 (en) * 2017-09-28 2019-04-04 武汉斗鱼网络科技有限公司 Method and apparatus for invoking system tool, readable storage medium, and device
WO2019168765A1 (en) * 2018-02-27 2019-09-06 Portland State University Context-aware synthesis for video frame interpolation
CN110688342A (en) * 2019-08-22 2020-01-14 苏州浪潮智能科技有限公司 Method, device and readable medium for decompressing file in Linux system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2452251C (en) * 2003-12-04 2010-02-09 Timothy R. Jewell Data backup system and method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546740A (en) * 2011-06-24 2012-07-04 奇智软件(北京)有限公司 Method, device and system used for compression and uncompression and based on cloud compression file
CN104978319A (en) * 2014-04-02 2015-10-14 东华软件股份公司 Method and equipment used for classified transmission of files
CN105446975A (en) * 2014-06-23 2016-03-30 广州爱九游信息技术有限公司 File packing method and device
US9779023B1 (en) * 2015-06-30 2017-10-03 EMC IP Holding Company LLC Storing inline-compressed data in segments of contiguous physical blocks
WO2019061636A1 (en) * 2017-09-28 2019-04-04 武汉斗鱼网络科技有限公司 Method and apparatus for invoking system tool, readable storage medium, and device
CN107977442A (en) * 2017-12-08 2018-05-01 北京希嘉创智教育科技有限公司 Journal file compresses and decompression method, electronic equipment and readable storage medium storing program for executing
WO2019168765A1 (en) * 2018-02-27 2019-09-06 Portland State University Context-aware synthesis for video frame interpolation
CN110688342A (en) * 2019-08-22 2020-01-14 苏州浪潮智能科技有限公司 Method, device and readable medium for decompressing file in Linux system

Also Published As

Publication number Publication date
CN111538706A (en) 2020-08-14

Similar Documents

Publication Publication Date Title
CN108430101B (en) Antenna closing method and device, storage medium and electronic equipment
US9344838B2 (en) Data transmission method and apparatus, and terminal with touch screen
CN105786878B (en) Display method and device of browsing object
CN106708554B (en) Program operating method and device
WO2015043403A1 (en) Method, apparatus, and terminal for obtaining video data
CN109714476B (en) Data processing method and device, mobile terminal and storage medium
CN110705497A (en) Image frame processing method and device, terminal equipment and computer readable storage medium
CN111104180B (en) Application program optimization method and device, storage medium and electronic equipment
CN111008090B (en) Battery electric quantity control method and device, storage medium and terminal equipment
CN106682189B (en) File name display method and device
CN111538706B (en) Data compression method, device, storage medium and mobile terminal
US11150913B2 (en) Method, device, and terminal for accelerating startup of application
CN106934003B (en) File processing method and mobile terminal
CN106777383B (en) File sorting method and intelligent terminal
CN110891262A (en) Bluetooth pairing method, system and terminal equipment
CN111143580B (en) Multimedia data storage method and device, storage medium and electronic equipment
CN106484529B (en) The Memory adjustments method and terminal of terminal
CN106294528B (en) Method and device for realizing information transmission
CN109831771B (en) Bluetooth searching method and device, mobile terminal and storage medium
CN109558731B (en) Feature code processing method, device and storage medium
CN107315623B (en) Method and device for reporting statistical data
CN106657278B (en) Data transmission method and device and computer equipment
CN111221782B (en) File searching method and device, storage medium and mobile terminal
CN110990606B (en) Picture storage method and device, storage medium and electronic equipment
CN111405649B (en) Information transmission method and device and mobile terminal

Legal Events

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